All Classes Namespaces Files Functions Pages
Layer3.IPv6 Class Reference

A class representing the IPv6 protocol that allows managing IPv6 settings, running IPv6 commands and accessing attached protocols. More...

Methods

 Description.Get
 Returns a textual description of the object.
 
 Destructor
 
 Gateway.Advertised.Get
 Returns the current (preferred) gateway of this IPv6 protocol, set either manually or by performing DHCP or SLAAC. More...
 
 Gateway.Manual.Get
 Returns the current manual configured gateway of this IPv6 protocol. More...
 
 Gateway.Manual.Set
 configures the manual gateway. More...
 
 Ip.Add address
 Adds a manual IPv6 address to the port. More...
 
 Ip.Clear
 Removes all manually added IP addresses from this port. More...
 
 Ip.Dhcp.Get
 Returns all IPv6 addresses that where obtained by the DHCPv6 protocol. More...
 
 Ip.LinkLocal.Get
 Returns the linklocal address which is based on the MAC address of the port. More...
 
 Ip.Manual.Add address
 Adds a manual IPv6 address to the port. More...
 
 Ip.Manual.Clear
 Removes all manually added IP addresses from this port. More...
 
 Ip.Manual.Get
 Returns all IPv6 addresses that where manually added by the user. More...
 
 Ip.Manual.Remove address
 Removes a specified manually added IP address from this port. More...
 
 Ip.Remove address
 Removes a specified manually added IP address from this port. More...
 
 Ip.Stateless.Get
 Returns all IPv6 addresses that where obtained by stateless autoconfiguration. More...
 
 Parent.Get
 Returns the parent object.
 
 Protocol.Dhcp.Get
 Returns the DHCPv6 protocol attached to this protocol through which DHCP can be performed. More...
 
 Protocol.Icmp.Get
 Returns the ICMPv6 protocol attached to this protocol that allows starting ICMP sessions. More...
 
 Protocol.Mld.Get
 Returns the MLD protocol. More...
 
 Protocol.NeighborDiscovery address
 Resolves a destination IPv6 address by explicitly performing Neighbor Discovery. More...
 
 Resolve address
 Resolves a destination IPv6 address by looking in the neighbour cache or performing Neighbor Discovery. More...
 
 StatelessAutoconfiguration.Async
 Performs stateless address autoconfiguration (SLAAC) to configure IPv6 with, among others, a global IPv6 address. More...
 
 StatelessAutoconfiguration
 Performs stateless address autoconfiguration (SLAAC) to configure IPv6 with, among others, a global IPv6 address. More...
 

Class overview

A class representing the IPv6 protocol that allows managing IPv6 settings, running IPv6 commands and accessing attached protocols.

Each ByteBlowerPort must be configured with a layer 3 protocol through the method ByteBlowerPort::Layer3.IPv6.Set. If the IPv6 protocol is selected, this object is returned. Through it, the IPv6 protocol instance on that port can be configured.

It provides the following functionality:

  • Configure and read various IPv6 settings and values such as the IP address.
  • Execute IPv6 commands such as resolving IPv6 addresses (through NDP).
  • Access protocols attached to the IPv6 protocol such as DHCPv6 and ICMPv6 on which other settings can be configured and other commands can be executed.

Definition at line 6157 of file api.tcl.

Method documentation

Layer3.IPv6::Destructor
Warning
This object cannot be destroyed. An exception will be thrown when this method is called.

Definition at line 6168 of file api.tcl.

Layer3.IPv6::Gateway.Advertised.Get

Returns the current (preferred) gateway of this IPv6 protocol, set either manually or by performing DHCP or SLAAC.

Since
2.1.0

The first time an IP address is added (either manually or by performing DHCP or SLAAC) the preferred gateway is also automatically detected. From that moment on, it can be retrieved by this method.

When no gateway is found when the IP is set (manually, through DHCP or SLAAC) the gateway is set to the null address (::). Every time this getter is called, IPv6 will look for router advertisements. If one is found, it will be updated automatically.

