A Discrete-Event Network Simulator
API
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 
31  : gbrDl (0),
32  gbrUl (0),
33  mbrDl (0),
34  mbrUl (0)
35 {
36 }
37 
39  : priorityLevel (0),
40  preemptionCapability (false),
41  preemptionVulnerability (false)
42 {
43 }
44 
46  : qci (NGBR_VIDEO_TCP_DEFAULT)
47 {
48 }
49 
51  : qci (x)
52 {
53 }
54 
56  : qci (x), gbrQosInfo (y)
57 {
58 }
59 
60 bool
62 {
63  // 3GPP 23.203 Section 6.1.7.2
64  switch (qci)
65  {
66  case GBR_CONV_VOICE:
67  case GBR_CONV_VIDEO:
68  case GBR_GAMING:
69  case GBR_NON_CONV_VIDEO:
70  return true;
71  case NGBR_IMS:
76  return false;
77  default:
78  NS_FATAL_ERROR ("unknown QCI value " << qci);
79  return false;
80  }
81 }
82 
83 uint8_t
85 {
86  // 3GPP 23.203 Section 6.1.7.2
87  switch (qci)
88  {
89  case GBR_CONV_VOICE:
90  return 2;
91  case GBR_CONV_VIDEO:
92  return 4;
93  case GBR_GAMING:
94  return 3;
95  case GBR_NON_CONV_VIDEO:
96  return 5;
97  case NGBR_IMS:
98  return 1;
100  return 6;
102  return 7;
104  return 8;
106  return 9;
107  default:
108  NS_FATAL_ERROR ("unknown QCI value " << qci);
109  return 0;
110  }
111 }
112 
113 uint16_t
115 {
116  // 3GPP 23.203 Section 6.1.7.2
117  switch (qci)
118  {
119  case GBR_CONV_VOICE:
120  return 100;
121  case GBR_CONV_VIDEO:
122  return 150;
123  case GBR_GAMING:
124  return 50;
125  case GBR_NON_CONV_VIDEO:
126  return 300;
127  case NGBR_IMS:
128  return 100;
130  return 300;
132  return 100;
134  return 300;
136  return 300;
137  default:
138  NS_FATAL_ERROR ("unknown QCI value " << qci);
139  return 0;
140  }
141 }
142 
143 double
145 {
146  // 3GPP 23.203 Section 6.1.7.2
147  switch (qci)
148  {
149  case GBR_CONV_VOICE:
150  return 1.0e-2;
151  case GBR_CONV_VIDEO:
152  return 1.0e-3;
153  case GBR_GAMING:
154  return 1.0e-3;
155  case GBR_NON_CONV_VIDEO:
156  return 1.0e-6;
157  case NGBR_IMS:
158  return 1.0e-6;
160  return 1.0e-6;
162  return 1.0e-3;
164  return 1.0e-6;
166  return 1.0e-6;
167  default:
168  NS_FATAL_ERROR ("unknown QCI value " << qci);
169  return 0;
170  }
171 }
172 
173 
174 
175 } // namespace ns3
uint16_t GetPacketDelayBudgetMs() const
Definition: eps-bearer.cc:114
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:162
bool IsGbr() const
Definition: eps-bearer.cc:61
uint8_t GetPriority() const
Definition: eps-bearer.cc:84
double GetPacketErrorLossRate() const
Definition: eps-bearer.cc:144
AllocationRetentionPriority()
Default constructor, initializes member variables to zero or equivalent.
Definition: eps-bearer.cc:38
Every class exported by the ns3 library is enclosed in the ns3 namespace.
enum ns3::EpsBearer::Qci qci
Qos class indicator.
GbrQosInformation()
Default constructor, initializes member variables to zero or equivalent.
Definition: eps-bearer.cc:30
EpsBearer()
Default constructor.
Definition: eps-bearer.cc:45
3GPP TS 36.413 9.2.1.18 GBR QoS Information
Definition: eps-bearer.h:33
Qci
QoS Class Indicator.
Definition: eps-bearer.h:77