A Discrete-Event Network Simulator
API
epc-test-s1u-uplink.cc
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2007,2008,2009 INRIA, UDCAST
4  * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * The original version of UdpClient is by Amine Ismail
20  * <amine.ismail@sophia.inria.fr> <amine.ismail@udcast.com>
21  * The rest of the code (including modifying UdpClient into
22  * EpsBearerTagUdpClient) is by Nicola Baldo <nbaldo@cttc.es>
23  */
24 
25 
26 
27 #include "ns3/simulator.h"
28 #include "ns3/log.h"
29 #include "ns3/test.h"
30 #include "ns3/point-to-point-epc-helper.h"
31 #include "ns3/epc-enb-application.h"
32 #include "ns3/packet-sink-helper.h"
33 #include "ns3/point-to-point-helper.h"
34 #include "ns3/csma-helper.h"
35 #include "ns3/internet-stack-helper.h"
36 #include "ns3/ipv4-address-helper.h"
37 #include "ns3/inet-socket-address.h"
38 #include "ns3/packet-sink.h"
39 #include <ns3/ipv4-static-routing-helper.h>
40 #include <ns3/ipv4-static-routing.h>
41 #include <ns3/ipv4-interface.h>
42 #include <ns3/mac48-address.h>
43 #include "ns3/seq-ts-header.h"
44 #include "ns3/eps-bearer-tag.h"
45 #include "ns3/arp-cache.h"
46 #include "ns3/boolean.h"
47 #include "ns3/uinteger.h"
48 #include "ns3/config.h"
49 #include "lte-test-entities.h"
50 
51 using namespace ns3;
52 
53 NS_LOG_COMPONENT_DEFINE ("EpcTestS1uUplink");
54 
68 {
69 public:
74  static TypeId
75  GetTypeId (void);
76 
84  EpsBearerTagUdpClient (uint16_t rnti, uint8_t bid);
85 
86  virtual ~EpsBearerTagUdpClient ();
87 
93  void SetRemote (Ipv4Address ip, uint16_t port);
94 
95 protected:
96  virtual void DoDispose (void);
97 
98 private:
99 
100  virtual void StartApplication (void);
101  virtual void StopApplication (void);
102 
107  void ScheduleTransmit (Time dt);
109  void Send (void);
110 
111  uint32_t m_count;
113  uint32_t m_size;
114 
115  uint32_t m_sent;
118  uint16_t m_peerPort;
120 
121  uint16_t m_rnti;
122  uint8_t m_bid;
123 
124 };
125 
126 
127 
128 TypeId
130 {
131  static TypeId tid = TypeId ("ns3::EpsBearerTagUdpClient")
133  .AddConstructor<EpsBearerTagUdpClient> ()
134  .AddAttribute ("MaxPackets",
135  "The maximum number of packets the application will send",
136  UintegerValue (100),
138  MakeUintegerChecker<uint32_t> ())
139  .AddAttribute ("Interval",
140  "The time to wait between packets", TimeValue (Seconds (1.0)),
142  MakeTimeChecker ())
143  .AddAttribute (
144  "RemoteAddress",
145  "The destination Ipv4Address of the outbound packets",
146  Ipv4AddressValue (),
149  .AddAttribute ("RemotePort", "The destination port of the outbound packets",
150  UintegerValue (100),
152  MakeUintegerChecker<uint16_t> ())
153  .AddAttribute ("PacketSize",
154  "Size of packets generated. The minimum packet size is 12 bytes which is the size of the header carrying the sequence number and the time stamp.",
155  UintegerValue (1024),
157  MakeUintegerChecker<uint32_t> ())
158  ;
159  return tid;
160 }
161 
163  : m_rnti (0),
164  m_bid (0)
165 {
167  m_sent = 0;
168  m_socket = 0;
169  m_sendEvent = EventId ();
170 }
171 
173  : m_rnti (rnti),
174  m_bid (bid)
175 {
177  m_sent = 0;
178  m_socket = 0;
179  m_sendEvent = EventId ();
180 }
181 
183 {
185 }
186 
187 void
189 {
190  m_peerAddress = ip;
191  m_peerPort = port;
192 }
193 
194 void
196 {
198  Application::DoDispose ();
199 }
200 
201 void
203 {
205 
206  if (m_socket == 0)
207  {
208  TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory");
209  m_socket = Socket::CreateSocket (GetNode (), tid);
210  m_socket->Bind ();
212  }
213 
215  m_sendEvent = Simulator::Schedule (Seconds (0.0), &EpsBearerTagUdpClient::Send, this);
216 }
217 
218 void
220 {
222  Simulator::Cancel (m_sendEvent);
223 }
224 
225 void
227 {
230  SeqTsHeader seqTs;
231  seqTs.SetSeq (m_sent);
232  Ptr<Packet> p = Create<Packet> (m_size-(8+4)); // 8+4 : the size of the seqTs header
233  p->AddHeader (seqTs);
234 
235  EpsBearerTag tag (m_rnti, m_bid);
236  p->AddPacketTag (tag);
237 
238  if ((m_socket->Send (p)) >= 0)
239  {
240  ++m_sent;
241  NS_LOG_INFO ("TraceDelay TX " << m_size << " bytes to "
242  << m_peerAddress << " Uid: " << p->GetUid ()
243  << " Time: " << (Simulator::Now ()).GetSeconds ());
244 
245  }
246  else
247  {
248  NS_LOG_INFO ("Error while sending " << m_size << " bytes to "
249  << m_peerAddress);
250  }
251 
252  if (m_sent < m_count)
253  {
254  m_sendEvent = Simulator::Schedule (m_interval, &EpsBearerTagUdpClient::Send, this);
255  }
256 }
257 
258 
259 
267 {
276  UeUlTestData (uint32_t n, uint32_t s, uint16_t r, uint8_t l);
277 
278  uint32_t numPkts;
279  uint32_t pktSize;
280  uint16_t rnti;
281  uint8_t bid;
282 
285 };
286 
287  UeUlTestData::UeUlTestData (uint32_t n, uint32_t s, uint16_t r, uint8_t l)
288  : numPkts (n),
289  pktSize (s),
290  rnti (r),
291  bid (l)
292 {
293 }
294 
303 {
304  std::vector<UeUlTestData> ues;
305 };
306 
307 
315 {
316 public:
323  EpcS1uUlTestCase (std::string name, std::vector<EnbUlTestData> v);
324  virtual ~EpcS1uUlTestCase ();
325 
326 private:
327  virtual void DoRun (void);
328  std::vector<EnbUlTestData> m_enbUlTestData;
329 };
330 
331 
332 EpcS1uUlTestCase::EpcS1uUlTestCase (std::string name, std::vector<EnbUlTestData> v)
333  : TestCase (name),
334  m_enbUlTestData (v)
335 {
336 }
337 
339 {
340 }
341 
342 void
344 {
345  Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper> ();
346  Ptr<Node> pgw = epcHelper->GetPgwNode ();
347 
348  // allow jumbo packets
349  Config::SetDefault ("ns3::CsmaNetDevice::Mtu", UintegerValue (30000));
350  Config::SetDefault ("ns3::PointToPointNetDevice::Mtu", UintegerValue (30000));
351  epcHelper->SetAttribute ("S1uLinkMtu", UintegerValue (30000));
352 
353  // Create a single RemoteHost
354  NodeContainer remoteHostContainer;
355  remoteHostContainer.Create (1);
356  Ptr<Node> remoteHost = remoteHostContainer.Get (0);
357  InternetStackHelper internet;
358  internet.Install (remoteHostContainer);
359 
360  // Create the internet
361  PointToPointHelper p2ph;
362  p2ph.SetDeviceAttribute ("DataRate", DataRateValue (DataRate ("100Gb/s")));
363  NetDeviceContainer internetDevices = p2ph.Install (pgw, remoteHost);
364  Ipv4AddressHelper ipv4h;
365  ipv4h.SetBase ("1.0.0.0", "255.0.0.0");
366  Ipv4InterfaceContainer internetNodesIpIfaceContainer = ipv4h.Assign (internetDevices);
367 
368  // setup default gateway for the remote hosts
369  Ipv4StaticRoutingHelper ipv4RoutingHelper;
370  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
371 
372  // hardcoded UE addresses for now
373  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.255.0"), 1);
374 
375 
376 
377  uint16_t udpSinkPort = 1234;
378 
379  NodeContainer enbs;
380  uint16_t cellIdCounter = 0;
381  uint64_t imsiCounter = 0;
382 
383  for (std::vector<EnbUlTestData>::iterator enbit = m_enbUlTestData.begin ();
384  enbit < m_enbUlTestData.end ();
385  ++enbit)
386  {
387  Ptr<Node> enb = CreateObject<Node> ();
388  enbs.Add (enb);
389 
390  // we test EPC without LTE, hence we use:
391  // 1) a CSMA network to simulate the cell
392  // 2) a raw socket opened on the CSMA device to simulate the LTE socket
393 
394  uint16_t cellId = ++cellIdCounter;
395 
396  NodeContainer ues;
397  ues.Create (enbit->ues.size ());
398 
399  NodeContainer cell;
400  cell.Add (ues);
401  cell.Add (enb);
402 
403  CsmaHelper csmaCell;
404  NetDeviceContainer cellDevices = csmaCell.Install (cell);
405 
406  // the eNB's CSMA NetDevice acting as an LTE NetDevice.
407  Ptr<NetDevice> enbDevice = cellDevices.Get (cellDevices.GetN () - 1);
408 
409  // Note that the EpcEnbApplication won't care of the actual NetDevice type
410  epcHelper->AddEnb (enb, enbDevice, cellId);
411 
412  // Plug test RRC entity
414  NS_ASSERT_MSG (enbApp != 0, "cannot retrieve EpcEnbApplication");
415  Ptr<EpcTestRrc> rrc = CreateObject<EpcTestRrc> ();
416  enb->AggregateObject (rrc);
417  rrc->SetS1SapProvider (enbApp->GetS1SapProvider ());
418  enbApp->SetS1SapUser (rrc->GetS1SapUser ());
419 
420  // we install the IP stack on UEs only
421  InternetStackHelper internet;
422  internet.Install (ues);
423 
424  // assign IP address to UEs, and install applications
425  for (uint32_t u = 0; u < ues.GetN (); ++u)
426  {
427  Ptr<NetDevice> ueLteDevice = cellDevices.Get (u);
428  Ipv4InterfaceContainer ueIpIface = epcHelper->AssignUeIpv4Address (NetDeviceContainer (ueLteDevice));
429 
430  Ptr<Node> ue = ues.Get (u);
431 
432  // disable IP Forwarding on the UE. This is because we use
433  // CSMA broadcast MAC addresses for this test. The problem
434  // won't happen with a LteUeNetDevice.
435  Ptr<Ipv4> ueIpv4 = ue->GetObject<Ipv4> ();
436  ueIpv4->SetAttribute ("IpForward", BooleanValue (false));
437 
438  // tell the UE to route all packets to the GW
439  Ptr<Ipv4StaticRouting> ueStaticRouting = ipv4RoutingHelper.GetStaticRouting (ueIpv4);
440  Ipv4Address gwAddr = epcHelper->GetUeDefaultGatewayAddress ();
441  NS_LOG_INFO ("GW address: " << gwAddr);
442  ueStaticRouting->SetDefaultRoute (gwAddr, 1);
443 
444  // since the UEs in this test use CSMA with IP enabled, and
445  // the eNB uses CSMA but without IP, we fool the UE's ARP
446  // cache into thinking that the IP address of the GW can be
447  // reached by sending a CSMA packet to the broadcast
448  // address, so the eNB will get it.
449  int32_t ueLteIpv4IfIndex = ueIpv4->GetInterfaceForDevice (ueLteDevice);
450  Ptr<Ipv4L3Protocol> ueIpv4L3Protocol = ue->GetObject<Ipv4L3Protocol> ();
451  Ptr<Ipv4Interface> ueLteIpv4Iface = ueIpv4L3Protocol->GetInterface (ueLteIpv4IfIndex);
452  Ptr<ArpCache> ueArpCache = ueLteIpv4Iface->GetArpCache ();
453  ueArpCache->SetAliveTimeout (Seconds (1000));
454  ArpCache::Entry* arpCacheEntry = ueArpCache->Add (gwAddr);
455  arpCacheEntry->SetMacAddress (Mac48Address::GetBroadcast ());
456  arpCacheEntry->MarkPermanent ();
457 
458 
459  PacketSinkHelper packetSinkHelper ("ns3::UdpSocketFactory",
460  InetSocketAddress (Ipv4Address::GetAny (), udpSinkPort));
461  ApplicationContainer sinkApp = packetSinkHelper.Install (remoteHost);
462  sinkApp.Start (Seconds (1.0));
463  sinkApp.Stop (Seconds (10.0));
464  enbit->ues[u].serverApp = sinkApp.Get (0)->GetObject<PacketSink> ();
465 
466  Time interPacketInterval = Seconds (0.01);
467  Ptr<EpsBearerTagUdpClient> client = CreateObject<EpsBearerTagUdpClient> (enbit->ues[u].rnti, enbit->ues[u].bid);
468  client->SetAttribute ("RemoteAddress", Ipv4AddressValue (internetNodesIpIfaceContainer.GetAddress (1)));
469  client->SetAttribute ("RemotePort", UintegerValue (udpSinkPort));
470  client->SetAttribute ("MaxPackets", UintegerValue (enbit->ues[u].numPkts));
471  client->SetAttribute ("Interval", TimeValue (interPacketInterval));
472  client->SetAttribute ("PacketSize", UintegerValue (enbit->ues[u].pktSize));
473  ue->AddApplication (client);
474  ApplicationContainer clientApp;
475  clientApp.Add (client);
476  clientApp.Start (Seconds (2.0));
477  clientApp.Stop (Seconds (10.0));
478  enbit->ues[u].clientApp = client;
479 
480  uint64_t imsi = ++imsiCounter;
481  epcHelper->AddUe (ueLteDevice, imsi);
482  epcHelper->ActivateEpsBearer (ueLteDevice, imsi, EpcTft::Default (), EpsBearer (EpsBearer::NGBR_VIDEO_TCP_DEFAULT));
483  Simulator::Schedule (MilliSeconds (10),
484  &EpcEnbS1SapProvider::InitialUeMessage,
485  enbApp->GetS1SapProvider (), imsi, enbit->ues[u].rnti);
486  // need this since all sinks are installed in the same node
487  ++udpSinkPort;
488  }
489 
490  }
491 
492  Simulator::Run ();
493 
494  for (std::vector<EnbUlTestData>::iterator enbit = m_enbUlTestData.begin ();
495  enbit < m_enbUlTestData.end ();
496  ++enbit)
497  {
498  for (std::vector<UeUlTestData>::iterator ueit = enbit->ues.begin ();
499  ueit < enbit->ues.end ();
500  ++ueit)
501  {
502  NS_TEST_ASSERT_MSG_EQ (ueit->serverApp->GetTotalRx (), (ueit->numPkts) * (ueit->pktSize), "wrong total received bytes");
503  }
504  }
505 
506  Simulator::Destroy ();
507 }
508 
509 
510 
511 
512 
517 {
518 public:
520 
522 
524  : TestSuite ("epc-s1u-uplink", SYSTEM)
525 {
526  std::vector<EnbUlTestData> v1;
527  EnbUlTestData e1;
528  UeUlTestData f1 (1, 100, 1, 1);
529  e1.ues.push_back (f1);
530  v1.push_back (e1);
531  AddTestCase (new EpcS1uUlTestCase ("1 eNB, 1UE", v1), TestCase::QUICK);
532 
533 
534  std::vector<EnbUlTestData> v2;
535  EnbUlTestData e2;
536  UeUlTestData f2_1 (1, 100, 1, 1);
537  e2.ues.push_back (f2_1);
538  UeUlTestData f2_2 (2, 200, 2, 1);
539  e2.ues.push_back (f2_2);
540  v2.push_back (e2);
541  AddTestCase (new EpcS1uUlTestCase ("1 eNB, 2UEs", v2), TestCase::QUICK);
542 
543 
544  std::vector<EnbUlTestData> v3;
545  v3.push_back (e1);
546  v3.push_back (e2);
547  AddTestCase (new EpcS1uUlTestCase ("2 eNBs", v3), TestCase::QUICK);
548 
549 
550  EnbUlTestData e3;
551  UeUlTestData f3_1 (3, 50, 1, 1);
552  e3.ues.push_back (f3_1);
553  UeUlTestData f3_2 (5, 1472, 2, 1);
554  e3.ues.push_back (f3_2);
555  UeUlTestData f3_3 (1, 1, 3, 1);
556  e3.ues.push_back (f3_2);
557  std::vector<EnbUlTestData> v4;
558  v4.push_back (e3);
559  v4.push_back (e1);
560  v4.push_back (e2);
561  AddTestCase (new EpcS1uUlTestCase ("3 eNBs", v4), TestCase::QUICK);
562 
563  std::vector<EnbUlTestData> v5;
564  EnbUlTestData e5;
565  UeUlTestData f5 (10, 3000, 1, 1);
566  e5.ues.push_back (f5);
567  v5.push_back (e5);
568  AddTestCase (new EpcS1uUlTestCase ("1 eNB, 10 pkts 3000 bytes each", v5), TestCase::QUICK);
569 
570  std::vector<EnbUlTestData> v6;
571  EnbUlTestData e6;
572  UeUlTestData f6 (50, 3000, 1, 1);
573  e6.ues.push_back (f6);
574  v6.push_back (e6);
575  AddTestCase (new EpcS1uUlTestCase ("1 eNB, 50 pkts 3000 bytes each", v6), TestCase::QUICK);
576 
577  std::vector<EnbUlTestData> v7;
578  EnbUlTestData e7;
579  UeUlTestData f7 (10, 15000, 1, 1);
580  e7.ues.push_back (f7);
581  v7.push_back (e7);
582  AddTestCase (new EpcS1uUlTestCase ("1 eNB, 10 pkts 15000 bytes each", v7), TestCase::QUICK);
583 
584  std::vector<EnbUlTestData> v8;
585  EnbUlTestData e8;
586  UeUlTestData f8 (100, 15000, 1, 1);
587  e8.ues.push_back (f8);
588  v8.push_back (e8);
589  AddTestCase (new EpcS1uUlTestCase ("1 eNB, 100 pkts 15000 bytes each", v8), TestCase::QUICK);
590 
591 }
virtual void DoRun(void)
Implementation to actually run this TestCase.
holds a vector of ns3::Application pointers.
uint32_t AddApplication(Ptr< Application > application)
Associate an Application to this Node.
Definition: node.cc:157
void MarkPermanent(void)
Changes the state of this entry to Permanent.
Definition: arp-cache.cc:414
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
uint64_t GetUid(void) const
Returns the packet&#39;s Uid.
Definition: packet.cc:390
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
an Inet address class
Test that the S1-U interface implementation works correctly.
AttributeValue implementation for Boolean.
Definition: boolean.h:36
void SetMacAddress(Address macAddress)
Definition: arp-cache.cc:460
ArpCache::Entry * Add(Ipv4Address to)
Add an Ipv4Address to this ARP cache.
Definition: arp-cache.cc:330
uint32_t m_count
maximum number of packets to send
holds a vector of std::pair of Ptr<Ipv4> and interface index.
void SetDefaultRoute(Ipv4Address nextHop, uint32_t interface, uint32_t metric=0)
Add a default route to the static routing table.
NS_ASSERT_MSG(false, "Ipv4AddressGenerator::MaskToIndex(): Impossible")
NetDeviceContainer Install(NodeContainer c)
a class to represent an Ipv4 address mask
Definition: ipv4-address.h:258
void Add(ApplicationContainer other)
Append the contents of another ApplicationContainer to the end of this container. ...
EpcS1uUlTestCase(std::string name, std::vector< EnbUlTestData > v)
Constructor.
Ptr< Application > clientApp
the client application
A suite of tests to run.
Definition: test.h:1342
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
Definition: object.cc:252
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
Definition: assert.h:67
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:204
uint8_t m_bid
the bearer identificator
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1070
ApplicationContainer Install(NodeContainer c) const
Install an ns3::PacketSinkApplication on each node of the input container configured with all the att...
aggregate IP/TCP/UDP functionality to existing Nodes.
uint32_t m_sent
number of packets sent
EventId m_sendEvent
the send event
Tag used to define the RNTI and EPS bearer ID for packets interchanged between the EpcEnbApplication ...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:280
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes...
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
Callback< R > MakeNullCallback(void)
Definition: callback.h:1635
Build a set of PointToPointNetDevice objects.
encapsulates test code
Definition: test.h:1155
void SetDeviceAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each NetDevice created by the helper.
void Send(void)
Send function.
uint16_t m_peerPort
the destination port of the outbound packets
bool IsExpired(void) const
This method is syntactic sugar for the ns3::Simulator::IsExpired method.
Definition: event-id.cc:59
virtual void DoDispose(void)
Destructor implementation.
uint16_t port
Definition: dsdv-manet.cc:45
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Definition: time.cc:446
Class for representing data rates.
Definition: data-rate.h:88
virtual void StartApplication(void)
Application specific startup code.
void SetS1SapUser(EpcEnbS1SapUser *s)
Set the S1 SAP User.
uint32_t m_size
the size of packets generated
virtual Ipv4InterfaceContainer AssignUeIpv4Address(NetDeviceContainer ueDevices)
Assign IPv4 addresses to UE devices.
Time m_interval
the time between packets
The base class for all ns3 applications.
Definition: application.h:60
AttributeValue implementation for Time.
Definition: nstime.h:1124
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Definition: test.cc:299
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
std::vector< EnbUlTestData > m_enbUlTestData
ENB UL test data.
Ptr< const AttributeChecker > MakeIpv4AddressChecker(void)
Hold an unsigned integer type.
Definition: uinteger.h:44
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
Definition: test.h:168
Ptr< Ipv4Interface > GetInterface(uint32_t i) const
Get an interface.
virtual uint8_t ActivateEpsBearer(Ptr< NetDevice > ueLteDevice, uint64_t imsi, Ptr< EpcTft > tft, EpsBearer bearer)
Activate an EPS bearer, setting up the corresponding S1-U tunnel.
Ptr< Application > GetApplication(uint32_t index) const
Retrieve the index-th Application associated to this node.
Definition: node.cc:168
holds a vector of ns3::NetDevice pointers
void SetRemote(Ipv4Address ip, uint16_t port)
set the remote address and port
Ptr< Socket > m_socket
the socket
static TypeId GetTypeId(void)
Get the type ID.
void SetRecvCallback(Callback< void, Ptr< Socket > >)
Notify application when new data is available to be read.
Definition: socket.cc:128
Custom structure containing information about data sent in the uplink of eNodeB.
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter...
void SetS1SapProvider(EpcEnbS1SapProvider *s)
Set the S1 SAP Provider.
EpcEnbS1SapUser * GetS1SapUser()
Ptr< Node > GetNode() const
Definition: application.cc:104
virtual void AddEnb(Ptr< Node > enbNode, Ptr< NetDevice > lteEnbNetDevice, uint16_t cellId)
Add an eNB to the EPC.
std::vector< UeUlTestData > ues
the list of UEs
uint32_t GetN(void) const
Get the number of Ptr<Node> stored in this container.
Packet header for UDP client/server application.
Definition: seq-ts-header.h:36
virtual int Connect(const Address &address)=0
Initiate a connection to a remote host.
Access to the IPv4 forwarding table, interfaces, and configuration.
Definition: ipv4.h:76
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:459
void SetAliveTimeout(Time aliveTimeout)
Set the time the entry will be in ALIVE state (unless refreshed)
Definition: arp-cache.cc:136
Implement the IPv4 layer.
virtual int Bind(const Address &address)=0
Allocate a local endpoint for this socket.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
EpcEnbS1SapProvider * GetS1SapProvider()
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:91
A record that that holds information about an ArpCache entry.
Definition: arp-cache.h:188
AttributeValue implementation for Ipv4Address.
Definition: ipv4-address.h:329
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: nstime.h:1125
UeUlTestData(uint32_t n, uint32_t s, uint16_t r, uint8_t l)
Constructor.
build a set of CsmaNetDevice objects
Definition: csma-helper.h:46
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
NetDeviceContainer Install(Ptr< Node > node) const
This method creates an ns3::CsmaChannel with the attributes configured by CsmaHelper::SetChannelAttri...
Definition: csma-helper.cc:218
void AddNetworkRouteTo(Ipv4Address network, Ipv4Mask networkMask, Ipv4Address nextHop, uint32_t interface, uint32_t metric=0)
Add a network route to the static routing table.
virtual void AddUe(Ptr< NetDevice > ueLteDevice, uint64_t imsi)
Notify the EPC of the existence of a new UE which might attach at a later time.
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:40
uint32_t pktSize
the packet size
void Stop(Time stop)
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter...
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
This application is installed inside eNBs and provides the bridge functionality for user data plane p...
uint16_t rnti
the RNTI
Ptr< PacketSink > serverApp
the server application
void Add(NodeContainer other)
Append the contents of another NodeContainer to the end of this container.
An identifier for simulation events.
Definition: event-id.h:53
void AddPacketTag(const Tag &tag) const
Add a packet tag.
Definition: packet.cc:863
Helper class that adds ns3::Ipv4StaticRouting objects.
AttributeValue implementation for DataRate.
Definition: data-rate.h:242
void SetSeq(uint32_t seq)
virtual Ptr< Node > GetPgwNode() const
Get the PGW node.
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1062
uint32_t GetN(void) const
Get the number of Ptr<NetDevice> stored in this container.
void SetDefault(std::string name, const AttributeValue &value)
Definition: config.cc:810
uint8_t bid
the BID
virtual void StopApplication(void)
Application specific shutdown code.
virtual int32_t GetInterfaceForDevice(Ptr< const NetDevice > device) const =0
uint32_t numPkts
the number of packets sent
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
Definition: simulator.cc:309
Ipv4Address m_peerAddress
the peer address of the outbound packets
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Ptr< const AttributeAccessor > MakeIpv4AddressAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: ipv4-address.h:329
Receive and consume traffic generated to an IP address and port.
Definition: packet-sink.h:68
virtual int Send(Ptr< Packet > p, uint32_t flags)=0
Send data (or dummy data) to the remote host.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:185
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: uinteger.h:45
a unique identifier for an interface.
Definition: type-id.h:58
Custom test structure to hold information of data transmitted in the uplink per UE.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:915
Ptr< Application > Get(uint32_t i) const
Get the Ptr<Application> stored in this container at a given index.
virtual Ipv4Address GetUeDefaultGatewayAddress()
void AddHeader(const Header &header)
Add header to this packet.
Definition: packet.cc:256
EpcS1uUlTestCase class.
Ptr< Ipv4StaticRouting > GetStaticRouting(Ptr< Ipv4 > ipv4) const
Try and find the static routing protocol as either the main routing protocol or in the list of routin...
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.