Public Member Functions | Static Public Member Functions | Static Public Attributes

ns3::Ipv6 Class Reference
[Ipv6]

Access to the IPv6 forwarding table, interfaces, and configuration. More...

#include <ipv6.h>

Inheritance diagram for ns3::Ipv6:
Inheritance graph
[legend]
Collaboration diagram for ns3::Ipv6:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Ipv6 ()
 Constructor.
virtual ~Ipv6 ()
 Destructor.
virtual void SetRoutingProtocol (Ptr< Ipv6RoutingProtocol > routingProtocol)=0
 Register a new routing protocol to be used by this IPv6 stack.
virtual Ptr< Ipv6RoutingProtocolGetRoutingProtocol (void) const =0
 Get the routing protocol to be used by this IPv6 stack.
virtual uint32_t AddInterface (Ptr< NetDevice > device)=0
 Add a NetDevice interface.
virtual uint32_t GetNInterfaces (void) const =0
 Get number of interfaces.
virtual int32_t GetInterfaceForAddress (Ipv6Address address) const =0
 Return the interface number of the interface that has been assigned the specified IP address.
virtual int32_t GetInterfaceForPrefix (Ipv6Address address, Ipv6Prefix mask) const =0
 Return the interface number of first interface found that has an IPv6 address within the prefix specified by the input address and mask parameters.
virtual Ptr< NetDeviceGetNetDevice (uint32_t interface)=0
 Get the NetDevice of the specified interface number.
virtual int32_t GetInterfaceForDevice (Ptr< const NetDevice > device) const =0
 Get the interface index of the specified NetDevice.
virtual bool AddAddress (uint32_t interface, Ipv6InterfaceAddress address)=0
 Add an address on the specified IPv6 interface.
virtual uint32_t GetNAddresses (uint32_t interface) const =0
 Get number of addresses on specified IPv6 interface.
virtual Ipv6InterfaceAddress GetAddress (uint32_t interface, uint32_t addressIndex) const =0
 Get IPv6 address on specified IPv6 interface.
virtual bool RemoveAddress (uint32_t interface, uint32_t addressIndex)=0
 Remove an address on specified IPv6 interface.
virtual void SetMetric (uint32_t interface, uint16_t metric)=0
 Set metric on specified Ipv6 interface.
virtual uint16_t GetMetric (uint32_t interface) const =0
 Get metric for the specified IPv6 interface.
virtual uint16_t GetMtu (uint32_t interface) const =0
 Get MTU for the specified IPv6 interface.
virtual bool IsUp (uint32_t interface) const =0
 If the specified interface index is in "up" state.
virtual void SetUp (uint32_t interface)=0
 Set the interface into the "up" state.
virtual void SetDown (uint32_t interface)=0
 Set the interface into the "down" state.
virtual bool IsForwarding (uint32_t interface) const =0
 If the specified IPv6 interface has forwarding enabled.
virtual void SetForwarding (uint32_t interface, bool val)=0
 Set forwarding on specified IPv6 interface.
virtual void RegisterExtensions ()=0
 Register the IPv6 Extensions.
virtual void RegisterOptions ()=0
 Register the IPv6 Options.

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::Ipv6.

Static Public Attributes

static const uint32_t IF_ANY = 0xffffffff
 Any interface magic number.

Detailed Description

Access to the IPv6 forwarding table, interfaces, and configuration.

This class defines the API to manipulate the following aspects of the IPv6 implementation:

  1. set/get an Ipv6RoutingProtocol
  2. register a NetDevice for use by the IPv6 layer (basically, to create IPv6-related state such as addressing and neighbor cache that is associated with a NetDevice)
  3. manipulate the status of the NetDevice from the IPv6 perspective, such as marking it as Up or Down,
  4. adding, deleting, and getting addresses associated to the IPv6 interfaces.
  5. exporting IPv6 configuration attributes

