|
| 1 | +# Cyphal/UDP provides UNRELIABLE UNORDERED DEDUPLICATED (at most one) delivery of UNICAST or MULTICAST datagrams |
| 2 | +# with GUARANTEED INTEGRITY (messages either delivered correct or not delivered). |
| 3 | +# |
1 | 4 | # All Cyphal/UDP traffic is sent to port 9382. |
2 | 5 | # The subject multicast group address is composed as 239.0.0.0 (=0xEF000000) + subject_id (23 bits). |
| 6 | +# |
3 | 7 | # All frames of a transfer must share the same field values unless otherwise noted. |
4 | 8 | # Frames may arrive out-of-order, possibly interleaved with neighboring transfers; implementations must cope. |
| 9 | +# |
| 10 | +# The origin UID is a 64-bit globally unique identifier (e.g., EUI-64). It allows nodes to use redundant interfaces |
| 11 | +# without source address ambiguity, and also allows live interface migration. |
| 12 | +# |
| 13 | +# Unicast traffic is sent directly to the source endpoint of the destination node, which is discovered dynamically. |
| 14 | +# The destination UID is not included explicitly since the IP endpoint is considered adequate for node identification. |
5 | 15 |
|
6 | 16 | uint5 version #=2 in this version. |
7 | 17 | uint3 priority # 0=highest, 7=lowest. |
8 | 18 |
|
9 | | -uint2 KIND_MSG_BEST_EFFORT = 0 # No ack must be sent. |
10 | | -uint2 KIND_MSG_RELIABLE = 1 # Remote must acknowledge reception by sending an ACK frame back. |
11 | | -uint2 KIND_ACK = 2 # Sent P2P; the transfer_id is of the acknowledged frame. Payload empty/ignored. |
12 | | -uint2 kind |
13 | | -uint6 reserved_incompat # Discard frame if any incompatibility flags are set that are not understood. |
| 19 | +void5 # Send zero, ignore on reception. |
| 20 | +uint3 incompatibility # Send zero, drop frame if nonzero. |
14 | 21 |
|
15 | | -void16 # Reserved for compatibility flags and fields (transmit zero, ignore on reception). |
16 | | - |
17 | | -# Payload reassembly information. |
18 | | -# We provide both the frame index and the frame payload offset to allow various reassembly strategies depending on the |
19 | | -# preferences of the implementation. The provided information is sufficient for zero-copy out-of-order reassembly. |
20 | | -# Offset 4 bytes. |
| 22 | +uint48 transfer_id # For multi-frame reassembly and dedup. |
| 23 | +uint64 sender_uid # Origin identifier ensures invariance to the source IP address for reassembly. |
21 | 24 |
|
22 | | -uint24 frame_index # Zero-based index of the payload fragment carried by this frame. |
23 | | -void8 |
24 | 25 | uint32 frame_payload_offset # The offset of the frame payload relative to the start of the transfer payload. |
25 | 26 | uint32 transfer_payload_size # Total for all frames. |
26 | 27 |
|
27 | | -# Transfer identification information. |
28 | | -# The transfer-ID is a single field that segregates transfers by topic hash and epoch (publisher sequence restarts). |
29 | | -# Offset 16 bytes. |
30 | | - |
31 | | -uint64 transfer_id # For multi-frame reassembly and dedup. ACK specifies the acked tfer here. |
32 | | -uint64 sender_uid # Origin identifier ensures invariance to the source IP address for reassembly. |
33 | | - |
34 | | -# Integrity checking information. |
35 | | -# Offset 32 bytes. |
36 | | - |
37 | 28 | uint32 prefix_crc32c # crc32c(payload[0:(frame_payload_offset+payload_size)]) |
38 | 29 | uint32 header_crc32c # Covers all fields above. Same as the transfer payload CRC. |
39 | 30 |
|
40 | | -# End of header at 40 bytes. Payload follows. |
| 31 | +# Header size 32 bytes; payload follows. |
0 commit comments