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
bool
42
EpsBearer::IsGbr
()
const
43
{
44
// 3GPP 23.203 Section 6.1.7.2
45
switch
(
qci
)
46
{
47
case
GBR_CONV_VOICE
:
48
case
GBR_CONV_VIDEO
:
49
case
GBR_GAMING
:
50
case
GBR_NON_CONV_VIDEO
:
51
return
true
;
52
case
NGBR_IMS
:
53
case
NGBR_VIDEO_TCP_OPERATOR
:
54
case
NGBR_VOICE_VIDEO_GAMING
:
55
case
NGBR_VIDEO_TCP_PREMIUM
:
56
case
NGBR_VIDEO_TCP_DEFAULT
:
57
return
false
;
58
default
:
59
NS_FATAL_ERROR
(
"unknown QCI value "
<<
qci
);
60
return
false
;
61
}
62
}
63
64
uint8_t
65
EpsBearer::GetPriority
()
const
66
{
67
// 3GPP 23.203 Section 6.1.7.2
68
switch
(
qci
)
69
{
70
case
GBR_CONV_VOICE
:
71
return
2;
72
case
GBR_CONV_VIDEO
:
73
return
4;
74
case
GBR_GAMING
:
75
return
3;
76
case
GBR_NON_CONV_VIDEO
:
77
return
5;
78
case
NGBR_IMS
:
79
return
1;
80
case
NGBR_VIDEO_TCP_OPERATOR
:
81
return
6;
82
case
NGBR_VOICE_VIDEO_GAMING
:
83
return
7;
84
case
NGBR_VIDEO_TCP_PREMIUM
:
85
return
8;
86
case
NGBR_VIDEO_TCP_DEFAULT
:
87
return
9;
88
default
:
89
NS_FATAL_ERROR
(
"unknown QCI value "
<<
qci
);
90
return
0;
91
}
92
}
93
94
uint16_t
95
EpsBearer::GetPacketDelayBudgetMs
()
const
96
{
97
// 3GPP 23.203 Section 6.1.7.2
98
switch
(
qci
)
99
{
100
case
GBR_CONV_VOICE
:
101
return
100;
102
case
GBR_CONV_VIDEO
:
103
return
150;
104
case
GBR_GAMING
:
105
return
50;
106
case
GBR_NON_CONV_VIDEO
:
107
return
300;
108
case
NGBR_IMS
:
109
return
100;
110
case
NGBR_VIDEO_TCP_OPERATOR
:
111
return
300;
112
case
NGBR_VOICE_VIDEO_GAMING
:
113
return
100;
114
case
NGBR_VIDEO_TCP_PREMIUM
:
115
return
300;
116
case
NGBR_VIDEO_TCP_DEFAULT
:
117
return
300;
118
default
:
119
NS_FATAL_ERROR
(
"unknown QCI value "
<<
qci
);
120
return
0;
121
}
122
}
123
124
double
125
EpsBearer::GetPacketErrorLossRate
()
const
126
{
127
// 3GPP 23.203 Section 6.1.7.2
128
switch
(
qci
)
129
{
130
case
GBR_CONV_VOICE
:
131
return
1.0e-2;
132
case
GBR_CONV_VIDEO
:
133
return
1.0e-3;
134
case
GBR_GAMING
:
135
return
1.0e-3;
136
case
GBR_NON_CONV_VIDEO
:
137
return
1.0e-6;
138
case
NGBR_IMS
:
139
return
1.0e-6;
140
case
NGBR_VIDEO_TCP_OPERATOR
:
141
return
1.0e-6;
142
case
NGBR_VOICE_VIDEO_GAMING
:
143
return
1.0e-3;
144
case
NGBR_VIDEO_TCP_PREMIUM
:
145
return
1.0e-6;
146
case
NGBR_VIDEO_TCP_DEFAULT
:
147
return
1.0e-6;
148
default
:
149
NS_FATAL_ERROR
(
"unknown QCI value "
<<
qci
);
150
return
0;
151
}
152
}
153
154
155
156
}
// namespace ns3
src
lte
model
eps-bearer.cc
Generated on Tue Oct 9 2012 16:45:40 for ns-3 by
1.8.1.2