LogoLogo
English
English
  • Diarkis Help Center
  • Overview of Diarkis
  • Getting Started
    • Diarkis Server Template
    • Diarkis Client SDK
    • Tutorials
      • 1. Launch Diarkis Server in Local Environment
      • 2. Perform Connectivity Check with Test Client
      • 3. Implement Custom Command
      • Connect to Server from Diarkis Client
    • Samples
  • Diarkis Modules
    • Room Module
      • Set Up Room Module on Server
      • Room Sample
        • room_broadcast
      • Utilizing Room Module from Client
      • Additional Features of Room
    • MatchMaker Module
      • Set Up MatchMaker Module on Server
    • Field Module
      • Set Up Field Module on Server
    • P2P Module
      • Set Up P2P Module on Server
      • P2P Sample
    • DM (Direct Message) Module
      • Set Up DM Module on Server
    • Notifier Module
      • Set Up Notifier Module on Server
    • Session Module
      • Set Up Session Module on Server
    • Group Module
      • Set Up Group Module on Server
  • Diarkis Server
    • Launch Diarkis Server in Cloud Environment
      • AWS
    • Launch Diarkis Server on Windows Environment
    • MARS Server
    • UDP Server
    • TCP Server
    • HTTP Server
    • Metrics API
    • Inter-server Communication - Mesh
  • Diarkis Client
    • Runtime Library
      • Diarkis RUDP
    • Diarkis Module
      • Initialization and Termination of Diarkis Module
      • Customization of Diarkis Module
      • Logging System of Diarkis Module
      • Migration
      • Threads of Diarkis
    • Samples
      • C++
        • room_broadcast
        • directmessage_simple
        • group_sample
        • matching_and_turn
        • matchmaker_ticket
        • p2p_rudp_sample
        • session_simple
      • Unreal Engine Plugin
        • FieldWalker
      • Unity Plugin
        • FieldWalker
          • HowToReplicatePosition.md
  • Diarkis Tools
    • Diarkis CLI
      • Procedures to Switch to Diarkis CLI v3
  • References
    • API Reference
    • Release Notes
      • v1.0
      • v1.0.1
      • v1.0.2
      • v1.0.3
      • v1.0.4
      • v1.0.5
      • v1.0.6
  • Support
    • License and Billing
Powered by GitBook
On this page
  • Overview
  • Specifications of Diarkis RUDP
  • Settings for Diarkis RUDP
  • Setting RetryInterval
  • Setting RetryMaxCount
  • Setting Sequence Guarantee
  • Cautions in Settings

Was this helpful?

  1. Diarkis Client
  2. Runtime Library

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:

udp.h
void SetSendRetryInterval(uint32_t minMs, uint32_t maxMs)

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:

udp.h
void SetSendRetryMaxCount(uint32_t count)

RetryMaxCount will be the value specified by count.

Setting Sequence Guarantee

DiarkisP2PBase.h
uint16_t SendBroadcast(const uint8_t* payload, size_t payloadSize, RudpType type)
p2p.h
enum RudpType : uint8_t
{
    UNRELIABLE_UNORDERED = 0, // No delivery guarantee, no sequence guarantee (UDP)
    RELIABLE_UNORDERED = 1,   // Delivery guarantee, no sequence guarantee
    RELIABLE_ORDERED = 2      // Delivery guarantee, sequence guarantee
};

b. When using the library directly, execute the data transmission function for P2P communication shown below with the bFixedOrder flag set to true.

p2p.h
Diarkis::System::Result RSend(const uint8_t* message, size_t messageSize, bool bFixedOrder)

Cautions in Settings

  • SetSendRetryInterval and SetSendRetryMaxCount set configurations for RUDP communication with the server. For P2P communication settings, use SetSendRetryIntervalP2P and SetSendRetryMaxCountP2P.

  • 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.

PreviousRuntime LibraryNextDiarkis Module

Last updated 2 months ago

Was this helpful?

a. When using the , 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.

Diarkis Module