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

socket_zep: ignore packets sent on the wrong radio channel #18594

Merged
merged 1 commit into from
Sep 15, 2022

Conversation

benpicco
Copy link
Contributor

Contribution description

So far, ZEP would accept all frames even if they are sent on the wrong 'channel'.

Apply phy configuration and filter incoming frames based on the radio channel.

Testing procedure

Run examples/gnrc_border_router and examples/gnrc_networking with USE_ZEP=1

main(): This is RIOT! (Version: 2022.10-devel-608-g36eac)
RIOT network stack example application
All up, running the shell now
> ping ff02::1
12 bytes from fe80::ac5a:b682:da1f:f3c1%7: icmp_seq=0 ttl=64 rssi=0 dBm time=0.544 ms
12 bytes from fe80::ac5a:b682:da1f:f3c1%7: icmp_seq=1 ttl=64 rssi=0 dBm time=0.556 ms
12 bytes from fe80::ac5a:b682:da1f:f3c1%7: icmp_seq=2 ttl=64 rssi=0 dBm time=0.565 ms

--- ff02::1 PING statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 0.544/0.555/0.565 ms
> ifconfig 
Iface  7  HWaddr: 3C:10  Channel: 26  NID: 0x23  PHY: O-QPSK 
          Long HWaddr: 6E:C9:17:7D:C9:6E:3C:10 
           State: IDLE 
          ACK_REQ  L2-PDU:102  MTU:1280  HL:64  RTR  
          6LO  IPHC  
          Source address length: 8
          Link type: wireless
          inet6 addr: fe80::6cc9:177d:c96e:3c10  scope: link  VAL
          inet6 group: ff02::2
          inet6 group: ff02::1
          inet6 group: ff02::1:ff6e:3c10
          inet6 group: ff02::1a
          
          Statistics for Layer 2
            RX packets 4  bytes 151
            TX packets 6 (Multicast: 6)  bytes 0
            TX succeeded 6 errors 0
          Statistics for IPv6
            RX packets 4  bytes 220
            TX packets 6 (Multicast: 6)  bytes 334
            TX succeeded 6 errors 0

> ifconfig 7 set chan 20
success: set channel on interface 7 to 20

> ping ff02::1

--- ff02::1 PING statistics ---
3 packets transmitted, 0 packets received, 100% packet loss

> ifconfig 7 set chan 26
success: set channel on interface 7 to 26

> ping ff02::1
12 bytes from fe80::ac5a:b682:da1f:f3c1%7: icmp_seq=0 ttl=64 rssi=0 dBm time=0.556 ms
12 bytes from fe80::ac5a:b682:da1f:f3c1%7: icmp_seq=1 ttl=64 rssi=0 dBm time=0.554 ms
12 bytes from fe80::ac5a:b682:da1f:f3c1%7: icmp_seq=2 ttl=64 rssi=0 dBm time=0.563 ms

--- ff02::1 PING statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 0.554/0.557/0.563 ms

Issues/PRs references

@github-actions github-actions bot added Area: cpu Area: CPU/MCU ports Platform: native Platform: This PR/issue effects the native platform labels Sep 14, 2022
@benpicco benpicco requested review from chrysn and jia200x September 14, 2022 09:54
@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 Sep 14, 2022
@jia200x
Copy link
Member

jia200x commented Sep 14, 2022

openDSME likes this

Copy link
Member

@jia200x jia200x left a comment

Choose a reason for hiding this comment

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

ACK, I trust your testing

@benpicco benpicco 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 Sep 14, 2022
@benpicco benpicco merged commit b992b73 into RIOT-OS:master Sep 15, 2022
@benpicco benpicco deleted the socket_zep-chan branch September 15, 2022 09:50
@maribu maribu added this to the Release 2022.10 milestone Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: cpu Area: CPU/MCU ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: native Platform: This PR/issue effects the native platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants