Tkkrlab Ethernet Interface 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 | |||||||||||||||||||||||||||||||
4 | 32 | Destination Port | D I S |
C O N |
T C P |
. . . |
. . . |
. . . |
. . . |
. . . |
Connection ID | ||||||||||||||||||||||
8 ... |
64 ... |
Payload |
- Destination Address (32 bits) – IPv4 address of receiver
- Destination Port (16 bits) – Destination Port
- DIS (1 bit) - If true, send payload then disconnect.
- CON (1 bit) - Connect. If Connection ID is supplied, try that ID. If connection ID is already in use, return ID in use.
- TCP (1 bit) - If true, use TCP to connect. If false, use UDP. Matters only when CON bit is high.
- ... (5 bits) - Reserved.
- Connection ID (16 bits) - What connection to use.
- Payload (Max. 65536 bits) - The Data.
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 | Source Address | |||||||||||||||||||||||||||||||
4 | 32 | Source Port | Pack Type |
T C P |
. . . |
. . . |
. . . |
Connection ID | |||||||||||||||||||||||||
8 ... |
64 ... |
Payload |
- Source Address (32 bits) – IPv4 address of source
- Source Port (32 bits) - Source Port
- Pack Type (4 bits) - Packet type:
- 0x0 - Ethernet Response
- 0x1 - Connection Established(Payload contains
- 0x2 - AddressInUseError(Connection ID contains alternative address used)
- 0x3 - AddressDoesNotExistError
- 0x4 - TimeoutError(Connection timed out)
- 0x5 - ConnectionRefusedError(Host refused connection)
- 0xF - UndefinedError(We don't know what the shit happened here, payload might contain debug info.)