Neighbor Information Base for IPv6

Neighbor Information Base (NIB) for IPv6.

Add detailed description

Implement multihop DAD

Implement classic SLAAC

Implement MLD

GNRC_IPV6_NIB_SND_UC_NS

(Re-)transmit unicast Neighbor Solicitation event.

1
(0x4fc0U)

This message type is for the event of (re-)transmitting of unicast Neighbor Solicitation. The expected message context is a pointer to a valid on-link entry representing the neighbor to which the Neighbor Solicitation is supposed to be sent.

GNRC_IPV6_NIB_SND_MC_NS

(Re-)transmit multicast Neighbor Solicitation event.

1
(0x4fc1U)

This message type is for the event of (re-)transmitting of multicast Neighbor Solicitation. The expected message context is a pointer to a valid on-link entry representing the neighbor to which solicited nodes group the Neighbor Solicitation is supposed to be sent.

GNRC_IPV6_NIB_SND_NA

Send delayed Neighbor Advertisement event.

1
(0x4fc2U)

This message type is for the event of sending delayed Neighbor Advertisements. The expected message context is a pointer to a valid include/net/gnrc/pkt.h::gnrc_pktsnip_t in sending order, representing the Neighbor Advertisement.

GNRC_IPV6_NIB_SEARCH_RTR

Search router event.

1
(0x4fc3U)

This message type is for the event of searching a (new) router (which implies sending a multicast Router Solicitation). The expected message context is a pointer to a valid interface behind which the router is searched.

GNRC_IPV6_NIB_REPLY_RS

Reply Router Solicitation event.

1
(0x4fc5U)

This message type is for the event of the delayed reply to a Router Solicitaion with a Router Advertisement. The expected message context is a pointer to a valid on-link entry representing the neighbor that sent the Router Solicitation.

Note

Only handled with ipv6/nib/conf.h::GNRC_IPV6_NIB_CONF_ROUTER != 0

GNRC_IPV6_NIB_SND_MC_RA

(Re-)transmit multicast Router Advertisement event.

1
(0x4fc6U)

This message type is for the event of (Re)transmit Advertisements event. The expected message context is a pointer to a valid interface over which the Router Advertisement will be sent and by which parameters it will be configured.

Note

Only handled with ipv6/nib/conf.h::GNRC_IPV6_NIB_CONF_ROUTER != 0

GNRC_IPV6_NIB_REACH_TIMEOUT

Reachability timeout event.

1
(0x4fc7U)

This message type is for the event of a REACHABLE state timeout. The expected message context is a pointer to a valid on-link entry representing the neighbor cache entry that faces a state change.

Note

Only handled with ipv6/nib/conf.h::GNRC_IPV6_NIB_CONF_ARSM != 0

GNRC_IPV6_NIB_DELAY_TIMEOUT

Delay timeout event.

1
(0x4fc8U)

This message type is for the event of the DELAY state timeout. The expected message context is a pointer to a valid on-link entry representing the neighbor cache entry that faces a state change.

Note

Only handled with ipv6/nib/conf.h::GNRC_IPV6_NIB_CONF_ARSM != 0

GNRC_IPV6_NIB_ADDR_REG_TIMEOUT

Address registration timeout event.

1
(0x4fc9U)

This message type is for the event of a 6LoWPAN address registration state timeout. The expected message context is a pointer to a valid on-link entry representing the neighbor which faces a timeout of its address registration.

Note

Only handled with ipv6/nib/conf.h::GNRC_IPV6_NIB_CONF_6LR != 0

GNRC_IPV6_NIB_ABR_TIMEOUT

Authoritative border router timeout event.

1
(0x4fcbU)

This message type is for the event of an Authoritative border router timeout. The expected message context is the NIB-internal state of the authoritative border router.

GNRC_IPV6_NIB_PFX_TIMEOUT

Prefix timeout event.

1
(0x4fccU)

This message type is for the event of a prefix timeout. The expected message context is a valid off-link entry representing the prefix.

GNRC_IPV6_NIB_RTR_TIMEOUT

Router timeout event.

1
(0x4fcdU)

This message type is for the event of a router timeout. The expected message context is a valid default router entry representing the router.

GNRC_IPV6_NIB_RECALC_REACH_TIME

Recalculate reachability timeout time.

1
(0x4fceU)

This message type is for the event of recalculating the reachability timeout time. The expected message context is a valid interface.

Note

Only handled with ipv6/nib/conf.h::GNRC_IPV6_NIB_CONF_ARSM != 0

GNRC_IPV6_NIB_REREG_ADDRESS

Reregister address.

1
(0x4fcfU)

This message type is for the event of reregistering an IPv6 address to the upstream router. The expected message context is an IPv6 address assigned to one of the nodes interfaces.

Note

Only handled with ipv6/nib/conf.h::GNRC_IPV6_NIB_CONF_6LN != 0

GNRC_IPV6_NIB_ROUTE_TIMEOUT

Route timeout event.

1
(0x4fd0U)

This message type is for the event of a route timeout. The expected message context is a valid off-link entry representing the route.

Note

Only handled with ipv6/nib/conf.h::GNRC_IPV6_NIB_CONF_ROUTER != 0

GNRC_IPV6_NIB_DAD

Perform DAD event.

1
(0x4fd1U)

This message type is for performing DAD for a given address. The expected message context is a TENTATIVE IPv6 address.

Note

