3.1.3 Initialization

The DirectPlay 8 Protocol: NAT Locator extensions SHOULD be initialized whenever the DirectPlay 8 Protocol: Core and Service Providers begins connecting an existing peer to a new peer that is attempting to join the game session. For an existing peer, the connection starts when the existing peer receives the DN_INSTRUCT_CONNECT message and responds to the message by initiating the connection. For the new peer, the connection starts when the new peer receives the DN_SEND_CONNECT_INFO message and responds to the message by preparing to accept the connection.

To use Path Tests, both peers MUST fill in a PATHTESTKEYDATA pseudo-structure with the following:

dpnidSender: Set to the DPNID of the new peer, in little-endian byte order.

dpnidTarget: Set to the DPNID of the existing peer, in little-endian byte order. For the new peer, the value of the dpnidTarget field is part of the DN_SEND_CONNECT_INFO message described in [MC-DPL8CS] section 2.2.1.4.

guidApplication: Set to the DirectPlay 8 Protocol: Core and Service Providers application GUID.

guidInstance: Set to the DirectPlay 8 Protocol: Core and Service Providers game session instance GUID.

Both peers MUST then generate a SHA-1 digest, as specified in [FIPS180], of the PATHTESTKEYDATA binary data, and use the first 64 bits of the output value as the Path Test key value ullKey.

For the existing peer, the value of the calculated ullKey ADM element MUST remain associated with the connection attempt that the peer is performing until either the attempt fails, the attempt completes successfully, or the peer receives a valid PATH_TEST message as described in section 3.1.5. Also at this time, the existing peer MUST prepare to accept PATH_TEST messages in response to its instructed peer connection, in addition to the standard [MC-DPL8CS] and [MC-DPL8R] connection responses.

For the new peer, this value MUST be used in the periodic transmission of PATH_TEST messages as described in section 3.1.6. Also at this time, the Path Test Retry Timer MUST be initialized. This process SHOULD be repeated for each existing peer as described in the DN_SEND_CONNECT_INFO message ([MC-DPL8CS] section 2.2.1.4).