Bug 1745 - There can be only one Ipv6AddressHelper in a script.
There can be only one Ipv6AddressHelper in a script.
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: ipv6
ns-3-dev
All All
: P5 normal
Assigned To: Tommaso Pecorella
:
: 1749 (view as bug list)
Depends on: 1749
Blocks: 2312
  Show dependency treegraph
 
Reported: 2013-08-07 09:32 EDT by francisco javier sanchez-roselly
Modified: 2018-02-07 18:52 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description francisco javier sanchez-roselly 2013-08-07 09:32:51 EDT
When using more than one Ipv6AddressHelper in a source file, configured with different base network numbering, the simulator considers the one latterly declared. 

That is, as expected, the following sample of code will assign to ic1 addresses in the range of network 2001:1::/64, whilst for ic2 the assigned addresses belongs to the network 2001:2::/64, given that nc1 and nc2 are NetDeviceContainers previously declared.
  
  Ipv6AddressHelper helper1;
  helper1.SetBase (Ipv6Address ("2001:1::"), Ipv6Prefix (64));
  Ipv6InterfaceContainer ic1 = helper1.Assign (nc1);

  Ipv6AddressHelper helper2;
  helper2.SetBase (Ipv6Address ("2001:2::"), Ipv6Prefix (64));
  Ipv6InterfaceContainer ic2 = helper2.Assign (nc2);

Nevertheless, the following piece of code will assign to ic1 and ic2 addresses in the range of the network 2001:2::/64, given that nc1 and nc2 are NetDeviceContainers previously declared.

  Ipv6AddressHelper helper1;
  helper1.SetBase (Ipv6Address ("2001:1::"), Ipv6Prefix (64));

  Ipv6AddressHelper helper2;
  helper2.SetBase (Ipv6Address ("2001:2::"), Ipv6Prefix (64));

  Ipv6InterfaceContainer ic1 = helper1.Assign (nc1);

  Ipv6InterfaceContainer ic2 = helper2.Assign (nc2);
Comment 1 Tommaso Pecorella 2015-02-05 10:12:56 EST
*** Bug 1749 has been marked as a duplicate of this bug. ***
Comment 2 Tommaso Pecorella 2018-02-05 23:17:52 EST
I found the problem.
Ipv4AddressGenerator and Ipv6Addressgenerators are dramatically different, and this is causing big headaches.

I'll put the v6 in sync with the v4 one as soon as possible.
Comment 3 Tommaso Pecorella 2018-02-07 18:52:46 EST
Pushed in changeset:   13277:8866bd5fa6d8