21 #include "ns3/core-module.h"
22 #include "ns3/network-module.h"
23 #include "ns3/internet-module.h"
24 #include "ns3/mobility-module.h"
25 #include "ns3/lte-module.h"
26 #include "ns3/applications-module.h"
27 #include "ns3/point-to-point-module.h"
28 #include "ns3/config-store-module.h"
41 <<
" UE IMSI " << imsi
42 <<
": connected to CellId " << cellid
43 <<
" with RNTI " << rnti
52 uint16_t targetCellId)
55 <<
" UE IMSI " << imsi
56 <<
": previously connected to CellId " << cellid
57 <<
" with RNTI " << rnti
58 <<
", doing handover to CellId " << targetCellId
69 <<
" UE IMSI " << imsi
70 <<
": successful handover to CellId " << cellid
71 <<
" with RNTI " << rnti
82 <<
" eNB CellId " << cellid
83 <<
": successful connection of UE with IMSI " << imsi
93 uint16_t targetCellId)
96 <<
" eNB CellId " << cellid
97 <<
": start handover of UE with IMSI " << imsi
99 <<
" to CellId " << targetCellId
110 <<
" eNB CellId " << cellid
111 <<
": completed handover of UE with IMSI " << imsi
141 uint16_t numberOfUes = 1;
142 uint16_t numberOfEnbs = 2;
143 uint16_t numBearersPerUe = 2;
144 double simTime = 0.300;
145 double distance = 100.0;
156 cmd.
AddValue(
"numberOfUes",
"Number of UEs", numberOfUes);
157 cmd.
AddValue(
"numberOfEnbs",
"Number of eNodeBs", numberOfEnbs);
158 cmd.
AddValue(
"simTime",
"Total duration of the simulation (in seconds)",simTime);
159 cmd.
Parse(argc, argv);
167 Ptr<Node> pgw = epcHelper->GetPgwNode ();
171 remoteHostContainer.
Create (1);
174 internet.
Install (remoteHostContainer);
183 ipv4h.
SetBase (
"1.0.0.0",
"255.0.0.0");
196 enbNodes.
Create(numberOfEnbs);
197 ueNodes.
Create(numberOfUes);
201 for (uint16_t i = 0; i < numberOfEnbs; i++)
203 positionAlloc->
Add (
Vector(distance * 2*i - distance, 0, 0));
205 for (uint16_t i = 0; i < numberOfUes; i++)
224 for (uint32_t u = 0; u < ueNodes.
GetN (); ++u)
229 ueStaticRouting->
SetDefaultRoute (epcHelper->GetUeDefaultGatewayAddress (), 1);
234 for (uint16_t i = 0; i < numberOfUes; i++)
236 lteHelper->
Attach (ueLteDevs.
Get(i), enbLteDevs.
Get(0));
243 uint16_t dlPort = 10000;
244 uint16_t ulPort = 20000;
253 for (uint32_t u = 0; u < numberOfUes; ++u)
258 ueStaticRouting->
SetDefaultRoute (epcHelper->GetUeDefaultGatewayAddress (), 1);
260 for (uint32_t b = 0; b < numBearersPerUe; ++b)
270 clientApps.
Add (dlClientHelper.Install (remoteHost));
273 serverApps.
Add (dlPacketSinkHelper.
Install (ue));
280 serverApps.
Add (ulPacketSinkHelper.
Install (remoteHost));
285 dlpf.localPortEnd = dlPort;
295 serverApps.
Start (startTime);
296 clientApps.
Start (startTime);
322 Config::Connect (
"/NodeList/*/DeviceList/*/LteEnbRrc/ConnectionEstablished",
324 Config::Connect (
"/NodeList/*/DeviceList/*/LteUeRrc/ConnectionEstablished",