Hi,
Thank you for your answers..
2. Yes, the static routing is preset for the 7.* network, on which the UEs reside and the Sgw-Pgw node transfers packets from RH to them or between them (if using otherPort is used too). This much is okey...
There is already an application on eNB and another one on Sgw-Pgw
=======================================================
void
EpcEnbApplication::RecvFromLteSocket (Ptr<Socket> socket)
{
NS_LOG_FUNCTION (this);
NS_ASSERT (socket == m_lteSocket);
Ptr<Packet> packet = socket->Recv ();
/// \internal
/// Workaround for \bugid{231}
SocketAddressTag satag;
packet->RemovePacketTag (satag);
EpsBearerTag tag;
bool found = packet->RemovePacketTag (tag);
NS_ASSERT (found);
uint16_t rnti = tag.GetRnti ();
uint8_t bid = tag.GetBid ();
NS_LOG_LOGIC ("received packet with RNTI=" << (uint32_t) rnti << ", BID=" << (uint32_t) bid);
std::map<uint16_t, std::map<uint8_t, uint32_t> >::iterator rntiIt = m_rbidTeidMap.find (rnti);
if (rntiIt == m_rbidTeidMap.end ())
{
NS_LOG_WARN ("UE context not found, discarding packet");
}
else
{
std::map<uint8_t, uint32_t>::iterator bidIt = rntiIt->second.find (bid);
NS_ASSERT (bidIt != rntiIt->second.end ());
uint32_t teid = bidIt->second;
SendToS1uSocket (packet, teid);
}
}
void
EpcEnbApplication::RecvFromS1uSocket (Ptr<Socket> socket)
{
NS_LOG_FUNCTION (this << socket);
NS_ASSERT (socket == m_s1uSocket);
Ptr<Packet> packet = socket->Recv ();
GtpuHeader gtpu;
packet->RemoveHeader (gtpu);
uint32_t teid = gtpu.GetTeid ();
std::map<uint32_t, EpsFlowId_t>::iterator it = m_teidRbidMap.find (teid);
NS_ASSERT (it != m_teidRbidMap.end ());
/// \internal
/// Workaround for \bugid{231}
SocketAddressTag tag;
packet->RemovePacketTag (tag);
SendToLteSocket (packet, it->second.m_rnti, it->second.m_bid);
}
void
EpcEnbApplication::SendToLteSocket (Ptr<Packet> packet, uint16_t rnti, uint8_t bid)
{
NS_LOG_FUNCTION (this << packet << rnti << (uint16_t) bid << packet->GetSize ());
EpsBearerTag tag (rnti, bid);
packet->AddPacketTag (tag);
int sentBytes = m_lteSocket->Send (packet);
NS_ASSERT (sentBytes > 0);
}
void
EpcEnbApplication::SendToS1uSocket (Ptr<Packet> packet, uint32_t teid)
{
NS_LOG_FUNCTION (this << packet << teid << packet->GetSize ());
GtpuHeader gtpu;
gtpu.SetTeid (teid);
// From 3GPP TS 29.281 v10.0.0 Section 5.1
// Length of the payload + the non obligatory GTP-U header
gtpu.SetLength (packet->GetSize () + gtpu.GetSerializedSize () - 8);
packet->AddHeader (gtpu);
uint32_t flags = 0;
m_s1uSocket->SendTo (packet, flags, InetSocketAddress(m_sgwS1uAddress, m_gtpuUdpPort));
}
===========================================================
3. By that reasoning (appearing valid though), EPC working in NS-3 Simulator. appears confusing...some questions that I would like to have answers for then are:
a) Is it due to the lack of actual Radio link between eNB and UEs, that the test script for e2e in lte test dir uses a Wifi config, ???
b) if we are doing data transfers with static routing to and fro with UEs under EPC too, then really speaking what advantage have we gained from the earlier LTE module in older NS-3 (ns-3.13), which used to have a lte-multiple-flows.cc example that used to work fine, in the "data-only" config??? is it only the tft and qos spec addition?
c) In the documentation for ns-3 lte module we show the Radio links, so when would do they come in to play in an Epc simulation ... (say in lena-simple-epc.cc or lena-dual-stripe) ?? Is it only for explanatory purposes of EPC and not for simulation of LTE in NS-3??? Ouch ! this would be disturbing...
d) What then is then being achieved by setting Earfcn or Bandwidth, if really no path via eNB comes in to play??? and alternatively, in which cases it does so pl?
With Thanks and Regards,
madan
Date: Thu, 14 Nov 2013 10:24:14 -0800