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