A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
eps-bearer.cc
Go to the documentation of this file.
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
30
31
32
EpsBearer::EpsBearer
()
33
{
34
}
35
36
EpsBearer::EpsBearer
(
Qci
x
)
37
: qci (x)
38
{
39
}
40
41
EpsBearer::EpsBearer
(
Qci
x
,
struct
GbrQosInformation
y)
42
: qci (x), gbrQosInfo (y)
43
{
44
}
45
46
bool
47
EpsBearer::IsGbr
()
const
48
{
49
// 3GPP 23.203 Section 6.1.7.2
50
switch
(
qci
)
51
{
52
case
GBR_CONV_VOICE
:
53
case
GBR_CONV_VIDEO
:
54
case
GBR_GAMING
:
55
case
GBR_NON_CONV_VIDEO
:
56
return
true
;
57
case
NGBR_IMS
:
58
case
NGBR_VIDEO_TCP_OPERATOR
:
59
case
NGBR_VOICE_VIDEO_GAMING
:
60
case
NGBR_VIDEO_TCP_PREMIUM
:
61
case
NGBR_VIDEO_TCP_DEFAULT
:
62
return
false
;
63
default
:
64
NS_FATAL_ERROR
(
"unknown QCI value "
<<
qci
);
65
return
false
;
66
}
67
}
68
69
uint8_t
70
EpsBearer::GetPriority
()
const
71
{
72
// 3GPP 23.203 Section 6.1.7.2
73
switch
(
qci
)
74
{
75
case
GBR_CONV_VOICE
:
76
return
2;
77
case
GBR_CONV_VIDEO
:
78
return
4;
79
case
GBR_GAMING
:
80
return
3;
81
case
GBR_NON_CONV_VIDEO
:
82
return
5;
83
case
NGBR_IMS
:
84
return
1;
85
case
NGBR_VIDEO_TCP_OPERATOR
:
86
return
6;
87
case
NGBR_VOICE_VIDEO_GAMING
:
88
return
7;
89
case
NGBR_VIDEO_TCP_PREMIUM
:
90
return
8;
91
case
NGBR_VIDEO_TCP_DEFAULT
:
92
return
9;
93
default
:
94
NS_FATAL_ERROR
(
"unknown QCI value "
<<
qci
);
95
return
0;
96
}
97
}
98
99
uint16_t
100
EpsBearer::GetPacketDelayBudgetMs
()
const
101
{
102
// 3GPP 23.203 Section 6.1.7.2
103
switch
(
qci
)
104
{
105
case
GBR_CONV_VOICE
:
106
return
100;
107
case
GBR_CONV_VIDEO
:
108
return
150;
109
case
GBR_GAMING
:
110
return
50;
111
case
GBR_NON_CONV_VIDEO
:
112
return
300;
113
case
NGBR_IMS
:
114
return
100;
115
case
NGBR_VIDEO_TCP_OPERATOR
:
116
return
300;
117
case
NGBR_VOICE_VIDEO_GAMING
:
118
return
100;
119
case
NGBR_VIDEO_TCP_PREMIUM
:
120
return
300;
121
case
NGBR_VIDEO_TCP_DEFAULT
:
122
return
300;
123
default
:
124
NS_FATAL_ERROR
(
"unknown QCI value "
<<
qci
);
125
return
0;
126
}
127
}
128
129
double
130
EpsBearer::GetPacketErrorLossRate
()
const
131
{
132
// 3GPP 23.203 Section 6.1.7.2
133
switch
(
qci
)
134
{
135
case
GBR_CONV_VOICE
:
136
return
1.0e-2;
137
case
GBR_CONV_VIDEO
:
138
return
1.0e-3;
139
case
GBR_GAMING
:
140
return
1.0e-3;
141
case
GBR_NON_CONV_VIDEO
:
142
return
1.0e-6;
143
case
NGBR_IMS
:
144
return
1.0e-6;
145
case
NGBR_VIDEO_TCP_OPERATOR
:
146
return
1.0e-6;
147
case
NGBR_VOICE_VIDEO_GAMING
:
148
return
1.0e-3;
149
case
NGBR_VIDEO_TCP_PREMIUM
:
150
return
1.0e-6;
151
case
NGBR_VIDEO_TCP_DEFAULT
:
152
return
1.0e-6;
153
default
:
154
NS_FATAL_ERROR
(
"unknown QCI value "
<<
qci
);
155
return
0;
156
}
157
}
158
159
160
161
}
// namespace ns3
src
lte
model
eps-bearer.cc
Generated on Fri Dec 21 2012 19:00:39 for ns-3 by
1.8.1.2