Routing problem in LTE+adhoc network

1,036 views
Skip to first unread message

Gooner 내려왔다

unread,
Mar 21, 2016, 5:34:43 AM3/21/16
to ns-3-users
Hello Guys,
    I am in the process of simulating LTE+Adhoc n/w. I am using OLSR to connect the interfaces between LTE and wifi Adhoc.
OLSR is installed on the wifi part of network and also Ipv4GlobalRoutingHelper is installed on the wifi part.
But when I use "Ipv4GlobalRoutingHelper::PopulateRoutingTables ();",  an error is thrown with the message "terminated with signal SIGSEGV". If "Ipv4GlobalRoutingHelper::PopulateRoutingTables ();" is not used, no error is thrown, but interaction does not happen.

Kindly help.

LTE_Adhoc.cc

Gooner 내려왔다

unread,
Mar 21, 2016, 6:31:59 AM3/21/16
to ns-3-users
What exactly below message mean
"ns3::GlobalRouter::GetAdjacent (this=0x725c30, nd=...,
    ch=...) at ../src/internet/model/global-router-interface.cc:1598
1598      NS_ASSERT_MSG (ch->GetNDevices () == 2, "GlobalRouter::GetAdjacent (): Channel with other than two devices");"

Above is the message obtained upon using "Ipv4GlobalRoutingHelper::PopulateRoutingTables ();" on Adhoc part.
Before, I have used  these routing schemes on a particular network. But I do not get what this error. Any help?

Nat P

unread,
Mar 21, 2016, 7:07:56 AM3/21/16
to ns-3-users
The message is pretty explanatory. If you have more than 2 devices over the same channel, how static routing can decide where it can send packets? Please, use a routing protocol for adhoc networks.

nat

Gooner 내려왔다

unread,
Mar 22, 2016, 7:43:11 AM3/22/16
to ns-3-users
Thanks Nat for the reply.
Actually I am already using OLSR for adhoc network with higher priority.
and LTE use static routing.
As a result, there are interactions within the components of LTE network and within Adhoc network separately. But not between the components of LTE and Adhoc network.
Do I have to do static routing for Adhoc as well?  (I assumed that applying Global routing on adhoc nodes would do it)

The reason I tried to Global routing on Adhoc was because, before I tried a 2 different wifi network connection. Here one was with OLSR(to connect with the interface of other wifi network with HNA message) along with Global routing and other wifi network with Global routing alone. And it was working fine.

It would be great if you could clear my question on this

Konstantinos

unread,
Mar 22, 2016, 8:10:58 AM3/22/16
to ns-3-users
Hi,

Such scenarios have been discussed in the past and there are some limitation in the current NS3 and LTE implementations.

You may be able to create an uplink traffic from OLSR to a remote host (RH) through LTE but at the moment no downlink traffic is routed from a RH to an adhoc node.

Regards,
K

Gooner 내려왔다

unread,
Apr 12, 2016, 7:51:37 PM4/12/16
to ns-3-users
Hi Konstantinos,
    I am just paused for a basic thing, while using LTE (no adhoc part here. Just simple LTE) and static routing.

Scenario1 :
   I used below static routing from remote host to UE node( UE nodes is in "7.0.0.0" ).
       Ipv4StaticRoutingHelper ipv4RoutingHelper;
    Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
    remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);

In this case, I can see the signal flow UE node to remotehost and from remotehost to UE node back. This is working as expected.

Scenario2:
  I used below static routing from UE node to remote host ( remote host UE is in "7.0.0.0")
     Ipv4StaticRoutingHelper ipv4RoutingHelper;
     Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (ueNodes.Get(0)->GetObject<Ipv4> ());
     remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("1.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);

In this case, signal flow happens from UE Node to remote host. But sigal flow does not happen from remotehost to UE node. Technically they are both same right?. Please throw me some light if I am on the wrong side.

Regards,
G

Konstantinos

unread,
Apr 13, 2016, 4:04:59 AM4/13/16
to ns-3-users
Dear Gooner,

The two code snippets may look similar, but they are not.
In the first you set-up a route from RH to the UEs. The UEs may use the default route to send traffic to the EPC and from there to the RH.
In the second you set-up a route from UEs to RH, but the RH does not know where to route its packets. That's why it does not work.

Regards,
K.

내려왔다Gooner

unread,
Apr 15, 2016, 8:45:08 PM4/15/16
to ns-3-...@googlegroups.com
Thanks a lot for clearing that concept of packet drop.

I have one more question about the hop to be used. Suppose we have another new network N1 connected to LTE(with interface in "20:0:0:0"), where UE node is common to LTE and N1. ie ue side will have 20:0:0:1 and N1 side of network has 20:0:0:2.

Then what is the hop to be used in the scenario 1? I tried with IP address of ueNode ( ie 7:0:0:2). But it does not work (no signal exchange at all)
Ipv4StaticRoutingHelper ipv4RoutingHelper;
    Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
    remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("20.0.0.0"), Ipv4Mask ("255.0.0.0"),ueIpIface.GetAddress (0), 1);

 But for scenario2,
