2.2.2.2 CONNECT

The CONNECT message is used by a node to establish a direct connection or neighbor connection with another node. This message provides the destination node with the listening addresses of the source node.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

Message Size

Version

Message Type

Reserved1

Z1

Z2

Z3

Z4

U

D

Z7

N

Address Count

Address Offset

Friendly Name Offset

Reserved2

Source Node ID

...

IPv6 Address Array (variable)

...

Friendly Name (variable)

...

Message Size (4 bytes): The total number of bytes in the message.

Version (1 byte): The Peer-to-Peer Graphing Protocol version number. This MUST be set to 0x10 to signify version 1.0.

Message Type (1 byte): MUST be set to 0x02.

Reserved1 (2 bytes): MUST be set to zero and MUST be ignored on receipt.

Z1 (1 bit): MUST be set to 0 and MUST be ignored on receipt.

Z2 (1 bit): MUST be set to 0 and MUST be ignored on receipt.

Z3 (1 bit): MUST be set to 0 and MUST be ignored on receipt.

Z4 (1 bit): MUST be set to 0 and MUST be ignored on receipt.

U (1 bit): (Update): When set, indicates that the source node has begun listening and now has a valid set of addresses.

D (1 bit): (Direct): When set, indicates that this connection is being established as a direct connection.

Z7 (1 bit): MUST be set to 0 and MUST be ignored on receipt.

N (1 bit): (Neighbor List): When set, this flag indicates that the source node wants the list of neighbors of the target node.

Address Count (1 byte): The total number of address entries included in the message. If the Update bit is set, this field MUST NOT be zero.

Address Offset (2 bytes): The offset, in bytes, from the beginning of the message to the first address in the address list.

Friendly Name Offset (2 bytes): The offset, in bytes, from the beginning of the message to the Friendly Name.

Reserved2 (2 bytes): MUST be set to zero and MUST be ignored on receipt.

Source Node ID (8 bytes): The node ID of the sender.

IPv6 Address Array (variable): An array of Address Count IPv6 addresses in PEER_IN6_ADDRESS (section 2.2.1.3) form. This field MUST NOT be present if the Address Count is 0.

Friendly Name (variable): A null-terminated UTF-8 string representing the friendly name of the sender. If the Friendly Name Offset is equal to the Message Size, this field MUST NOT be present.