Each NetDevice has conceptually a single IPv6 interface associated with it (the corresponding structure in the Linux IPv6 implementation is struct in_device). Each interface may have one or more IPv6 addresses associated with it. Each IPv6 address may have different subnet mask, scope, etc., so all of this per-address information is stored in an Ipv6InterfaceAddress class (the corresponding structure in Linux is struct in6_ifaddr)

IPv6 attributes such as whether IP forwarding is enabled and disabled are also stored in this class

TO DO: Add API to allow access to the IPv6 neighbor table

See also:
Ipv6RoutingProtocol
Ipv6InterfaceAddress

Member Function Documentation

virtual bool ns3::Ipv6::AddAddress ( uint32_t  interface,
Ipv6InterfaceAddress  address 
) [pure virtual]

Add an address on the specified IPv6 interface.

Parameters:
interface Interface number of an IPv6 interface
address Ipv6InterfaceAddress address to associate with the underlying IPv6 interface
Returns:
true if the operation succeeded

Implemented in ns3::Ipv6L3Protocol.

virtual uint32_t ns3::Ipv6::AddInterface ( Ptr< NetDevice device  )  [pure virtual]

Add a NetDevice interface.

Once a device has been added, it can never be removed: if you want to disable it, you can invoke Ipv6::SetDown which will make sure that it is never used during packet forwarding.

Parameters:
device device to add to the list of IPv6 interfaces which can be used as output interfaces during packet forwarding.
Returns:
the index of the IPv6 interface added.

Implemented in ns3::Ipv6L3Protocol.

virtual Ipv6InterfaceAddress ns3::Ipv6::GetAddress ( uint32_t  interface,
uint32_t  addressIndex 
) const [pure virtual]

Get IPv6 address on specified IPv6 interface.

Because addresses can be removed, the addressIndex is not guaranteed to be static across calls to this method.

Parameters:
interface Interface number of an IPv6 interface
addressIndex index of Ipv6InterfaceAddress
Returns:
the Ipv6InterfaceAddress associated to the interface and addressIndex

Implemented in ns3::Ipv6L3Protocol.

virtual int32_t ns3::Ipv6::GetInterfaceForAddress ( Ipv6Address  address  )  const [pure virtual]

Return the interface number of the interface that has been assigned the specified IP address.

Parameters:
address The IP address being searched for
Returns:
The interface number of the IPv6 interface with the given address or -1 if not found.

Each IP interface has one or more IP addresses associated with it. This method searches the list of interfaces for one that holds a particular address. This call takes an IP address as a parameter and returns the interface number of the first interface that has been assigned that address, or -1 if not found. There must be an exact match.

Implemented in ns3::Ipv6L3Protocol.

virtual int32_t ns3::Ipv6::GetInterfaceForDevice ( Ptr< const NetDevice device  )  const [pure virtual]

Get the interface index of the specified NetDevice.

Parameters:
device The NetDevice for an Ipv6Interface
Returns:
The interface number of an IPv6 interface or -1 if not found.

Implemented in ns3::Ipv6L3Protocol.

virtual int32_t ns3::Ipv6::GetInterfaceForPrefix ( Ipv6Address  address,
Ipv6Prefix  mask 
) const [pure virtual]

Return the interface number of first interface found that has an IPv6 address within the prefix specified by the input address and mask parameters.

Parameters:
address The IP address assigned to the interface of interest.
mask The IP prefix to use in the mask
Returns:
The interface number of the IPv6 interface with the given address or -1 if not found.

Each IP interface has one or more IP addresses associated with it. This method searches the list of interfaces for the first one found that holds an address that is included within the prefix formed by the input address and mask parameters. The value -1 is returned if no match is found.

Implemented in ns3::Ipv6L3Protocol.

virtual uint16_t ns3::Ipv6::GetMetric ( uint32_t  interface  )  const [pure virtual]

Get metric for the specified IPv6 interface.

Parameters:
interface The interface number of an IPv6 interface
Returns:
routing metric (cost) associated to the underlying IPv6 interface

Implemented in ns3::Ipv6L3Protocol.