Ipv4StaticRoutingHelper ipv4RoutingHelper;
     Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (NewNw.Get(0)->GetObject<Ipv4> ());
     remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("1.0.0.0"), Ipv4Mask ("255.0.0.0"),
"20.0.0.1", 1);
But it work as per the explanation you have given.



Thanks,
G4L

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/ztodDgMSWtA/unsubscribe.
To unsubscribe from this group and all its topics, 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 https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

Konstantinos

unread,
Apr 16, 2016, 8:58:10 AM4/16/16
to ns-3-users
Hi,

I have not full understood what is your network looks like and what is not working.
The new network (N1) is connected through the UE? In that case, no traffic can go through the LTE network to N1 from a remote host. This is due to lack of NAT functionality.
The packet will leave the RH, will go to the EPC which does not know that packets to N1 should go through UE_1

Regards,
K
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.

Gooner 내려왔다

unread,
Apr 19, 2016, 5:30:43 AM4/19/16
to ns-3-users
Hi Konstantinos,
  I have applied NAT on the ueNode like below.
Ipv4StaticNatRule rule2 (Ipv4Address ("20.0.0.2"), 49153, Ipv4Address ("7.0.0.100"), 3002, 0);
//20.0.0.2 is the ip of node of N1 network and for outside network it see it as 7:0.0.100. Ie they see it as with same subnet as UE


Coming back to my previous question, if the network topology is like below
RH --> EPC --> UE --> N1
what is the hop to be used in the scenario? I used  ueIpIface.GetAddress (0), but it did not help. I also tried without any hop, assuming that EPC see it as a part of it and use the default routing.

Thanks,
G4L

Konstantinos

unread,
Apr 19, 2016, 5:52:22 AM4/19/16
to ns-3-users
In a scenario like the one you mention
RH --> EPC --> UE --> N1

The problem is your assumption... EPC can not see N1.
You need to install NAT also on the EPC.
See previous discussions on this matter here https://groups.google.com/d/msg/ns-3-users/Z7Jbw0fFujQ/Ucuzd95hAj0J

Gooner 내려왔다

unread,
Apr 19, 2016, 9:12:27 PM4/19/16
to ns-3-users
Hi Konstantinos,
   Thanks for the help. Much appreciated.
I used NAT on EPC and scenario 2, which was not working  in 2 way before, started working 2 way(with no network N1 added)

When network N1 is added,

RH --> EPC --> UE --> N1
connection from N1 to RH work smoothly. But from RH to N1, the packets get dropped at EPC. This is because, EPC can not see N1. So I added a NAT on UE, which makes N1 looks like in same subnet as UE. But it is not helping(ie same result like without using NAT on UE). This could be because, when packet reach at EPC, it try to look for eNB and UE combination for the corresponding IP address. But it would not find since its a random value from NAT node.
From my reading, I understood that EpcSgwPgwApplication::RecvFromTunDevice() drop the packets if not correct combination is found. But how do I make EpcSgwPgwApplication aware of the topology?

I know, I asked a few questions. Thanks a lot and hopefully, this will be last one.

Thanks,
G4L

Gooner 내려왔다

unread,
Apr 20, 2016, 3:21:55 PM4/20/16
to ns-3-users
Please refer the code attached here.


LTE_work3.cc

Konstantinos

unread,
Apr 21, 2016, 4:04:43 AM4/21/16
to ns-3-users
Hi,

I can't run your scenario since I do not have NAT and it is not a module in the main ns-3 codebase.
I do not know how 'good' is the implementation of that NAT.
The fact that the packets are dropped at the EPC and you install NAT on the UE is not clear to me. On the UE a simple static route would be enough. 
You will need to work on the EPC and specifically the RecvFromTunDevice(). I do not know exactly what needs to be changed. Use a debugger to identify where they are dropped and try to alter that behaviour.

내려왔다Gooner

unread,
Apr 21, 2016, 2:23:49 PM4/21/16
to ns-3-...@googlegroups.com
I have already installed NAT on EPC. It is after this implementation where scenario 2(without network N1) starting working forward and backward. If NAT is not applied on EPC, then packet drop happens at RH as it will not be able to figure out where to send. Now packet drop happens at EPC.
The reason, I mentioned NAT on UE specifically is because, EPC is not able understand the IP address they obtained from the NAT node. So I thought NATing on UE should solve the problem, which unfortunately did not make any change.

I will definitely work on debugger to understand the problem. If you are having any other thoughts, let me know

Thanks a lot,
G4L

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/ztodDgMSWtA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

Gooner 내려왔다

unread,
Apr 21, 2016, 9:19:29 PM4/21/16
to ns-3-users
Hi Konstantinos,
    The problem is happening, because data packet is addressed to 7:0:0:100 (IP address obtained from NAT on UE node). But EPC can not find any matching UE for this IP address. Hence the function SendToS1uSocket can not be executed. Hence data can not be sent  to its respective eNB and then to  UE and then to N1 node.
Let me know if there is any way to route a packet inside EPC, but with an IP address of any UE present inside.

Please refer the screenshot.

I am using below routing from N1 to RH
Ipv4StaticRoutingHelper ipv4RoutingHelper;
    Ptr<Ipv4StaticRouting> sensor0StaticRouting = ipv4RoutingHelper.GetStaticRouting (sensorNodeContainer.Get (0)->GetObject<Ipv4> ());
    sensor0StaticRouting->AddNetworkRouteTo (Ipv4Address ("1.0.0.0"), Ipv4Mask ("255.0.0.0"), csmaIpv4InterfaceContainer.GetAddress (0), 1);

Is there any way where I can use the reverse, like below (which does not do any data packet transmission so far. I just want to try this possibility as well)

Ipv4StaticRoutingHelper ipv4RoutingHelper;
     Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
    remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("20.0.0.0"), Ipv4Mask ("255.0.0.0"),internetIpIfaces.GetAddress (0), 1);
I tried with all the possble hop, but nothing helped me.

Hoping for some kind of good news.


Cheers,
G4L
LTE2.png

Gooner 내려왔다

unread,
May 2, 2016, 7:15:38 AM5/2/16
to ns-3-users
Hi All,
 It was a minor problem in my routing from PGW to network N1. Everything is sorted out now. Thanks Konstantinos for your help.

Summarizing for those who will try same topology
1. Apply static routing on N1 node to RH with proper hop
2. Apply NAT on node which is common to both LTE and network N1
3. Apply NAT on PGW. This is applied to make sure that packets come from RH to PGW. This does not sound very logical. But without NATing this node, I was not getting the packet from RH to PGW.
4. Apply another static routing on PGW, telling that packet should be routed to N1 through proper hop.

Regards,
G4L

Sohail Ahmad

unread,
Feb 8, 2017, 12:02:16 AM2/8/17
to ns-3-users
Hi Gooner & All,
I am working on a scenario (uplink traffic only) where a UE (hybrid WiFi + LTE) can switch packets between WiFi AP and eNb node on the basis of PDR (packet delivery ratio), I facing a problem in routing between UE and WiFi AP, FlowMonitor shows the switch, but actually all packets are still routing to eNb node. please guide me to establish proper routing. if you required I inboxed you my script. Any kind of suggestion would be appreciated. 

Regards
Sohail

Gooner 내려왔다

unread,
Feb 8, 2017, 3:29:58 PM2/8/17
to ns-3-users
Hello Sohail,
  I guess the problem could be because the IP address of wifi and LTE are different
For eg:
RH------pgw--------eNB-------------UE----------WiFi
                                                       7.0.0.2       20.0.0.2
 With above configuration if you try to send packets from WiFi to RH, it will be dropped surely(where it will be dropped depend on where you applied). So you need to apply a network address translation(NAT) on node UE so that all the packets from WiFi will put in IP network of 7.0.0.0. NAT does not come with ns3, you need to add it separately.

Regards,
G

Sohail Ahmad

unread,
Feb 9, 2017, 1:23:54 AM2/9/17
to ns-3-...@googlegroups.com
Hello Gooner,
Thanks for the reply, I really need help, in my scenario I only working on uplink traffic, I think for uplink traffic NAT is not compulsory. I attached my script, please go through it, and suggest me some code snippet of how to add two routings to a single UE. I just want to send packets UE (7.0.0.0) to LTE (1.0.0.0) and also want to switch packets to WiFi (11.0.0.0) during simulation.

 
campus-throughput-exp.cc

Babu

unread,
Feb 11, 2017, 6:58:08 AM2/11/17
to ns-3-users
Can you please upload the latest source code with proper routing?
Message has been deleted

李康达

unread,
Mar 19, 2017, 9:28:36 AM3/19/17
to ns-3-users
Hi Gooner,
     
I also have finished the topology. And I think that third is not necessary. We only need to install NAT in the network connection node.
Best regards,
Kangda Lee

在 2016年5月2日星期一 UTC+8下午7:15:38,Gooner 내려왔다写道:

ERGOU CHEN

unread,
Oct 5, 2020, 10:02:31 AM10/5/20
to ns-3-users
hello, have you completed the LTE+Adhoc in the end? l have the similar problem when l try to set the LTE+adhoc network in ns3, could you please help me? Thanks a lot! 
Regards

Reply all
Reply to author
Forward
0 new messages