9#include "ns3/config-store.h"
10#include "ns3/core-module.h"
11#include "ns3/epc-helper.h"
12#include "ns3/internet-module.h"
13#include "ns3/ipv4-global-routing-helper.h"
14#include "ns3/ipv6-static-routing.h"
15#include "ns3/lte-helper.h"
16#include "ns3/lte-module.h"
17#include "ns3/mobility-module.h"
18#include "ns3/network-module.h"
19#include "ns3/point-to-point-helper.h"
20#include "ns3/udp-echo-helper.h"
86 void DoRun()
override;
98 :
TestCase(
"Test IPv6 Routing at LTE")
110 p->PeekHeader(ipv6Header);
121 p->PeekHeader(ipv6Header);
132 p->PeekHeader(ipv6Header);
143 p->PeekHeader(ipv6Header);
161 p1->RemoveHeader(ipv6header1);
162 uint64_t uid = p1->GetUid();
163 p1->RemoveHeader(udpHeader1);
169 p2->RemoveHeader(ipv6header2);
173 p2->RemoveHeader(udpHeader2);
175 uint16_t destinationPort;
179 if ((p2->GetUid() == p1->GetUid()) && sourceAddress == ipv6header1.
GetDestination() &&
180 destinationAddress == ipv6header1.
GetSource() &&
207 "No. of Request and Reply messages mismatch");
215 double distance = 60.0;
219 lteHelper->SetEpcHelper(epcHelper);
228 remoteHostContainer.
Create(1);
231 internet.Install(remoteHostContainer);
249 positionAlloc1->Add(Vector(distance * 0, 0, 0));
250 positionAlloc1->Add(Vector(distance * 0 + 5, 0, 0));
251 positionAlloc1->Add(Vector(distance * 1, 0, 0));
253 positionAlloc2->Add(Vector(distance * 0, 0, 0));
254 positionAlloc2->Add(Vector(distance * 1, 0, 0));
257 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
258 mobility.SetPositionAllocator(positionAlloc1);
259 mobility.Install(ueNodes);
261 mobility.SetPositionAllocator(positionAlloc2);
262 mobility.Install(enbNodes);
265 internet.Install(ueNodes);
282 ueStaticRouting->SetDefaultRoute(epcHelper->GetUeDefaultGatewayAddress6(), 1);
286 lteHelper->Attach(ueLteDevs.
Get(0), enbLteDevs.
Get(0));
287 lteHelper->Attach(ueLteDevs.
Get(1), enbLteDevs.
Get(0));
288 lteHelper->Attach(ueLteDevs.
Get(2), enbLteDevs.
Get(1));
299 remoteHostStaticRouting
311 serverApps.Add(echoServer2.
Install(ueNodes.
Get(1)));
312 serverApps.Add(echoServer3.
Install(ueNodes.
Get(2)));
314 serverApps.Start(
Seconds(4.0));
315 serverApps.Stop(
Seconds(12.0));
348 ipL3->TraceConnectWithoutContext(
"Tx",
350 ipL3->TraceConnectWithoutContext(
"Rx",
356 appPgw->TraceConnectWithoutContext(
"RxFromS1u",
358 appPgw->TraceConnectWithoutContext(
"RxFromTun",
Lte Ipv6 routing test case.
Ipv6InterfaceContainer m_ueIpIface
IPv6 interface container for ue.
void TunToPgw(Ptr< Packet > p)
Received Packet at pgw from enb.
Ipv6Address m_remoteHostAddr
remote host address
void ReceivedAtClient(Ptr< const Packet > p, Ptr< Ipv6 > ipv6, uint32_t interface)
Received Packets at client's IPv6 interface.
std::list< Ptr< Packet > > m_clientTxPkts
list of sent packets from client
std::list< uint64_t > m_pgwUidRxFrmTun
list of uids of packets received at pgw from tunnel net device
void EnbToPgw(Ptr< Packet > p)
Received Packet at pgw from enb.
void Checker()
Initialize testing parameters.
~LteIpv6RoutingTestCase() override
std::list< Ptr< Packet > > m_clientRxPkts
list of received packets at client
void SentAtClient(Ptr< const Packet > p, Ptr< Ipv6 > ipv6, uint32_t interface)
sent Packets from client's IPv6 interface.
std::list< uint64_t > m_pgwUidRxFrmEnb
list of uids of packets received at pgw from enb
void DoRun() override
Implementation to actually run this TestCase.
LteIpv6RoutingTestSuite()
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.
void Stop(Time stop) const
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter.
ApplicationContainer Install(NodeContainer c)
Install an application on each node of the input container configured with all the attributes set wit...
void SetAttribute(const std::string &name, const AttributeValue &value)
Helper function used to set the underlying application attributes.
void ConfigureDefaults()
Configure the default values.
Class for representing data rates.
aggregate IP/TCP/UDP functionality to existing Nodes.
Helper class to auto-assign global IPv6 unicast addresses.
void SetBase(Ipv6Address network, Ipv6Prefix prefix, Ipv6Address base=Ipv6Address("::1"))
Set the base network number, network prefix, and base interface ID.
Ipv6InterfaceContainer Assign(const NetDeviceContainer &c)
Allocate an Ipv6InterfaceContainer with auto-assigned addresses.
Describes an IPv6 address.
Access to the IPv6 forwarding table, interfaces, and configuration.
Keep track of a set of IPv6 interfaces.
void SetForwarding(uint32_t i, bool state)
Set the state of the stack (act as a router or as an host) for the specified index.
void SetDefaultRouteInAllNodes(uint32_t router)
Set the default route for all the devices (except the router itself).
Ipv6Address GetAddress(uint32_t i, uint32_t j) const
Get the address for the specified index.
Describes an IPv6 prefix.
Helper class that adds ns3::Ipv6StaticRouting objects.
Ptr< Ipv6StaticRouting > GetStaticRouting(Ptr< Ipv6 > ipv6) const
Get Ipv6StaticRouting pointer from IPv6 stack.
Helper class used to assign positions and mobility models to nodes.
holds a vector of ns3::NetDevice pointers
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.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
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.
void SetChannelAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each Channel created by the helper.
NetDeviceContainer Install(NodeContainer c)
Smart pointer class similar to boost::intrusive_ptr.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void Run()
Run the simulation.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
Simulation virtual time values and global simulation resolution.
Create an application which sends a UDP packet and waits for an echo of this packet.
Create a server application which waits for input UDP packets and sends them back to the original sen...
static const uint8_t PROT_NUMBER
protocol number (0x11)
Hold an unsigned integer type.
static LteIpv6RoutingTestSuite g_lteipv6testsuite
Static variable for test initialization.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
#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.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...