A Discrete-Event Network Simulator
API
 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 
33 {
34 }
35 
37  : qci (x)
38 {
39 }
40 
41 bool
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:
57  return false;
58  default:
59  NS_FATAL_ERROR ("unknown QCI value " << qci);
60  return false;
61  }
62 }
63 
64 uint8_t
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;
81  return 6;
83  return 7;
85  return 8;
87  return 9;
88  default:
89  NS_FATAL_ERROR ("unknown QCI value " << qci);
90  return 0;
91  }
92 }
93 
94 uint16_t
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;
111  return 300;
113  return 100;
115  return 300;
117  return 300;
118  default:
119  NS_FATAL_ERROR ("unknown QCI value " << qci);
120  return 0;
121  }
122 }
123 
124 double
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;
141  return 1.0e-6;
143  return 1.0e-3;
145  return 1.0e-6;
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