Once the preferred gateway is set using Gateway.Manual.Set, this value remains the preferred gateway until it is explicitly replaced. Performing DHCP or SLAAC again will not replace the manually set value. This may change in the future.

Exceptions
ByteBlower.Protocol.UnavailableThis protocol is not initialized until a first IP is set (by adding an IP address manually, performing SLAAC or performing DHCP). Calling this method before that is done causes this exception.
Example

This example retrieves the current gateway.

1 $ipv6 Gateway.Advertised.Get

Returns:

fe80:0000:0000:0000:0290:0eff:fe1c:e44d 

Definition at line 6188 of file api.tcl.

Layer3.IPv6::Gateway.Manual.Get

Returns the current manual configured gateway of this IPv6 protocol.

Since
2.1.0
Exceptions
ByteBlower.Protocol.UnavailableThis protocol is not initialized until a first IP is set (by adding an IP address manually, performing SLAAC or performing DHCP). Calling this method before that is done causes this exception.
Example

This example retrieves the current gateway.

1 $ipv6 Gateway.Manual.Get

Returns:

fe80:0000:0000:0000:0290:0eff:fe1c:e44d 

Definition at line 6202 of file api.tcl.

Layer3.IPv6::Gateway.Manual.Set

configures the manual gateway.

Since
2.1.0

The current IPv6 implementation is limited to a single gateway. This is the preferred gateway. This may change in the future.

Exceptions
ByteBlower.Protocol.InvalidValueSetting one of the port's own IP addresses as gateway is not possible and causes this exception.
ByteBlower.Protocol.AddressUnavailableExplicitly setting an unresolvable IPv6 address as gateway causes this exception.
ByteBlower.Protocol.UnavailableThis protocol is not initialized until a first IP is set (by adding an IP address manually, performing SLAAC or performing DHCP). Calling this method before that is done causes this exception.
Example

This example sets the current gateway.

1 $ipv6 Gateway.Manual.Set fe80:0000:0000:0000:0290:0eff:fe1c:e44d

Definition at line 6222 of file api.tcl.

Layer3.IPv6::Ip.Add   address  

Adds a manual IPv6 address to the port.

Deprecated:
since 2.1.0, please use Ip.Manual.Add .

An IPv6 host can have multiple IPv6 addresses at the same time. ByteBlower divides these addresses in four categories: manually added addresses, addresses obtained through the DHCP protocol, addresses obtained using stateless address autoconfiguration (SLAAC) and linklocal addresses.

This method adds such a manual IP address to the port. Note this method also adds the prefix derived from the specified address to the list of on-link prefixes.

If the IPv6 protocol is not yet initialized, calling this method the first time will do so. This initialization causes the host's link-local address to be generated and looks for router advertisements to set the default gateway. If no router advertisement occurs, the gateway is set to the null address (::).

Parameters
addressThe IPv6 address you want to add. The IPv6 address may be written in any valid IPv6 addressing format. For example, removing leading zeros within a group, compressing adjacent groups of zeros, .... A custom prefix length can be provided by appending this argument with '/<prefix length>', where <prefix length> can be a number between 0 and 128. If no such prefix length is appended, the default length of 64 is taken.
Example

This examples adds a global address address using default prefix length 64.

1 $ipv6 Ip.Add 2001:1234::1 $ipv6 Ip.Manual.Get

Returns:

2001:1234:0000:0000:0000:0000:0000:0001/64 

This examples adds a global address address using prefix length 56.

1 $ipv6 Ip.Add 2001:1234::2 $ipv6 Ip.Manual.Get

Returns:

2001:1234:0000:0000:0000:0000:0000:0002/56 

Definition at line 6242 of file api.tcl.

Layer3.IPv6::Ip.Clear

Removes all manually added IP addresses from this port.

Deprecated:
since 2.1.0, please use Ip.Manual.Clear .

