Problem with assigning IPv6 to a wifi station Nodes

133 views
Skip to first unread message

murta Maj

unread,
Jan 7, 2016, 5:41:09 PM1/7/16
to ns-3-users
Hi,
I have four linked routers using P2P connection. The RIPngHelper were used to build a routing table for IPv6. I test it using two hosts, each one links to different router, it working. But when I added new router and install an Access Point on this router to create a new domain contains 10 Station nodes I got the following error message

'--SimulatorImplementationType=ns3::VisualSimulatorImpl'] terminated with signal SIGSEGV. Run it under a debugger to get more information
the debugger gave me this type of error:
TypeError: not all arguments converted during string formatting.

I am followed the examples to write the code and tried to correct this error but I cann't.
I will be thankful if any one could tell me how to solve this problem.

Many Thanks
mynet1.cc

Tommaso Pecorella

unread,
Jan 7, 2016, 7:30:57 PM1/7/16
to ns-3-users
Hi,

multiple problems you have, yes...

  //Domain 1
  ipv6
.SetBase (Ipv6Address ("2001:3::"), Ipv6Prefix (64));
 
Ipv6InterfaceContainer i10 = ipv6.Assign (staDevices1);
  i10
= ipv6.Assign(apDevices1);
  i10
.SetForwarding (1, false);
  i10
.SetDefaultRouteInAllNodes (1);

i10 is assigned twice. Are you sure it's what you wanted ?
Moreover, you're setting the router's properties (forwarding and default router in the nodes) in a rather puzzling way.
I don't really care why you want the router to be not forwarding (!), but the last line is telling all the nodes in the container to use the node 1 as  the default router. Problem is: you have 11 nodes, and the AP is node 10, not node 1 (it's counting from 0).
The error itself (rather non-informative, I'll push a fix) is because no Ipv6StaticRouting could be found on the AP (node 10), and you're trying to setup a default route in the AP, pointing a STA. Definitely not right.

I'd suggest to reorder the nodes in the container, and to have the AP in the zero-th position. In this way you'll not mess up when you'll change the number of STAs.

Cheers,

T.

Tommaso Pecorella

unread,
Jan 7, 2016, 7:34:54 PM1/7/16
to ns-3-users
Forgot...

there *could* be a bug in RipNg. If you're using ns-3-dev and you get one more segmentation fault, try upgrading.

Cheers,

T.

Tommaso Pecorella

unread,
Jan 7, 2016, 7:40:49 PM1/7/16
to ns-3-users
Forgot that I forgot...

if you don't add a Simulation::Stop somewhere, the simulation will never stop (RipNg keeps it going).

Cheers,

T.

murta Maj

unread,
Jan 7, 2016, 9:19:18 PM1/7/16
to ns-3-users
Hi Tommaso,

Thank you for your quick replay, your advice solved this problem.

Thanks

murta Maj

unread,
Jan 9, 2016, 9:37:25 PM1/9/16
to ns-3-users
Hi,

I am facing another problem with this code. As Tommaso suggested, I rearranged the nodes  as below 


ipv6.SetBase (Ipv6Address ("2001:3::"), Ipv6Prefix (64));
  Ipv6InterfaceContainer i10; // Domain1 AP1+D1StaNodes
  i10 = ipv6.Assign(apDevices1);
  i10 = ipv6.Assign (staDevices1);
  i10.SetForwarding (1, true);
  //i10.SetDefaultRouteInAllNodes(0);

It is works when the node received a traffic, But when I installed another application in this network the traffic can't forward to the next router. I think it the node couldn't find the AP as it send the traffic to the 0th node od stDevices1.

I don't know what is the wrong. I did the following
1 Create 4 routers and activated RIPng routing and test it with two nodes it works.
2 create another router (wAP1) linked with one of the previous routers.
3 follow third.cc example to create wifi AP network
   -   Create node container (D1AP) and assign (wAP1) to this container
   -  Create STaNodes container
    -  Install WiFi links in the AP and StaNodes
4 assign IPv6 address in the code above.

Could any one please tell me what I my error? Why the node can receive a traffic but can't sent a traffic to outside node?
Many Thanks,
M.

Tommaso Pecorella

unread,
Jan 10, 2016, 8:38:37 AM1/10/16
to ns-3-users
  ipv6.SetBase (Ipv6Address ("2001:3::"), Ipv6Prefix (64));
 
Ipv6InterfaceContainer i10; // Domain1 AP1+D1StaNodes
  i10
= ipv6.Assign(apDevices1);
  i10
= ipv6.Assign (staDevices1);

  i10
.SetForwarding (0, true);
  i10
.SetDefaultRouteInAllNodes(0);

The SetForwarding is necessary, or the AP will not forward the packets.
SetDefaultRoute is necessary as well, because the STAs doesn't have RIP. You could avoid to install manually the default route in the STAs only if you use RADVD.

Cheers,

T.

murta Maj

unread,
Jan 10, 2016, 9:53:13 PM1/10/16
to ns-3-users
Dear all,

Thank you for your answer, Tommaso.
I made the suggested changes but the problem is the same. the problem is the node send the packets to  node 1 while AP is node 0!. I can't understand why this happened. I am afraid there is some error in AP node creation steps and like it with a P2P node.
Could you please advice me what is the problem?

Thanks,
M.   
mynet2.cc

Tommaso Pecorella

unread,
Jan 11, 2016, 4:21:31 PM1/11/16
to ns-3-users
Enter code here...

Hi,

again, several small problems. The major one is that you did not fix one I already signaled.
  i10 = ipv6.Assign (apDevices1);
  i10
= ipv6.Assign (staDevices1);

The second line will overwrite the content of i10, making it impossible to use it later for assigning the default router.
It should be:
  i10 = ipv6.Assign (apDevices1);
  i10
.Add (ipv6.Assign (staDevices1));
but due to a bug the above code will not work (unless you use the very latest ns-3-dev).
A workaround is:
  i10 = ipv6.Assign (apDevices1);
 
Ipv6InterfaceContainer i10tmp = ipv6.Assign (staDevices1);
  i10
.Add (i10tmp;

Then there's an issue with the applications and the IP addresses. Since you actually shifted the IP addresses of the STA devices (the "1" being the AP), you have to shift accordingly the applications setup:
  OnOffHelper onoff ("ns3::UdpSocketFactory",
                     
Address (Inet6SocketAddress (i10.GetAddress(4, 1), port1)));
...
 apps
= sink.Install (D1StaNodes.Get(3));


Then it will work.

Details... they are important.

Cheers,

T.


Ausama Majeed

unread,
Jan 11, 2016, 6:28:59 PM1/11/16
to ns-3-...@googlegroups.com
Hi Tommaso,

Thank you for your answer.
I am new NS3 user and I need your advise for the good reference guide for the beginners.

Cheers
M. 

--
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/08GxHBXhBww/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.

Tommaso Pecorella

unread,
Jan 11, 2016, 8:49:33 PM1/11/16
to ns-3-users
Reference guide for beginners ?
The tutorial and the material listed here: https://www.nsnam.org/documentation/ (presentations, videos, etc.) and a LOT of patience.
The examples in the examples folder and in the modules folders (i.e., src/*/examples) are also very helpful.
Plus, if you have any doubt you can ask.

Cheers,

T.
Reply all
Reply to author
Forward
0 new messages