Only handled with ipv6/nib/conf.h::GNRC_IPV6_NIB_CONF_SLAAC != 0

GNRC_IPV6_NIB_VALID_ADDR

Validate a tentative address event.

1
(0x4fd2U)

Moves a TENTATIVE address to VALID state. The expected message context is a TENTATIVE IPv6 address.

Note

Only handled with ipv6/nib/conf.h::GNRC_IPV6_NIB_CONF_SLAAC != 0

GNRC_IPV6_NIB_RDNSS_TIMEOUT

Recursive DNS server timeout.

1
(0x4fd3U)

This message type is for the event of a recursive DNS server timeout. The expected message context is the sock/udp.h::sock_udp_ep_t representing the DNS server.

Note

Only handled with ipv6/nib/conf.h::GNRC_IPV6_NIB_CONF_DNS != 0

enum @189
GNRC_IPV6_NIB_ROUTE_INFO_TYPE_UNDEF = 0
undefined
GNRC_IPV6_NIB_ROUTE_INFO_TYPE_RRQ

reactive routing query

A reactive routing query is issued when a route is unknown to the NIB. A reactive routing protocol can use this call to search for a route in a reactive manner.

The ctx_addr will be the destination address of the unknown route, ctx a pointer to the packet as gnrc_pktsnip_t that caused the route look-up (to possibly queue it for later sending).

GNRC_IPV6_NIB_ROUTE_INFO_TYPE_RN

route notification

A route notification is issued when an already established route is taken. A routing protocol can use this call to update its information on the route.

The ctx_addr is the prefix of the route, ctx is set to a value equal to the length of the prefix in bits.

GNRC_IPV6_NIB_ROUTE_INFO_TYPE_NSC

neighbor state change

A neighbor state change is issued when ever the NUD state of a neighbor changes. A routing protocol can use this call to update its information on routes via this neighbor.

The ctx_addr is the address of the neighbor, ctx is a value equal to the new NUD state as defined in [the NC info flags](). If the entry is deleted, ctx will be set to nc.h::GNRC_IPV6_NIB_NC_INFO_NUD_STATE_UNREACHABLE (except if it was already in the UNREACHABLE state). This does not include cache-outs, since they give no information about the neighbor’s reachability (you might however get an INCOMPLETE or STALE notification due to that, as soon as the neighbor enters the neighbor cache again).

Be adviced to only use ctx_addr in the context of the callback, since it might be overwritten, after the callback was left.

void gnrc_ipv6_nib_init(void)

Initialize NIB.

void gnrc_ipv6_nib_init_iface(gnrc_netif_t * netif)

Adds an interface to be managed by the NIB.

Parameters

netif:The interface to be managed by the NIB

int gnrc_ipv6_nib_get_next_hop_l2addr(const ipv6_addr_t * dst, gnrc_netif_t * netif, include/net/gnrc/pkt.h::gnrc_pktsnip_t * pkt, gnrc_ipv6_nib_nc_t * nce)

Gets link-layer address of next hop to a destination address.

Parameters

dst:Destination address of a packet.
netif:Restrict search to this interface. May be NULL for any interface.
pkt:The IPv6 packet in sending order for which the next hop is searched. Needed for queuing for with reactive routing or address resolution. May be NULL. Will be released properly on error.
nce:The neighbor cache entry of the next hop to dst.

Return values

  • 0, on success.
  • -ENETUNREACH if there is no route to host.
  • -EHOSTUNREACH if the next hop is not reachable or if dst was link-local, but iface was kernel_types.h::KERNEL_PID_UNDEF (no neighbor cache entry will be created in this case and no neighbor solicitation sent).
void gnrc_ipv6_nib_handle_pkt(gnrc_netif_t * netif, const ipv6_hdr_t * ipv6, const icmpv6_hdr_t * icmpv6, msp430_types.h::size_t icmpv6_len)

Handles a received ICMPv6 packet.

Note

ipv6 is just used for the addresses and hop limit. The next header field will not be checked for correctness (but should be protnum.h::PROTNUM_ICMPV6)

Parameters

netif:The interface the packet came over.
ipv6:The IPv6 header of the received packet.
icmpv6:The ICMPv6 header and payload of the received packet.
icmpv6_len:The number of bytes at icmpv6.

void gnrc_ipv6_nib_handle_timer_event(void * ctx, uint16_t type)

Handles a timer event.

Parameters

ctx:Context of the timer event.
type:Type of the timer event (see types”)

void gnrc_ipv6_nib_change_rtr_adv_iface(gnrc_netif_t * netif, bool enable)

Changes the state if an interface advertises itself as a router or not.

Parameters

netif:The interface for which the state should be changed.
enable:true, to enable advertising the interface as a router. false, to disable advertising the interface as a router.

void _snd_ns(const ipv6_addr_t * tgt, gnrc_netif_t * netif, const ipv6_addr_t * src, const ipv6_addr_t * dst)

Sends neighbor solicitation (including ARO if required)

Parameters

tgt:The target address of the neighbor solicitation. Must not be NULL or a multicast address.
netif:Interface to send over. Must not be NULL.
src:Source address for the neighbor solicitation. Will be chosen from the interface according to dst, if NULL.
dst:Destination address for neighbor solicitation. Must not be NULL.

void _init_iface_router(gnrc_netif_t * netif)

Initializes interface for router behavior.

Parameters

netif:An interface.