Bug 1745

Summary: There can be only one Ipv6AddressHelper in a script.
Product: ns-3 Reporter: francisco javier sanchez-roselly <franciscojavier.sanchezroselly>
Component: ipv6Assignee: Tommaso Pecorella <tommaso.pecorella>
Status: RESOLVED FIXED    
Severity: normal CC: bbojovic, ns-bugs, tommaso.pecorella
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   
Bug Depends on: 1749    
Bug Blocks: 2312    

Description francisco javier sanchez-roselly 2013-08-07 09:32:51 UTC
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 UTC
*** Bug 1749 has been marked as a duplicate of this bug. ***
Comment 2 Tommaso Pecorella 2018-02-05 23:17:52 UTC
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 UTC
Pushed in changeset:   13277:8866bd5fa6d8