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 
42  : qci (x), gbrQosInfo (y)
43 {
44 }
45 
46 bool
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:
62  return false;
63  default:
64  NS_FATAL_ERROR ("unknown QCI value " << qci);
65  return false;
66  }
67 }
68 
69 uint8_t
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;
86  return 6;
88  return 7;
90  return 8;
92  return 9;
93  default:
94  NS_FATAL_ERROR ("unknown QCI value " << qci);
95  return 0;
96  }
97 }
98 
99 uint16_t
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;
116  return 300;
118  return 100;
120  return 300;
122  return 300;
123  default:
124  NS_FATAL_ERROR ("unknown QCI value " << qci);
125  return 0;
126  }
127 }
128 
129 double
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;
146  return 1.0e-6;
148  return 1.0e-3;
150  return 1.0e-6;
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