cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2619
Views
5
Helpful
3
Replies

UDP - Message Boundaries Question :)

Iluvnetwork
Level 1
Level 1

How does UDP manage to preserve message boundaries? I am guessing that UDP can preserve messages boundaries because UDP doesn't care about the RWND/CWND or congestion when it transmits the data, Right? 

 

Lastly, my understanding is that:

TCP data get segmented at L4 within the buffer according to many variables such as RWND, CWND, additional mechanisms, and etc. UDP data also get segmented from the Hard. I am wondering according to which size, does UDP data get segmented and become a datagram?

1 Accepted Solution

Accepted Solutions

Peter Paluch
Cisco Employee
Cisco Employee

Hello,

UDP preserves message boundaries by a set of its design traits:

  • UDP never groups several blocks of data received from the application together into a single segment, and it never splits a single block of data received from the application into multiple segments. There is always a 1:1 relation between the block of data received from the application, and the resulting UDP segment. Whatever comes from the application, UDP just puts its header on it, and passes it to IP.
  • After the UDP segment is delivered to the destination host, the receiving application is supposed to call an OS function (typically read() or recv(), depending also on the programming language) to receive the payload of the segment. Every recv() dequeues exactly one received UDP segment. Even if the application reads less bytes than the size of the segment, the whole segment is considered to be dequeued; any unread bytes from the dequeued segment will be irretrievably lost.

Best regards,
Peter

View solution in original post

3 Replies 3