An IPv6 host can have multiple IPv6 addresses at the same time. ByteBlower divides these addresses in four categories: manually added addresses, addresses obtained through the DHCP protocol, addresses obtained using stateless address autoconfiguration (SLAAC) and linklocal addresses.

This method removes all addresses in the first category.

Example

This example removes all manually added addresses from the port.

1 $ipv6 Ip.Clear $ipv6 Ip.Manual.Get

Returns:

 

Definition at line 6258 of file api.tcl.

Layer3.IPv6::Ip.Dhcp.Get

Returns all IPv6 addresses that where obtained by the DHCPv6 protocol.

An IPv6 host can have multiple IPv6 addresses at the same time. ByteBlower divides these addresses in four categories: manually added addresses, addresses obtained through the DHCP protocol, addresses obtained using stateless address autoconfiguration (SLAAC) and linklocal addresses.

This method returns all DHCP IPv6 addresses on the port. They are configured by retrieving the DHCP protocol using Protocol.Dhcp.Get and executing Layer5.Dhcpv6::Perform.

Every time this getter is called, IPv6 synchronizes its state by looking for router advertisements. For example, if a router advertisements is found for the first time when calling this method, the gateway property will be set updated automatically.

Returns
A list of IPv6 addresses obtained during DHCP is returned. These addresses are returned using the full (i.e. uncompressed) representation and appended with their prefix lengths (see example). An empty list (i.e. empty string) is returned if no DHCP was performed yet or if it did not provided any IP addresses.
Exceptions
ByteBlower.Protocol.UnavailableThis protocol is not initialized until a first IP is set (by adding an IP address manually, performing SLAAC or performing DHCP). Calling this method before that is done causes this exception.
Example

This example returns the list of IPv6 addresses obtained by DHCP.

1 $ipv6 Ip.Dhcp.Get

Returns:

fdec:5ef9:84b7:4100:0000:ffff:0000:5a38/64 

Definition at line 6278 of file api.tcl.

Layer3.IPv6::Ip.LinkLocal.Get

Returns the linklocal address which is based on the MAC address of the port.

An IPv6 host can have multiple IPv6 addresses at the same time. ByteBlower divides these addresses in four categories: manually added addresses, addresses obtained through the DHCP protocol, addresses obtained using stateless address autoconfiguration (SLAAC) and linklocal addresses.

This method returns the link-local IPv6 address on the port. It uses the dedicated fe80::/64 prefix as the first half of the address and the modified EUI-64 number (based on the Ethernet MAC address) as the last half of the address.

Every time this getter is called, IPv6 synchronizes its state by looking for router advertisements. For example, if a router advertisements is found for the first time when calling this method, the gateway property will be set updated automatically.

Returns
The linklocal IPv6 address is returned. This address does always exist, even if no IPv6 gateway is present. The address is returned using the full (i.e. uncompressed) representation. The prefix length suffix ('/64') is omitted!
Exceptions
ByteBlower.Protocol.UnavailableThis protocol is not initialized until a first IP is set (by adding an IP address manually, performing SLAAC or performing DHCP). Calling this method before that is done causes this exception.
Example

This example returns the link-local address of a port.

1 $ipv6 Ip.LinkLocal.Get

Returns:

fe80:0000:0000:0000:02ff:25ff:fe00:0001 

Definition at line 6298 of file api.tcl.

Layer3.IPv6::Ip.Manual.Add   address  

Adds a manual IPv6 address to the port.

Since
2.1.0

An IPv6 host can have multiple IPv6 addresses at the same time. ByteBlower divides these addresses in four categories: manually added addresses, addresses obtained through the DHCP protocol, addresses obtained using stateless address autoconfiguration (SLAAC) and linklocal addresses.

This method adds such a manual IP address to the port. Note this method also adds the prefix derived from the specified address to the list of on-link prefixes.

If the IPv6 protocol is not yet initialized, calling this method the first time will do so. This initialization causes the host's link-local address to be generated and looks for router advertisements to set the default gateway. If no router advertisement occurs, the gateway is set to the null address (::).

