frames - SkycoinWikis/dmsg GitHub Wiki
HOME » SOFTWARE » DMSG » FRAMES
Frames
Frames are sent and received within a dmsg connection after the noise handshake. A frame has two sections; the header and the payload. Here are the fields of a frame:
|| FrameType | TransportID | PayloadSize || Payload ||
|| 1 byte | 2 bytes | 2 bytes || ~ bytes ||
- The
FrameTypespecifies the frame type via the one byte. - The
TransportIDcontains an encodeduint16which represents a identifier for a transport. A set of IDs are unique for a givendmsgconnection. - The
PayloadSizecontains an encodeduint16which represents the size (in bytes) of the payload. - The
Payloadhave a size that is obtainable viaPayloadSize.
The following is a summary of the frame types:
| FrameType | Name | Payload Contents | Payload Size |
|---|---|---|---|
0x1 |
REQUEST |
initiating client's public key + responding client's public key | 66 |
0x2 |
ACCEPT |
initiating client's public key + responding client's public key | 66 |
0x3 |
CLOSE |
1 byte that represents the reason for closing | 1 |
0xa |
FWD |
uint16 sequence + transport payload | >2 |
0xb |
ACK |
uint16 sequence | 2 |