Skip to content

Network Protocol

Tom Colas edited this page Jan 18, 2026 · 2 revisions

R-Type UDP Reliable Protocol (RURP)

Status: Experimental

Category: Informational


1. Introduction

This document specifies the R-Type UDP Reliable Protocol (RURP), a lightweight reliability layer built on top of UDP.

RURP provides TCP-like guarantees (delivery, ordering is optional) while retaining UDP performance characteristics.


2. Terminology

  • BASIC: Unreliable UDP transmission
  • SAFE: Reliable UDP transmission
  • ACK: Acknowledgment packet
  • SAFE UID: Unique identifier for reliable packets

3. Packet Structure

0                   1                   2                   3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                         ID (size_t)                           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           Protocol            |         SAFE UID              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Size              |            Type               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                         Payload ...                           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

4. Protocol Types

Value Name
0 BASIC
1+ SAFE (Client-specific ID)

5. SAFE Transmission

  1. Sender assigns a unique SAFE UID
  2. Packet is sent
  3. Receiver replies with ACK (type = 0)
  4. Sender removes packet from retransmission queue

6. Retransmission Policy

  • Timeout-based retransmission
  • Default timeout: 100ms
  • Infinite retries until ACK or disconnect

7. Acknowledgment Packet

ACK packets:

  • Use same protocol ID
  • type = 0
  • No payload
  • Carry SAFE UID

8. Client Identification

Clients are identified by:

  • IP address
  • UDP port

No persistent session state is required.


9. Security Considerations

This protocol provides no encryption or authentication. It is intended for trusted environments (LAN / game servers).


10. Use Cases

  • Game menus
  • Lobby systems
  • Reliable state synchronization
  • ECS event replication