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 * SPDX-License-Identifier: GPL-2.0-only
6 *
7 * The original version of UdpClient is by Amine Ismail
8 * <amine.ismail@sophia.inria.fr> <amine.ismail@udcast.com>
9 * The rest of the code (including modifying UdpClient into
10 * EpsBearerTagUdpClient) is by Nicola Baldo <nbaldo@cttc.es>
11 */
12
13#include "lte-test-entities.h"
14
15#include "ns3/arp-cache.h"
16#include "ns3/boolean.h"
17#include "ns3/config.h"
18#include "ns3/csma-helper.h"
19#include "ns3/epc-enb-application.h"
20#include "ns3/eps-bearer-tag.h"
21#include "ns3/inet-socket-address.h"
22#include "ns3/internet-stack-helper.h"
23#include "ns3/ipv4-address-helper.h"
24#include "ns3/log.h"
25#include "ns3/packet-sink-helper.h"
26#include "ns3/packet-sink.h"
27#include "ns3/point-to-point-epc-helper.h"
28#include "ns3/point-to-point-helper.h"
29#include "ns3/seq-ts-header.h"
30#include "ns3/simulator.h"
31#include "ns3/test.h"
32#include "ns3/uinteger.h"
33#include <ns3/ipv4-interface.h>
34#include <ns3/ipv4-static-routing-helper.h>
35#include <ns3/ipv4-static-routing.h>
36#include <ns3/mac48-address.h>
37
38using namespace ns3;
39
40NS_LOG_COMPONENT_DEFINE("EpcTestS1uUplink");
41
42/**
43 * \ingroup lte-test
44 *
45 * A Udp client. Sends UDP packet carrying sequence number and time
46 * stamp but also including the EpsBearerTag. This tag is normally
47 * generated by the LteEnbNetDevice when forwarding packet in the
48 * uplink. But in this test we don't have the LteEnbNetDevice, because
49 * we test the S1-U interface with simpler devices to make sure it
50 * just works.
51 *
52 */
54{
55 public:
56 /**
57 * \brief Get the type ID.
58 * \return the object TypeId
59 */
60 static TypeId GetTypeId();
61
63 /**
64 * Constructor
65 *
66 * \param rnti the RNTI
67 * \param bid the BID
68 */
69 EpsBearerTagUdpClient(uint16_t rnti, uint8_t bid);
70
71 ~EpsBearerTagUdpClient() override;
72
73 /**
74 * \brief set the remote address and port
75 * \param ip remote IP address
76 * \param port remote port
77 */
78 void SetRemote(Ipv4Address ip, uint16_t port);
79
80 protected:
81 void DoDispose() override;
82
83 private:
84 void StartApplication() override;
85 void StopApplication() override;
86
87 /**
88 * \brief Schedule transmit function
89 * \param dt the delta time
90 */
92 /// Send function
93 void Send();
94
95 uint32_t m_count; ///< maximum number of packets to send
96 Time m_interval; ///< the time between packets
97 uint32_t m_size; ///< the size of packets generated
98
99 uint32_t m_sent; ///< number of packets sent
100 Ptr<Socket> m_socket; ///< the socket
101 Ipv4Address m_peerAddress; ///< the peer address of the outbound packets
102 uint16_t m_peerPort; ///< the destination port of the outbound packets
103 EventId m_sendEvent; ///< the send event
104
105 uint16_t m_rnti; ///< the RNTI
106 uint8_t m_bid; ///< the bearer identificator
107};
108
109TypeId
111{
112 static TypeId tid =
113 TypeId("ns3::EpsBearerTagUdpClient")
115 .AddConstructor<EpsBearerTagUdpClient>()
116 .AddAttribute(
117 "MaxPackets",
118 "The maximum number of packets the application will send (zero means infinite)",
119 UintegerValue(100),
122 .AddAttribute("Interval",
123 "The time to wait between packets",
124 TimeValue(Seconds(1.0)),
127 .AddAttribute("RemoteAddress",
128 "The destination Ipv4Address of the outbound packets",
132 .AddAttribute("RemotePort",
133 "The destination port of the outbound packets",
134 UintegerValue(100),
137 .AddAttribute("PacketSize",
138 "Size of packets generated. The minimum packet size is 12 bytes which is "
139 "the size of the header carrying the sequence number and the time stamp.",
140 UintegerValue(1024),
143 return tid;
144}
145
147 : m_rnti(0),
148 m_bid(0)
149{
151 m_sent = 0;
152 m_socket = nullptr;
154}
155
157 : m_rnti(rnti),
158 m_bid(bid)
159{
161 m_sent = 0;
162 m_socket = nullptr;
164}
165
170
171void
177
178void
184
185void
201
202void
208
209void
211{
214 SeqTsHeader seqTs;
215 seqTs.SetSeq(m_sent);
216 Ptr<Packet> p = Create<Packet>(m_size - (8 + 4)); // 8+4 : the size of the seqTs header
217 p->AddHeader(seqTs);
218
220 p->AddPacketTag(tag);
221
222 if ((m_socket->Send(p)) >= 0)
223 {
224 ++m_sent;
225 NS_LOG_INFO("TraceDelay TX " << m_size << " bytes to " << m_peerAddress << " Uid: "
226 << p->GetUid() << " Time: " << (Simulator::Now()).As(Time::S));
227 }
228 else
229 {
230 NS_LOG_INFO("Error while sending " << m_size << " bytes to " << m_peerAddress);
231 }
232
233 if (m_sent < m_count || m_count == 0)
234 {
236 }
237}
238
239/**
240 * \ingroup lte-test
241 *
242 * \brief Custom test structure to hold information of data transmitted in the uplink per UE
243 */
245{
246 /**
247 * Constructor
248 *
249 * \param n number of packets
250 * \param s packet size
251 * \param r the RNTI
252 * \param l the BID
253 */
254 UeUlTestData(uint32_t n, uint32_t s, uint16_t r, uint8_t l);
255
256 uint32_t numPkts; ///< the number of packets sent
257 uint32_t pktSize; ///< the packet size
258 uint16_t rnti; ///< the RNTI
259 uint8_t bid; ///< the BID
260
261 Ptr<PacketSink> serverApp; ///< the server application
262 Ptr<Application> clientApp; ///< the client application
263};
264
265UeUlTestData::UeUlTestData(uint32_t n, uint32_t s, uint16_t r, uint8_t l)
266 : numPkts(n),
267 pktSize(s),
268 rnti(r),
269 bid(l)
270{
271}
272
273/**
274 * \ingroup lte-test
275 *
276 * \brief Custom structure containing information about data sent in the uplink
277 * of eNodeB. Includes the information of the data sent in the uplink per UE.
278 */
280{
281 std::vector<UeUlTestData> ues; ///< the list of UEs
282};
283
284/**
285 * \ingroup lte-test
286 *
287 * \brief EpcS1uUlTestCase class
288 */
290{
291 public:
292 /**
293 * Constructor
294 *
295 * \param name the reference name
296 * \param v the list of UE lists
297 */
298 EpcS1uUlTestCase(std::string name, std::vector<EnbUlTestData> v);
299 ~EpcS1uUlTestCase() override;
300
301 private:
302 void DoRun() override;
303 std::vector<EnbUlTestData> m_enbUlTestData; ///< ENB UL test data
304};
305
306EpcS1uUlTestCase::EpcS1uUlTestCase(std::string name, std::vector<EnbUlTestData> v)
307 : TestCase(name),
308 m_enbUlTestData(v)
309{
310}
311
315
316void
318{
320 Ptr<Node> pgw = epcHelper->GetPgwNode();
321
322 // allow jumbo packets
323 Config::SetDefault("ns3::CsmaNetDevice::Mtu", UintegerValue(30000));
324 Config::SetDefault("ns3::PointToPointNetDevice::Mtu", UintegerValue(30000));
325 epcHelper->SetAttribute("S1uLinkMtu", UintegerValue(30000));
326
327 // Create a single RemoteHost
328 NodeContainer remoteHostContainer;
329 remoteHostContainer.Create(1);
330 Ptr<Node> remoteHost = remoteHostContainer.Get(0);
331 InternetStackHelper internet;
332 internet.Install(remoteHostContainer);
333
334 // Create the internet
336 p2ph.SetDeviceAttribute("DataRate", DataRateValue(DataRate("100Gb/s")));
337 NetDeviceContainer internetDevices = p2ph.Install(pgw, remoteHost);
338 Ipv4AddressHelper ipv4h;
339 ipv4h.SetBase("1.0.0.0", "255.0.0.0");
340 Ipv4InterfaceContainer internetNodesIpIfaceContainer = ipv4h.Assign(internetDevices);
341
342 // setup default gateway for the remote hosts
343 Ipv4StaticRoutingHelper ipv4RoutingHelper;
344 Ptr<Ipv4StaticRouting> remoteHostStaticRouting =
345 ipv4RoutingHelper.GetStaticRouting(remoteHost->GetObject<Ipv4>());
346
347 // hardcoded UE addresses for now
348 remoteHostStaticRouting->AddNetworkRouteTo(Ipv4Address("7.0.0.0"),
349 Ipv4Mask("255.255.255.0"),
350 1);
351
352 uint16_t udpSinkPort = 1234;
353
354 NodeContainer enbs;
355 uint16_t cellIdCounter = 0;
356 uint64_t imsiCounter = 0;
357
358 for (auto enbit = m_enbUlTestData.begin(); enbit < m_enbUlTestData.end(); ++enbit)
359 {
361 enbs.Add(enb);
362
363 // we test EPC without LTE, hence we use:
364 // 1) a CSMA network to simulate the cell
365 // 2) a raw socket opened on the CSMA device to simulate the LTE socket
366
367 uint16_t cellId = ++cellIdCounter;
368
369 NodeContainer ues;
370 ues.Create(enbit->ues.size());
371
372 NodeContainer cell;
373 cell.Add(ues);
374 cell.Add(enb);
375
376 CsmaHelper csmaCell;
377 NetDeviceContainer cellDevices = csmaCell.Install(cell);
378
379 // the eNB's CSMA NetDevice acting as an LTE NetDevice.
380 Ptr<NetDevice> enbDevice = cellDevices.Get(cellDevices.GetN() - 1);
381
382 // Note that the EpcEnbApplication won't care of the actual NetDevice type
383 std::vector<uint16_t> cellIds;
384 cellIds.push_back(cellId);
385 epcHelper->AddEnb(enb, enbDevice, cellIds);
386
387 // Plug test RRC entity
388 Ptr<EpcEnbApplication> enbApp = enb->GetApplication(0)->GetObject<EpcEnbApplication>();
389 NS_ASSERT_MSG(enbApp, "cannot retrieve EpcEnbApplication");
391 enb->AggregateObject(rrc);
392 rrc->SetS1SapProvider(enbApp->GetS1SapProvider());
393 enbApp->SetS1SapUser(rrc->GetS1SapUser());
394
395 // we install the IP stack on UEs only
396 InternetStackHelper internet;
397 internet.Install(ues);
398
399 // assign IP address to UEs, and install applications
400 for (uint32_t u = 0; u < ues.GetN(); ++u)
401 {
402 Ptr<NetDevice> ueLteDevice = cellDevices.Get(u);
403 Ipv4InterfaceContainer ueIpIface =
404 epcHelper->AssignUeIpv4Address(NetDeviceContainer(ueLteDevice));
405
406 Ptr<Node> ue = ues.Get(u);
407
408 // disable IP Forwarding on the UE. This is because we use
409 // CSMA broadcast MAC addresses for this test. The problem
410 // won't happen with a LteUeNetDevice.
411 Ptr<Ipv4> ueIpv4 = ue->GetObject<Ipv4>();
412 ueIpv4->SetAttribute("IpForward", BooleanValue(false));
413
414 // tell the UE to route all packets to the GW
415 Ptr<Ipv4StaticRouting> ueStaticRouting = ipv4RoutingHelper.GetStaticRouting(ueIpv4);
416 Ipv4Address gwAddr = epcHelper->GetUeDefaultGatewayAddress();
417 NS_LOG_INFO("GW address: " << gwAddr);
418 ueStaticRouting->SetDefaultRoute(gwAddr, 1);
419
420 // since the UEs in this test use CSMA with IP enabled, and
421 // the eNB uses CSMA but without IP, we fool the UE's ARP
422 // cache into thinking that the IP address of the GW can be
423 // reached by sending a CSMA packet to the broadcast
424 // address, so the eNB will get it.
425 int32_t ueLteIpv4IfIndex = ueIpv4->GetInterfaceForDevice(ueLteDevice);
426 Ptr<Ipv4L3Protocol> ueIpv4L3Protocol = ue->GetObject<Ipv4L3Protocol>();
427 Ptr<Ipv4Interface> ueLteIpv4Iface = ueIpv4L3Protocol->GetInterface(ueLteIpv4IfIndex);
428 Ptr<ArpCache> ueArpCache = ueLteIpv4Iface->GetArpCache();
429 ueArpCache->SetAliveTimeout(Seconds(1000));
430 ArpCache::Entry* arpCacheEntry = ueArpCache->Add(gwAddr);
432 arpCacheEntry->MarkPermanent();
433
434 PacketSinkHelper packetSinkHelper(
435 "ns3::UdpSocketFactory",
436 InetSocketAddress(Ipv4Address::GetAny(), udpSinkPort));
437 ApplicationContainer sinkApp = packetSinkHelper.Install(remoteHost);
438 sinkApp.Start(Seconds(1.0));
439 sinkApp.Stop(Seconds(10.0));
440 enbit->ues[u].serverApp = sinkApp.Get(0)->GetObject<PacketSink>();
441
442 Time interPacketInterval = Seconds(0.01);
444 CreateObject<EpsBearerTagUdpClient>(enbit->ues[u].rnti, enbit->ues[u].bid);
445 client->SetAttribute("RemoteAddress",
446 Ipv4AddressValue(internetNodesIpIfaceContainer.GetAddress(1)));
447 client->SetAttribute("RemotePort", UintegerValue(udpSinkPort));
448 client->SetAttribute("MaxPackets", UintegerValue(enbit->ues[u].numPkts));
449 client->SetAttribute("Interval", TimeValue(interPacketInterval));
450 client->SetAttribute("PacketSize", UintegerValue(enbit->ues[u].pktSize));
451 ue->AddApplication(client);
452 ApplicationContainer clientApp;
453 clientApp.Add(client);
454 clientApp.Start(Seconds(2.0));
455 clientApp.Stop(Seconds(10.0));
456 enbit->ues[u].clientApp = client;
457
458 uint64_t imsi = ++imsiCounter;
459 epcHelper->AddUe(ueLteDevice, imsi);
460 epcHelper->ActivateEpsBearer(ueLteDevice,
461 imsi,
466 enbApp->GetS1SapProvider(),
467 imsi,
468 enbit->ues[u].rnti);
469 // need this since all sinks are installed in the same node
470 ++udpSinkPort;
471 }
472 }
473
475
476 for (auto enbit = m_enbUlTestData.begin(); enbit < m_enbUlTestData.end(); ++enbit)
477 {
478 for (auto ueit = enbit->ues.begin(); ueit < enbit->ues.end(); ++ueit)
479 {
480 NS_TEST_ASSERT_MSG_EQ(ueit->serverApp->GetTotalRx(),
481 (ueit->numPkts) * (ueit->pktSize),
482 "wrong total received bytes");
483 }
484 }
485
487}
488
489/**
490 * Test that the S1-U interface implementation works correctly
491 */
498
500 : TestSuite("epc-s1u-uplink", Type::SYSTEM)
501{
502 std::vector<EnbUlTestData> v1;
503 EnbUlTestData e1;
504 UeUlTestData f1(1, 100, 1, 1);
505 e1.ues.push_back(f1);
506 v1.push_back(e1);
507 AddTestCase(new EpcS1uUlTestCase("1 eNB, 1UE", v1), TestCase::Duration::QUICK);
508
509 std::vector<EnbUlTestData> v2;
510 EnbUlTestData e2;
511 UeUlTestData f2_1(1, 100, 1, 1);
512 e2.ues.push_back(f2_1);
513 UeUlTestData f2_2(2, 200, 2, 1);
514 e2.ues.push_back(f2_2);
515 v2.push_back(e2);
516 AddTestCase(new EpcS1uUlTestCase("1 eNB, 2UEs", v2), TestCase::Duration::QUICK);
517
518 std::vector<EnbUlTestData> v3;
519 v3.push_back(e1);
520 v3.push_back(e2);
521 AddTestCase(new EpcS1uUlTestCase("2 eNBs", v3), TestCase::Duration::QUICK);
522
523 EnbUlTestData e3;
524 UeUlTestData f3_1(3, 50, 1, 1);
525 e3.ues.push_back(f3_1);
526 UeUlTestData f3_2(5, 1472, 2, 1);
527 e3.ues.push_back(f3_2);
528 UeUlTestData f3_3(1, 1, 3, 1);
529 e3.ues.push_back(f3_2);
530 std::vector<EnbUlTestData> v4;
531 v4.push_back(e3);
532 v4.push_back(e1);
533 v4.push_back(e2);
534 AddTestCase(new EpcS1uUlTestCase("3 eNBs", v4), TestCase::Duration::QUICK);
535
536 std::vector<EnbUlTestData> v5;
537 EnbUlTestData e5;
538 UeUlTestData f5(10, 3000, 1, 1);
539 e5.ues.push_back(f5);
540 v5.push_back(e5);
541 AddTestCase(new EpcS1uUlTestCase("1 eNB, 10 pkts 3000 bytes each", v5),
542 TestCase::Duration::QUICK);
543
544 std::vector<EnbUlTestData> v6;
545 EnbUlTestData e6;
546 UeUlTestData f6(50, 3000, 1, 1);
547 e6.ues.push_back(f6);
548 v6.push_back(e6);
549 AddTestCase(new EpcS1uUlTestCase("1 eNB, 50 pkts 3000 bytes each", v6),
550 TestCase::Duration::QUICK);
551
552 std::vector<EnbUlTestData> v7;
553 EnbUlTestData e7;
554 UeUlTestData f7(10, 15000, 1, 1);
555 e7.ues.push_back(f7);
556 v7.push_back(e7);
557 AddTestCase(new EpcS1uUlTestCase("1 eNB, 10 pkts 15000 bytes each", v7),
558 TestCase::Duration::QUICK);
559
560 std::vector<EnbUlTestData> v8;
561 EnbUlTestData e8;
562 UeUlTestData f8(100, 15000, 1, 1);
563 e8.ues.push_back(f8);
564 v8.push_back(e8);
565 AddTestCase(new EpcS1uUlTestCase("1 eNB, 100 pkts 15000 bytes each", v8),
566 TestCase::Duration::QUICK);
567}
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:51
void DoDispose() override
Destructor implementation.
Ptr< Node > GetNode() const
A record that that holds information about an ArpCache entry.
Definition arp-cache.h:173
void MarkPermanent()
Changes the state of this entry to Permanent.
Definition arp-cache.cc:435
void SetMacAddress(Address macAddress)
Definition arp-cache.cc:495
build a set of CsmaNetDevice objects
Definition csma-helper.h:37
NetDeviceContainer Install(Ptr< Node > node) const
This method creates an ns3::CsmaChannel with the attributes configured by CsmaHelper::SetChannelAttri...
Class for representing data rates.
Definition data-rate.h:78
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:218
This class contains the specification of EPS Bearers.
Definition eps-bearer.h:80
@ NGBR_VIDEO_TCP_DEFAULT
Non-GBR TCP-based Video (Buffered Streaming, e.g., www, e-mail...)
Definition eps-bearer.h:115
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:45
bool IsExpired() const
This method is syntactic sugar for the ns3::Simulator::IsExpired method.
Definition event-id.cc:58
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.
static Ipv4Address GetAny()
Access to the IPv4 forwarding table, interfaces, and configuration.
Definition ipv4.h:69
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
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.
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:64
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.
Packet header to carry sequence number and timestamp.
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:560
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:274
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
Definition simulator.cc:131
static Time Now()
Return the current simulation virtual time.
Definition simulator.cc:197
static void Run()
Run the simulation.
Definition simulator.cc:167
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:117
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:61
virtual int Bind(const Address &address)=0
Allocate a local endpoint for this socket.
encapsulates test code
Definition test.h:1050
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
Definition test.cc:292
A suite of tests to run.
Definition test.h:1267
Type
Type of test.
Definition test.h:1274
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
@ S
second
Definition nstime.h:105
a unique identifier for an interface.
Definition type-id.h:48
static TypeId LookupByName(std::string name)
Get a TypeId by name.
Definition type-id.cc:872
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
Hold an unsigned integer type.
Definition uinteger.h:34
uint16_t port
Definition dsdv-manet.cc:33
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition assert.h:55
#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:75
Callback< R, Args... > MakeNullCallback()
Definition callback.h:727
void SetDefault(std::string name, const AttributeValue &value)
Definition config.cc:883
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#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:264
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:619
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition ptr.h:436
#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:134
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1308
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1320
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeUintegerChecker()
Definition uinteger.h:85
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Definition nstime.h:1396
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Definition uinteger.h:35
Ptr< const AttributeAccessor > MakeIpv4AddressAccessor(T1 a1)
Ptr< const AttributeChecker > MakeIpv4AddressChecker()
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
Definition nstime.h:1416
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)