S1-U downlink working with multiple eNBs and UEs

This commit is contained in:
Nicola Baldo
2011-10-20 16:59:47 +02:00
parent 6a87966409
commit 460af60a0f
3 changed files with 57 additions and 4 deletions

View File

@@ -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<uint16_t> ())
;
return tid;
}
@@ -132,6 +137,7 @@ EpcHelper::AddEnb (Ptr<Node> enb, Ptr<NetDevice> 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<Ipv4> ()->GetNInterfaces ());
@@ -162,6 +168,7 @@ EpcHelper::AddEnb (Ptr<Node> enb, Ptr<NetDevice> 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);

View File

@@ -125,6 +125,7 @@ private:
DataRate m_s1uLinkDataRate;
Time m_s1uLinkDelay;
uint16_t m_s1uLinkMtu;
/**

View File

@@ -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 <ns3/ipv4-static-routing-helper.h>
#include <ns3/ipv4-static-routing.h>
#include "ns3/boolean.h"
#include "ns3/uinteger.h"
using namespace ns3;
@@ -155,6 +157,11 @@ EpcS1uTestCase::DoRun ()
Ipv4InterfaceContainer ueIpIface = epcHelper->AssignUeIpv4Address (NetDeviceContainer (ueLteDevice));
Ptr<Node> 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<Ipv4> ()->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<EnbTestData> 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<EnbTestData> 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<EnbTestData> 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<EnbTestData> v4;
v4.push_back (e3);
v4.push_back (e1);
v4.push_back (e2);
AddTestCase (new EpcS1uTestCase ("3 eNBs", v4));
}