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  virtual void StartApplication (void);
100  virtual void StopApplication (void);
101 
108  void Send (void);
109 
113 
117  uint16_t m_peerPort;
119 
120  uint16_t m_rnti;
121  uint8_t m_bid;
122 
123 };
124 
125 
126 
127 TypeId
129 {
130  static TypeId tid = TypeId ("ns3::EpsBearerTagUdpClient")
132  .AddConstructor<EpsBearerTagUdpClient> ()
133  .AddAttribute ("MaxPackets",
134  "The maximum number of packets the application will send",
135  UintegerValue (100),
137  MakeUintegerChecker<uint32_t> ())
138  .AddAttribute ("Interval",
139  "The time to wait between packets", TimeValue (Seconds (1.0)),
141  MakeTimeChecker ())
142  .AddAttribute ("RemoteAddress",
143  "The destination Ipv4Address of the outbound packets",
144  Ipv4AddressValue (),
145  MakeIpv4AddressAccessor (&EpsBearerTagUdpClient::m_peerAddress),
146  MakeIpv4AddressChecker ())
147  .AddAttribute ("RemotePort", "The destination port of the outbound packets",
148  UintegerValue (100),
150  MakeUintegerChecker<uint16_t> ())
151  .AddAttribute ("PacketSize",
152  "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.",
153  UintegerValue (1024),
155  MakeUintegerChecker<uint32_t> ())
156  ;
157  return tid;
158 }
159 
161  : m_rnti (0),
162  m_bid (0)
163 {
165  m_sent = 0;
166  m_socket = 0;
167  m_sendEvent = EventId ();
168 }
169 
171  : m_rnti (rnti),
172  m_bid (bid)
173 {
175  m_sent = 0;
176  m_socket = 0;
177  m_sendEvent = EventId ();
178 }
179 
181 {
183 }
184 
185 void
187 {
188  m_peerAddress = ip;
189  m_peerPort = port;
190 }
191 
192 void
194 {
196  Application::DoDispose ();
197 }
198 
199 void
201 {
203 
204  if (m_socket == 0)
205  {
206  TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory");
207  m_socket = Socket::CreateSocket (GetNode (), tid);
208  m_socket->Bind ();
210  }
211 
213  m_sendEvent = Simulator::Schedule (Seconds (0.0), &EpsBearerTagUdpClient::Send, this);
214 }
215 
216 void
218 {
220  Simulator::Cancel (m_sendEvent);
221 }
222 
223 void
225 {
228  SeqTsHeader seqTs;
229  seqTs.SetSeq (m_sent);
230  Ptr<Packet> p = Create<Packet> (m_size - (8 + 4)); // 8+4 : the size of the seqTs header
231  p->AddHeader (seqTs);
232 
233  EpsBearerTag tag (m_rnti, m_bid);
234  p->AddPacketTag (tag);
235 
236  if ((m_socket->Send (p)) >= 0)
237  {
238  ++m_sent;
239  NS_LOG_INFO ("TraceDelay TX " << m_size << " bytes to "
240  << m_peerAddress << " Uid: " << p->GetUid ()
241  << " Time: " << (Simulator::Now ()).As (Time::S));
242 
243  }
244  else
245  {
246  NS_LOG_INFO ("Error while sending " << m_size << " bytes to "
247  << m_peerAddress);
248  }
249 
250  if (m_sent < m_count)
251  {
252  m_sendEvent = Simulator::Schedule (m_interval, &EpsBearerTagUdpClient::Send, this);
253  }
254 }
255 
256 
257 
265 {
274  UeUlTestData (uint32_t n, uint32_t s, uint16_t r, uint8_t l);
275 
278  uint16_t rnti;
279  uint8_t bid;
280 
283 };
284 
285 UeUlTestData::UeUlTestData (uint32_t n, uint32_t s, uint16_t r, uint8_t l)
286  : numPkts (n),
287  pktSize (s),
288  rnti (r),
289  bid (l)
290 {}
291 
300 {
301  std::vector<UeUlTestData> ues;
302 };
303 
304 
312 {
313 public:
320  EpcS1uUlTestCase (std::string name, std::vector<EnbUlTestData> v);
321  virtual ~EpcS1uUlTestCase ();
322 
323 private:
324  virtual void DoRun (void);
325  std::vector<EnbUlTestData> m_enbUlTestData;
326 };
327 
328 
329 EpcS1uUlTestCase::EpcS1uUlTestCase (std::string name, std::vector<EnbUlTestData> v)
330  : TestCase (name),
331  m_enbUlTestData (v)
332 {}
333 
335 {}
336 
337 void
339 {
340  Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper> ();
341  Ptr<Node> pgw = epcHelper->GetPgwNode ();
342 
343  // allow jumbo packets
344  Config::SetDefault ("ns3::CsmaNetDevice::Mtu", UintegerValue (30000));
345  Config::SetDefault ("ns3::PointToPointNetDevice::Mtu", UintegerValue (30000));
346  epcHelper->SetAttribute ("S1uLinkMtu", UintegerValue (30000));
347 
348  // Create a single RemoteHost
349  NodeContainer remoteHostContainer;
350  remoteHostContainer.Create (1);
351  Ptr<Node> remoteHost = remoteHostContainer.Get (0);
352  InternetStackHelper internet;
353  internet.Install (remoteHostContainer);
354 
355  // Create the internet
356  PointToPointHelper p2ph;
357  p2ph.SetDeviceAttribute ("DataRate", DataRateValue (DataRate ("100Gb/s")));
358  NetDeviceContainer internetDevices = p2ph.Install (pgw, remoteHost);
359  Ipv4AddressHelper ipv4h;
360  ipv4h.SetBase ("1.0.0.0", "255.0.0.0");
361  Ipv4InterfaceContainer internetNodesIpIfaceContainer = ipv4h.Assign (internetDevices);
362 
363  // setup default gateway for the remote hosts
364  Ipv4StaticRoutingHelper ipv4RoutingHelper;
365  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
366 
367  // hardcoded UE addresses for now
368  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.255.0"), 1);
369 
370 
371 
372  uint16_t udpSinkPort = 1234;
373 
374  NodeContainer enbs;
375  uint16_t cellIdCounter = 0;
376  uint64_t imsiCounter = 0;
377 
378  for (std::vector<EnbUlTestData>::iterator enbit = m_enbUlTestData.begin ();
379  enbit < m_enbUlTestData.end ();
380  ++enbit)
381  {
382  Ptr<Node> enb = CreateObject<Node> ();
383  enbs.Add (enb);
384 
385  // we test EPC without LTE, hence we use:
386  // 1) a CSMA network to simulate the cell
387  // 2) a raw socket opened on the CSMA device to simulate the LTE socket
388 
389  uint16_t cellId = ++cellIdCounter;
390 
391  NodeContainer ues;
392  ues.Create (enbit->ues.size ());
393 
394  NodeContainer cell;
395  cell.Add (ues);
396  cell.Add (enb);
397 
398  CsmaHelper csmaCell;
399  NetDeviceContainer cellDevices = csmaCell.Install (cell);
400 
401  // the eNB's CSMA NetDevice acting as an LTE NetDevice.
402  Ptr<NetDevice> enbDevice = cellDevices.Get (cellDevices.GetN () - 1);
403 
404  // Note that the EpcEnbApplication won't care of the actual NetDevice type
405  epcHelper->AddEnb (enb, enbDevice, cellId);
406 
407  // Plug test RRC entity
409  NS_ASSERT_MSG (enbApp != 0, "cannot retrieve EpcEnbApplication");
410  Ptr<EpcTestRrc> rrc = CreateObject<EpcTestRrc> ();
411  enb->AggregateObject (rrc);
412  rrc->SetS1SapProvider (enbApp->GetS1SapProvider ());
413  enbApp->SetS1SapUser (rrc->GetS1SapUser ());
414 
415  // we install the IP stack on UEs only
416  InternetStackHelper internet;
417  internet.Install (ues);
418 
419  // assign IP address to UEs, and install applications
420  for (uint32_t u = 0; u < ues.GetN (); ++u)
421  {
422  Ptr<NetDevice> ueLteDevice = cellDevices.Get (u);
423  Ipv4InterfaceContainer ueIpIface = epcHelper->AssignUeIpv4Address (NetDeviceContainer (ueLteDevice));
424 
425  Ptr<Node> ue = ues.Get (u);
426 
427  // disable IP Forwarding on the UE. This is because we use
428  // CSMA broadcast MAC addresses for this test. The problem
429  // won't happen with a LteUeNetDevice.
430  Ptr<Ipv4> ueIpv4 = ue->GetObject<Ipv4> ();
431  ueIpv4->SetAttribute ("IpForward", BooleanValue (false));
432 
433  // tell the UE to route all packets to the GW
434  Ptr<Ipv4StaticRouting> ueStaticRouting = ipv4RoutingHelper.GetStaticRouting (ueIpv4);
435  Ipv4Address gwAddr = epcHelper->GetUeDefaultGatewayAddress ();
436  NS_LOG_INFO ("GW address: " << gwAddr);
437  ueStaticRouting->SetDefaultRoute (gwAddr, 1);
438 
439  // since the UEs in this test use CSMA with IP enabled, and
440  // the eNB uses CSMA but without IP, we fool the UE's ARP
441  // cache into thinking that the IP address of the GW can be
442  // reached by sending a CSMA packet to the broadcast
443  // address, so the eNB will get it.
444  int32_t ueLteIpv4IfIndex = ueIpv4->GetInterfaceForDevice (ueLteDevice);
445  Ptr<Ipv4L3Protocol> ueIpv4L3Protocol = ue->GetObject<Ipv4L3Protocol> ();
446  Ptr<Ipv4Interface> ueLteIpv4Iface = ueIpv4L3Protocol->GetInterface (ueLteIpv4IfIndex);
447  Ptr<ArpCache> ueArpCache = ueLteIpv4Iface->GetArpCache ();
448  ueArpCache->SetAliveTimeout (Seconds (1000));
449  ArpCache::Entry* arpCacheEntry = ueArpCache->Add (gwAddr);
450  arpCacheEntry->SetMacAddress (Mac48Address::GetBroadcast ());
451  arpCacheEntry->MarkPermanent ();
452 
453 
454  PacketSinkHelper packetSinkHelper ("ns3::UdpSocketFactory",
455  InetSocketAddress (Ipv4Address::GetAny (), udpSinkPort));
456  ApplicationContainer sinkApp = packetSinkHelper.Install (remoteHost);
457  sinkApp.Start (Seconds (1.0));
458  sinkApp.Stop (Seconds (10.0));
459  enbit->ues[u].serverApp = sinkApp.Get (0)->GetObject<PacketSink> ();
460 
461  Time interPacketInterval = Seconds (0.01);
462  Ptr<EpsBearerTagUdpClient> client = CreateObject<EpsBearerTagUdpClient> (enbit->ues[u].rnti, enbit->ues[u].bid);
463  client->SetAttribute ("RemoteAddress", Ipv4AddressValue (internetNodesIpIfaceContainer.GetAddress (1)));
464  client->SetAttribute ("RemotePort", UintegerValue (udpSinkPort));
465  client->SetAttribute ("MaxPackets", UintegerValue (enbit->ues[u].numPkts));
466  client->SetAttribute ("Interval", TimeValue (interPacketInterval));
467  client->SetAttribute ("PacketSize", UintegerValue (enbit->ues[u].pktSize));
468  ue->AddApplication (client);
469  ApplicationContainer clientApp;
470  clientApp.Add (client);
471  clientApp.Start (Seconds (2.0));
472  clientApp.Stop (Seconds (10.0));
473  enbit->ues[u].clientApp = client;
474 
475  uint64_t imsi = ++imsiCounter;
476  epcHelper->AddUe (ueLteDevice, imsi);
477  epcHelper->ActivateEpsBearer (ueLteDevice, imsi, EpcTft::Default (), EpsBearer (EpsBearer::NGBR_VIDEO_TCP_DEFAULT));
478  Simulator::Schedule (MilliSeconds (10),
479  &EpcEnbS1SapProvider::InitialUeMessage,
480  enbApp->GetS1SapProvider (), imsi, enbit->ues[u].rnti);
481  // need this since all sinks are installed in the same node
482  ++udpSinkPort;
483  }
484 
485  }
486 
487  Simulator::Run ();
488 
489  for (std::vector<EnbUlTestData>::iterator enbit = m_enbUlTestData.begin ();
490  enbit < m_enbUlTestData.end ();
491  ++enbit)
492  {
493  for (std::vector<UeUlTestData>::iterator ueit = enbit->ues.begin ();
494  ueit < enbit->ues.end ();
495  ++ueit)
496  {
497  NS_TEST_ASSERT_MSG_EQ (ueit->serverApp->GetTotalRx (), (ueit->numPkts) * (ueit->pktSize), "wrong total received bytes");
498  }
499  }
500 
501  Simulator::Destroy ();
502 }
503 
504 
505 
506 
507 
512 {
513 public:
515 
517 
519  : TestSuite ("epc-s1u-uplink", SYSTEM)
520 {
521  std::vector<EnbUlTestData> v1;
522  EnbUlTestData e1;
523  UeUlTestData f1 (1, 100, 1, 1);
524  e1.ues.push_back (f1);
525  v1.push_back (e1);
526  AddTestCase (new EpcS1uUlTestCase ("1 eNB, 1UE", v1), TestCase::QUICK);
527 
528 
529  std::vector<EnbUlTestData> v2;
530  EnbUlTestData e2;
531  UeUlTestData f2_1 (1, 100, 1, 1);
532  e2.ues.push_back (f2_1);
533  UeUlTestData f2_2 (2, 200, 2, 1);
534  e2.ues.push_back (f2_2);
535  v2.push_back (e2);
536  AddTestCase (new EpcS1uUlTestCase ("1 eNB, 2UEs", v2), TestCase::QUICK);
537 
538 
539  std::vector<EnbUlTestData> v3;
540  v3.push_back (e1);
541  v3.push_back (e2);
542  AddTestCase (new EpcS1uUlTestCase ("2 eNBs", v3), TestCase::QUICK);
543 
544 
545  EnbUlTestData e3;
546  UeUlTestData f3_1 (3, 50, 1, 1);
547  e3.ues.push_back (f3_1);
548  UeUlTestData f3_2 (5, 1472, 2, 1);
549  e3.ues.push_back (f3_2);
550  UeUlTestData f3_3 (1, 1, 3, 1);
551  e3.ues.push_back (f3_2);
552  std::vector<EnbUlTestData> v4;
553  v4.push_back (e3);
554  v4.push_back (e1);
555  v4.push_back (e2);
556  AddTestCase (new EpcS1uUlTestCase ("3 eNBs", v4), TestCase::QUICK);
557 
558  std::vector<EnbUlTestData> v5;
559  EnbUlTestData e5;
560  UeUlTestData f5 (10, 3000, 1, 1);
561  e5.ues.push_back (f5);
562  v5.push_back (e5);
563  AddTestCase (new EpcS1uUlTestCase ("1 eNB, 10 pkts 3000 bytes each", v5), TestCase::QUICK);
564 
565  std::vector<EnbUlTestData> v6;
566  EnbUlTestData e6;
567  UeUlTestData f6 (50, 3000, 1, 1);
568  e6.ues.push_back (f6);
569  v6.push_back (e6);
570  AddTestCase (new EpcS1uUlTestCase ("1 eNB, 50 pkts 3000 bytes each", v6), TestCase::QUICK);
571 
572  std::vector<EnbUlTestData> v7;
573  EnbUlTestData e7;
574  UeUlTestData f7 (10, 15000, 1, 1);
575  e7.ues.push_back (f7);
576  v7.push_back (e7);
577  AddTestCase (new EpcS1uUlTestCase ("1 eNB, 10 pkts 15000 bytes each", v7), TestCase::QUICK);
578 
579  std::vector<EnbUlTestData> v8;
580  EnbUlTestData e8;
581  UeUlTestData f8 (100, 15000, 1, 1);
582  e8.ues.push_back (f8);
583  v8.push_back (e8);
584  AddTestCase (new EpcS1uUlTestCase ("1 eNB, 100 pkts 15000 bytes each", v8), TestCase::QUICK);
585 
586 }
ns3::NetDeviceContainer
holds a vector of ns3::NetDevice pointers
Definition: net-device-container.h:42
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
ns3::InetSocketAddress
an Inet address class
Definition: inet-socket-address.h:41
DataRateValue
AttributeValue implementation for DataRate.
ns3::ApplicationContainer::Get
Ptr< Application > Get(uint32_t i) const
Get the Ptr<Application> stored in this container at a given index.
Definition: application-container.cc:62
EpcS1uUlTestCase
EpcS1uUlTestCase class.
Definition: epc-test-s1u-uplink.cc:312
EpsBearerTagUdpClient::Send
void Send(void)
Send function.
Definition: epc-test-s1u-uplink.cc:224
ns3::TestCase::AddTestCase
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Definition: test.cc:299
ns3::Node::GetApplication
Ptr< Application > GetApplication(uint32_t index) const
Retrieve the index-th Application associated to this node.
Definition: node.cc:170
UeUlTestData::bid
uint8_t bid
the BID
Definition: epc-test-s1u-uplink.cc:279
EpsBearerTagUdpClient::ScheduleTransmit
void ScheduleTransmit(Time dt)
Schedule transmit function.
NS_ASSERT
#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
ns3::MakeTimeChecker
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Definition: time.cc:536
ns3::BooleanValue
AttributeValue implementation for Boolean.
Definition: boolean.h:37
ns3::EpcEnbApplication
This application is installed inside eNBs and provides the bridge functionality for user data plane p...
Definition: epc-enb-application.h:50
ns3::Socket::Bind
virtual int Bind(const Address &address)=0
Allocate a local endpoint for this socket.
ns3::NoBackhaulEpcHelper::GetPgwNode
virtual Ptr< Node > GetPgwNode() const
Get the PGW node.
Definition: no-backhaul-epc-helper.cc:498
EpsBearerTagUdpClient::m_bid
uint8_t m_bid
the bearer identificator
Definition: epc-test-s1u-uplink.cc:121
ns3::EventId
An identifier for simulation events.
Definition: event-id.h:54
ns3::Packet::AddHeader
void AddHeader(const Header &header)
Add header to this packet.
Definition: packet.cc:256
EpsBearerTagUdpClient::m_interval
Time m_interval
the time between packets
Definition: epc-test-s1u-uplink.cc:111
ns3::PointToPointEpcHelper::AddEnb
virtual void AddEnb(Ptr< Node > enbNode, Ptr< NetDevice > lteEnbNetDevice, uint16_t cellId)
Add an eNB to the EPC.
Definition: point-to-point-epc-helper.cc:109
ns3::EpcTestRrc::SetS1SapProvider
void SetS1SapProvider(EpcEnbS1SapProvider *s)
Set the S1 SAP Provider.
Definition: lte-test-entities.cc:716
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::ApplicationContainer::Stop
void Stop(Time stop)
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter.
Definition: application-container.cc:107
ns3::ArpCache::Entry
A record that that holds information about an ArpCache entry.
Definition: arp-cache.h:178
ns3::Ipv4AddressHelper
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
Definition: ipv4-address-helper.h:48
ns3::SeqTsHeader::SetSeq
void SetSeq(uint32_t seq)
Definition: seq-ts-header.cc:41
ns3::PointToPointHelper::SetDeviceAttribute
void SetDeviceAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each NetDevice created by the helper.
Definition: point-to-point-helper.cc:70
ns3::EpcEnbApplication::SetS1SapUser
void SetS1SapUser(EpcEnbS1SapUser *s)
Set the S1 SAP User.
Definition: epc-enb-application.cc:126
ns3::Object::GetObject
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:470
ns3::ArpCache::Entry::SetMacAddress
void SetMacAddress(Address macAddress)
Definition: arp-cache.cc:460
ns3::Ipv4L3Protocol::GetInterface
Ptr< Ipv4Interface > GetInterface(uint32_t i) const
Get an interface.
Definition: ipv4-l3-protocol.cc:429
ns3::PointToPointHelper::Install
NetDeviceContainer Install(NodeContainer c)
Definition: point-to-point-helper.cc:229
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:41
EpsBearerTagUdpClient::m_sendEvent
EventId m_sendEvent
the send event
Definition: epc-test-s1u-uplink.cc:118
ns3::Ipv4StaticRouting::SetDefaultRoute
void SetDefaultRoute(Ipv4Address nextHop, uint32_t interface, uint32_t metric=0)
Add a default route to the static routing table.
Definition: ipv4-static-routing.cc:122
ns3::NodeContainer::GetN
uint32_t GetN(void) const
Get the number of Ptr<Node> stored in this container.
Definition: node-container.cc:88
lte-test-entities.h
ns3::ObjectBase::SetAttribute
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:256
ns3::CsmaHelper::Install
NetDeviceContainer Install(Ptr< Node > node) const
This method creates an ns3::CsmaChannel with the attributes configured by CsmaHelper::SetChannelAttri...
Definition: csma-helper.cc:225
EnbUlTestData::ues
std::vector< UeUlTestData > ues
the list of UEs
Definition: epc-test-s1u-uplink.cc:301
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:922
ns3::NodeContainer::Create
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Definition: node-container.cc:98
ns3::CsmaHelper
build a set of CsmaNetDevice objects
Definition: csma-helper.h:47
ns3::MakeNullCallback
Callback< R, Ts... > MakeNullCallback(void)
Definition: callback.h:1688
ns3::NoBackhaulEpcHelper::GetUeDefaultGatewayAddress
virtual Ipv4Address GetUeDefaultGatewayAddress()
Definition: no-backhaul-epc-helper.cc:523
ns3::NoBackhaulEpcHelper::ActivateEpsBearer
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.
Definition: no-backhaul-epc-helper.cc:439
ns3::TestCase
encapsulates test code
Definition: test.h:994
EnbUlTestData
Custom structure containing information about data sent in the uplink of eNodeB.
Definition: epc-test-s1u-uplink.cc:300
EpcS1uUlTestCase::EpcS1uUlTestCase
EpcS1uUlTestCase(std::string name, std::vector< EnbUlTestData > v)
Constructor.
Definition: epc-test-s1u-uplink.cc:329
ns3::ApplicationContainer::Add
void Add(ApplicationContainer other)
Append the contents of another ApplicationContainer to the end of this container.
Definition: application-container.cc:67
EpcS1uUlTestSuite
Test that the S1-U interface implementation works correctly.
Definition: epc-test-s1u-uplink.cc:512
ns3::NodeContainer::Add
void Add(NodeContainer other)
Append the contents of another NodeContainer to the end of this container.
Definition: node-container.cc:114
ns3::Ipv4AddressHelper::SetBase
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
Definition: ipv4-address-helper.cc:64
ns3::Ipv4
Access to the IPv4 forwarding table, interfaces, and configuration.
Definition: ipv4.h:77
ns3::Ipv4StaticRoutingHelper
Helper class that adds ns3::Ipv4StaticRouting objects.
Definition: ipv4-static-routing-helper.h:43
ns3::Ptr< Socket >
ns3::DataRate
Class for representing data rates.
Definition: data-rate.h:89
ns3::Socket::Send
virtual int Send(Ptr< Packet > p, uint32_t flags)=0
Send data (or dummy data) to the remote host.
EpsBearerTagUdpClient::m_peerPort
uint16_t m_peerPort
the destination port of the outbound packets
Definition: epc-test-s1u-uplink.cc:117
ns3::Socket::SetRecvCallback
void SetRecvCallback(Callback< void, Ptr< Socket > > receivedData)
Notify application when new data is available to be read.
Definition: socket.cc:128
EpsBearerTagUdpClient
A Udp client.
Definition: epc-test-s1u-uplink.cc:68
ns3::Ipv4StaticRoutingHelper::GetStaticRouting
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...
Definition: ipv4-static-routing-helper.cc:58
ns3::Now
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
Definition: simulator.cc:287
ns3::Ipv4::GetInterfaceForDevice
virtual int32_t GetInterfaceForDevice(Ptr< const NetDevice > device) const =0
Send
static void Send(Ptr< NetDevice > dev, int level, std::string emuMode)
Definition: fd-emu-send.cc:55
ns3::InternetStackHelper::Install
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
Definition: internet-stack-helper.cc:359
ns3::NoBackhaulEpcHelper::AssignUeIpv4Address
virtual Ipv4InterfaceContainer AssignUeIpv4Address(NetDeviceContainer ueDevices)
Assign IPv4 addresses to UE devices.
Definition: no-backhaul-epc-helper.cc:504
NS_LOG_INFO
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:281
ns3::MilliSeconds
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1252
ns3::Node::AddApplication
uint32_t AddApplication(Ptr< Application > application)
Associate an Application to this Node.
Definition: node.cc:159
ns3::Object::AggregateObject
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
Definition: object.cc:252
EpcS1uUlTestCase::DoRun
virtual void DoRun(void)
Implementation to actually run this TestCase.
Definition: epc-test-s1u-uplink.cc:338
ns3::ArpCache::Add
ArpCache::Entry * Add(Ipv4Address to)
Add an Ipv4Address to this ARP cache.
Definition: arp-cache.cc:330
EpcS1uUlTestCase::~EpcS1uUlTestCase
virtual ~EpcS1uUlTestCase()
Definition: epc-test-s1u-uplink.cc:334
ns3::Ipv4InterfaceContainer
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Definition: ipv4-interface-container.h:55
UeUlTestData::UeUlTestData
UeUlTestData(uint32_t n, uint32_t s, uint16_t r, uint8_t l)
Constructor.
Definition: epc-test-s1u-uplink.cc:285
UeUlTestData
Custom test structure to hold information of data transmitted in the uplink per UE.
Definition: epc-test-s1u-uplink.cc:265
ns3::NodeContainer::Get
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
Definition: node-container.cc:93
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
EpsBearerTagUdpClient::EpsBearerTagUdpClient
EpsBearerTagUdpClient()
Definition: epc-test-s1u-uplink.cc:160
ns3::ArpCache::SetAliveTimeout
void SetAliveTimeout(Time aliveTimeout)
Set the time the entry will be in ALIVE state (unless refreshed)
Definition: arp-cache.cc:136
UeUlTestData::rnti
uint16_t rnti
the RNTI
Definition: epc-test-s1u-uplink.cc:278
NS_ASSERT_MSG
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition: assert.h:88
ns3::NoBackhaulEpcHelper::AddUe
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.
Definition: no-backhaul-epc-helper.cc:430
EpsBearerTagUdpClient::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: epc-test-s1u-uplink.cc:128
ns3::PacketSinkHelper
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes.
Definition: packet-sink-helper.h:36
ns3::Packet::AddPacketTag
void AddPacketTag(const Tag &tag) const
Add a packet tag.
Definition: packet.cc:956
EpcS1uUlTestCase::m_enbUlTestData
std::vector< EnbUlTestData > m_enbUlTestData
ENB UL test data.
Definition: epc-test-s1u-uplink.cc:325
EpsBearerTagUdpClient::SetRemote
void SetRemote(Ipv4Address ip, uint16_t port)
set the remote address and port
Definition: epc-test-s1u-uplink.cc:186
ns3::TestSuite
A suite of tests to run.
Definition: test.h:1188
NS_LOG_FUNCTION_NOARGS
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
Definition: log-macros-enabled.h:209
uint32_t
NS_TEST_ASSERT_MSG_EQ
#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:141
ns3::EpsBearer
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:92
ns3::EpsBearerTag
Tag used to define the RNTI and EPS bearer ID for packets interchanged between the EpcEnbApplication ...
Definition: eps-bearer-tag.h:37
EpsBearerTagUdpClient::m_size
uint32_t m_size
the size of packets generated
Definition: epc-test-s1u-uplink.cc:112
ns3::Socket::Connect
virtual int Connect(const Address &address)=0
Initiate a connection to a remote host.
ns3::ApplicationContainer::Start
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter.
Definition: application-container.cc:87
ns3::Seconds
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1244
ns3::SeqTsHeader
Packet header to carry sequence number and timestamp.
Definition: seq-ts-header.h:45
EpsBearerTagUdpClient::m_sent
uint32_t m_sent
number of packets sent
Definition: epc-test-s1u-uplink.cc:114
ns3::Ipv4AddressHelper::Assign
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
Definition: ipv4-address-helper.cc:135
ns3::ApplicationContainer
holds a vector of ns3::Application pointers.
Definition: application-container.h:43
EpcS1uUlTestSuite::EpcS1uUlTestSuite
EpcS1uUlTestSuite()
Definition: epc-test-s1u-uplink.cc:518
ns3::Ipv4L3Protocol
Implement the IPv4 layer.
Definition: ipv4-l3-protocol.h:81
pktSize
uint32_t pktSize
packet size used for the simulation (in bytes)
Definition: wifi-bianchi.cc:86
UeUlTestData::pktSize
uint32_t pktSize
the packet size
Definition: epc-test-s1u-uplink.cc:277
ns3::ArpCache::Entry::MarkPermanent
void MarkPermanent(void)
Changes the state of this entry to Permanent.
Definition: arp-cache.cc:414
ns3::TimeValue
AttributeValue implementation for Time.
Definition: nstime.h:1308
ns3::PointToPointHelper
Build a set of PointToPointNetDevice objects.
Definition: point-to-point-helper.h:45
ns3::NodeContainer
keep track of a set of node pointers.
Definition: node-container.h:39
ns3::Ipv4Mask
a class to represent an Ipv4 address mask
Definition: ipv4-address.h:256
ns3::Ipv4StaticRouting::AddNetworkRouteTo
void AddNetworkRouteTo(Ipv4Address network, Ipv4Mask networkMask, Ipv4Address nextHop, uint32_t interface, uint32_t metric=0)
Add a network route to the static routing table.
Definition: ipv4-static-routing.cc:63
ns3::EpcEnbApplication::GetS1SapProvider
EpcEnbS1SapProvider * GetS1SapProvider()
Definition: epc-enb-application.cc:133
ns3::PacketSink
Receive and consume traffic generated to an IP address and port.
Definition: packet-sink.h:72
ns3::Ipv4InterfaceContainer::GetAddress
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
Definition: ipv4-interface-container.cc:59
ns3::UintegerValue
Hold an unsigned integer type.
Definition: uinteger.h:44
ns3::Application::GetNode
Ptr< Node > GetNode() const
Definition: application.cc:104
ns3::EpcTestRrc::GetS1SapUser
EpcEnbS1SapUser * GetS1SapUser()
Definition: lte-test-entities.cc:723
ns3::Config::SetDefault
void SetDefault(std::string name, const AttributeValue &value)
Definition: config.cc:849
EpsBearerTagUdpClient::m_peerAddress
Ipv4Address m_peerAddress
the peer address of the outbound packets
Definition: epc-test-s1u-uplink.cc:116
UeUlTestData::clientApp
Ptr< Application > clientApp
the client application
Definition: epc-test-s1u-uplink.cc:282
ns3::NetDeviceContainer::GetN
uint32_t GetN(void) const
Get the number of Ptr<NetDevice> stored in this container.
Definition: net-device-container.cc:57
EpsBearerTagUdpClient::m_rnti
uint16_t m_rnti
the RNTI
Definition: epc-test-s1u-uplink.cc:120
EpsBearerTagUdpClient::DoDispose
virtual void DoDispose(void)
Destructor implementation.
Definition: epc-test-s1u-uplink.cc:193
ns3::MakeUintegerAccessor
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
EpsBearerTagUdpClient::StartApplication
virtual void StartApplication(void)
Application specific startup code.
Definition: epc-test-s1u-uplink.cc:200
ns3::Application
The base class for all ns3 applications.
Definition: application.h:61
EpsBearerTagUdpClient::m_count
uint32_t m_count
maximum number of packets to send
Definition: epc-test-s1u-uplink.cc:110
EpsBearerTagUdpClient::~EpsBearerTagUdpClient
virtual ~EpsBearerTagUdpClient()
Definition: epc-test-s1u-uplink.cc:180
ns3::InternetStackHelper
aggregate IP/TCP/UDP functionality to existing Nodes.
Definition: internet-stack-helper.h:88
ns3::NetDeviceContainer::Get
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
Definition: net-device-container.cc:62
EpsBearerTagUdpClient::StopApplication
virtual void StopApplication(void)
Application specific shutdown code.
Definition: epc-test-s1u-uplink.cc:217
sample-rng-plot.n
n
Definition: sample-rng-plot.py:37
ns3::PacketSinkHelper::Install
ApplicationContainer Install(NodeContainer c) const
Install an ns3::PacketSinkApplication on each node of the input container configured with all the att...
Definition: packet-sink-helper.cc:55
ns3::MakeTimeAccessor
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:1309
UeUlTestData::serverApp
Ptr< PacketSink > serverApp
the server application
Definition: epc-test-s1u-uplink.cc:281
ns3::EventId::IsExpired
bool IsExpired(void) const
This method is syntactic sugar for the ns3::Simulator::IsExpired method.
Definition: event-id.cc:65
ns3::Packet::GetUid
uint64_t GetUid(void) const
Returns the packet's Uid.
Definition: packet.cc:390
EpsBearerTagUdpClient::m_socket
Ptr< Socket > m_socket
the socket
Definition: epc-test-s1u-uplink.cc:115
port
uint16_t port
Definition: dsdv-manet.cc:45
UeUlTestData::numPkts
uint32_t numPkts
the number of packets sent
Definition: epc-test-s1u-uplink.cc:276
Ipv4AddressValue
AttributeValue implementation for Ipv4Address.