27 #include "ns3/simulator.h"
30 #include "ns3/epc-helper.h"
31 #include "ns3/packet-sink-helper.h"
32 #include "ns3/point-to-point-helper.h"
33 #include "ns3/csma-helper.h"
34 #include "ns3/internet-stack-helper.h"
35 #include "ns3/ipv4-address-helper.h"
36 #include "ns3/inet-socket-address.h"
37 #include "ns3/packet-sink.h"
38 #include <ns3/ipv4-static-routing-helper.h>
39 #include <ns3/ipv4-static-routing.h>
40 #include <ns3/ipv4-interface.h>
41 #include <ns3/mac48-address.h>
42 #include "ns3/seq-ts-header.h"
43 #include "ns3/lte-radio-bearer-tag.h"
44 #include "ns3/arp-cache.h"
45 #include "ns3/boolean.h"
46 #include "ns3/uinteger.h"
47 #include "ns3/config.h"
113 static TypeId tid =
TypeId (
"ns3::LteRadioBearerTagUdpClient")
115 .AddConstructor<LteRadioBearerTagUdpClient> ()
116 .AddAttribute (
"MaxPackets",
117 "The maximum number of packets the application will send",
120 MakeUintegerChecker<uint32_t> ())
121 .AddAttribute (
"Interval",
127 "The destination Ipv4Address of the outbound packets",
130 MakeIpv4AddressChecker ())
131 .AddAttribute (
"RemotePort",
"The destination port of the outbound packets",
134 MakeUintegerChecker<uint16_t> ())
135 .AddAttribute (
"PacketSize",
136 "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.",
139 MakeUintegerChecker<uint32_t> ())
244 UeUlTestData (uint32_t n, uint32_t s, uint16_t r, uint8_t l);
265 std::vector<UeUlTestData>
ues;
276 virtual void DoRun (
void);
304 remoteHostContainer.
Create (1);
307 internet.
Install (remoteHostContainer);
314 ipv4h.
SetBase (
"1.0.0.0",
"255.0.0.0");
326 uint16_t udpSinkPort = 1234;
330 for (std::vector<EnbUlTestData>::iterator enbit =
m_enbUlTestData.begin ();
342 ues.
Create (enbit->ues.size ());
355 epcHelper->
AddEnb (enb, lteEnbNetDevice);
362 for (uint32_t u = 0; u < ues.
GetN (); ++u)
406 client->SetAttribute (
"RemotePort",
UintegerValue (udpSinkPort));
407 client->SetAttribute (
"MaxPackets",
UintegerValue (enbit->ues[u].numPkts));
408 client->SetAttribute (
"Interval",
TimeValue (interPacketInterval));
409 client->SetAttribute (
"PacketSize",
UintegerValue (enbit->ues[u].pktSize));
412 clientApp.
Add (client);
415 enbit->ues[u].clientApp = client;
429 for (std::vector<EnbUlTestData>::iterator enbit =
m_enbUlTestData.begin ();
433 for (std::vector<UeUlTestData>::iterator ueit = enbit->ues.begin ();
434 ueit < enbit->ues.end ();
437 NS_TEST_ASSERT_MSG_EQ (ueit->serverApp->GetTotalRx (), (ueit->numPkts) * (ueit->pktSize),
"wrong total received bytes");
461 std::vector<EnbUlTestData> v1;
464 e1.
ues.push_back (f1);
469 std::vector<EnbUlTestData> v2;
472 e2.
ues.push_back (f2_1);
474 e2.
ues.push_back (f2_2);
479 std::vector<EnbUlTestData> v3;
487 e3.
ues.push_back (f3_1);
489 e3.
ues.push_back (f3_2);
491 e3.
ues.push_back (f3_2);
492 std::vector<EnbUlTestData> v4;
498 std::vector<EnbUlTestData> v5;
501 e5.
ues.push_back (f5);
505 std::vector<EnbUlTestData> v6;
508 e6.
ues.push_back (f6);
512 std::vector<EnbUlTestData> v7;
515 e7.
ues.push_back (f7);
519 std::vector<EnbUlTestData> v8;
522 e8.
ues.push_back (f8);