How does modern computer networking work?

Sliding Window Protocol:

A window is a space that holds or can hold multiple bytes. For example, if there is a window of 1000 bytes and the size of the individual message or frame is 100 bytes long. There could be a maximum of 10 messages at any time in the window.

The sliding window is a technique for sending multiple frames at a time. In this technique, each frame has sent from the sequence number. The sequence numbers are used to find the missing data in the receiver end. The purpose of the sliding window technique is to avoid duplicate data, so it uses the sequence number.

1.Go-Back-N Automatic Repeat Request(Go back N ARQ):

It is a data link layer protocol that uses a sliding window method. In this, if any frame is corrupted or lost, all subsequent frames have to be sent again.

If the receiver receives a corrupted frame, it cancels it. The receiver does not accept a corrupted frame. When the timer expires, the sender sends the correct frame again.

2.Selective Repeat Automatic Repeat Request(Selective Repeat ARQ):

The Go-back-N ARQ protocol works well if it has fewer errors. But if there is a lot of error in the frame, lots of bandwidth loss in sending the frames again. So, we use the Selective Repeat ARQ protocol. In this protocol, the size of the sender window is always equal to the size of the receiver window. The size of the sliding window is always greater than 1.

If the receiver receives a corrupt frame, it does not directly discard it. It sends a negative acknowledgment to the sender. The sender sends that frame again as soon as on the receiving negative acknowledgment. There is no waiting for any time-out to send that frame.

When we have network issue, then we reduce the window size by half to debug the issue. When the window size reaches 1, it is called as Silly window.

Flow Control:

Flow control methods are techniques that determine the data flow between sender and receiver. It determines how much data should be send by the sender before receiving acknowledgement. It makes sender to wait for some sort of an acknowledgement before continuing to send some more data.

  1. Avoids the sender from overwhelming the receiver
  2. Sender transmits the data slowly to the receiver

Algorithms Used for Flow control are Nagle, Karn and Patridge, and Jacobson.

Congestion Control:

Congestion is a situation in Communication Networks in which too many packets are present in a part of the subnet, performance degrades.

Congestion in a network may occur when the load on the network is greater than the capacity of the network.

  1. Avoid senders from overwhelming the network
  2. Transmits the data to the network slowly

Network congestion occurs in case of traffic overloading. We have two Algorithms to help to regulate rate of data transmission and reduces congestion,

1.Leaky Bucket:

Suppose we have a bucket with a hole at the bottom of it, now we may input water into the bucket at any rate but the water will pour at a constant rate from the bottom.

Java code for leaky bucket algorithm

2.Token Bucket:

To over come the problem of water overflowing in the leaky bucket. We use Token bucket, it has a finite set of tokens. Each packet is given a token, if token are finished then the packet has to wait in a queue, until token becomes available.

Java code for token bucket algorithm

It’s recommended to first put a token bucket and then a leaky bucket in the network.

Q.How to reduce packet drops?

1.Additive Increase Multiplicative Decrease(AIMD):

It checks the traffic in the network and

  1. If there is less traffic in the network, then increase the window size by 1.
  2. If there is more traffic in the network, then decrease the window size by half.

2.Random Early Detection(RED):

It calculates the probability of a packet to be dropped, If the probability is high it will drop it otherwise will enqueue it.

  1. http://www.eecs.umich.edu/courses/eecs489/w07/LectureSlides/lec8_tcp.pdf
  2. https://web.cs.wpi.edu/~rek/Undergrad_Nets/C02/TCP_SlidingWindows.pdf
For more Information on flow and congestion control:

One thought on “How does modern computer networking work?

Leave a comment