brannondorsey / chattervox

📡 An AX.25 packet radio chat protocol with support for digital signatures and binary compression. Like IRC over radio waves.
Other
748 stars 36 forks source link

RFC #2: Message Sequence Field #20

Open brannondorsey opened 5 years ago

brannondorsey commented 5 years ago

Proposal

Add an optional message sequence field to the chattervox packet. Initially proposed here.

Details

This functionality can be useful in determining if messages have been lost in transmission. It can also be used to protect against replay attacks in the event that clock synchronization is not possible or no timestamp field is included in the packet (see RFC #1).

This RFC proposes protocol-level support for message sequence numbers, however, it is up to the chattervox client software to choose how use them.

Considerations

Protocol Changes

Byte Offset # of Bits Name Value Description
0x0000 16 Magic Header 0x7a39 A constant two-byte value used to identify chattervox packets.
0x0002 8 Version Byte Number A protocol version number between 1-255.
0x0003 5 Unused Flag Bits Null Reserved for future use.
0x0003 1 Sequence Number Flag Bit A value of 1 indicates that the message contains a message sequence number.
0x0003 1 Digital Signature Flag Bit A value of 1 indicates that the message contains a ECDSA digital signature.
0x0003 1 Compression Flag Bit A value of 1 indicates that the message payload is compressed.
[0x0004] [8] [Signature Length] Number The length in bytes of the digital signature. This field is only included if the Digital Signature Flag is set.
[0x0004 or 0x0005] [0-2048] [Digital Signature] Bytes The ECDSA digital signature created using a SHA256 hash of the message contents and the sender's private key.
[0x0004-0x104] 8 or 24 **[Sequence Number]*** Unsigned Integer A message sequence number. This number should increase by one each time a new message is sent by a chattervox client.
0x0004-0x11C 0-∞ Message* Bytes The packet's UTF-8 message payload. If the Compression Flag is set the contents of this buffer is a raw DEFLATE buffer containing the UTF-8 message.
bold values indicate proposed changes.
[] indicates an optional field.
* indicates a member of the signed message if a digital signature is present.

Open Questions