21 #include "ns3/lte-helper.h"
22 #include "ns3/epc-helper.h"
23 #include "ns3/core-module.h"
24 #include "ns3/network-module.h"
25 #include "ns3/ipv4-global-routing-helper.h"
26 #include "ns3/ipv6-static-routing.h"
27 #include "ns3/internet-module.h"
28 #include "ns3/mobility-module.h"
29 #include "ns3/lte-module.h"
30 #include "ns3/applications-module.h"
31 #include "ns3/point-to-point-helper.h"
32 #include "ns3/config-store.h"
94 virtual void DoRun (
void);
106 :
TestCase (
"Test IPv6 Routing at LTE")
118 if (ipv6Header.
GetNextHeader () == UdpL4Protocol::PROT_NUMBER)
128 if (ipv6Header.
GetNextHeader () == UdpL4Protocol::PROT_NUMBER)
138 if (ipv6Header.
GetNextHeader () == UdpL4Protocol::PROT_NUMBER)
148 if (ipv6Header.
GetNextHeader () == UdpL4Protocol::PROT_NUMBER)
165 uint64_t uid = p1->
GetUid ();
178 uint16_t destinationPort;
212 double distance = 60.0;
221 Ptr<Node> pgw = epcHelper->GetPgwNode ();
225 remoteHostContainer.
Create (1);
228 internet.
Install (remoteHostContainer);
246 positionAlloc1->
Add (Vector (distance * 0, 0, 0));
247 positionAlloc1->
Add (Vector (distance * 0 + 5, 0, 0));
248 positionAlloc1->
Add (Vector (distance * 1, 0, 0));
250 positionAlloc2->Add (Vector (distance * 0, 0, 0));
251 positionAlloc2->Add (Vector (distance * 1, 0, 0));
273 for (uint32_t u = 0; u < ueNodes.
GetN (); ++u)
278 ueStaticRouting->
SetDefaultRoute (epcHelper->GetUeDefaultGatewayAddress6 (), 1);
282 lteHelper->
Attach (ueLteDevs.
Get (0), enbLteDevs.
Get (0));
283 lteHelper->
Attach (ueLteDevs.
Get (1), enbLteDevs.
Get (0));
284 lteHelper->
Attach (ueLteDevs.
Get (2), enbLteDevs.
Get (1));
319 echoClient2.SetAttribute (
"MaxPackets",
UintegerValue (1000));
321 echoClient2.SetAttribute (
"PacketSize",
UintegerValue (1024));
323 echoClient3.SetAttribute (
"MaxPackets",
UintegerValue (1000));
325 echoClient3.SetAttribute (
"PacketSize",
UintegerValue (1024));
352 Simulator::Stop (
Seconds (14));
355 Simulator::Destroy ();
369 :
TestSuite (
"lte-ipv6-routing-test", UNIT)
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
holds a vector of ns3::Application pointers.
Introspection did not find any typical Config paths.
Simulation virtual time values and global simulation resolution.
std::list< Ptr< Packet > > m_clientTxPkts
list of sent packets from client
NetDeviceContainer InstallEnbDevice(NodeContainer c)
Create a set of eNodeB devices.
Keep track of a set of IPv6 interfaces.
Ipv6InterfaceContainer m_ueIpIface
IPv6 interface container for ue.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Access to the IPv6 forwarding table, interfaces, and configuration.
void SetDefaultRouteInAllNodes(uint32_t router)
Set the default route for all the devices (except the router itself).
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
NetDeviceContainer Install(NodeContainer c)
void Add(ApplicationContainer other)
Append the contents of another ApplicationContainer to the end of this container. ...
uint64_t GetUid(void) const
Returns the packet's Uid.
Create an application which sends a UDP packet and waits for an echo of this packet.
void Attach(NetDeviceContainer ueDevices)
Enables automatic attachment of a set of UE devices to a suitable cell using Idle mode initial cell s...
Ptr< Ipv6StaticRouting > GetStaticRouting(Ptr< Ipv6 > ipv6) const
Get Ipv6StaticRouting pointer from IPv6 stack.
aggregate IP/TCP/UDP functionality to existing Nodes.
bool IsEqual(const Ipv6Address &other) const
Comparison operation between two Ipv6Addresses.
void SetBase(Ipv6Address network, Ipv6Prefix prefix, Ipv6Address base=Ipv6Address("::1"))
Set the base network number, network prefix, and base interface ID.
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 SetForwarding(uint32_t i, bool state)
Set the state of the stack (act as a router or as an host) for the specified index.
ApplicationContainer Install(Ptr< Node > node) const
Create a UdpEchoServerApplication on the specified Node.
Ipv6InterfaceContainer Assign(const NetDeviceContainer &c)
Allocate an Ipv6InterfaceContainer with auto-assigned addresses.
uint32_t GetN(void) const
Get the number of Ptr stored in this container.
Class for representing data rates.
Create a server application which waits for input UDP packets and sends them back to the original sen...
Ptr< Application > GetApplication(uint32_t index) const
Retrieve the index-th Application associated to this node.
void Install(Ptr< Node > node) const
"Layout" a single node according to the current position allocator type.
void TunToPgw(Ptr< Packet > p)
Received Packet at pgw from enb.
AttributeValue implementation for Time.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
LteIpv6RoutingTestSuite()
Hold an unsigned integer type.
#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.
holds a vector of ns3::NetDevice pointers
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
void AddNetworkRouteTo(Ipv6Address network, Ipv6Prefix networkPrefix, Ipv6Address nextHop, uint32_t interface, uint32_t metric=0)
Add route to network.
void ReceivedAtClient(Ptr< const Packet > p, Ptr< Ipv6 > ipv6, uint32_t interface)
Received Packets at client's IPv6 interface.
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter...
std::list< uint64_t > m_pgwUidRxFrmTun
list of uids of packets received at pgw from tunnel net device
void ConfigureDefaults(void)
Configure the default values.
Ipv6Address m_remoteHostAddr
remote host address
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
uint32_t PeekHeader(Header &header) const
Deserialize but does not remove the header from the internal buffer.
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
void EnbToPgw(Ptr< Packet > p)
Received Packet at pgw from enb.
Helper class that adds ns3::Ipv6StaticRouting objects.
void SetMobilityModel(std::string type, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue())
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
std::list< Ptr< Packet > > m_clientRxPkts
list of received packets at client
virtual void DoRun(void)
Implementation to actually run this TestCase.
std::list< uint64_t > m_pgwUidRxFrmEnb
list of uids of packets received at pgw from enb
void SetChannelAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each Channel created by the helper.
Helper class to auto-assign global IPv6 unicast addresses.
NetDeviceContainer InstallUeDevice(NodeContainer c)
Create a set of UE devices.
Helper class used to assign positions and mobility models to nodes.
Describes an IPv6 address.
void Stop(Time stop)
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter...
void Checker()
Initialize testing parameters.
void SetDefaultRoute(Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse=Ipv6Address("::"), uint32_t metric=0)
Set the default route.
virtual ~LteIpv6RoutingTestCase()
void SetEpcHelper(Ptr< EpcHelper > h)
Set the EpcHelper to be used to setup the EPC network in conjunction with the setup of the LTE radio ...
AttributeValue implementation for DataRate.
Ptr< Node > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
Time Seconds(double value)
Construct a Time in the indicated unit.
void SentAtClient(Ptr< const Packet > p, Ptr< Ipv6 > ipv6, uint32_t interface)
sent Packets from client's IPv6 interface.
void Add(Vector v)
Add a position to the list of positions.
Describes an IPv6 prefix.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
void SetAttribute(std::string name, const AttributeValue &value)
Record an attribute to be set in each Application after it is is created.
void SetPositionAllocator(Ptr< PositionAllocator > allocator)
Set the position allocator which will be used to allocate the initial position of every node initiali...
ApplicationContainer Install(Ptr< Node > node) const
Create a udp echo client application on the specified node.
Ipv6Address GetAddress(uint32_t i, uint32_t j) const
Get the address for the specified index.
static LteIpv6RoutingTestSuite lteipv6testsuite