Parameters
addressThe IPv6 address you want to add. The IPv6 address may be written in any valid IPv6 addressing format. For example, removing leading zeros within a group, compressing adjacent groups of zeros, .... A custom prefix length can be provided by appending this argument with '/<prefix length>', where <prefix length> can be a number between 0 and 128. If no such prefix length is appended, the default length of 64 is taken.
Example

This examples adds a global address address using default prefix length 64.

1 $ipv6 Ip.Manual.Add 2001:1234::1 $ipv6 Ip.Manual.Get

Returns:

2001:1234:0000:0000:0000:0000:0000:0001/64 

This examples adds a global address address using prefix length 56.

1 $ipv6 Ip.ManualAdd 2001:1234::2 $ipv6 Ip.Manual.Get

Returns:

2001:1234:0000:0000:0000:0000:0000:0002/56 

Definition at line 6318 of file api.tcl.

Layer3.IPv6::Ip.Manual.Clear

Removes all manually added IP addresses from this port.

Since
2.1.0

An IPv6 host can have multiple IPv6 addresses at the same time. ByteBlower divides these addresses in four categories: manually added addresses, addresses obtained through the DHCP protocol, addresses obtained using stateless address autoconfiguration (SLAAC) and linklocal addresses.

This method removes all addresses in the first category.

Example

This example removes all manually added addresses from the port.

1 $ipv6 Ip.Manual.Clear $ipv6 Ip.Manual.Get

Returns:

 

Definition at line 6334 of file api.tcl.

Layer3.IPv6::Ip.Manual.Get

Returns all IPv6 addresses that where manually added by the user.

An IPv6 host can have multiple IPv6 addresses at the same time. ByteBlower divides these addresses in four categories: manually added addresses, addresses obtained through the DHCP protocol, addresses obtained using stateless address autoconfiguration (SLAAC) and linklocal addresses.

This method returns all manual IPv6 addresses on the port.

Every time this getter is called, IPv6 synchronizes its state by looking for router advertisements. For example, if a router advertisements is found for the first time when calling this method, the gateway property will be set updated automatically.

Returns
A list of manually added IPv6 addresses is returned. These addresses are returned using the full (i.e. uncompressed) representation and appended with their prefix lengths (see example). An empty list (i.e. empty string) is returned if no addresses were added yet.
Exceptions
ByteBlower.Protocol.UnavailableThis protocol is not initialized until a first IP is set (by adding an IP address manually, performing SLAAC or performing DHCP). Calling this method before that is done causes this exception.
Example

This example returns the list of manual IPv6 addresses.

1 $ipv6 Ip.Manual.Get

Returns:

2001:1234:0000:0000:0000:0000:0000:0001/64 2001:1234:0000:0000:0000:0000:0000:0002/56 

Definition at line 6354 of file api.tcl.

Layer3.IPv6::Ip.Manual.Remove   address  

Removes a specified manually added IP address from this port.

Since
2.1.0

An IPv6 host can have multiple IPv6 addresses at the same time. ByteBlower divides these addresses in four categories: manually added addresses, addresses obtained through the DHCP protocol, addresses obtained using stateless address autoconfiguration (SLAAC) and linklocal addresses.

This method removes the specified IPv6 address from the port if it was added manually before. If the address was not added manually, nothing is done.

Parameters
addressThe IPv6 address you want to add. The IPv6 address may be written in any valid IPv6 addressing format. For example, removing leading zeros within a group, compressing adjacent groups of zeros, .... No prefix length suffix (e.g. '/64') may be included!
Example

This example removes the specified address from the port if it was previously added.

1 $ipv6 Ip.Manual.Remove 2001:1234::0001

Definition at line 6372 of file api.tcl.

Layer3.IPv6::Ip.Remove   address  

Removes a specified manually added IP address from this port.

Deprecated:
since 2.1.0, please use Ip.Manual.Remove .

