Repository navigation
Clear End Device Initiator when relaying an end device child's frame - #66
Merged
puddly merged 1 commit intoOct 16, 2026
Conversation
Zigbee R23.2 3.3.1.1.8: after validating the source, a router parent SHALL clear the End Device Initiator bit when relaying a message sent by one of its end device children. Ziggurat relayed these frames with the bit still set, so other routers, which find no end device with that source in their own neighbor table, drop them (3.6.2.2). A group command an end device remote broadcasts through its ziggurat parent was therefore dropped by the routers that received the relayed copy, the bound bulbs included. Clear the bit for frames whose NWK source is one of our end device children in both relay paths: the broadcast relay (the over-the-air copy, its retransmits, and the indirect copies fanned out to sleepy children) and the unicast relay (sender retries and the indirect queue).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When ziggurat relays a frame sent by one of its end device children, it keeps the End Device Initiator bit of the NWK frame control set. Zigbee R23.2 §3.3.1.1.8 requires the router parent to clear that bit when relaying such a frame, and §3.6.2.2 has every other router drop a frame carrying the bit unless its source is an end device in that router's own neighbor table. So a group command an end device remote (an IKEA TRADFRI remote, for example) broadcasts through a ziggurat parent goes out with frame control 0x2248, and the routers that receive the relayed copy, the bound bulbs included, drop it.
Fixes #65. The analysis is ChristophKaser's: the issue identifies the missing clear, the relay paths, and the spec sections, and the reporter confirmed that clearing the bit before forwarding makes the bound bulb respond.
Changes
Neighbors::clear_end_device_initiator_for_relay(ziggurat-zigbee) clears the bit only when the frame's NWK source is an end device child in our neighbor table, which is the source validation §3.3.1.1.8 asks for. Frames from any other source keep the bit unchanged.maybe_relay_broadcastapplies it to the relayed copy before anything is queued. The over-the-air relay, its passive-ack retransmits, and the copies fanned out to sleepy children through the indirect queue all go out with the bit cleared. The fan-out was previously built from the unmodified inbound frame, and an end device drops any frame with the bit set (§3.6.2.2, step 1).relay_unicast_nwk_frameapplies it after the radius check, so the sender's retries and the indirect queue for a sleepy destination carry the cleared bit as well.Testing
ziggurat-zigbee/src/nwk/neighbors.rs: frame control 0x2248 from an end device child serializes as 0x0248 after the clear, and the bit is left alone for an unknown source, a router child, and a frame without the bit.cargo test -p ziggurat-zigbee(28 passed),cargo test -p ziggurat-driver(builds, the crate has no tests), andcargo clippy -p ziggurat-zigbee -p ziggurat-driver --all-targets --all-features -- -D warnings -Dclippy::all -Dclippy::nurseryare clean.cargo fmt --all --checkis clean.Open items