Tkkrlab Token Network Protocol
From
Offsets | Octet | 0 | 1 | 2 | 3 | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Octet | Bit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ||||||||
0 | 0 | Destination Address | Source Address | ||||||||||||||||||||||||||||||||||||||
4 | 32 | O C C |
P I D |
. . . |
. . . |
. . . |
. . . |
. . . |
. . . |
Length | Payload | ||||||||||||||||||||||||||||||
8 ... |
64 ... |
Payload | Checksum |
- Destination Address (16 bits) – What machine is allowed to read the packet. 0x0000 is Master, 0xFFFF is Broadcast.
- Source Address (16 bits) – What machine is allowed to switch the OCC bit.
- OCC (1 bit) - Occupied. Is there data in the frame?
- PID (1 bit) - Packet ID. Should flip every time the packet data is changed.
- ... (6 bits) - Reserved.
- Length (16 bits) - Length of Payload.
- Payload (Max. 65536 bits) - The Data.
- Checksum (16 bits) - Checksum is calculated by taking the sum of the payload, ignoring overflow.
Function of Master
If there is no token frame going around, the master computer should create a new token.