An IPv6 host can have multiple IPv6 addresses at the same time. ByteBlower divides these addresses in four categories: manually added addresses, addresses obtained through the DHCP protocol, addresses obtained using stateless address autoconfiguration (SLAAC) and linklocal addresses.

This method removes the specified IPv6 address from the port if it was added manually before. If the address was not added manually, nothing is done.

Parameters
addressThe IPv6 address you want to add. The IPv6 address may be written in any valid IPv6 addressing format. For example, removing leading zeros within a group, compressing adjacent groups of zeros, .... No prefix length suffix (e.g. '/64') may be included!
Example

This example removes the specified address from the port if it was previously added.

1 $ipv6 Ip.Remove 2001:1234::0001

Definition at line 6390 of file api.tcl.

Layer3.IPv6::Ip.Stateless.Get

Returns all IPv6 addresses that where obtained by stateless autoconfiguration.

An IPv6 host can have multiple IPv6 addresses at the same time. ByteBlower divides these addresses in four categories: manually added addresses, addresses obtained through the DHCP protocol, addresses obtained using stateless address autoconfiguration (SLAAC) and linklocal addresses.

This method returns all SLAAC IPv6 addresses on the port. They are configuredby calling the StatelessAutoconfiguration function.

Every time this getter is called, IPv6 synchronizes its state by looking for router advertisements. For example, if a router advertisements is found for the first time when calling this method, the gateway property will be set updated automatically.

Returns
A list of IPv6 addresses obtained during stateless autoconfiguration (SLAAC) is returned. These addresses are returned using the full (i.e. uncompressed) representation and appended with their prefix lengths (see example). An empty list (i.e. empty string) is returned if no autoconfiguration was performed yet or if it did not provided any IP addresses.
Exceptions
ByteBlower.Protocol.UnavailableThis protocol is not initialized until a first IP is set (by adding an IP address manually, performing SLAAC or performing DHCP). Calling this method before that is done causes this exception.
Example

This example returns the list of IPv6 addresses obtained by Stateless Autoconfiguration.

1 $ipv6 Ip.Stateless.Get

Returns:

fdec:5ef9:84b7:4100:02ff:25ff:fe00:0001/64 

Definition at line 6410 of file api.tcl.

Layer3.IPv6::Protocol.Dhcp.Get

Returns the DHCPv6 protocol attached to this protocol through which DHCP can be performed.

See Layer5.Dhcpv6 for more configuration options. To actually perform DHCP, execute the Layer5.Dhcpv6::Perform method on the returned object.

If the IPv6 protocol is not yet initialized, performing DHCP the first time will do so. This initialization causes the host's link-local address to be generated and looks for router advertisements to set the default gateway. If no router advertisement occurs, the gateway is set to the null address (::) and no address is set.

Returns
The DHCPv6 protocol object attached to this IPv6 protocol. This is an Layer5.Dhcpv6 object.
Example

This example returns the DHCP object.

1 $ipv6 Protocol.Dhcp.Get

Returns:

<Layer5.Dhcpv6 object> 

This example immediately performs DHCP. Nothing is returned, but a DHCP IP address and preferred gateway are set or the relevant exception is thrown.

1 [ $ipv6 Protocol.Dhcp.Get ] Perform

Definition at line 6431 of file api.tcl.

Layer3.IPv6::Protocol.Icmp.Get

Returns the ICMPv6 protocol attached to this protocol that allows starting ICMP sessions.

See Layer3.Icmpv6Protocol for more information on creating ICMP sessions.

Returns
The ICMPv6 protocol object attached to this IPv6 protocol. This is an Layer3.Icmpv6Protocol object.
Example

This example returns the ICMP object.

1 $ipv6 Protocol.Icmp.Get

Returns:

<Layer3.Icmpv6Protocol object> 

Definition at line 6445 of file api.tcl.

Layer3.IPv6::Protocol.Mld.Get

Returns the MLD protocol.

Returns
Object of type Layer4.Mld.
Example

This example gets the MLD protocol object.

1 $l3 Protocol.Mld.Get

Returns:

<Layer4.Mld object> 

