Reliable UDP (RUDP): Can UDP be made reliable?

Table of Contents

Contributors

Picture of Nafayeth

Nafayeth

Tech Stack
0 +
Want to accelerate your software development your company?

It has become a prerequisite for companies to develop custom software products to stay competitive. Vivasoft's technical expertise.

The major decision has to be made for the real-time application is which transport protocol will be used, as some features demand reliability, some need real time effects. Beyond these, developers had to develop an optimized solution so that user can use the application in low bandwidth efficiently, reducing user handset’s power consumption, and also using peer-to-peer communication system where possible.

 

Popular Communication Protocols:

TCP and UDP are the most commonly used ones.

TCP provides a reliable connection and is used by the majority of current Internet applications. TCP, besides being responsible for error checking and correcting, is also responsible for controlling the speed at which this data is sent. TCP is capable of detecting congestion in the network and will back off transmission speed when congestion occurs. These features protect the network from congestion collapse. As TCP provides features such as congestion control, it would be the preferred protocol to use. Unfortunately due to the fact that TCP is a reliable service, delays will be introduced whenever a bit error or packet loss occurs. This delay is caused by retransmission of the broken packet, along with any successive packets that may have already been sent. This can be a large source of jitter. TCP uses a combination of four algorithms to provide congestion control, slow start, and congestion avoidance, fast retransmit and fast recovery. These algorithms all use packet loss as an indication of congestion, and all alter the number of packets TCP will send before waiting for acknowledgments of those packets. These alterations affect the bandwidth available and also change delays seen on a link, providing another source of jitter. Combined, TCP raises jitter to an unacceptable level rendering TCP unusable for real-time services. And also affects handset’s power consumption.

UDP is a thin layer on top of IP that provides a way to distinguish among multiple programs running on a single machine. UDP also inherits all of the properties of IP that TCP attempts to hide. UDP is therefore also a packet based connectionless, best-effort service. It is up to the application to split data into packets, and provide any necessary error checking that is required. Because of this, UDP allows the fastest and most simple way of transmitting data to the receiver. There is no interference in the stream of data that can be possibly avoided. This provides the way for an application to get as close to meeting real-time constraints as possible. UDP however provides no congestion control systems. A congested link that is only running TCP will be approximately fair to all users. When UDP data is introduced into this link, there is no requirement for the UDP data rates to back off, forcing the remaining TCP connections to back off even further.

 

What is RUDP?

In summary, TCP is easy because it works in all cases, but it is less efficient because of that. On the other hand, UDP either needs its applications to be resilient to loss or the application developer needs to write in a system for ensuring that missing/corrupted packets are retransmitted. And such systems are in effect proprietary RUDP. RUDP is used in many famous projects, such as Google’s QUIC and WebRTC.

 

What is RUDP

Diagram: – What is RUDP?

 

Why RUDP?

Now we will take a look how RUDP can solve Latencies in Network Games.

One of the major problems in network games has been that of latency (lagging) that game
technology researchers are still tackling. Latency largely affects user satisfaction and it is often caused by insufficient hardware capacity or the internet speed that the user is employing. Even though online games are becoming more complex and the number of participants in these games is increasing continuously, users cannot properly deal with the requirements to play these games, as system upgrades and subscription changes to a higher speed internet service are costly. Instead of passing such a burden on to the users, the game companies should instead invest in providing an improved communication algorithm.

When RUDP is ideally implemented, it is possible to distinguish between the information essential and non-essential for playing games even if it has been lost. Also, the essential information can be distinguished into the cases where its order is guaranteed or unguaranteed. Actually, since the amount and the frequency of these non-essential packets being lost during
communications are low, they can be effective when they are used appropriately. The data which is to be transmitted repeatedly can be renewed/updated even if it is lost and the information which does not largely affect the visual component (e.g., the movement of an unnoticeable character at the edge of the screen, etc.) should be utilized more actively.

Unlike TCP, it is possible that the delay caused by momentary packet error in the network (latency) can be reduced a little. For instance, supposing that the information (low-reliability + no order) of the characters A, B, and C have died in sequence has been transmitted by the server, it will not be so strange in the game that the characters B and C would die first followed by A when the information is used regardless of its credibility and order. In the case where TCP is used, the information of A will be retransmitted first and all the characters will die later. In other words, if the process is implemented with TCP only, the delay will not only occur for B and C but also for all the actions taking place after their death. Actually, UDP can be used widely in games as it has fewer constraints between the personal networks.

Meanwhile, RUDP is introducing the concept ‘Reliable state’ in addition to 3 data types.
For example, when the state has been changed as A → B → C, any re-transmission request will
not be requested even when only A has been received followed by C, skipping B. Therefore, RUDP is optimized for making the most of its characteristics of maintaining the latest information with reliability while maintaining the main concept of the game.

 

RUDP Work Flow

Diagram: – RUDP Work Flow

 

The game companies and their researchers are still dealing with one of the major issues in their gaming software, the latency or the lagging. A variety of factors (e.g., hardware capacities, internet connections, etc.) are involved in this issue and its effect is growing larger as the online games are becoming more complex and sophisticated allowing more participants to join them. Although the game companies encourage or recommend the users to upgrade their systems or change internet service providers to solve the problem, they still need to consider the situation where their customers would not be able to afford costly upgrades or move to an expensive internet service. This will definitely affect their sales policy so that they are consistently looking for a more efficient way of stabilizing the gaming speed without actually forcing the customers to make changes. One of the major problems involved with gaming speed has been the communication algorithm, and the communication protocol in particular.

Tech Stack
0 +
Accelerate Your Software Development Potential with Us
With our innovative solutions and dedicated expertise, success is a guaranteed outcome. Let's accelerate together towards your goals and beyond.
Blogs You May Love

Don’t let understaffing hold you back. Maximize your team’s performance and reach your business goals with the best IT Staff Augmentation