virtual uint16_t ns3::Ipv6::GetMtu ( uint32_t  interface  )  const [pure virtual]

Get MTU for the specified IPv6 interface.

Parameters:
interface Interface number of IPv6 interface
Returns:
the Maximum Transmission Unit (in bytes) associated to the underlying IPv6 interface

Implemented in ns3::Ipv6L3Protocol.

virtual uint32_t ns3::Ipv6::GetNAddresses ( uint32_t  interface  )  const [pure virtual]

Get number of addresses on specified IPv6 interface.

Parameters:
interface Interface number of an IPv6 interface
Returns:
the number of Ipv6InterfaceAddress entries for the interface.

Implemented in ns3::Ipv6L3Protocol.

virtual Ptr<NetDevice> ns3::Ipv6::GetNetDevice ( uint32_t  interface  )  [pure virtual]

Get the NetDevice of the specified interface number.

Parameters:
interface The interface number of an IPv6 interface.
Returns:
The NetDevice associated with the IPv6 interface number.

Implemented in ns3::Ipv6L3Protocol.

virtual uint32_t ns3::Ipv6::GetNInterfaces ( void   )  const [pure virtual]

Get number of interfaces.

Returns:
the number of interfaces added by the user.

Implemented in ns3::Ipv6L3Protocol.

virtual Ptr<Ipv6RoutingProtocol> ns3::Ipv6::GetRoutingProtocol ( void   )  const [pure virtual]

Get the routing protocol to be used by this IPv6 stack.

Returns:
smart pointer to Ipv6RoutingProtocol object, or null pointer if none

Implemented in ns3::Ipv6L3Protocol.

static TypeId ns3::Ipv6::GetTypeId ( void   )  [static]

This method returns the TypeId associated to ns3::Ipv6.

This object is accessible through the following paths with Config::Set and Config::Connect:

  • /NodeList/[i]/DeviceList/[i]/$ns3::AlohaNoackNetDevice/Phy/$ns3::Ipv6
  • /NodeList/[i]/DeviceList/[i]/$ns3::BaseStationNetDevice/BsIpcsPacketClassifier/$ns3::Ipv6
  • /NodeList/[i]/DeviceList/[i]/$ns3::BaseStationNetDevice/LinkManager/$ns3::Ipv6
  • /NodeList/[i]/DeviceList/[i]/$ns3::BaseStationNetDevice/SSManager/$ns3::Ipv6
  • /NodeList/[i]/DeviceList/[i]/$ns3::BaseStationNetDevice/ServiceFlowManager/$ns3::Ipv6
  • /NodeList/[i]/DeviceList/[i]/$ns3::NonCommunicatingNetDevice/Phy/$ns3::Ipv6
  • /NodeList/[i]/DeviceList/[i]/$ns3::SubscriberStationNetDevice/Classifier/$ns3::Ipv6
  • /NodeList/[i]/DeviceList/[i]/$ns3::SubscriberStationNetDevice/LinkManager/$ns3::Ipv6
  • /NodeList/[i]/DeviceList/[i]/$ns3::SubscriberStationNetDevice/SSScheduler/$ns3::Ipv6
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Channel/NoiseModel/$ns3::Ipv6
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Channel/PropagationModel/$ns3::Ipv6
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Mac/$ns3::Ipv6
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Phy/$ns3::Ipv6
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Transducer/$ns3::Ipv6
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::BaseStationNetDevice/BsIpcsPacketClassifier/$ns3::Ipv6
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::BaseStationNetDevice/LinkManager/$ns3::Ipv6
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::BaseStationNetDevice/SSManager/$ns3::Ipv6
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::BaseStationNetDevice/ServiceFlowManager/$ns3::Ipv6
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::SubscriberStationNetDevice/Classifier/$ns3::Ipv6
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::SubscriberStationNetDevice/LinkManager/$ns3::Ipv6
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::SubscriberStationNetDevice/SSScheduler/$ns3::Ipv6
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/BandwidthManager/$ns3::Ipv6
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/BurstProfileManager/$ns3::Ipv6
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/Channel/$ns3::UanChannel/NoiseModel/$ns3::Ipv6
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/Channel/$ns3::UanChannel/PropagationModel/$ns3::Ipv6
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/ConnectionManager/$ns3::Ipv6
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/Phy/Channel/$ns3::UanChannel/NoiseModel/$ns3::Ipv6
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/Phy/Channel/$ns3::UanChannel/PropagationModel/$ns3::Ipv6

