Silly Window Syndrome | Nagle’s Algorithm

Silly Window Syndrome-

 

  • Silly Window Syndrome is a problem that arises due to the poor implementation of TCP.
  • It degrades the TCP performance and makes the data transmission extremely inefficient.

 

Why This Name?

 

The problem is called so because-

  • It causes the sender window size to shrink to a silly value.
  • The window size shrinks to such an extent where the data being transmitted is smaller than TCP Header.

 

Causes-

 

The problem arises due to following causes-

 

 

  1. Sender transmitting data in small segments repeatedly
  2. Receiver accepting only few bytes at a time repeatedly

 

Cause-01: Sender Transmitting Data In Small Segments Repeatedly-

 

  • Consider application generates one byte of data to send at a time.
  • The poor implementation of TCP causes the sender to send each byte of data in an individual TCP segment.

 

This problem is solved using Nagle’s Algorithm.

 

Nagle’s Algorithm-

 

Nagle’s Algorithm tries to solve the problem

caused by the sender delivering 1 data byte at a time.

 

Nagle’s algorithm suggests-

  • Sender should send only the first byte on receiving one byte data from the application.
  • Sender should buffer all the rest bytes until the outstanding byte gets acknowledged.
  • In other words, sender should wait for 1 RTT.
  • After receiving the acknowledgement, sender should send the buffered data in one TCP segment.
  • Then, sender should buffer the data again until the previously sent data gets acknowledged.

 

Cause-02: Receiver Accepting Only Few Bytes Repeatedly-

 

  • Consider the receiver continues to be unable to process all the incoming data.
  • In such a case, its window size becomes smaller and smaller.
  • A stage arrives when it repeatedly sends the window size of 1 byte to the sender.

 

This problem is solved using Clark’s Solution.

 

Clark’s Solution-

 

Clark’s Solution tries to solve the problem

caused by the receiver sucking up one data byte at a time.

 

Clark’s solution suggests-

  • Receiver should not send a window update for 1 byte.
  • Receiver should wait until it has a decent amount of space available.
  • Receiver should then advertise that window size to the sender.

 

Specifically, the receiver should not send a window update-

  • Until it can handle the MSS it advertised during Three Way Handshake
  • Or until its buffer is half empty, whichever is smaller.

 

Important Notes-

 

Note-01:

 

Nagle’s algorithm is turned off for the applications that require data to be sent immediately.

 

This is because-

  • Nagle’s algorithm sends only one segment per round trip time.
  • This impacts the latency by introducing a delay.

 

Note-02:

 

Nagle’s algorithm and Clark’s solution are complementary.

 

  • Both Nagle’s solution and Clark’s solution can work together.
  • The ultimate goal is sender should not send the small segments and receiver should not ask for them.

 

PRACTICE PROBLEM BASED ON NAGLE’S ALGORITHM-

 

Problem-

 

A fast typist can do 100 words a minute and each word has an average of 6 characters. Demonstrate Nagle’s algorithm by showing the sequence of TCP segment exchanges between a client with input from our fast typist and a server. Indicate how many characters are contained in each segment sent from the client.

 

Consider the following two cases-

  1. The client and server are in the same LAN and the RTT is 20 ms.
  2. The client and server are connected across a WAN and the RTT is 100 ms.

 

Solution-

 

Nagle’s algorithm suggests-

  • Sender should wait for 1 RTT before sending the data.
  • The amount of data received from the application layer in 1 RTT should be sent to the receiver.

 

Case-01:

 

Amount of data accumulated in 1 RTT

= (600 characters / 1 minute) x 20 msec

= (600 characters / 60 sec) x 20 msec

= (10 characters / 103 msec) x 20 msec

= 0.2 characters

 

From here, we observe-

  • Even if the sender waits for 1 RTT, not even a single character is produced.
  • So, sender will have to wait till it receives at least 1 character.
  • Then, sender sends it in one segment.

 

Thus, one character will be sent per segment.

Assuming the TCP header length is 20 bytes, 41 bytes of data will be sent in each segment.

 

Case-02:

 

Amount of data accumulated in 1 RTT

= (600 characters / 1 minute) x 100 msec

= (600 characters / 60 sec) x 100 msec

= (10 characters / 103 msec) x 100 msec

= 1 character

 

From here, we observe that one character is produced in 1 RTT.

 

Thus, one character will be sent per segment.

Assuming the TCP header length is 20 bytes, 41 bytes of data will be sent in each segment.

 

Next Article- User Datagram Protocol | UDP Header

 

Get more notes and other study material of Computer Networks.

Watch video lectures by visiting our YouTube channel LearnVidFun.

Summary
Silly Window Syndrome | Nagle's Algorithm
Article Name
Silly Window Syndrome | Nagle's Algorithm
Description
Silly Window Syndrome is a problem that arises due to the poor implementation of TCP. Nagle's Algorithm and Clark's solution tries to solve the problems caused due to silly window syndrome.
Author
Publisher Name
Gate Vidyalay
Publisher Logo
Liked this article? Share it with your friends and classmates now-