author | Nicola Baldo <nbaldo@cttc.es> |
Wed, 19 Dec 2012 17:34:54 +0100 | |
changeset 9594 | 63d9b752f99c |
parent 9337 | ae7126b266ce |
child 9653 | 382d27da8905 |
permissions | -rw-r--r-- |
7886 | 1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 |
/* |
|
3 |
* Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License version 2 as |
|
7 |
* published by the Free Software Foundation; |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 |
* |
|
18 |
* Author: Nicola Baldo <nbaldo@cttc.es> |
|
19 |
*/ |
|
20 |
||
21 |
||
22 |
#include "eps-bearer.h" |
|
23 |
||
24 |
#include <ns3/fatal-error.h> |
|
25 |
||
26 |
||
27 |
namespace ns3 { |
|
28 |
||
29 |
||
9594
63d9b752f99c
initialize member variables of EpsBearer upon construction
Nicola Baldo <nbaldo@cttc.es>
parents:
9337
diff
changeset
|
30 |
GbrQosInformation::GbrQosInformation () |
63d9b752f99c
initialize member variables of EpsBearer upon construction
Nicola Baldo <nbaldo@cttc.es>
parents:
9337
diff
changeset
|
31 |
: gbrDl (0), |
63d9b752f99c
initialize member variables of EpsBearer upon construction
Nicola Baldo <nbaldo@cttc.es>
parents:
9337
diff
changeset
|
32 |
gbrUl (0), |
63d9b752f99c
initialize member variables of EpsBearer upon construction
Nicola Baldo <nbaldo@cttc.es>
parents:
9337
diff
changeset
|
33 |
mbrDl (0), |
63d9b752f99c
initialize member variables of EpsBearer upon construction
Nicola Baldo <nbaldo@cttc.es>
parents:
9337
diff
changeset
|
34 |
mbrUl (0) |
63d9b752f99c
initialize member variables of EpsBearer upon construction
Nicola Baldo <nbaldo@cttc.es>
parents:
9337
diff
changeset
|
35 |
{ |
63d9b752f99c
initialize member variables of EpsBearer upon construction
Nicola Baldo <nbaldo@cttc.es>
parents:
9337
diff
changeset
|
36 |
} |
7886 | 37 |
|
9594
63d9b752f99c
initialize member variables of EpsBearer upon construction
Nicola Baldo <nbaldo@cttc.es>
parents:
9337
diff
changeset
|
38 |
AllocationRetentionPriority::AllocationRetentionPriority () |
63d9b752f99c
initialize member variables of EpsBearer upon construction
Nicola Baldo <nbaldo@cttc.es>
parents:
9337
diff
changeset
|
39 |
: priorityLevel (0), |
63d9b752f99c
initialize member variables of EpsBearer upon construction
Nicola Baldo <nbaldo@cttc.es>
parents:
9337
diff
changeset
|
40 |
preemptionCapability (false), |
63d9b752f99c
initialize member variables of EpsBearer upon construction
Nicola Baldo <nbaldo@cttc.es>
parents:
9337
diff
changeset
|
41 |
preemptionVulnerability (false) |
63d9b752f99c
initialize member variables of EpsBearer upon construction
Nicola Baldo <nbaldo@cttc.es>
parents:
9337
diff
changeset
|
42 |
{ |
63d9b752f99c
initialize member variables of EpsBearer upon construction
Nicola Baldo <nbaldo@cttc.es>
parents:
9337
diff
changeset
|
43 |
} |
7886 | 44 |
|
45 |
EpsBearer::EpsBearer () |
|
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
7886
diff
changeset
|
46 |
: qci (NGBR_VIDEO_TCP_DEFAULT) |
7886 | 47 |
{ |
48 |
} |
|
49 |
||
50 |
EpsBearer::EpsBearer (Qci x) |
|
51 |
: qci (x) |
|
52 |
{ |
|
53 |
} |
|
54 |
||
55 |
bool |
|
56 |
EpsBearer::IsGbr () const |
|
57 |
{ |
|
58 |
// 3GPP 23.203 Section 6.1.7.2 |
|
59 |
switch (qci) |
|
60 |
{ |
|
61 |
case GBR_CONV_VOICE: |
|
62 |
case GBR_CONV_VIDEO: |
|
63 |
case GBR_GAMING: |
|
64 |
case GBR_NON_CONV_VIDEO: |
|
65 |
return true; |
|
66 |
case NGBR_IMS: |
|
67 |
case NGBR_VIDEO_TCP_OPERATOR: |
|
68 |
case NGBR_VOICE_VIDEO_GAMING: |
|
69 |
case NGBR_VIDEO_TCP_PREMIUM: |
|
70 |
case NGBR_VIDEO_TCP_DEFAULT: |
|
71 |
return false; |
|
72 |
default: |
|
73 |
NS_FATAL_ERROR ("unknown QCI value " << qci); |
|
74 |
return false; |
|
75 |
} |
|
76 |
} |
|
77 |
||
78 |
uint8_t |
|
79 |
EpsBearer::GetPriority () const |
|
80 |
{ |
|
81 |
// 3GPP 23.203 Section 6.1.7.2 |
|
82 |
switch (qci) |
|
83 |
{ |
|
84 |
case GBR_CONV_VOICE: |
|
85 |
return 2; |
|
86 |
case GBR_CONV_VIDEO: |
|
87 |
return 4; |
|
88 |
case GBR_GAMING: |
|
89 |
return 3; |
|
90 |
case GBR_NON_CONV_VIDEO: |
|
91 |
return 5; |
|
92 |
case NGBR_IMS: |
|
93 |
return 1; |
|
94 |
case NGBR_VIDEO_TCP_OPERATOR: |
|
95 |
return 6; |
|
96 |
case NGBR_VOICE_VIDEO_GAMING: |
|
97 |
return 7; |
|
98 |
case NGBR_VIDEO_TCP_PREMIUM: |
|
99 |
return 8; |
|
100 |
case NGBR_VIDEO_TCP_DEFAULT: |
|
101 |
return 9; |
|
102 |
default: |
|
103 |
NS_FATAL_ERROR ("unknown QCI value " << qci); |
|
104 |
return 0; |
|
105 |
} |
|
106 |
} |
|
107 |
||
108 |
uint16_t |
|
109 |
EpsBearer::GetPacketDelayBudgetMs () const |
|
110 |
{ |
|
111 |
// 3GPP 23.203 Section 6.1.7.2 |
|
112 |
switch (qci) |
|
113 |
{ |
|
114 |
case GBR_CONV_VOICE: |
|
115 |
return 100; |
|
116 |
case GBR_CONV_VIDEO: |
|
117 |
return 150; |
|
118 |
case GBR_GAMING: |
|
119 |
return 50; |
|
120 |
case GBR_NON_CONV_VIDEO: |
|
121 |
return 300; |
|
122 |
case NGBR_IMS: |
|
123 |
return 100; |
|
124 |
case NGBR_VIDEO_TCP_OPERATOR: |
|
125 |
return 300; |
|
126 |
case NGBR_VOICE_VIDEO_GAMING: |
|
127 |
return 100; |
|
128 |
case NGBR_VIDEO_TCP_PREMIUM: |
|
129 |
return 300; |
|
130 |
case NGBR_VIDEO_TCP_DEFAULT: |
|
131 |
return 300; |
|
132 |
default: |
|
133 |
NS_FATAL_ERROR ("unknown QCI value " << qci); |
|
134 |
return 0; |
|
135 |
} |
|
136 |
} |
|
137 |
||
138 |
double |
|
139 |
EpsBearer::GetPacketErrorLossRate () const |
|
140 |
{ |
|
141 |
// 3GPP 23.203 Section 6.1.7.2 |
|
142 |
switch (qci) |
|
143 |
{ |
|
144 |
case GBR_CONV_VOICE: |
|
145 |
return 1.0e-2; |
|
146 |
case GBR_CONV_VIDEO: |
|
147 |
return 1.0e-3; |
|
148 |
case GBR_GAMING: |
|
149 |
return 1.0e-3; |
|
150 |
case GBR_NON_CONV_VIDEO: |
|
151 |
return 1.0e-6; |
|
152 |
case NGBR_IMS: |
|
153 |
return 1.0e-6; |
|
154 |
case NGBR_VIDEO_TCP_OPERATOR: |
|
155 |
return 1.0e-6; |
|
156 |
case NGBR_VOICE_VIDEO_GAMING: |
|
157 |
return 1.0e-3; |
|
158 |
case NGBR_VIDEO_TCP_PREMIUM: |
|
159 |
return 1.0e-6; |
|
160 |
case NGBR_VIDEO_TCP_DEFAULT: |
|
161 |
return 1.0e-6; |
|
162 |
default: |
|
163 |
NS_FATAL_ERROR ("unknown QCI value " << qci); |
|
164 |
return 0; |
|
165 |
} |
|
166 |
} |
|
167 |
||
168 |
||
169 |
||
170 |
} // namespace ns3 |