author | Nicola Baldo <nbaldo@cttc.es> |
Mon, 10 Oct 2011 18:05:18 +0200 | |
changeset 8253 | 6faee3d1d1d0 |
parent 7385 | src/lte/model/enb-net-device.h@10beb0e53130 |
parent 8148 | src/lte/model/enb-net-device.h@09e2d03022a2 |
child 8255 | bd60df311c7b |
permissions | -rw-r--r-- |
7385
10beb0e53130
standardize emacs c++ mode comments
Vedran Mileti? <rivanvx@gmail.com>
parents:
7238
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
6705 | 2 |
/* |
3 |
* Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari |
|
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: Giuseppe Piro <g.piro@poliba.it> |
|
7886 | 19 |
* Author: Marco Miozzo <marco.miozzo@cttc.es> : Update to FF API Architecture |
6705 | 20 |
*/ |
21 |
||
7887 | 22 |
#ifndef LTE_ENB_NET_DEVICE_H |
23 |
#define LTE_ENB_NET_DEVICE_H |
|
6705 | 24 |
|
25 |
#include "lte-net-device.h" |
|
26 |
#include "ns3/event-id.h" |
|
27 |
#include "ns3/mac48-address.h" |
|
28 |
#include "ns3/traced-callback.h" |
|
29 |
#include "ns3/nstime.h" |
|
30 |
#include "ns3/log.h" |
|
31 |
#include "lte-phy.h" |
|
32 |
#include <vector> |
|
33 |
||
34 |
namespace ns3 { |
|
35 |
||
36 |
class Packet; |
|
37 |
class PacketBurst; |
|
38 |
class Node; |
|
39 |
class LtePhy; |
|
7887 | 40 |
class LteEnbPhy; |
7886 | 41 |
class LteEnbMac; |
42 |
class LteEnbRrc; |
|
7897 | 43 |
class FfMacScheduler; |
6705 | 44 |
|
45 |
||
46 |
/** |
|
7238
85a7e87bb4cc
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
6852
diff
changeset
|
47 |
* \ingroup lte |
85a7e87bb4cc
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
6852
diff
changeset
|
48 |
* |
6705 | 49 |
* The eNodeB device implementation |
50 |
*/ |
|
7887 | 51 |
class LteEnbNetDevice : public LteNetDevice |
6705 | 52 |
{ |
53 |
public: |
|
54 |
static TypeId GetTypeId (void); |
|
55 |
||
7887 | 56 |
LteEnbNetDevice (void); |
6705 | 57 |
/** |
58 |
* \brief Create eNB net device |
|
59 |
* \param node the network node |
|
7906
d58de34e41d3
MAC, RRC and Scheduler created by LenaHelper
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7897
diff
changeset
|
60 |
* \param phy the physical object attached to it |
d58de34e41d3
MAC, RRC and Scheduler created by LenaHelper
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7897
diff
changeset
|
61 |
* \param mac the mac layer object attached to it |
d58de34e41d3
MAC, RRC and Scheduler created by LenaHelper
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7897
diff
changeset
|
62 |
* \param sched the scheduler object attached to it |
d58de34e41d3
MAC, RRC and Scheduler created by LenaHelper
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7897
diff
changeset
|
63 |
* \param rrc the rrc entity object attached to it |
6705 | 64 |
*/ |
7906
d58de34e41d3
MAC, RRC and Scheduler created by LenaHelper
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7897
diff
changeset
|
65 |
LteEnbNetDevice (Ptr<Node> node, Ptr<LteEnbPhy> phy, Ptr<LteEnbMac> mac, Ptr<FfMacScheduler> sched, Ptr<LteEnbRrc> rrc); |
6705 | 66 |
|
7887 | 67 |
virtual ~LteEnbNetDevice (void); |
6710
3cd651349cb6
lte examples now passing valgrind tests
Nicola Baldo <nbaldo@cttc.es>
parents:
6705
diff
changeset
|
68 |
virtual void DoDispose (void); |
6705 | 69 |
|
70 |
/** |
|
7886 | 71 |
* \return a pointer to the MAC |
6705 | 72 |
*/ |
7952
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
73 |
Ptr<LteEnbMac> GetMac (void) const; |
6705 | 74 |
|
75 |
/** |
|
7886 | 76 |
* \return a pointer to the physical layer. |
6705 | 77 |
*/ |
7887 | 78 |
Ptr<LteEnbPhy> GetPhy (void) const; |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
79 |
|
7952
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
80 |
/** |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
81 |
* \return a pointer to the Radio Resource Control instance of the eNB |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
82 |
*/ |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
83 |
Ptr<LteEnbRrc> GetRrc () const; |
6705 | 84 |
|
7952
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
85 |
/** |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
86 |
* \return the Cell Identifier of this eNB |
6705 | 87 |
*/ |
7952
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
88 |
uint16_t GetCellId () const; |
6705 | 89 |
|
7886 | 90 |
/** |
7952
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
91 |
* \return the uplink bandwidth in RBs |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
92 |
*/ |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
93 |
uint8_t GetUlBandwidth () const; |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
94 |
|
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
95 |
/** |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
96 |
* \param bw the uplink bandwidth in RBs |
7886 | 97 |
*/ |
7952
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
98 |
void SetUlBandwidth (uint8_t bw); |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
99 |
|
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
100 |
/** |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
101 |
* \return the downlink bandwidth in RBs |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
102 |
*/ |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
103 |
uint8_t GetDlBandwidth () const; |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
104 |
|
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
105 |
/** |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
106 |
* \param bw the downlink bandwidth in RBs |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
107 |
*/ |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
108 |
void SetDlBandwidth (uint8_t bw); |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
109 |
|
8015 | 110 |
/** |
111 |
* \return the downlink carrier frequency (EARFCN) |
|
112 |
*/ |
|
113 |
uint16_t GetDlEarfcn () const; |
|
114 |
||
115 |
/** |
|
116 |
* \param bw the downlink carrier frequency (EARFCN) |
|
117 |
*/ |
|
118 |
void SetDlEarfcn (uint16_t earfcn); |
|
119 |
||
120 |
/** |
|
121 |
* \return the uplink carrier frequency (EARFCN) |
|
122 |
*/ |
|
123 |
uint16_t GetUlEarfcn () const; |
|
124 |
||
125 |
/** |
|
126 |
* \param bw the uplink carrier frequency (EARFCN) |
|
127 |
*/ |
|
128 |
void SetUlEarfcn (uint16_t earfcn); |
|
129 |
||
6705 | 130 |
|
7976
541eee38ac12
fixed LENA-78 m_dlBandwidth not initialized
Nicola Baldo <nbaldo@cttc.es>
parents:
7952
diff
changeset
|
131 |
protected: |
541eee38ac12
fixed LENA-78 m_dlBandwidth not initialized
Nicola Baldo <nbaldo@cttc.es>
parents:
7952
diff
changeset
|
132 |
// inherited from Object |
541eee38ac12
fixed LENA-78 m_dlBandwidth not initialized
Nicola Baldo <nbaldo@cttc.es>
parents:
7952
diff
changeset
|
133 |
virtual void DoStart (void); |
541eee38ac12
fixed LENA-78 m_dlBandwidth not initialized
Nicola Baldo <nbaldo@cttc.es>
parents:
7952
diff
changeset
|
134 |
|
541eee38ac12
fixed LENA-78 m_dlBandwidth not initialized
Nicola Baldo <nbaldo@cttc.es>
parents:
7952
diff
changeset
|
135 |
|
6705 | 136 |
private: |
137 |
bool DoSend (Ptr<Packet> packet, |
|
138 |
const Mac48Address& source, |
|
139 |
const Mac48Address& dest, |
|
140 |
uint16_t protocolNumber); |
|
141 |
||
142 |
void DoReceive (Ptr<Packet> p); |
|
143 |
||
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
144 |
/** |
7952
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
145 |
* Several attributes (e.g., the bandwidth) are exported as |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
146 |
* attributes of the LteEnbNetDevice from a user perspective, but |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
147 |
* are actually used also in other modules as well (the RRC, the |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
148 |
* PHY, the scheduler...). This methods takes care of updating the |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
149 |
* configuration of all modules so that their copy of the attribute |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
150 |
* values is in sync with the one in the LteEnbNetDevice. |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
151 |
*/ |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
152 |
void UpdateConfig (void); |
7886 | 153 |
|
154 |
Ptr<LteEnbMac> m_mac; |
|
155 |
||
7887 | 156 |
Ptr<LteEnbPhy> m_phy; |
6705 | 157 |
|
7886 | 158 |
Ptr<LteEnbRrc> m_rrc; |
159 |
||
7897 | 160 |
Ptr<FfMacScheduler> m_scheduler; |
7886 | 161 |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
162 |
uint16_t m_cellId; /**< Cell Identifer. Part of the CGI, see TS 29.274, section 8.21.1 */ |
7886 | 163 |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
164 |
static uint16_t m_cellIdCounter; |
7952
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
165 |
|
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
166 |
uint8_t m_dlBandwidth; /**< downlink bandwidth in RBs */ |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
167 |
uint8_t m_ulBandwidth; /**< uplink bandwidth in RBs */ |
8015 | 168 |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
169 |
uint16_t m_dlEarfcn; /**< downlink carrier frequency */ |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
170 |
uint16_t m_ulEarfcn; /**< uplink carrier frequency */ |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
171 |
|
6705 | 172 |
}; |
173 |
||
174 |
} // namespace ns3 |
|
175 |
||
7887 | 176 |
#endif /* LTE_ENB_NET_DEVICE_H */ |