Bug 1432 - align Ipv6AddressHelper API with IPv4AddressHelper API
align Ipv6AddressHelper API with IPv4AddressHelper API
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: ipv6
pre-release
All All
: P5 normal
Assigned To: Tommaso Pecorella
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-20 18:19 UTC by Tom Henderson
Modified: 2012-05-24 02:11 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Henderson 2012-05-20 18:19:16 UTC
The current usage pattern for IPv6 address assignment is different than that for IPv4 address assignment; e.g. in examples/udp/udp-echo.cc:

  if (useV6 == false)
    {
      Ipv4AddressHelper ipv4;
      ipv4.SetBase ("10.1.1.0", "255.255.255.0");
      Ipv4InterfaceContainer i = ipv4.Assign (d);
      serverAddress = Address(i.GetAddress (1));
    }
  else
    {
      Ipv6AddressHelper ipv6;
      ipv6.NewNetwork ("2001:0000:f00d:cafe::", 64);
      Ipv6InterfaceContainer i6 = ipv6.Assign (d);
      serverAddress = Address(i6.GetAddress (1,1));
    }

I would like to change the IPv6AddressHelper API to align it with IPv4AddressHelper API.  Specifically, the following usage pattern exists for IPv4:

  SetBase (network, prefix, (optional) host portion);  // used to reset
  NewNetwork (void);  //used to increment the network portion
  NewAddress (void); // used to increment the host portion
  Ipv4InterfaceContainer Assign (const NetDeviceContainer &c);  // for containers

I would like to align IPv6 with this.  The main change is to deprecate (with NS_DEPRECATED) all calls to "NewNework (network, prefix)" and replace them with SetBase (network, prefix).  

I would like to make this change before ns-3.14 release because ns-3.14 (with addition of transport protocols) will start more widespread usage of IPv6 code in ns-3, so it would be good to convert before this.

Code review patch to follow.
Comment 1 Tom Henderson 2012-05-20 18:41:38 UTC
Codereview at:  http://codereview.appspot.com/6226043
Comment 2 Tommaso Pecorella 2012-05-21 06:43:36 UTC
I didn't test the code on my ns-3, but looking at the code (i.e., dry check) I'm ok with it.

I assume that everything is working as intended, tho.

+1
Comment 3 Tom Henderson 2012-05-24 02:11:31 UTC
changeset 5d8dfd7c6609