From 460af60a0f1ff2f7d53968da5332e7ce0e1ef268 Mon Sep 17 00:00:00 2001 From: Nicola Baldo Date: Thu, 20 Oct 2011 16:59:47 +0200 Subject: [PATCH] S1-U downlink working with multiple eNBs and UEs --- src/lte/helper/epc-helper.cc | 7 ++++ src/lte/helper/epc-helper.h | 1 + src/lte/test/epc-test-s1u-downlink.cc | 53 +++++++++++++++++++++++++-- 3 files changed, 57 insertions(+), 4 deletions(-) diff --git a/src/lte/helper/epc-helper.cc b/src/lte/helper/epc-helper.cc index 074876965..01b2be978 100644 --- a/src/lte/helper/epc-helper.cc +++ b/src/lte/helper/epc-helper.cc @@ -108,6 +108,11 @@ EpcHelper::GetTypeId (void) TimeValue (Seconds (0)), MakeTimeAccessor (&EpcHelper::m_s1uLinkDelay), MakeTimeChecker ()) + .AddAttribute ("S1uLinkMtu", + "The MTU of the next S1-U link to be created. Note that, because of the additional GTP/UDP/IP tunneling overhead, you need a MTU larger than the end-to-end MTU that you want to support.", + UintegerValue (2000), + MakeUintegerAccessor (&EpcHelper::m_s1uLinkMtu), + MakeUintegerChecker ()) ; return tid; } @@ -132,6 +137,7 @@ EpcHelper::AddEnb (Ptr enb, Ptr lteEnbNetDevice) enbSgwNodes.Add (enb); PointToPointHelper p2ph; p2ph.SetDeviceAttribute ("DataRate", DataRateValue (m_s1uLinkDataRate)); + p2ph.SetDeviceAttribute ("Mtu", UintegerValue (m_s1uLinkMtu)); p2ph.SetChannelAttribute ("Delay", TimeValue (m_s1uLinkDelay)); NetDeviceContainer enbSgwDevices = p2ph.Install (enb, m_sgwPgw); NS_LOG_LOGIC ("number of Ipv4 ifaces of the eNB after installing p2p dev: " << enb->GetObject ()->GetNInterfaces ()); @@ -162,6 +168,7 @@ EpcHelper::AddEnb (Ptr enb, Ptr lteEnbNetDevice) NS_ASSERT (retval == 0); PacketSocketAddress enbLteSocketConnectAddress; enbLteSocketConnectAddress.SetPhysicalAddress (Mac48Address::GetBroadcast ()); + enbLteSocketConnectAddress.SetSingleDevice (lteEnbNetDevice->GetIfIndex ()); enbLteSocketConnectAddress.SetProtocol (Ipv4L3Protocol::PROT_NUMBER); retval = enbLteSocket->Connect (enbLteSocketConnectAddress); NS_ASSERT (retval == 0); diff --git a/src/lte/helper/epc-helper.h b/src/lte/helper/epc-helper.h index 406568061..62dcd1e52 100644 --- a/src/lte/helper/epc-helper.h +++ b/src/lte/helper/epc-helper.h @@ -125,6 +125,7 @@ private: DataRate m_s1uLinkDataRate; Time m_s1uLinkDelay; + uint16_t m_s1uLinkMtu; /** diff --git a/src/lte/test/epc-test-s1u-downlink.cc b/src/lte/test/epc-test-s1u-downlink.cc index a295f1f88..e9a2fb325 100644 --- a/src/lte/test/epc-test-s1u-downlink.cc +++ b/src/lte/test/epc-test-s1u-downlink.cc @@ -31,10 +31,12 @@ #include "ns3/internet-stack-helper.h" #include "ns3/ipv4-address-helper.h" #include "ns3/inet-socket-address.h" -#include "ns3/uinteger.h" #include "ns3/packet-sink.h" #include #include +#include "ns3/boolean.h" +#include "ns3/uinteger.h" + using namespace ns3; @@ -155,6 +157,11 @@ EpcS1uTestCase::DoRun () Ipv4InterfaceContainer ueIpIface = epcHelper->AssignUeIpv4Address (NetDeviceContainer (ueLteDevice)); Ptr ue = ues.Get (u); + + // disable IP Forwarding on the UE. This is because we use + // CSMA broadcast MAC addresses for this test. The problem + // won't happen with a LteUeNetDevice. + ue->GetObject ()->SetAttribute ("IpForward", BooleanValue (false)); uint16_t port = 1234; PacketSinkHelper packetSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), port)); @@ -195,7 +202,7 @@ EpcS1uTestCase::DoRun () } } - + Simulator::Destroy (); } @@ -214,13 +221,51 @@ public: EpcS1uTestSuite::EpcS1uTestSuite () : TestSuite ("epc-s1u-downlink", SYSTEM) -{ - +{ std::vector v1; EnbTestData e1; UeTestData f1 (1, 100); e1.ues.push_back (f1); v1.push_back (e1); AddTestCase (new EpcS1uTestCase ("1 eNB, 1UE", v1)); + + + std::vector v2; + EnbTestData e2; + UeTestData f2_1 (1, 100); + e2.ues.push_back (f2_1); + UeTestData f2_2 (2, 200); + e2.ues.push_back (f2_2); + v2.push_back (e2); + AddTestCase (new EpcS1uTestCase ("1 eNB, 2UEs", v2)); + + + std::vector v3; + v3.push_back (e1); + v3.push_back (e2); + AddTestCase (new EpcS1uTestCase ("2 eNBs", v3)); + + + EnbTestData e3; + UeTestData f3_1 (3, 50); + e3.ues.push_back (f3_1); + UeTestData f3_2 (5, 1472); + e3.ues.push_back (f3_2); + UeTestData f3_3 (1, 1); + e3.ues.push_back (f3_2); + std::vector v4; + v4.push_back (e3); + v4.push_back (e1); + v4.push_back (e2); + AddTestCase (new EpcS1uTestCase ("3 eNBs", v4)); + + + + + + + + + }