A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
epc-test-s1u-uplink.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2007,2008,2009 INRIA, UDCAST
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 * The original version of UdpClient is by Amine Ismail
19 * <amine.ismail@sophia.inria.fr> <amine.ismail@udcast.com>
20 * The rest of the code (including modifying UdpClient into
21 * EpsBearerTagUdpClient) is by Nicola Baldo <nbaldo@cttc.es>
22 */
23
24#include "lte-test-entities.h"
25
26#include "ns3/arp-cache.h"
27#include "ns3/boolean.h"
28#include "ns3/config.h"
29#include "ns3/csma-helper.h"
30#include "ns3/epc-enb-application.h"
31#include "ns3/eps-bearer-tag.h"
32#include "ns3/inet-socket-address.h"
33#include "ns3/internet-stack-helper.h"
34#include "ns3/ipv4-address-helper.h"
35#include "ns3/log.h"
36#include "ns3/packet-sink-helper.h"
37#include "ns3/packet-sink.h"
38#include "ns3/point-to-point-epc-helper.h"
39#include "ns3/point-to-point-helper.h"
40#include "ns3/seq-ts-header.h"
41#include "ns3/simulator.h"
42#include "ns3/test.h"
43#include "ns3/uinteger.h"
44#include <ns3/ipv4-interface.h>
45#include <ns3/ipv4-static-routing-helper.h>
46#include <ns3/ipv4-static-routing.h>
47#include <ns3/mac48-address.h>
48
49using namespace ns3;
50
51NS_LOG_COMPONENT_DEFINE("EpcTestS1uUplink");
52
53/**
54 * \ingroup lte-test
55 *
56 * A Udp client. Sends UDP packet carrying sequence number and time
57 * stamp but also including the EpsBearerTag. This tag is normally
58 * generated by the LteEnbNetDevice when forwarding packet in the
59 * uplink. But in this test we don't have the LteEnbNetDevice, because
60 * we test the S1-U interface with simpler devices to make sure it
61 * just works.
62 *
63 */
65{
66 public:
67 /**
68 * \brief Get the type ID.
69 * \return the object TypeId
70 */
71 static TypeId GetTypeId();
72
74 /**
75 * Constructor
76 *
77 * \param rnti the RNTI
78 * \param bid the BID
79 */
80 EpsBearerTagUdpClient(uint16_t rnti, uint8_t bid);
81
82 ~EpsBearerTagUdpClient() override;
83
84 /**
85 * \brief set the remote address and port
86 * \param ip remote IP address
87 * \param port remote port
88 */
89 void SetRemote(Ipv4Address ip, uint16_t port);
90
91 protected:
92 void DoDispose() override;
93
94 private:
95 void StartApplication() override;
96 void StopApplication() override;
97
98 /**
99 * \brief Schedule transmit function
100 * \param dt the delta time
101 */
103 /// Send function
104 void Send();
105
106 uint32_t m_count; ///< maximum number of packets to send
107 Time m_interval; ///< the time between packets
108 uint32_t m_size; ///< the size of packets generated
109
110 uint32_t m_sent; ///< number of packets sent
111 Ptr<Socket> m_socket; ///< the socket
112 Ipv4Address m_peerAddress; ///< the peer address of the outbound packets
113 uint16_t m_peerPort; ///< the destination port of the outbound packets
114 EventId m_sendEvent; ///< the send event
115
116 uint16_t m_rnti; ///< the RNTI
117 uint8_t m_bid; ///< the bearer identificator
118};
119
120TypeId
122{
123 static TypeId tid =
124 TypeId("ns3::EpsBearerTagUdpClient")
126 .AddConstructor<EpsBearerTagUdpClient>()
127 .AddAttribute(
128 "MaxPackets",
129 "The maximum number of packets the application will send (zero means infinite)",
130 UintegerValue(100),
132 MakeUintegerChecker<uint32_t>())
133 .AddAttribute("Interval",
134 "The time to wait between packets",
135 TimeValue(Seconds(1.0)),
138 .AddAttribute("RemoteAddress",
139 "The destination Ipv4Address of the outbound packets",
143 .AddAttribute("RemotePort",
144 "The destination port of the outbound packets",
145 UintegerValue(100),
147 MakeUintegerChecker<uint16_t>())
148 .AddAttribute("PacketSize",
149 "Size of packets generated. The minimum packet size is 12 bytes which is "
150 "the size of the header carrying the sequence number and the time stamp.",
151 UintegerValue(1024),
153 MakeUintegerChecker<uint32_t>());
154 return tid;
155}
156
158 : m_rnti(0),
159 m_bid(0)
160{
162 m_sent = 0;
163 m_socket = nullptr;
165}
166
168 : m_rnti(rnti),
169 m_bid(bid)
170{
172 m_sent = 0;
173 m_socket = nullptr;
175}
176
178{
180}
181
182void
184{
185 m_peerAddress = ip;
187}
188
189void
191{
194}
195
196void
198{
200
201 if (!m_socket)
202 {
203 TypeId tid = TypeId::LookupByName("ns3::UdpSocketFactory");
205 m_socket->Bind();
207 }
208
211}
212
213void
215{
218}
219
220void
222{
225 SeqTsHeader seqTs;
226 seqTs.SetSeq(m_sent);
227 Ptr<Packet> p = Create<Packet>(m_size - (8 + 4)); // 8+4 : the size of the seqTs header
228 p->AddHeader(seqTs);
229
231 p->AddPacketTag(tag);
232
233 if ((m_socket->Send(p)) >= 0)
234 {
235 ++m_sent;
236 NS_LOG_INFO("TraceDelay TX " << m_size << " bytes to " << m_peerAddress << " Uid: "
237 << p->GetUid() << " Time: " << (Simulator::Now()).As(Time::S));
238 }
239 else
240 {
241 NS_LOG_INFO("Error while sending " << m_size << " bytes to " << m_peerAddress);
242 }
243
244 if (m_sent < m_count || m_count == 0)
245 {
247 }
248}
249
250/**
251 * \ingroup lte-test
252 *
253 * \brief Custom test structure to hold information of data transmitted in the uplink per UE
254 */
256{
257 /**
258 * Constructor
259 *
260 * \param n number of packets
261 * \param s packet size
262 * \param r the RNTI
263 * \param l the BID
264 */
265 UeUlTestData(uint32_t n, uint32_t s, uint16_t r, uint8_t l);
266
267 uint32_t numPkts; ///< the number of packets sent
268 uint32_t pktSize; ///< the packet size
269 uint16_t rnti; ///< the RNTI
270 uint8_t bid; ///< the BID
271
272 Ptr<PacketSink> serverApp; ///< the server application
273 Ptr<Application> clientApp; ///< the client application
274};
275
276UeUlTestData::UeUlTestData(uint32_t n, uint32_t s, uint16_t r, uint8_t l)
277 : numPkts(n),
278 pktSize(s),
279 rnti(r),
280 bid(l)
281{
282}
283
284/**
285 * \ingroup lte-test
286 *
287 * \brief Custom structure containing information about data sent in the uplink
288 * of eNodeB. Includes the information of the data sent in the uplink per UE.
289 */
291{
292 std::vector<UeUlTestData> ues; ///< the list of UEs
293};
294
295/**
296 * \ingroup lte-test
297 *
298 * \brief EpcS1uUlTestCase class
299 */
301{
302 public:
303 /**
304 * Constructor
305 *
306 * \param name the reference name
307 * \param v the list of UE lists
308 */
309 EpcS1uUlTestCase(std::string name, std::vector<EnbUlTestData> v);
310 ~EpcS1uUlTestCase() override;
311
312 private:
313 void DoRun() override;
314 std::vector<EnbUlTestData> m_enbUlTestData; ///< ENB UL test data
315};
316
317EpcS1uUlTestCase::EpcS1uUlTestCase(std::string name, std::vector<EnbUlTestData> v)
318 : TestCase(name),
319 m_enbUlTestData(v)
320{
321}
322
324{
325}
326
327void
329{
330 Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper>();
331 Ptr<Node> pgw = epcHelper->GetPgwNode();
332
333 // allow jumbo packets
334 Config::SetDefault("ns3::CsmaNetDevice::Mtu", UintegerValue(30000));
335 Config::SetDefault("ns3::PointToPointNetDevice::Mtu", UintegerValue(30000));
336 epcHelper->SetAttribute("S1uLinkMtu", UintegerValue(30000));
337
338 // Create a single RemoteHost
339 NodeContainer remoteHostContainer;
340 remoteHostContainer.Create(1);
341 Ptr<Node> remoteHost = remoteHostContainer.Get(0);
342 InternetStackHelper internet;
343 internet.Install(remoteHostContainer);
344
345 // Create the internet
347 p2ph.SetDeviceAttribute("DataRate", DataRateValue(DataRate("100Gb/s")));
348 NetDeviceContainer internetDevices = p2ph.Install(pgw, remoteHost);
349 Ipv4AddressHelper ipv4h;
350 ipv4h.SetBase("1.0.0.0", "255.0.0.0");
351 Ipv4InterfaceContainer internetNodesIpIfaceContainer = ipv4h.Assign(internetDevices);
352
353 // setup default gateway for the remote hosts
354 Ipv4StaticRoutingHelper ipv4RoutingHelper;
355 Ptr<Ipv4StaticRouting> remoteHostStaticRouting =
356 ipv4RoutingHelper.GetStaticRouting(remoteHost->GetObject<Ipv4>());
357
358 // hardcoded UE addresses for now
359 remoteHostStaticRouting->AddNetworkRouteTo(Ipv4Address("7.0.0.0"),
360 Ipv4Mask("255.255.255.0"),
361 1);
362
363 uint16_t udpSinkPort = 1234;
364
365 NodeContainer enbs;
366 uint16_t cellIdCounter = 0;
367 uint64_t imsiCounter = 0;
368
369 for (auto enbit = m_enbUlTestData.begin(); enbit < m_enbUlTestData.end(); ++enbit)
370 {
371 Ptr<Node> enb = CreateObject<Node>();
372 enbs.Add(enb);
373
374 // we test EPC without LTE, hence we use:
375 // 1) a CSMA network to simulate the cell
376 // 2) a raw socket opened on the CSMA device to simulate the LTE socket
377
378 uint16_t cellId = ++cellIdCounter;
379
380 NodeContainer ues;
381 ues.Create(enbit->ues.size());
382
383 NodeContainer cell;
384 cell.Add(ues);
385 cell.Add(enb);
386
387 CsmaHelper csmaCell;
388 NetDeviceContainer cellDevices = csmaCell.Install(cell);
389
390 // the eNB's CSMA NetDevice acting as an LTE NetDevice.
391 Ptr<NetDevice> enbDevice = cellDevices.Get(cellDevices.GetN() - 1);
392
393 // Note that the EpcEnbApplication won't care of the actual NetDevice type
394 std::vector<uint16_t> cellIds;
395 cellIds.push_back(cellId);
396 epcHelper->AddEnb(enb, enbDevice, cellIds);
397
398 // Plug test RRC entity
399 Ptr<EpcEnbApplication> enbApp = enb->GetApplication(0)->GetObject<EpcEnbApplication>();
400 NS_ASSERT_MSG(enbApp, "cannot retrieve EpcEnbApplication");
401 Ptr<EpcTestRrc> rrc = CreateObject<EpcTestRrc>();
402 enb->AggregateObject(rrc);
403 rrc->SetS1SapProvider(enbApp->GetS1SapProvider());
404 enbApp->SetS1SapUser(rrc->GetS1SapUser());
405
406 // we install the IP stack on UEs only
407 InternetStackHelper internet;
408 internet.Install(ues);
409
410 // assign IP address to UEs, and install applications
411 for (uint32_t u = 0; u < ues.GetN(); ++u)
412 {
413 Ptr<NetDevice> ueLteDevice = cellDevices.Get(u);
414 Ipv4InterfaceContainer ueIpIface =
415 epcHelper->AssignUeIpv4Address(NetDeviceContainer(ueLteDevice));
416
417 Ptr<Node> ue = ues.Get(u);
418
419 // disable IP Forwarding on the UE. This is because we use
420 // CSMA broadcast MAC addresses for this test. The problem
421 // won't happen with a LteUeNetDevice.
422 Ptr<Ipv4> ueIpv4 = ue->GetObject<Ipv4>();
423 ueIpv4->SetAttribute("IpForward", BooleanValue(false));
424
425 // tell the UE to route all packets to the GW
426 Ptr<Ipv4StaticRouting> ueStaticRouting = ipv4RoutingHelper.GetStaticRouting(ueIpv4);
427 Ipv4Address gwAddr = epcHelper->GetUeDefaultGatewayAddress();
428 NS_LOG_INFO("GW address: " << gwAddr);
429 ueStaticRouting->SetDefaultRoute(gwAddr, 1);
430
431 // since the UEs in this test use CSMA with IP enabled, and
432 // the eNB uses CSMA but without IP, we fool the UE's ARP
433 // cache into thinking that the IP address of the GW can be
434 // reached by sending a CSMA packet to the broadcast
435 // address, so the eNB will get it.
436 int32_t ueLteIpv4IfIndex = ueIpv4->GetInterfaceForDevice(ueLteDevice);
437 Ptr<Ipv4L3Protocol> ueIpv4L3Protocol = ue->GetObject<Ipv4L3Protocol>();
438 Ptr<Ipv4Interface> ueLteIpv4Iface = ueIpv4L3Protocol->GetInterface(ueLteIpv4IfIndex);
439 Ptr<ArpCache> ueArpCache = ueLteIpv4Iface->GetArpCache();
440 ueArpCache->SetAliveTimeout(Seconds(1000));
441 ArpCache::Entry* arpCacheEntry = ueArpCache->Add(gwAddr);
443 arpCacheEntry->MarkPermanent();
444
445 PacketSinkHelper packetSinkHelper(
446 "ns3::UdpSocketFactory",
447 InetSocketAddress(Ipv4Address::GetAny(), udpSinkPort));
448 ApplicationContainer sinkApp = packetSinkHelper.Install(remoteHost);
449 sinkApp.Start(Seconds(1.0));
450 sinkApp.Stop(Seconds(10.0));
451 enbit->ues[u].serverApp = sinkApp.Get(0)->GetObject<PacketSink>();
452
453 Time interPacketInterval = Seconds(0.01);
455 CreateObject<EpsBearerTagUdpClient>(enbit->ues[u].rnti, enbit->ues[u].bid);
456 client->SetAttribute("RemoteAddress",
457 Ipv4AddressValue(internetNodesIpIfaceContainer.GetAddress(1)));
458 client->SetAttribute("RemotePort", UintegerValue(udpSinkPort));
459 client->SetAttribute("MaxPackets", UintegerValue(enbit->ues[u].numPkts));
460 client->SetAttribute("Interval", TimeValue(interPacketInterval));
461 client->SetAttribute("PacketSize", UintegerValue(enbit->ues[u].pktSize));
462 ue->AddApplication(client);
463 ApplicationContainer clientApp;
464 clientApp.Add(client);
465 clientApp.Start(Seconds(2.0));
466 clientApp.Stop(Seconds(10.0));
467 enbit->ues[u].clientApp = client;
468
469 uint64_t imsi = ++imsiCounter;
470 epcHelper->AddUe(ueLteDevice, imsi);
471 epcHelper->ActivateEpsBearer(ueLteDevice,
472 imsi,
477 enbApp->GetS1SapProvider(),
478 imsi,
479 enbit->ues[u].rnti);
480 // need this since all sinks are installed in the same node
481 ++udpSinkPort;
482 }
483 }
484
486
487 for (auto enbit = m_enbUlTestData.begin(); enbit < m_enbUlTestData.end(); ++enbit)
488 {
489 for (auto ueit = enbit->ues.begin(); ueit < enbit->ues.end(); ++ueit)
490 {
491 NS_TEST_ASSERT_MSG_EQ(ueit->serverApp->GetTotalRx(),
492 (ueit->numPkts) * (ueit->pktSize),
493 "wrong total received bytes");
494 }
495 }
496
498}
499
500/**
501 * Test that the S1-U interface implementation works correctly
502 */
504{
505 public:
507
509
511 : TestSuite("epc-s1u-uplink", Type::SYSTEM)
512{
513 std::vector<EnbUlTestData> v1;
514 EnbUlTestData e1;
515 UeUlTestData f1(1, 100, 1, 1);
516 e1.ues.push_back(f1);
517 v1.push_back(e1);
518 AddTestCase(new EpcS1uUlTestCase("1 eNB, 1UE", v1), TestCase::Duration::QUICK);
519
520 std::vector<EnbUlTestData> v2;
521 EnbUlTestData e2;
522 UeUlTestData f2_1(1, 100, 1, 1);
523 e2.ues.push_back(f2_1);
524 UeUlTestData f2_2(2, 200, 2, 1);
525 e2.ues.push_back(f2_2);
526 v2.push_back(e2);
527 AddTestCase(new EpcS1uUlTestCase("1 eNB, 2UEs", v2), TestCase::Duration::QUICK);
528
529 std::vector<EnbUlTestData> v3;
530 v3.push_back(e1);
531 v3.push_back(e2);
532 AddTestCase(new EpcS1uUlTestCase("2 eNBs", v3), TestCase::Duration::QUICK);
533
534 EnbUlTestData e3;
535 UeUlTestData f3_1(3, 50, 1, 1);
536 e3.ues.push_back(f3_1);
537 UeUlTestData f3_2(5, 1472, 2, 1);
538 e3.ues.push_back(f3_2);
539 UeUlTestData f3_3(1, 1, 3, 1);
540 e3.ues.push_back(f3_2);
541 std::vector<EnbUlTestData> v4;
542 v4.push_back(e3);
543 v4.push_back(e1);
544 v4.push_back(e2);
545 AddTestCase(new EpcS1uUlTestCase("3 eNBs", v4), TestCase::Duration::QUICK);
546
547 std::vector<EnbUlTestData> v5;
548 EnbUlTestData e5;
549 UeUlTestData f5(10, 3000, 1, 1);
550 e5.ues.push_back(f5);
551 v5.push_back(e5);
552 AddTestCase(new EpcS1uUlTestCase("1 eNB, 10 pkts 3000 bytes each", v5),
553 TestCase::Duration::QUICK);
554
555 std::vector<EnbUlTestData> v6;
556 EnbUlTestData e6;
557 UeUlTestData f6(50, 3000, 1, 1);
558 e6.ues.push_back(f6);
559 v6.push_back(e6);
560 AddTestCase(new EpcS1uUlTestCase("1 eNB, 50 pkts 3000 bytes each", v6),
561 TestCase::Duration::QUICK);
562
563 std::vector<EnbUlTestData> v7;
564 EnbUlTestData e7;
565 UeUlTestData f7(10, 15000, 1, 1);
566 e7.ues.push_back(f7);
567 v7.push_back(e7);
568 AddTestCase(new EpcS1uUlTestCase("1 eNB, 10 pkts 15000 bytes each", v7),
569 TestCase::Duration::QUICK);
570
571 std::vector<EnbUlTestData> v8;
572 EnbUlTestData e8;
573 UeUlTestData f8(100, 15000, 1, 1);
574 e8.ues.push_back(f8);
575 v8.push_back(e8);
576 AddTestCase(new EpcS1uUlTestCase("1 eNB, 100 pkts 15000 bytes each", v8),
577 TestCase::Duration::QUICK);
578}
EpcS1uUlTestCase class.
EpcS1uUlTestCase(std::string name, std::vector< EnbUlTestData > v)
Constructor.
std::vector< EnbUlTestData > m_enbUlTestData
ENB UL test data.
void DoRun() override
Implementation to actually run this TestCase.
Test that the S1-U interface implementation works correctly.
uint16_t m_peerPort
the destination port of the outbound packets
void SetRemote(Ipv4Address ip, uint16_t port)
set the remote address and port
uint32_t m_count
maximum number of packets to send
uint32_t m_sent
number of packets sent
void ScheduleTransmit(Time dt)
Schedule transmit function.
Ptr< Socket > m_socket
the socket
uint32_t m_size
the size of packets generated
void StartApplication() override
Application specific startup code.
uint8_t m_bid
the bearer identificator
void StopApplication() override
Application specific shutdown code.
EventId m_sendEvent
the send event
void Send()
Send function.
Ipv4Address m_peerAddress
the peer address of the outbound packets
void DoDispose() override
Destructor implementation.
Time m_interval
the time between packets
static TypeId GetTypeId()
Get the type ID.
holds a vector of ns3::Application pointers.
void Start(Time start) const
Start all of the Applications in this container at the start time given as a parameter.
Ptr< Application > Get(uint32_t i) const
Get the Ptr<Application> stored in this container at a given index.
void Stop(Time stop) const
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter.
void Add(ApplicationContainer other)
Append the contents of another ApplicationContainer to the end of this container.
The base class for all ns3 applications.
Definition: application.h:62
void DoDispose() override
Destructor implementation.
Definition: application.cc:86
Ptr< Node > GetNode() const
Definition: application.cc:108
A record that that holds information about an ArpCache entry.
Definition: arp-cache.h:184
void MarkPermanent()
Changes the state of this entry to Permanent.
Definition: arp-cache.cc:446
void SetMacAddress(Address macAddress)
Definition: arp-cache.cc:506
AttributeValue implementation for Boolean.
Definition: boolean.h:37
build a set of CsmaNetDevice objects
Definition: csma-helper.h:48
NetDeviceContainer Install(Ptr< Node > node) const
This method creates an ns3::CsmaChannel with the attributes configured by CsmaHelper::SetChannelAttri...
Definition: csma-helper.cc:226
Class for representing data rates.
Definition: data-rate.h:89
AttributeValue implementation for DataRate.
Definition: data-rate.h:296
This application is installed inside eNBs and provides the bridge functionality for user data plane p...
virtual void InitialUeMessage(uint64_t imsi, uint16_t rnti)=0
Initial UE message.
static Ptr< EpcTft > Default()
creates a TFT matching any traffic
Definition: epc-tft.cc:229
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:91
@ NGBR_VIDEO_TCP_DEFAULT
Non-GBR TCP-based Video (Buffered Streaming, e.g., www, e-mail...)
Definition: eps-bearer.h:126
Tag used to define the RNTI and EPS bearer ID for packets interchanged between the EpcEnbApplication ...
An identifier for simulation events.
Definition: event-id.h:55
bool IsExpired() const
This method is syntactic sugar for the ns3::Simulator::IsExpired method.
Definition: event-id.cc:69
an Inet address class
aggregate IP/TCP/UDP functionality to existing Nodes.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:42
static Ipv4Address GetAny()
AttributeValue implementation for Ipv4Address.
Definition: ipv4-address.h:341
Access to the IPv4 forwarding table, interfaces, and configuration.
Definition: ipv4.h:80
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
Implement the IPv4 layer.
a class to represent an Ipv4 address mask
Definition: ipv4-address.h:257
Helper class that adds ns3::Ipv4StaticRouting objects.
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...
static Mac48Address GetBroadcast()
holds a vector of ns3::NetDevice pointers
uint32_t GetN() const
Get the number of Ptr<NetDevice> stored in this container.
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
keep track of a set of node pointers.
uint32_t GetN() const
Get the number of Ptr<Node> stored in this container.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
void Add(const NodeContainer &nc)
Append the contents of another NodeContainer to the end of this container.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
Definition: object.h:522
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes.
Receive and consume traffic generated to an IP address and port.
Definition: packet-sink.h:75
Build a set of PointToPointNetDevice objects.
void SetDeviceAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each NetDevice created by the helper.
NetDeviceContainer Install(NodeContainer c)
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Packet header to carry sequence number and timestamp.
Definition: seq-ts-header.h:45
void SetSeq(uint32_t seq)
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Definition: simulator.h:571
static void Cancel(const EventId &id)
Set the cancel bit on this event: the event's associated function will not be invoked when it expires...
Definition: simulator.cc:285
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
Definition: simulator.cc:142
static Time Now()
Return the current simulation virtual time.
Definition: simulator.cc:208
static void Run()
Run the simulation.
Definition: simulator.cc:178
virtual int Send(Ptr< Packet > p, uint32_t flags)=0
Send data (or dummy data) to the remote host.
virtual int Connect(const Address &address)=0
Initiate a connection to a remote host.
void SetRecvCallback(Callback< void, Ptr< Socket > > receivedData)
Notify application when new data is available to be read.
Definition: socket.cc:128
static Ptr< Socket > CreateSocket(Ptr< Node > node, TypeId tid)
This method wraps the creation of sockets that is performed on a given node by a SocketFactory specif...
Definition: socket.cc:72
virtual int Bind(const Address &address)=0
Allocate a local endpoint for this socket.
encapsulates test code
Definition: test.h:1061
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
Definition: test.cc:301
A suite of tests to run.
Definition: test.h:1268
Type
Type of test.
Definition: test.h:1275
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
@ S
second
Definition: nstime.h:116
AttributeValue implementation for Time.
Definition: nstime.h:1413
a unique identifier for an interface.
Definition: type-id.h:59
static TypeId LookupByName(std::string name)
Get a TypeId by name.
Definition: type-id.cc:836
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:932
Hold an unsigned integer type.
Definition: uinteger.h:45
uint16_t port
Definition: dsdv-manet.cc:44
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition: assert.h:66
#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:86
Ptr< const AttributeChecker > MakeIpv4AddressChecker()
Ptr< const AttributeAccessor > MakeIpv4AddressAccessor(T1 a1)
Definition: ipv4-address.h:341
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
Definition: nstime.h:1434
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Definition: nstime.h:1414
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Definition: uinteger.h:46
Callback< R, Args... > MakeNullCallback()
Definition: callback.h:747
void SetDefault(std::string name, const AttributeValue &value)
Definition: config.cc:894
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:275
#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:145
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1326
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1338
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Custom structure containing information about data sent in the uplink of eNodeB.
std::vector< UeUlTestData > ues
the list of UEs
Custom test structure to hold information of data transmitted in the uplink per UE.
uint32_t numPkts
the number of packets sent
uint16_t rnti
the RNTI
uint32_t pktSize
the packet size
Ptr< PacketSink > serverApp
the server application
UeUlTestData(uint32_t n, uint32_t s, uint16_t r, uint8_t l)
Constructor.
uint8_t bid
the BID
Ptr< Application > clientApp
the client application
uint32_t pktSize
packet size used for the simulation (in bytes)