27 #include "ns3/simulator.h"
30 #include "ns3/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"
115 static TypeId tid =
TypeId (
"ns3::EpsBearerTagUdpClient")
117 .AddConstructor<EpsBearerTagUdpClient> ()
118 .AddAttribute (
"MaxPackets",
119 "The maximum number of packets the application will send",
122 MakeUintegerChecker<uint32_t> ())
123 .AddAttribute (
"Interval",
129 "The destination Ipv4Address of the outbound packets",
132 MakeIpv4AddressChecker ())
133 .AddAttribute (
"RemotePort",
"The destination port of the outbound packets",
136 MakeUintegerChecker<uint16_t> ())
137 .AddAttribute (
"PacketSize",
138 "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.",
141 MakeUintegerChecker<uint32_t> ())
246 UeUlTestData (uint32_t n, uint32_t s, uint16_t r, uint8_t l);
267 std::vector<UeUlTestData>
ues;
278 virtual void DoRun (
void);
306 remoteHostContainer.
Create (1);
309 internet.
Install (remoteHostContainer);
316 ipv4h.
SetBase (
"1.0.0.0",
"255.0.0.0");
328 uint16_t udpSinkPort = 1234;
331 uint16_t cellIdCounter = 0;
333 for (std::vector<EnbUlTestData>::iterator enbit =
m_enbUlTestData.begin ();
344 uint16_t cellId = ++cellIdCounter;
347 ues.
Create (enbit->ues.size ());
360 epcHelper->
AddEnb (enb, enbDevice, cellId);
364 NS_ASSERT_MSG (enbApp != 0,
"cannot retrieve EpcEnbApplication");
366 rrc->SetS1SapProvider (enbApp->GetS1SapProvider ());
367 enbApp->SetS1SapUser (rrc->GetS1SapUser ());
374 for (uint32_t u = 0; u < ues.
GetN (); ++u)
418 client->SetAttribute (
"RemotePort",
UintegerValue (udpSinkPort));
419 client->SetAttribute (
"MaxPackets",
UintegerValue (enbit->ues[u].numPkts));
420 client->SetAttribute (
"Interval",
TimeValue (interPacketInterval));
421 client->SetAttribute (
"PacketSize",
UintegerValue (enbit->ues[u].pktSize));
424 clientApp.
Add (client);
427 enbit->ues[u].clientApp = client;
430 epcHelper->
AddUe (ueLteDevice, imsi);
432 enbApp->GetS1SapProvider ()->InitialUeMessage (imsi, (uint16_t) imsi);
442 for (std::vector<EnbUlTestData>::iterator enbit =
m_enbUlTestData.begin ();
446 for (std::vector<UeUlTestData>::iterator ueit = enbit->ues.begin ();
447 ueit < enbit->ues.end ();
450 NS_TEST_ASSERT_MSG_EQ (ueit->serverApp->GetTotalRx (), (ueit->numPkts) * (ueit->pktSize),
"wrong total received bytes");
474 std::vector<EnbUlTestData> v1;
477 e1.
ues.push_back (f1);
482 std::vector<EnbUlTestData> v2;
485 e2.
ues.push_back (f2_1);
487 e2.
ues.push_back (f2_2);
492 std::vector<EnbUlTestData> v3;
500 e3.
ues.push_back (f3_1);
502 e3.
ues.push_back (f3_2);
504 e3.
ues.push_back (f3_2);
505 std::vector<EnbUlTestData> v4;
511 std::vector<EnbUlTestData> v5;
514 e5.
ues.push_back (f5);
518 std::vector<EnbUlTestData> v6;
521 e6.
ues.push_back (f6);
525 std::vector<EnbUlTestData> v7;
528 e7.
ues.push_back (f7);
532 std::vector<EnbUlTestData> v8;
535 e8.
ues.push_back (f8);