Home docs pia protocols Mesh
Post

Mesh

Protocol PortDescription
0Unreliable
1Reliable
Message TypeDescription
0x01Join request
0x02Join response
0x04Leave request
0x08Leave response
0x10Destroy mesh
0x11Destroy response
0x20Update mesh
0x21Kickout notice
0x22Dummy message
0x23Dummy ack
0x24Connection failure notice
0x40Greeting
0x41Migration finish
0x42Greeting response
0x44Migration start
0x48Migration response
0x49Multi migration start
0x4AMulti migration rank decision
0x80Connection report
0x81Relay route directions

The following version numbers are advertised during the connection request:

Pia versionVersion
5.19 - 5.200
5.21 - 5.271
5.28 - 5.292
5.30 - 5.433

Join request

Up to 5.10:

TypeDescription
Uint8Message type (1)
Uint8Station index
Uint16Padding (always 0)
StationAddressStation address
Uint32Ack id

5.11 - 5.18:

TypeDescription
Uint8Message type (1)
Uint8Station index
Uint32Ack id

Join response (success)

If the join response is too big to be sent in a single packet it is split into fragments.

Up to 3.10:

TypeDescription
Uint8Message type (2)
Uint8Number of stations in mesh, including joining station
Uint8Index of host station
Uint8Index of joining station
Uint8Number of fragments
Uint8Fragment index
Uint8Number of station info entries in current fragment (N)
Uint8Base index of station info in current fragment
StationInfo (xN)Station info list
Uint32Ack id

4.8 - 4.10:

TypeDescription
Uint8Message type (2)
Uint8Number of stations in mesh, including joining station
Uint8Index of host station
Uint8Index of joining station
Uint8Number of fragments
Uint8Fragment index
Uint8Number of station info entries in current fragment (N)
Uint8Base index of station info in current fragment
Uint8Maximum number of stations in first mesh
Uint8Maximum number of stations in second mesh
Uint16Padding
StationInfo (xN)Station info list
Uint32Ack id

5.18

TypeDescription
Uint8Message type (2)
Uint8Number of stations in mesh, including joining station
Uint8Index of host station
Uint8Index of joining station
Uint8Number of fragments
Uint8Fragment index
Uint8Number of station info entries in current fragment (N)
Uint8Base index of station info entries in current fragment
Uint8Maximum number of stations in first mesh
Uint8Maximum number of stations in second mesh
Uint8Maximum number of stations (total)
Uint8Padding
Uint32Update counter (incremented on each mesh update)
StationInfo (xN)Station info list
Uint32Ack id

Join response (denying)

OffsetSizeDescription
0x01Message type (2)
0x11Always 0
0x21Always 0xFF
0x31Always 0xFF
0x41Reason

Leave request

OffsetSizeDescription
0x01Message type
0x11Station index
0x22Padding
0x48StationAddress

Leave response

OffsetSizeDescription
0x01Message type
0x11Station index
0x22Padding
0x48StationAddress

Destroy request

OffsetSizeDescription
0x01Message type
0x11Station index
0x22Padding
0x48StationAddress

Destroy response

OffsetSizeDescription
0x01Message type
0x11Station index

Update mesh

Because this message is sent through the reliable mesh protocol it does not need to be split into fragments like the join response.

OffsetSizeDescription
0x01Message type
0x11Number of stations
0x21Host index
0x31Always 0
0x44Update counter (incremented on each mesh update)
0x81Number of fragments
0x91Fragment index
0xA1Number of station info entries in current fragment
0xB1Base index of station info entries in current fragment
0xC StationInfo entries

StationInfo

Up to 5.9:

TypeDescription
StationConnectionInfoConnection info
Uint8Station index
 Padding such that the size becomes a multiple of 4 bytes.

5.10 - 5.18:

OffsetSizeDescription
0x00x3EStationLocation. If it takes up less than 0x3E bytes the remaining bytes are filled with 0’s.
0x3E1Station index
0x3F1Padding
Contents