Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gnrc/ipv6_auto_subnets: allow to join multiple subnets #17547

Merged
merged 1 commit into from
May 24, 2022

Conversation

benpicco
Copy link
Contributor

Contribution description

Our subnet-setup just got a little more complex 😉
We now have a sensor network tree that sends data to a collector unit. This network is offline most of the time and will be a private network in the fc00::/8 range.

When the collector unit comes in range of a gateway device, it will receive a global prefix (and start uploading the data it collected).
This global prefix is also split up to use in the sensor network tree, so the sensors now also have a global address and can query a remote server for configuration or firmware updates.
The private address for internal data collection remains in use.

Testing procedure

Edit the Makefile of examples/gnrc_networking_subnets and add:

CFLAGS += -DCONFIG_GNRC_IPV6_AUTO_SUBNETS_PREFIX_FIX_LEN=16
CFLAGS += -DCONFIG_GNRC_NETIF_IPV6_ADDRS_NUMOF=4
CFLAGS += -DCONFIG_GNRC_IPV6_AUTO_SUBNETS_NUMOF=2

Run the setup_taps.sh script to configure the needed TAP interfaces, then run two nodes:

make PORT="tap_a0 tap_b1" all term and make PORT="tap_b0 tap_c1" all term

A first prefix will already be assigned by radvd:

Iface  7  HWaddr: CA:F4:13:CE:3F:43 
          L2-PDU:1500  MTU:1500  HL:64  RTR  
          RTR_ADV  
          Source address length: 6
          Link type: wired
          inet6 addr: fe80::c8f4:13ff:fece:3f43  scope: link  VAL
          inet6 addr: 2001:db8:0:8:c8f4:13ff:fece:3f43  scope: global  VAL
          inet6 group: ff02::2
          inet6 group: ff02::1
          inet6 group: ff02::1:ffce:3f43
          
          Statistics for Layer 2
            RX packets 4  bytes 480
            TX packets 2 (Multicast: 2)  bytes 140
            TX succeeded 2 errors 0
          Statistics for IPv6
            RX packets 4  bytes 424
            TX packets 2 (Multicast: 2)  bytes 112
            TX succeeded 2 errors 0

Iface  6  HWaddr: 1A:48:79:20:CF:5A 
          L2-PDU:1500  MTU:1500  HL:64  RTR  
          Source address length: 6
          Link type: wired
          inet6 addr: fe80::1848:79ff:fe20:cf5a  scope: link  VAL
          inet6 addr: 2001:db8::1848:79ff:fe20:cf5a  scope: global  VAL
          inet6 group: ff02::2
          inet6 group: ff02::1
          inet6 group: ff02::1:ff20:cf5a
          
          Statistics for Layer 2
            RX packets 5  bytes 670
            TX packets 6 (Multicast: 6)  bytes 410
            TX succeeded 6 errors 0
          Statistics for IPv6
            RX packets 5  bytes 600
            TX packets 6 (Multicast: 6)  bytes 326
            TX succeeded 6 errors 0

Now we manually add a second prefix (requires #17350) on the downstream interface:

nib prefix add 7 fc01::/16

Iface  7  HWaddr: CA:F4:13:CE:3F:43 
          L2-PDU:1500  MTU:1500  HL:64  RTR  
          RTR_ADV  
          Source address length: 6
          Link type: wired
          inet6 addr: fe80::c8f4:13ff:fece:3f43  scope: link  VAL
          inet6 addr: 2001:db8:0:8:c8f4:13ff:fece:3f43  scope: global  VAL
          inet6 addr: fc01::c8f4:13ff:fece:3f43  scope: global  VAL
          inet6 group: ff02::2
          inet6 group: ff02::1
          inet6 group: ff02::1:ffce:3f43
          
          Statistics for Layer 2
            RX packets 120  bytes 9603
            TX packets 71 (Multicast: 54)  bytes 7382
            TX succeeded 71 errors 0
          Statistics for IPv6
            RX packets 120  bytes 7923
            TX packets 71 (Multicast: 54)  bytes 6388
            TX succeeded 71 errors 0

Iface  6  HWaddr: 1A:48:79:20:CF:5A 
          L2-PDU:1500  MTU:1500  HL:64  RTR  
          Source address length: 6
          Link type: wired
          inet6 addr: fe80::1848:79ff:fe20:cf5a  scope: link  VAL
          inet6 addr: 2001:db8::1848:79ff:fe20:cf5a  scope: global  VAL
          inet6 group: ff02::2
          inet6 group: ff02::1
          inet6 group: ff02::1:ff20:cf5a
          
          Statistics for Layer 2
            RX packets 17  bytes 1980
            TX packets 30 (Multicast: 29)  bytes 2156
            TX succeeded 30 errors 0
          Statistics for IPv6
            RX packets 17  bytes 1742
            TX packets 30 (Multicast: 29)  bytes 1736
            TX succeeded 30 errors 0

The downstream node will now receive both prefixes and create two subnets on the downstream interface

auto_subnets: create 1 subnets, start with 0
auto_subnets: configure prefix fc01:8000::/17 on 7
auto_subnets: create 1 subnets, start with 0
auto_subnets: configure prefix 2001:db8:0:c::/62 on 7
auto_subnets: announce sent, next timeout in 42184 µs
auto_subnets: announce sent, next timeout in 45700 µs
auto_subnets: announce sent, next timeout in 48292 µs
auto_subnets: create 1 subnets, start with 0
auto_subnets: configure prefix fc01:8000::/17 on 7
auto_subnets: create 1 subnets, start with 0
auto_subnets: configure prefix 2001:db8:0:c::/62 on 7

Iface  7  HWaddr: 3E:27:6D:25:E9:5D 
          L2-PDU:1500  MTU:1500  HL:64  RTR  
          RTR_ADV  
          Source address length: 6
          Link type: wired
          inet6 addr: fe80::3c27:6dff:fe25:e95d  scope: link  VAL
          inet6 addr: fc01:8000::3c27:6dff:fe25:e95d  scope: global  VAL
          inet6 addr: 2001:db8:0:c:3c27:6dff:fe25:e95d  scope: global  VAL
          inet6 group: ff02::2
          inet6 group: ff02::1
          inet6 group: ff02::1:ff25:e95d
          
          Statistics for Layer 2
            RX packets 6  bytes 753
            TX packets 108 (Multicast: 104)  bytes 14208
            TX succeeded 108 errors 0
          Statistics for IPv6
            RX packets 6  bytes 669
            TX packets 108 (Multicast: 104)  bytes 12696
            TX succeeded 108 errors 0

Iface  6  HWaddr: 8E:CA:EF:8B:D6:4F 
          L2-PDU:1500  MTU:1500  HL:64  RTR  
          Source address length: 6
          Link type: wired
          inet6 addr: fe80::8cca:efff:fe8b:d64f  scope: link  VAL
          inet6 addr: fc01::8cca:efff:fe8b:d64f  scope: global  VAL
          inet6 addr: 2001:db8:0:8:8cca:efff:fe8b:d64f  scope: global  VAL
          inet6 group: ff02::2
          inet6 group: ff02::1
          inet6 group: ff02::1:ff8b:d64f
          
          Statistics for Layer 2
            RX packets 41  bytes 4534
            TX packets 82 (Multicast: 82)  bytes 6542
            TX succeeded 82 errors 0
          Statistics for IPv6
            RX packets 41  bytes 3960
            TX packets 82 (Multicast: 82)  bytes 5394
            TX succeeded 82 errors 0

Issues/PRs references

@github-actions github-actions bot added Area: network Area: Networking Area: sys Area: System labels Jan 20, 2022
@benpicco benpicco force-pushed the gnrc_ipv6_auto_subnets-multi branch from 0245efb to 6217ac1 Compare January 20, 2022 21:49
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jan 20, 2022
@benpicco benpicco requested a review from JKRhb January 24, 2022 21:06
@benpicco benpicco requested a review from fabian18 March 23, 2022 12:29
@benpicco benpicco requested review from kfessel and chrysn April 13, 2022 12:49
@benpicco benpicco force-pushed the gnrc_ipv6_auto_subnets-multi branch from 6217ac1 to cccbbf9 Compare May 11, 2022 22:41
@benpicco benpicco force-pushed the gnrc_ipv6_auto_subnets-multi branch from cccbbf9 to b13b942 Compare May 11, 2022 22:44
Copy link
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look sensible and trust your testing of this module. ACK

@miri64 miri64 added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels May 24, 2022
@miri64 miri64 enabled auto-merge May 24, 2022 09:07
@miri64 miri64 merged commit a61c4b7 into RIOT-OS:master May 24, 2022
@benpicco
Copy link
Contributor Author

Thank you for the review!

@benpicco benpicco deleted the gnrc_ipv6_auto_subnets-multi branch May 24, 2022 14:05
@chrysn chrysn added this to the Release 2022.07 milestone Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants