Loading...
Searching...
No Matches
Simple-Subnet auto-configuration

Automatic configuration for cascading subnets. More...

Detailed Description

Automatic configuration for cascading subnets.

About

This module provides an automatic configuration for networks with a (simple) tree topology.

If a sufficiently large IPv6 subnet (prefix length < /64) is provided via Router Advertisements, a routing node with this module will automatically configure subnets from it by dividing it into sub-prefixes for each downstream interface.

When using the gnrc_ipv6_auto_subnets_simple module, there can only be a single routing node on each level of the network but an arbitrary number of leaf nodes and downstream interfaces.

Example Topology with only one router on each level

If there are multiple routing nodes on the same link, coordination between the routers is required. For this the gnrc_ipv6_auto_subnets implements a simple UDP based synchronisation protocol where each router announces the number of subnets they want to create.

Synchronisation Algorithm

The layer 2 address of the sender then determines the order in which the prefixes are assigned.

Example Topology with multiple routers

The downstream network(s) receive the sub-prefix via Router Advertisements and the process repeats until the bits of the prefix are exhausted. The smallest subnet must still have a /64 prefix.

The new subnet must no longer be considered on-link by the hosts in the parent network. Therefore the downstream router will send a router advertisement, which only contains a Route Information Option, to the upstream network. The Route Information Option contains the prefix of the downstream network so that upstream routers will no longer consider hosts in this subnet on-link, but instead will use the downstream router to route to the new subnet.

The need for a Route Information Option

All nodes that want to communicate with hosts in a downstream subnet must implement parsing of the Route Information Option. For routing RIOT nodes this is enabled by default, non-routing nodes need to enable the gnrc_ipv6_nib_rio module.

This is because all addresses in the subnet are also within the original network, so without further information hosts would consider those addresses on-link and perform neighbor solicitation to communicate with them.

E.g. if host Ⓒ (2001:db8:0:8:5075:35ff:fefa:30bc) sends an ICMPv6 Echo request to Ⓑ (2001:db8:0:0:a7a2:12e0:48bc:7487), it would not get a response:

Auto-Subnets without RIO

To solve this, the routing node Ⓐ also sends a Router Advertisement to the upstream network that only contains a Route Information Option for each downstream network created by that router. This way hosts in the upstream network will prefer the route via Ⓐ over link-local transmission as it is a stronger match than the upstream prefix:

Auto-Subnets with RIO

Usage

Simply add the gnrc_ipv6_auto_subnets or gnrc_ipv6_auto_subnets_simple module to the nodes that should act as routers in the cascading network. The upstream network will be automatically chosen as the one that first receives a router advertisement.

Files

file  gnrc_ipv6_auto_subnets.c
 

Macros

#define CONFIG_GNRC_IPV6_AUTO_SUBNETS_PORT   (16179)
 Port for the custom UDP sync protocol.
 
#define CONFIG_GNRC_IPV6_AUTO_SUBNETS_PEERS_MAX   (4)
 Max number of other routers on the same link.
 
#define CONFIG_GNRC_IPV6_AUTO_SUBNETS_TX_PER_PERIOD   (3)
 How often the number subnets should be announced by the routers.
 
#define CONFIG_GNRC_IPV6_AUTO_SUBNETS_TIMEOUT_MS   (50)
 How long to wait for other routers announcements before resending or creating subnets when the retry counter is exhausted.
 
#define CONFIG_GNRC_IPV6_AUTO_SUBNETS_PREFIX_FIX_LEN   (0)
 How many bits of a new prefix have to match the old prefix for it to be considered for replacement.
 
#define CONFIG_GNRC_IPV6_AUTO_SUBNETS_PREFIX_MIN_LEN   (0)
 Minimal length of a new prefix.
 
#define CONFIG_GNRC_IPV6_AUTO_SUBNETS_NUMOF   (1)
 Number of subnets that can be configured.
 
#define CONFIG_GNRC_IPV6_AUTO_SUBNETS_STATIC   (0)
 Enable this if you have a static network that might experience high packet loss under certain conditions.
 

Macro Definition Documentation

◆ CONFIG_GNRC_IPV6_AUTO_SUBNETS_NUMOF

#define CONFIG_GNRC_IPV6_AUTO_SUBNETS_NUMOF   (1)

Number of subnets that can be configured.

   This is not needed when using the `gnrc_ipv6_auto_subnets_simple` module
   or if only a single upstream subnet is to be partitioned.

   If this is set to any number higher than 1, make sure to also configure
   CONFIG_GNRC_IPV6_AUTO_SUBNETS_PREFIX_FIX_LEN to suit your setup.

Definition at line 163 of file gnrc_ipv6_auto_subnets.c.

◆ CONFIG_GNRC_IPV6_AUTO_SUBNETS_PEERS_MAX

#define CONFIG_GNRC_IPV6_AUTO_SUBNETS_PEERS_MAX   (4)

Max number of other routers on the same link.

Definition at line 114 of file gnrc_ipv6_auto_subnets.c.

◆ CONFIG_GNRC_IPV6_AUTO_SUBNETS_PORT

#define CONFIG_GNRC_IPV6_AUTO_SUBNETS_PORT   (16179)

Port for the custom UDP sync protocol.

Definition at line 107 of file gnrc_ipv6_auto_subnets.c.

◆ CONFIG_GNRC_IPV6_AUTO_SUBNETS_PREFIX_FIX_LEN

#define CONFIG_GNRC_IPV6_AUTO_SUBNETS_PREFIX_FIX_LEN   (0)

How many bits of a new prefix have to match the old prefix for it to be considered for replacement.

Set this if you want to join multiple upstream subnets at the same time.

If you use gnrc_ipv6_auto_subnets instead of gnrc_ipv6_auto_subnets_simple make sure to also set CONFIG_GNRC_IPV6_AUTO_SUBNETS_NUMOF accordingly.

Definition at line 142 of file gnrc_ipv6_auto_subnets.c.

◆ CONFIG_GNRC_IPV6_AUTO_SUBNETS_PREFIX_MIN_LEN

#define CONFIG_GNRC_IPV6_AUTO_SUBNETS_PREFIX_MIN_LEN   (0)

Minimal length of a new prefix.

e.g. Linux will only accept /64 prefixes for SLAAC

Definition at line 150 of file gnrc_ipv6_auto_subnets.c.

◆ CONFIG_GNRC_IPV6_AUTO_SUBNETS_STATIC

#define CONFIG_GNRC_IPV6_AUTO_SUBNETS_STATIC   (0)

Enable this if you have a static network that might experience high packet loss under certain conditions.

If enabled, this option causes the module to always assume the highest number of downstream routers it has ever seen. This prevents different/conflicting downstream subnets from being configured if multiple sync packets got lost.

Definition at line 175 of file gnrc_ipv6_auto_subnets.c.

◆ CONFIG_GNRC_IPV6_AUTO_SUBNETS_TIMEOUT_MS

#define CONFIG_GNRC_IPV6_AUTO_SUBNETS_TIMEOUT_MS   (50)

How long to wait for other routers announcements before resending or creating subnets when the retry counter is exhausted.

Definition at line 129 of file gnrc_ipv6_auto_subnets.c.

◆ CONFIG_GNRC_IPV6_AUTO_SUBNETS_TX_PER_PERIOD

#define CONFIG_GNRC_IPV6_AUTO_SUBNETS_TX_PER_PERIOD   (3)

How often the number subnets should be announced by the routers.

Definition at line 121 of file gnrc_ipv6_auto_subnets.c.