Lena - IP multicast

561 views
Skip to first unread message

Ndrs

unread,
Mar 2, 2012, 6:28:20 AM3/2/12
to ns-3-users
Hi all,

I'm trying to set a very simple scenario, based on lena-simple-
epc.cc.
I want the remote host to send packets to a multicast address that all
ues attached to the enb will receive.

The problem is that no ue is able to receive the multicast packets.
I set a destination "multicastGroup" address to send the packets
(225.1.2.4) and set the following static routes:

from the remoteHost to the pgw (over the point to point interface)
from the pgw to the enb (over the S1 interface)
from the enb to the LTE interface (which I think is not necessary,
because the pgw is already in the same IP network than the ues, but
I'm running out of ideas).

I'm not an LTE expert, maybe I'm having conceptual mistakes here so
any help will be appreciated.

----------------------------------------

#include "ns3/lte-helper.h"
#include "ns3/epc-helper.h"
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/mobility-module.h"
#include "ns3/config-store.h"
#include "ns3/internet-module.h"
#include "ns3/applications-module.h"
#include "ns3/lte-module.h"
#include "ns3/point-to-point-helper.h"
#include "ns3/ipv4-static-routing-helper.h"

using namespace ns3;

NS_LOG_COMPONENT_DEFINE ("LteMulticast");
int
main (int argc, char *argv[])
{
uint16_t numDevs = 4;
double duration = 5.5;

LogComponentEnable("PacketSink",
(LogLevel) (LOG_LEVEL_INFO|LOG_PREFIX_FUNC|LOG_PREFIX_TIME|
LOG_PREFIX_NODE));
LogComponentEnable("PacketSink",
(LogLevel) (LOG_LEVEL_DEBUG|LOG_PREFIX_FUNC|LOG_PREFIX_TIME|
LOG_PREFIX_NODE));
LogComponentEnable("UdpTraceClient",
(LogLevel) (LOG_LEVEL_INFO|LOG_PREFIX_FUNC|LOG_PREFIX_TIME|
LOG_PREFIX_NODE));
LogComponentEnable("UdpTraceClient",
(LogLevel) (LOG_LEVEL_DEBUG|LOG_PREFIX_FUNC|LOG_PREFIX_TIME|
LOG_PREFIX_NODE));

// *** ECP *** //
Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
Ptr<EpcHelper> epcHelper = CreateObject<EpcHelper> ();
lteHelper->SetEpcHelper (epcHelper);
lteHelper->SetSchedulerType("ns3::RrFfMacScheduler");
Ptr<Node> pgw = epcHelper->GetPgwNode (); //Packet Data Network
Gateway
// Create a RemoteHost
NodeContainer remoteHostContainer;
remoteHostContainer.Create (1);
Ptr<Node> remoteHost = remoteHostContainer.Get (0);
InternetStackHelper internet;
internet.Install (remoteHostContainer);
// Create the Internet
PointToPointHelper p2ph;
p2ph.SetDeviceAttribute ("DataRate", DataRateValue (DataRate ("100Gb/
s")));
p2ph.SetDeviceAttribute ("Mtu", UintegerValue (1500));
p2ph.SetChannelAttribute ("Delay", TimeValue (Seconds (0.010)));
NetDeviceContainer internetDevices = p2ph.Install (pgw, remoteHost);
Ipv4AddressHelper ipv4h;
ipv4h.SetBase ("1.0.0.0", "255.0.0.0");
Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign
(internetDevices);
Ipv4StaticRoutingHelper ipv4RoutingHelper;
Ptr<Ipv4StaticRouting> remoteHostStaticRouting =
ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"),
Ipv4Mask ("255.0.0.0"), 1);

NodeContainer ueNodes;
NodeContainer enbNodes;
enbNodes.Create(1);
ueNodes.Create(numDevs);

// ******* Mobility ****** //
MobilityHelper mobility;
// For the UEs
double width;
width = sqrt (numDevs);
modf (width , &width);
mobility.SetPositionAllocator ("ns3::GridPositionAllocator", "MinX",
DoubleValue (0.0), "MinY", DoubleValue (0.0), "DeltaX", DoubleValue
(50),
"DeltaY", DoubleValue (50), "GridWidth", UintegerValue
(width), "LayoutType", StringValue ("RowFirst"));
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
mobility.Install (ueNodes);
mobility.SetPositionAllocator ("ns3::GridPositionAllocator", "MinX",
DoubleValue (width*50));
mobility.Install (enbNodes);

// Install LTE Devices to the nodes
NetDeviceContainer enbLteDevs = lteHelper->InstallEnbDevice
(enbNodes);
NetDeviceContainer ueLteDevs = lteHelper->InstallUeDevice (ueNodes);

// Attach UEs to the eNodeB
for (uint16_t i = 0; i < numDevs; i++)
{
NS_LOG_DEBUG ("Attaching UE " << i << " to eNB");
lteHelper->Attach (ueLteDevs.Get(i), enbLteDevs.Get(0));
}
// Install the IP stack on the UEs
internet.Install (ueNodes);
Ipv4InterfaceContainer ueIp;
ueIp = epcHelper->AssignUeIpv4Address (NetDeviceContainer
(ueLteDevs));

Ptr<Node> enb = enbNodes.Get (0);

// Assign IP address to UEs, and install applications
for (uint32_t u = 0; u < ueNodes.GetN (); ++u)
{
Ptr<Node> ueNode = ueNodes.Get (u);
// Set the default gateway for the UE
Ptr<Ipv4StaticRouting> ueStaticRouting =
ipv4RoutingHelper.GetStaticRouting (ueNode->GetObject<Ipv4> ());
ueStaticRouting->SetDefaultRoute (epcHelper-
>GetUeDefaultGatewayAddress (), 1);
}
lteHelper->ActivateEpsBearer (ueLteDevs, EpsBearer
(EpsBearer::NGBR_IMS), EpcTft::Default ());

// ******** Multicast route ****** //
Ipv4Address multicastSource (remoteHost->GetObject<Ipv4> ()-
>GetAddress (1, 0).GetLocal ());
Ipv4Address multicastGroup ("225.1.2.4");
//Ipv4Address multicastGroup ("7.0.0.3");
uint16_t multicastPort = 1236;
Ipv4StaticRoutingHelper multicast;
// Configure a multicast route on PGW
Ptr<Node> multicastRouter = pgw;
Ptr<NetDevice> inputIf = pgw->GetDevice(2);
multicast.AddMulticastRoute (multicastRouter, multicastSource,
multicastGroup, inputIf, pgw->GetDevice(1));
// Set up a default multicast route on the sender
Ptr<Node> sender = remoteHost;
Ptr<NetDevice> senderIf = internetDevices.Get (1);
remoteHostStaticRouting->SetDefaultMulticastRoute (1);
// Configure a multicast route on eNodeB
multicastRouter = enb;
inputIf = enb->GetDevice(2);
multicast.AddMulticastRoute (multicastRouter, multicastSource,
multicastGroup, inputIf, enb->GetDevice(2));

// ********** APPLICATIONS ****** //
PacketSinkHelper packetSinkHelper ("ns3::UdpSocketFactory",
InetSocketAddress (Ipv4Address::GetAny (), multicastPort));
ApplicationContainer sinkApp;
sinkApp = packetSinkHelper.Install (ueNodes);
sinkApp.Start (Seconds (0.01));
sinkApp.Stop (Seconds (duration));

UdpTraceClientHelper udpClient (multicastGroup, multicastPort, "");
ApplicationContainer clientApp;
clientApp = udpClient.Install (remoteHost);
clientApp.Start (Seconds (3));
clientApp.Stop (Seconds (4));

Simulator::Stop(Seconds(duration));
Simulator::Run();
Simulator::Destroy();
return 0;
}

封潇

unread,
Dec 4, 2012, 5:40:05 AM12/4/12
to ns-3-...@googlegroups.com
I'm sorry. Have you fixed this problem?
I met a similar problem like this.

How to fix it?
Thank you.

在 2012年3月2日星期五UTC+8下午7时28分20秒,Ndrs写道:

coderc...@gmail.com

unread,
Feb 11, 2013, 4:04:57 PM2/11/13
to ns-3-...@googlegroups.com
Hi,

Has anyone found a solution to this please? I followed a similar procedure and also used https://bitbucket.org/mezza84/ns-3-lte-dev/src/18bb8e694652/examples/wimax/wimax-multicast.cc
as an example.  However, I seem to be missing the point.  This is what I got so far:

 // First LAN eNB and PGW
 NodeContainer LAN_PGW_eNB;
 LAN_PGW_eNB.Add (enbNodes.Get (0));
 LAN_PGW_eNB.Add (pgw);

 NetDeviceContainer enb_Devs;
 Ptr<Node> enb = enbNodes.Get (0);  
 Ptr<Node> multicastRouter = enb; 
 Ptr<NetDevice> inputIf = enb->GetDevice(1);       
 enb_Devs.Add (inputIf);

 NetDeviceContainer ASN_Devs2; 
 ASN_Devs2.Add (internetDevices .Get (0));
 NetDeviceContainer ASN_Devs1;
 ASN_Devs1.Add (ASN_Devs2.Get(0));
 
 // Second LAN ASN-GW and Streamer
 NetDeviceContainer STREAMER_Devs;                        
 STREAMER_Devs.Add (internetDevices .Get (1));              
                                           
                 
 Ipv4Address multicastSource ("1.0.0.2");
Ipv4Address multicastGroup ("224.30.10.81");
 Ipv4StaticRoutingHelper multicast;
 
 // Configure a multicast route on PGW 
  multicastRouter = pgw; 
 inputIf = ASN_Devs2.Get (0); 
 multicast.AddMulticastRoute (pgw , multicastSource, multicastGroup, inputIf, ASN_Devs1); //pgw
 
 // 2) Set up a default multicast route on the sender 
 Ptr<Node> sender = remoteHostContainer.Get (0);
 Ptr<NetDevice> senderIf = STREAMER_Devs.Get (0);//remote host
 multicast.SetDefaultMulticastRoute (sender, senderIf);
 
 // Configure a multicast route on eNodeB 
 multicastRouter = enb; 
 inputIf = enb->GetDevice(1);       
 
 multicast.AddMulticastRoute (multicastRouter, multicastSource, multicastGroup, inputIf, enb->GetDevice(2));
 uint16_t multicastPort = 100;

UEs are not receiving data.  It seems it just reaches the PGW.  Any insight of what might be going on is appreciated.  

Thanks

Nicola Baldo

unread,
Feb 12, 2013, 9:05:11 AM2/12/13
to ns-3-...@googlegroups.com
Hi,

the example in the link that you posted is for WiMAX. This approach won't work with the ns-3 LTE model unless you modify the ns-3 LTE module to add multicast support.

Nicola

Codey Codey

unread,
Feb 16, 2013, 9:51:24 AM2/16/13
to ns-3-...@googlegroups.com
Hi Nicola,

Thanks for your response and clarifying the issue,  What kind of modifications are you referring to? I changed the default 7.0.0.0 address of the UEs and PGW to a multicast address.  Are there any other modifications that you might suggest please? (since the UEs are still not receiving any data).  I am really interested in LTE and this module seems to be the best there is and I wish to build my topology using this module.  Any insight/ information is highly appreciated.  Thank you.

Best Regards,
Codey



--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Nicola Baldo

unread,
Feb 18, 2013, 7:00:28 AM2/18/13
to ns-3-...@googlegroups.com
Hi Codey,

to start with, I suggest you to read a bit about the LTE Multimedia Broadcas / Multicast System (MBMS) to get an idea of how multicast works in a real LTE system.

Nicola


Reply all
Reply to author
Forward
0 new messages