Definition at line 6457 of file api.tcl.

Layer3.IPv6::Protocol.NeighborDiscovery   address  

Resolves a destination IPv6 address by explicitly performing Neighbor Discovery.

To use the neighbor cache first when resolving an IPv6 address, execute the Resolve method. This may return significantly faster then this method.

Parameters
addressThe IPv6 address that must be resolved. The IPv6 address may be written in any valid IPv6 addressing format. For example, removing leading zeros within a group, compressing adjacent groups of zeros, .... No prefix length suffix (e.g. '/64') may be included!
Returns
The layer 2 MAC address found for the provided IPv6 address.
Exceptions
ByteBlower.Protocol.Arp.NoReplyWhen nobody replies to the Neighbour Discovery request (i.e. neither the host itself or a forwarding router), this exception is thrown.
Example

This simple example resolves a link-local IPv6 address. This example clearly shows that the host part of a link-local address is based on its layer 2 MAC address.

1 $ipv6 Protocol.NeighborDiscovery fe80:0000:0000:0000:02ff:25ff:fe00:0001

Returns:

00:FF:25:00:00:01 

Definition at line 6475 of file api.tcl.

Layer3.IPv6::Resolve   address  

Resolves a destination IPv6 address by looking in the neighbour cache or performing Neighbor Discovery.

To force this host to perform the Neighbor Discovery algorithm and thus bypass the cache, execute the Protocol.NeighborDiscovery method.

Parameters
addressThe IPv6 address that must be resolved. The IPv6 address may be written in any valid IPv6 addressing format. For example, removing leading zeros within a group, compressing adjacent groups of zeros, .... No prefix length suffix (e.g. '/64') may be included!
Returns
The layer 2 MAC address found for the provided IPv6 address.
Exceptions
ByteBlower.Protocol.Arp.NoReplyWhen the item is not present in the neighbor cache and nobody replies to the Neighbour Discovery request (i.e. neither the host itself or a forwarding router), this exception is thrown.
Example

This simple example resolves a link-local IPv6 address. This example clearly shows that the host part of a link-local address is based on its layer 2 MAC address.

1 $ipv6 Resolve fe80:0000:0000:0000:02ff:25ff:fe00:0001

Returns:

00:FF:25:00:00:01 

Definition at line 6493 of file api.tcl.

Layer3.IPv6::StatelessAutoconfiguration

Performs stateless address autoconfiguration (SLAAC) to configure IPv6 with, among others, a global IPv6 address.

The stateless address autoconfiguration (SLAAC) is done in an asynchronous manner. It works through the IPv6 Neighbor Discovery Protocol (NDP). It creates an IP address based on the prefix information from incoming router advertisements (first 64 bits) and the hosts MAC address (last 64 bits).

Note that SLAAC and the NDP is also used to create the link-local IP address. This address has a fixed prefix (fe80::/64) and the same host part. This address is immediately generated when the IPv6 protocol is initialized and is not part of this call.

If the IPv6 protocol is not yet initialized, calling this method the first time will do so. This initialization sets the link-local address described above and listens for router advertisements to set the default gateway. If no router advertisement occurs, the gateway is set to the null address (::).

When no routing advertisement is found, no address is added.

Example

This example performs stateless address autoconfiguration on this host.

1 $ipv6 StatelessAutoconfiguration

Definition at line 6529 of file api.tcl.

Layer3.IPv6::StatelessAutoconfiguration.Async

Performs stateless address autoconfiguration (SLAAC) to configure IPv6 with, among others, a global IPv6 address.

Since
API 2.3.0

This is a asynchronous call so it will return immediately. If you want to wait until it has finished then call the StatelessAutoconfiguration method after having called this method. This will also rethrow any exceptions that may have occured on the server side.

Returns immediately.

Returns
This method will return nothing and return immediately.
Example

This example performs stateless address autoconfiguration on this host.

1 $ipv6 StatelessAutoconfiguration.Async

Definition at line 6511 of file api.tcl.