Attributes defined for this type:

  • IpForward: Globally enable or disable IP forwarding for all current and future IPv6 devices.
    • Set with class: BooleanValue
    • Underlying type: bool
    • Initial value: false
    • Flags: construct write read

No TraceSources defined for this type.

Reimplemented from ns3::Object.

Reimplemented in ns3::Ipv6L3Protocol.

virtual bool ns3::Ipv6::IsForwarding ( uint32_t  interface  )  const [pure virtual]

If the specified IPv6 interface has forwarding enabled.

Parameters:
interface Interface number of IPv6 interface
Returns:
true if IPv6 forwarding enabled for input datagrams on this device

Implemented in ns3::Ipv6L3Protocol.

virtual bool ns3::Ipv6::IsUp ( uint32_t  interface  )  const [pure virtual]

If the specified interface index is in "up" state.

Parameters:
interface Interface number of IPv6 interface
Returns:
true if the underlying interface is in the "up" state, false otherwise.

Implemented in ns3::Ipv6L3Protocol.

virtual bool ns3::Ipv6::RemoveAddress ( uint32_t  interface,
uint32_t  addressIndex 
) [pure virtual]

Remove an address on specified IPv6 interface.

Remove the address at addressIndex on named interface. The addressIndex for all higher indices will decrement by one after this method is called; so, for example, to remove 5 addresses from an interface i, one could call RemoveAddress (i, 0); 5 times.

Parameters:
interface Interface number of an IPv6 interface
addressIndex index of Ipv6InterfaceAddress to remove
Returns:
true if the operation succeeded

Implemented in ns3::Ipv6L3Protocol.

virtual void ns3::Ipv6::SetDown ( uint32_t  interface  )  [pure virtual]

Set the interface into the "down" state.

In this state, it is ignored during IPv6 forwarding.

Parameters:
interface Interface number of IPv6 interface

Implemented in ns3::Ipv6L3Protocol.

virtual void ns3::Ipv6::SetForwarding ( uint32_t  interface,
bool  val 
) [pure virtual]

Set forwarding on specified IPv6 interface.

Parameters:
interface Interface number of IPv6 interface
val Value to set the forwarding flag

If set to true, IPv6 forwarding is enabled for input datagrams on this device

Implemented in ns3::Ipv6L3Protocol.

virtual void ns3::Ipv6::SetMetric ( uint32_t  interface,
uint16_t  metric 
) [pure virtual]

Set metric on specified Ipv6 interface.

Parameters:
interface The interface number of an IPv6 interface
metric routing metric (cost) associated to the underlying IPv6 interface

Implemented in ns3::Ipv6L3Protocol.

virtual void ns3::Ipv6::SetRoutingProtocol ( Ptr< Ipv6RoutingProtocol routingProtocol  )  [pure virtual]

Register a new routing protocol to be used by this IPv6 stack.

This call will replace any routing protocol that has been previously registered. If you want to add multiple routing protocols, you must add them to a Ipv6ListRoutingProtocol directly.

Parameters:
routingProtocol smart pointer to Ipv6RoutingProtocol object

Implemented in ns3::Ipv6L3Protocol.

virtual void ns3::Ipv6::SetUp ( uint32_t  interface  )  [pure virtual]

Set the interface into the "up" state.

In this state, it is considered valid during IPv6 forwarding.

Parameters:
interface Interface number of IPv6 interface

Implemented in ns3::Ipv6L3Protocol.


The documentation for this class was generated from the following files: