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_sixlowpan: allow to build with gnrc_sixlowpan_ctx disabled #17594

Closed
wants to merge 2 commits into from

Conversation

benpicco
Copy link
Contributor

@benpicco benpicco commented Jan 31, 2022

Contribution description

This allows to disable the gnrc_sixlowpan_ctx module. This is useful if no compression contexts are desired.
It is an easy workaround for the issue that CONFIG_GNRC_IPV6_NIB_MULTIHOP_P6C is not checked per-interface and thus having a non-6Lo host behind a 6Lo node does not work, but since compression contexts are an optional feature, it should be possible to disable them.

Testing procedure

Everything should still work with

USEMODULE += gnrc_sixlowpan_no_ctx

In my case I have:

same54-xpro (border router)
Iface  8  HWaddr: FC:C2:3D:0D:02:E3
          L2-PDU:1500  MTU:1500  HL:64  RTR
          Source address length: 6
          Link type: wired
          inet6 addr: fe80::fec2:3dff:fe0d:2e3  scope: link  VAL
          inet6 addr: fc23::fec2:3dff:fe0d:2e3  scope: global  VAL
          inet6 group: ff02::2
          inet6 group: ff02::1
          inet6 group: ff02::1:ff0d:2e3

          Statistics for Layer 2
            RX packets 82  bytes 26502
            TX packets 20 (Multicast: 9)  bytes 1588
            TX succeeded 20 errors 0
          Statistics for IPv6
            RX packets 52  bytes 12644
            TX packets 20 (Multicast: 9)  bytes 1308
            TX succeeded 20 errors 0

Iface  7  HWaddr: 42:BB  Channel: 26  Page: 0  NID: 0x23  PHY: O-QPSK

          Long HWaddr: BA:4C:F0:1D:6E:42:42:BB
           TX-Power: 0dBm  State: IDLE  max. Retrans.: 3  CSMA Retries: 4
          AUTOACK  ACK_REQ  CSMA  L2-PDU:102  MTU:1280  HL:64  RTR
          RTR_ADV  6LO  IPHC
          Source address length: 8
          Link type: wireless
          inet6 addr: fe80::b84c:f01d:6e42:42bb  scope: link  VAL
          inet6 addr: fc23:0:4000:0:b84c:f01d:6e42:42bb  scope: global  VAL
          inet6 group: ff02::2
          inet6 group: ff02::1
          inet6 group: ff02::1:ff42:42bb

          Statistics for Layer 2
            RX packets 6  bytes 276
            TX packets 6 (Multicast: 4)  bytes 248
            TX succeeded 6 errors 0
          Statistics for IPv6
            RX packets 6  bytes 372
            TX packets 6 (Multicast: 4)  bytes 364
            TX succeeded 6 errors 0

Iface  6  HWaddr: 42:BA  Channel: 0  Page: 2  NID: 0x23  PHY: O-QPSK

          Long HWaddr: BA:4C:F0:1D:6E:42:42:BA
           TX-Power: 0dBm  State: IDLE  max. Retrans.: 3  CSMA Retries: 4
          AUTOACK  ACK_REQ  CSMA  L2-PDU:102  MTU:1280  HL:64  RTR
          RTR_ADV  6LO  IPHC
          Source address length: 8
          Link type: wireless
          inet6 addr: fe80::b84c:f01d:6e42:42ba  scope: link  VAL
          inet6 addr: fc23:0:8000:0:b84c:f01d:6e42:42ba  scope: global  VAL
          inet6 group: ff02::2
          inet6 group: ff02::1
          inet6 group: ff02::1:ff42:42ba

          Statistics for Layer 2
            RX packets 0  bytes 0
            TX packets 11 (Multicast: 11)  bytes 437
            TX succeeded 11 errors 0
          Statistics for IPv6
            RX packets 0  bytes 0
            TX packets 11 (Multicast: 11)  bytes 668
            TX succeeded 11 errors 0

> nib route
fc23::/32 dev #8
fc23:0:4000::/34 dev #7
fc23:0:8000::/34 dev #6
fc23:0:6000::/35 via fe80::204:2519:1801:c905 dev #7
default* via fe80::215:5dff:fe25:93a2 dev #8
samr21-xpro (6LR)
Iface  7
          Long HWaddr: E6:1E:5E:72:34:2C:D0:7B
          MTU:65535  HL:64  RTR
          RTR_ADV
          Link type: wired
          inet6 addr: fe80::e41e:5e72:342c:d07b  scope: link  VAL
          inet6 addr: fc23:0:6000:0:e41e:5e72:342c:d07b  scope: global  VAL
          inet6 group: ff02::2
          inet6 group: ff02::1
          inet6 group: ff02::1:ff2c:d07b

          Statistics for Layer 2
            RX packets 1  bytes 64
            TX packets 1 (Multicast: 0)  bytes 64
            TX succeeded 0 errors 0
          Statistics for IPv6
            RX packets 1  bytes 64
            TX packets 1 (Multicast: 1)  bytes 64
            TX succeeded 1 errors 0

Iface  6  HWaddr: 49:05  Channel: 26  Page: 0  NID: 0x23  PHY: O-QPSK

          Long HWaddr: 00:04:25:19:18:01:C9:05
           TX-Power: 0dBm  State: IDLE  max. Retrans.: 3  CSMA Retries: 4
          AUTOACK  ACK_REQ  CSMA  L2-PDU:102  MTU:1280  HL:64  RTR
          RTR_ADV  6LO  IPHC
          Source address length: 8
          Link type: wireless
          inet6 addr: fe80::204:2519:1801:c905  scope: link  VAL
          inet6 addr: fc23:0:4000:0:204:2519:1801:c905  scope: global  VAL
          inet6 group: ff02::2
          inet6 group: ff02::1
          inet6 group: ff02::1:ff01:c905

          Statistics for Layer 2
            RX packets 4  bytes 344
            TX packets 5 (Multicast: 2)  bytes 358
            TX succeeded 5 errors 0
          Statistics for IPv6
            RX packets 4  bytes 344
            TX packets 5 (Multicast: 2)  bytes 400
            TX succeeded 5 errors 0

> nib route
fc23:0:6000::/35 dev #7
default via fe80::b84c:f01d:6e42:42bb dev #6
samd21-xpro (IPv6 node)
Iface  5
          Long HWaddr: BA:8C:00:6A:14:6B:3C:55
          MTU:65535  HL:64  RTR

          Link type: wired
          inet6 addr: fe80::b88c:6a:146b:3c55  scope: link  VAL
          inet6 addr: fc23:0:6000:0:b88c:6a:146b:3c55  scope: global  VAL
          inet6 group: ff02::2
          inet6 group: ff02::1
          inet6 group: ff02::1:ff6b:3c55

          Statistics for Layer 2
            RX packets 1  bytes 104
            TX packets 3 (Multicast: 0)  bytes 176
            TX succeeded 0 errors 0
          Statistics for IPv6
            RX packets 1  bytes 104
            TX packets 3 (Multicast: 3)  bytes 176
            TX succeeded 3 errors 0

> nib route
fc23:0:6000::/35 dev #5
default* via fe80::e41e:5e72:342c:d07b dev #5
ping between samd21-xpro and same54-xpro via SLIP and IEEE 802.15.4
> ping fc23::fec2:3dff:fe0d:2e3
12 bytes from fc23::fec2:3dff:fe0d:2e3: icmp_seq=0 ttl=63 time=74.689 ms
12 bytes from fc23::fec2:3dff:fe0d:2e3: icmp_seq=1 ttl=63 time=73.410 ms
12 bytes from fc23::fec2:3dff:fe0d:2e3: icmp_seq=2 ttl=63 time=74.046 ms

--- fc23::fec2:3dff:fe0d:2e3 PING statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 73.410/74.048/74.689 ms

Issues/PRs references

@github-actions github-actions bot added Area: network Area: Networking Area: sys Area: System labels Jan 31, 2022
@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 31, 2022
@benpicco benpicco requested a review from chrysn January 31, 2022 18:56
sys/net/gnrc/Makefile.dep Outdated Show resolved Hide resolved
@github-actions github-actions bot added the Area: build system Area: Build system label Feb 2, 2022
@benpicco benpicco removed the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Feb 2, 2022
@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 Feb 10, 2022
@benpicco benpicco requested a review from fabian18 March 23, 2022 17:42
@fabian18
Copy link
Contributor

fabian18 commented Mar 24, 2022

If I have one 6LBR and one 6LR (0) compiled as usual, and one 6LR (1) compiled with USEMODULE+=gnrc_sixlowpan_no_ctx, 6LBR and 6LR (0) can ping each other successfully. But 6LR (1) can neither ping 6LBR nor 6LR (0). I am guessing this is because 6LR (1) does not know about the context that 6LBR and 6LR (0) are using to compress the prefix.

Is this expected behaviour?

RFC6775 says it is kind of important that all nodes get the context from the 6LBR.

In order for 6LoWPAN header compression [RFC6282] to operate
correctly, the compression context must match for all the hosts,
6LRs, and 6LBRs that can send, receive, or forward a given packet.
If Section 8.1 is used to distribute context information, this
implies that all the 6LBRs must coordinate the context information
they distribute within a single LoWPAN.

Or are just border routers supposed to be compiled with USEMODULE+=gnrc_sixlowpan_no_ctx, so that no compression context is disseminated at all?

@benpicco
Copy link
Contributor Author

Yea this only works if the border router also uses gnrc_sixlowpan_no_ctx.
It's more of a hack tbh, the proper solution would be to make compression work when a node has both a 6Lo and a normal IPv6 interface but is not a border router, but for now just disabling compression sufficiently solved my issue.

@miri64
Copy link
Member

miri64 commented Mar 25, 2022

It's more of a hack tbh, the proper solution would be to make compression work when a node has both a 6Lo and a normal IPv6 interface but is not a border router, but for now just disabling compression sufficiently solved my issue.

Maybe that is, where #17678 is more of a clean solution: deactivate the auto-configuration of a context at the border router only and prevent the automatic dissemination via RAs in the first place. 6LoWPAN state-full compression was never designed to be run without some kind of synchronization mechanism in place (see RFC 6282)

@benpicco
Copy link
Contributor Author

benpicco commented Mar 25, 2022

The question is: if it's disabled, why include the code for it in the ROM?

@benpicco
Copy link
Contributor Author

benpicco commented Apr 12, 2022

The problem I'm trying to work around here is that CONFIG_GNRC_IPV6_NIB_MULTIHOP_P6C is a global setting and not a per-interface setting.

Do you agree that this should be a per-interface flag (in addition to a config option, so it can be compile-time disabled for non-6Lo interfaces)?

(I still think it's useful to have the option to build without gnrc_sixlowpan_ctx as this only requires minimal changes)

@miri64
Copy link
Member

miri64 commented Apr 13, 2022

Do you agree that this should be a per-interface flag (in addition to a config option, so it can be compile-time disabled for non-6Lo interfaces)?

Yes, I think that is a good thing to have, though I am not sure what this could imply for the requirements set out in RFC 6775.

@miri64
Copy link
Member

miri64 commented Apr 13, 2022

The question is: if it's disabled, why include the code for it in the ROM?

Disabling here is a question that the network operator (i.e. the owner of the border router) decides. Sure, if you have full control over the network, you may disable it also in ROM, but if you go in blind, the node should be able to work with stateful header compression.

@stale
Copy link

stale bot commented Nov 2, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.

@stale stale bot added the State: stale State: The issue / PR has no activity for >185 days label Nov 2, 2022
@maribu maribu added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Nov 2, 2022
@miri64
Copy link
Member

miri64 commented Nov 2, 2022

With CONFIG_GNRC_NETIF_IPV6_BR_AUTO_6CTX is this still needed?

@stale stale bot removed the State: stale State: The issue / PR has no activity for >185 days label Nov 2, 2022
@benpicco
Copy link
Contributor Author

#19604 provides the proper fix for this.

@benpicco benpicco closed this May 23, 2023
@benpicco benpicco deleted the gnrc_sixlowpan_ctx-optional branch May 23, 2023 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: build system Area: Build system 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants