Diarkis RUDP
Overview
The Reliable User Datagram Protocol (RUDP) is an implementation of UDP communication that guarantees data delivery. Diarkis client can use RUDP to transmit data either in communication with the server or in P2P communication, ensuring that critical information necessary for game progression is reliably delivered. This page explains the specifications and settings of Diarkis's RUDP.
Specifications of Diarkis RUDP
The combinations in which Diarkis RUDP can be established include server-client and client-client (P2P communication). Some features are only available in P2P communication.
In Diarkis RUDP, when data is received, an Acknowledgement (ACK) is returned to inform the sender of the data's arrival. If an ACK is not received within a specified timeframe, the Diarkis client will resend the same data. In this document, this timeframe is referred to as RetryInterval. Furthermore, if an ACK is not received after resending the data a specified number of times, the Diarkis client will disconnect the communication with the other party due to a timeout. In this document, this number of retries is referred to as RetryMaxCount.
Exclusively in P2P communication with RUDP, a sequence guarantee toggle feature is provided in addition to data delivery assurance. When sequence guarantee is enabled, it ensures that the data received by the application is in the order sent by the peer user. The Diarkis library will not pass data to the application until packets are received in the correct sequential order. If the sequence guarantee is disabled, the Diarkis library will pass packets to the application in the order they are received, and this order may vary due to network conditions or the presence of retransmitted packets.
In server-client RUDP communication, sequence guarantee is always enabled.
Settings for Diarkis RUDP
Setting RetryInterval
RetryInterval can be adjusted using the following function:
RetryInterval begins with the time specified by minMs
(milliseconds) and doubles each time the client resends until it reaches the time specified by maxMs
. For example, if minMs=300ms, maxMs=1000ms, and RetryMaxCount is 5, the RetryInterval changes as 300ms, 600ms, 900ms, 1000ms, 1000ms. If the fifth resend times out, the client disconnects the communication.
By making RetryInterval exponential, you can reduce the network processing load on the client. If you want to set a fixed RetryInterval, specify the same values for minMS
and maxMS
to keep RetryInterval constant regardless of the number of retries.
Setting RetryMaxCount
RetryMaxCount can be adjusted using the following function:
RetryMaxCount will be the value specified by count
.
Setting Sequence Guarantee
a. When using the Diarkis Module, control the operation of RUDP with the type
argument in functions such as SendBroadcast
defined in DiarkisP2PBase.h
. Specify a value from the enumerated type RudpType
for the type
argument.
b. When using the library directly, execute the data transmission function for P2P communication shown below with the bFixedOrder
flag set to true
.
Cautions in Settings
SetSendRetryInterval
andSetSendRetryMaxCount
set configurations for RUDP communication with the server. For P2P communication settings, useSetSendRetryIntervalP2P
andSetSendRetryMaxCountP2P
.Be cautious that if RetryInterval is extremely small or RetryMaxCount is large, the client will need to send a large number of packets, increasing the network processing load.
Last updated
Was this helpful?