Category: Computer Networks

Access Control in Networking | Methods

Types of Communication Links-

 

In computer networking,

  • Communication links enable the stations to communicate with each other.
  • Stations may communicate using the following types of links-

 

 

  1. Point to Point Link
  2. Broadcast Link

 

1. Point to Point Link-

 

  • Point to Point link is a dedicated link that exists between the two stations.
  • The entire capacity of the link is used for transmission between the two connected stations only.
  • Depending upon the Type Of Channel, the data flow takes place between the stations.

 

Example-

 

 

2. Broadcast Link-

 

  • Broadcast link is a common link to which multiple stations are connected.
  • The capacity of the link is shared among the connected stations for transmission.

 

Example-

 

 

Access Control-

 

Access Control is a mechanism that controls the access of stations to the transmission link.

 

  • Broadcast links require the access control.
  • This is because the link is shared among several stations.

 

Need of Access Control-

 

To prevent the occurrence of collision or if the collision occurs, to deal with it.

 

Consider a situation where-

  • Multiple stations place their data packets on the link and starts transmitting simultaneously.
  • Such a situation gives rise to a collision among the data packets.
  • Collision of data packets causes the data to get corrupt.

 

Example-

 

Consider the following scenario-

 

 

Here,

  • Two stations A and D starts transmitting their data packets simultaneously.
  • This situation gives rise to a collision between the data packets transmitted by them.
  • Thus, to prevent the collision or to deal with it, access control is needed.

 

Access Control Methods-

 

Access control methods are the methods used for providing access control.

 

  • They prevent the collision or deal with it and ensures smooth flow of traffic on the network.
  • They are implemented at the data link layer of the OSI reference model.

 

Various access control methods used are-

 

 

  1. Time Division Multiplexing
  2. Polling
  3. CSMA / CD
  4. Token Passing
  5. Aloha

 

We will discuss all these methods one by one in detail.

 

To gain better understanding about Access Control,

Watch this Video Lecture

 

Next Article- Time Division Multiplexing (TDM)

 

Get more notes and other study material of Computer Networks.

Watch video lectures by visiting our YouTube channel LearnVidFun.

Stop and Wait ARQ | Sliding Window Protocols

Stop and Wait Protocol-

 

Before you go through this article, make sure that you have gone through the previous article on Stop and Wait Protocol.

 

In stop and wait protocol,

  • Sender sends one data packet and then waits for its acknowledgement.
  • Sender sends the next packet only after it receives the acknowledgement for the previous packet.

 

 

The main problem faced by the Stop and Wait protocol is the occurrence of deadlock due to-

  1. Loss of data packet
  2. Loss of acknowledgement

 

Stop and Wait ARQ-

 

Stop and Wait ARQ is an improved and modified version of Stop and Wait protocol.

 

Stop and Wait ARQ assumes-

  • The communication channel is noisy.
  • Errors may get introduced in the data during the transmission.

 

Working-

 

  • Stop and wait ARQ works similar to stop and wait protocol.
  • It provides a solution to all the limitations of stop and wait protocol.
  • Stop and wait ARQ includes the following three extra elements.

 

 

Thus, we can say-

 

Stop and Wait ARQ

= Stop and Wait Protocol + Time Out Timer + Sequence Numbers for Data Packets and Acknowledgements

 

Number of Sequence Numbers Required-

 

NOTE

For any sliding window protocol to work without any problem,

the following condition must be satisfied-

Available Sequence Numbers >= Sender Window Size + Receiver Window Size

 

Stop and wait ARQ is a one bit sliding window protocol where-

  • Sender window size = 1
  • Receiver window size = 1

 

Thus, in stop and wait ARQ,

Minimum number of sequence numbers required

= Sender Window Size + Receiver Window Size

= 1 + 1

= 2

 

Thus,

  • Minimum number of sequence numbers required in Stop and Wait ARQ = 2.
  • The two sequence numbers used are 0 and 1.

 

How Stop and Wait ARQ Solves All Problems?

 

1. Problem of Lost Data Packet-

 

  • Time out timer helps to solve the problem of lost data packet.
  • After sending a data packet  to the receiver, sender starts the time out timer.
  • If the data packet gets acknowledged before the timer expires, sender stops the time out timer.
  • If the timer goes off before receiving the acknowledgement, sender retransmits the same data packet.
  • After retransmission, sender resets the timer.
  • This prevents the occurrence of deadlock.

 

 

2. Problem of Lost Acknowledgement-

 

  • Sequence number on data packets help to solve the problem of delayed acknowledgement.
  • Consider the acknowledgement sent by the receiver gets lost.
  • Then, sender retransmits the same data packet after its timer goes off.
  • This prevents the occurrence of deadlock.
  • The sequence number on the data packet helps the receiver to identify the duplicate data packet.
  • Receiver discards the duplicate packet and re-sends the same acknowledgement.

 

 

Role of Sequence Number on Data Packets

 

Consider the above example-

 

Step-01:

 

  • Sender sends a data packet with sequence number-0 to the receiver.

 

Step-02:

 

  • Receiver receives the data packet correctly.
  • Receiver now expects data packet with sequence number-1.
  • Receiver sends the acknowledgement ACK-1.

 

Step-03:

 

  • Acknowledgement ACK-1 sent by the receiver gets lost on the way.

 

Step-04:

 

  • Sender receives no acknowledgement and time out occurs.
  • Sender retransmits the same data packet with sequence number-0.
  • This will be a duplicate packet for the receiver.

 

Step-05:

 

  • Receiver receives the data packet and discovers it is the duplicate packet.
  • It expects the data packet with sequence number-1 but receiving the data packet with sequence number-0.
  • It discards the duplicate data packet and re-sends acknowledgement ACK-1.
  • ACK-1 requests the sender to send a data packet with sequence number-1.
  • This avoids the inconsistency of data.

 

Conclusion-

 

  • Had the sequence numbers not been allotted to the data packets, receiver would have accepted the duplicate data packet thinking of it as the new data packet.
  • This is how sequence numbers allotted to the data packets prove to be useful for identifying the duplicate data packets and discarding them.

 

3. Problem of Delayed Acknowledgement-

 

  • Sequence number on acknowledgements help to solve the problem of delayed acknowledgement.

 

 

Role of Sequence Number on Acknowledgements

 

Consider the above example-

 

Step-01:

 

  • Sender sends a data packet with sequence number-0 to the receiver.

 

Step-02:

 

  • Receiver receives the data packet correctly.
  • Receiver now expects data packet with sequence number-1.
  • Receiver sends the acknowledgement ACK-1.

 

Step-03:

 

  • Acknowledgement ACK-1 sent by the receiver gets delayed in reaching the sender.

 

Step-04:

 

  • Sender receives no acknowledgement and time out occurs.
  • Sender retransmits the same data packet with sequence number-0.
  • This will be a duplicate packet for the receiver.

 

Step-05:

 

  • Receiver receives the data packet and discovers it is the duplicate packet.
  • It expects the data packet with sequence number-1 but receiving the data packet with sequence number-0.
  • It discards the duplicate data packet and re-sends acknowledgement ACK-1.
  • ACK-1 requests the sender to send a data packet with sequence number-1.

 

Step-06:

 

  • Two acknowledgements ACK1 reaches the sender.
  • When first acknowledgement ACK1 reaches the sender, sender sends the next data packet with sequence number 1.
  • When second acknowledgement ACK1 reaches the sender, sender rejects the duplicate acknowledgement.
  • This is because it has already sent the data packet with sequence number-1 and now sender expects the acknowledgement with sequence number 0 from the receiver.

 

Conclusion-

 

  • Had the sequence numbers not been allotted to the acknowledgements, sender would have accepted the duplicate acknowledgement thinking of it as the new acknowledgement for the latest data packet sent by it.
  • This is how sequence numbers allotted to the acknowledgements prove to be useful for identifying duplicate acknowledgements and discarding them.

 

4. Problem of Damaged Packet-

 

  • If receiver receives a corrupted data packet from the sender, it sends a negative acknowledgement (NAK) to the sender.
  • NAK requests the sender to send the data packet again.

 

 

Stop and Wait Protocol Vs Stop and Wait ARQ-

 

The following comparison table states the differences between the two protocols-

 

Stop and Wait Protocol Stop and Wait ARQ
It assumes that the communication channel is perfect and noise free. It assumes that the communication channel is imperfect and noisy.
Data packet sent by the sender can never get corrupt. Data packet sent by the sender may get corrupt.
There is no concept of negative acknowledgements. A negative acknowledgement is sent by the receiver if the data packet is found to be corrupt.
There is no concept of time out timer. Sender starts the time out timer after sending the data packet.
There is no concept of sequence numbers. Data packets and acknowledgements are numbered using sequence numbers.

 

Limitation of Stop and Wait ARQ-

 

The major limitation of Stop and Wait ARQ is its very less efficiency.

 

To increase the efficiency, protocols like Go back N and Selective Repeat are used.

 

Explanation-

 

In stop and wait ARQ,

  • Sender window size is 1.
  • This allows the sender to keep only one frame unacknowledged.
  • So, sender sends one frame and then waits until the sent frame gets acknowledged.
  • After receiving the acknowledgement from the receiver, sender sends the next frame.

 

 

Here,

  • Sender uses Tt time for transmitting the packet over the link.
  • Then, sender waits for 2 x Tp time.
  • After 2 x Tp time, sender receives the acknowledgement for the sent frame from the receiver.
  • Then, sender sends the next frame.
  • This 2 x Tp waiting time is the actual cause of less efficiency.

 

Efficiency Improvement-

 

  • The efficiency of stop and wait ARQ can be improved by increasing the window size.
  • This allows the sender to keep more than one unacknowledged frame in its window.
  • Thus, sender can send frames in the waiting time too.

This gives rise to the concept of sliding window protocols.

 

To gain better understanding about Stop and Wait ARQ,

Watch this Video Lecture

 

Next Article- Practice Problems On Stop and Wait Protocol

 

Get more notes and other study material of Computer Networks.

Watch video lectures by visiting our YouTube channel LearnVidFun.

Flow Control | Stop and Wait Protocol

Flow Control in Computer Networks-

 

In computer networks, flow control is defined as-

 

A set of procedures which are used for restricting the amount of data that a sender can send to the receiver.

 

Flow Control Protocols-

 

There are various flow control protocols which are classified as-

 

 

In this article, we will discuss about stop and wait protocol.

 

Stop and Wait Protocol-

 

Stop and Wait Protocol is the simplest flow control protocol.

 

It works under the following assumptions-

  • Communication channel is perfect.
  • No error occurs during transmission.

 

Working-

 

The working of a stop and wait protocol may be explained as-

  • Sender sends a data packet to the receiver.
  • Sender stops and waits for the acknowledgement for the sent packet from the receiver.
  • Receiver receives and processes the data packet.
  • Receiver sends an acknowledgement to the sender.
  • After receiving the acknowledgement, sender sends the next data packet to the receiver.

 

These steps are illustrated below-

 

 

Analysis-

 

Now, let us analyze in depth how the transmission is actually carried out-

 

  • Sender puts the data packet on the transmission link.
  • Data packet propagates towards the receiver’s end.
  • Data packet reaches the receiver and waits in its buffer.
  • Receiver processes the data packet.
  • Receiver puts the acknowledgement on the transmission link.
  • Acknowledgement propagates towards the sender’s end.
  • Acknowledgement reaches the sender and waits in its buffer.
  • Sender processes the acknowledgement.

 

These steps are illustrated below-

 

 

Also Read- Delays in Computer Networks

 

Total Time-

 

Total time taken in sending one data packet

= (Transmission delay + Propagation delay + Queuing delay + Processing delay)packet

+

(Transmission delay + Propagation delay + Queuing delay + Processing delay)ACK

 

Assume-

  • Queuing delay and processing delay to be zero at both sender and receiver side.
  • Transmission time for the acknowledgement to be zero since it’s size is very small.

 

Under the above assumptions.

 

Total time taken in sending one data packet

= (Transmission delay + Propagation delay)packet + (Propagation delay)ACK

 

We know,

  • Propagation delay depends on the distance and speed.
  • So, it would be same for both data packet and acknowledgement.

 

So, we have-

 

Total time taken in sending one data packet

= (Transmission delay)packet + 2 x Propagation delay

 

Efficiency-

 

Efficiency of any flow control control protocol is given by-

 

Efficiency (η) = Useful Time / Total Time

 

where-

  • Useful time = Transmission delay of data packet = (Transmission delay)packet
  • Useless time = Time for which sender is forced to wait and do nothing = 2 x Propagation delay
  • Total time = Useful time + Useless time

 

Thus,

 

 

Factors Affecting Efficiency-

 

We know,

Efficiency (η)

= (Transmission delay)packet / { (Transmission delay)packet + 2 x Propagation delay }

 

Dividing numerator and denominator by  (Transmission delay)packet, we get-

 

 

From here, we can observe-

  • Efficiency (η) ∝ 1 / Distance between sender and receiver
  • Efficiency (η) ∝ 1 / Bandwidth
  • Efficiency (η) ∝ Transmission speed
  • Efficiency (η) ∝ Length of data packet

 

Throughput-

 

  • Number of bits that can be sent through the channel per second is called as its throughput.

 

 

Round Trip Time-

 

Round Trip Time = 2 x Propagation delay

 

Advantages-

 

The advantages of stop and wait protocol are-

  • It is very simple to implement.
  • The incoming packet from receiver is always an acknowledgement.

 

Limitations-

 

The limitations of stop and wait protocol are-

 

Point-01:

 

It is extremely inefficient because-

  • It makes the transmission process extremely slow.
  • It does not use the bandwidth entirely as each single packet and acknowledgement uses the entire time to traverse the link.

 

Point-02:

 

If the data packet sent by the sender gets lost, then-

  • Sender will keep waiting for the acknowledgement for infinite time.
  • Receiver will keep waiting for the data packet for infinite time.

 

Point-03:

 

If acknowledgement sent by the receiver gets lost, then-

  • Sender will keep waiting for the acknowledgement for infinite time.
  • Receiver will keep waiting for another data packet for infinite time.

 

Important Notes-

 

Note-01:

 

Efficiency may also be referred by the following names-

  • Line Utilization
  • Link Utilization
  • Sender Utilization
  • Utilization of Sender

 

Note-02:

 

Throughput may also be referred by the following names-

  • Bandwidth Utilization
  • Effective Bandwidth
  • Maximum data rate possible
  • Maximum achievable throughput

 

Note-03:

 

Stop and Wait protocol performs better for LANs than WANs.

This is because-

  • Efficiency of the protocol is inversely proportional to the distance between sender and receiver.
  • So, the protocol performs better where the distance between sender and receiver is less.
  • The distance is less in LANs as compared to WANs.

 

To gain better understanding about Stop and Wait Protocol,

Watch this Video Lecture

 

Next Article- Stop and Wait ARQ

 

Get more notes and other study material of Computer Networks.

Watch video lectures by visiting our YouTube channel LearnVidFun.

Simplex | Half Duplex | Full Duplex

Types of Communication Channels-

 

In computer networking, there are 3 types of communication channels-

 

 

  1. Simplex channel
  2. Half duplex channel
  3. Full duplex channel

 

1. Simplex Channel-

 

  • A simplex communication channel can send the signals only in one direction.
  • Thus, entire bandwidth of the channel can be used during the transmission.

 

Example-

 

Radio station

  • Radio station is a good example of a simplex communication channel.
  • A radio station always sends signals to its audience.
  • It never receives signals from the audience.

 

2. Half Duplex Channel-

 

  • A half duplex communication channel can send signals in both the directions but in only one direction at a time.
  • It may be considered as a simplex communication channel whose transmission direction can be switched.

 

Example-

 

Walkie-Talkie

  • Walkie-Talkie is a good example of a half duplex channel.
  • Walkie-talkie has a push-to-talk button.
  • This button is used to turn on the transmitter but turn off the receiver.
  • When the button is pressed, transmitter can not hear the receiver but receiver can hear the transmitter.

 

3. Full Duplex Channel-

 

  • A full duplex communication channel can send signals in both the directions at the same time.
  • Full duplex communication channels greatly increases the efficiency of communication.

 

Example-

 

Telephone

  • Telephone is a good example of a full duplex channel.
  • Both the persons can speak as well as hear each other at the same time.

 

Channel Capacity-

 

The total number of bits a channel can hold is called as its capacity.

 

Capacity of a half duplex channel

= Bandwidth x Propagation delay

 

Capacity of a full duplex channel

= 2 x Capacity of a half duplex channel

= 2 x Bandwidth x Propagation delay

 

To gain better understanding about communication channels in networking,

Watch this Video Lecture

 

Next Article- Stop and Wait Protocol

 

Get more notes and other study material of Computer Networks.

Watch video lectures by visiting our YouTube channel LearnVidFun.

Delays in Computer Networks | Formulas

Delays in Computer Networks-

 

Consider-

  • Two hosts A and B are connected over a transmission link / transmission media.
  • A data packet is sent by the Host A to Host B.

 

Following different types of delay occur during transmission-

 

 

  1. Transmission delay
  2. Propagation delay
  3. Queuing delay
  4. Processing delay

 

1. Transmission Delay-

 

Time taken to put the data packet on the transmission link is called as transmission delay.

 

Mathematically,

  • Transmission delay ∝ Length / Size of data packet
  • Transmission delay ∝ 1 / Bandwidth

 

Thus,

 

2. Propagation Delay-

 

Time taken for one bit to travel from sender to receiver end of the link is called as propagation delay.

 

Mathematically,

  • Propagation delay ∝ Distance between sender and receiver
  • Propagation delay ∝ 1 / transmission speed

 

Thus,

 

3. Queuing Delay-

 

Time spent by the data packet waiting in the queue before it is taken for execution is called as queuing delay.

 

  • It depends on the congestion in the network.

 

4. Processing Delay-

 

Time taken by the processor to process the data packet is called as processing delay.

 

  • It depends on the speed of the processor.
  • Processing of the data packet helps in detecting bit level errors that occurs during transmission.

 

Important Points-

 

Note-01:

 

Total delay in sending one data packet or End to End time

= Transmission delay + Propagation delay + Queuing delay + Processing delay

 

Note-02:

 

In optical fibre, transmission speed of data packet = 2.1 x 108 m/sec

 

  • In optical fibre, signals travel with 70% speed of light.

70% speed of light

= 0.7 x 3 x 108 m/sec

= 2.1 x 108 m/sec

  • So, consider transmission speed = 2.1 x 108 m/sec for calculations when using optical fibre.

 

Note-03:

 

Both queuing delay and processing delay are dependent on the state of the system.

 

This is because-

  • If destination host is busy doing some heavy processing, then these delays will increase.
  • If destination host is free, then data packets will be processed immediately and these delays will decrease.

 

Note-04:

 

  • For any particular transmission link, bandwidth and transmission speed are always constant.
  • This is because they are properties of the transmission medium.

 

Note-05:

 

Bandwidth is always expressed in powers of 10 and data is always expressed in powers of 2.

(Remember while solving numerical problems)

 

Examples-

 

  • 1 kilo bytes = 210 bytes
  • 1 kilo bits = 210 bits
  • 1 Mega bytes = 220 bytes
  • 1 kilo bytes per second = 103 bytes per second
  • 1 kilo bits per second = 103 bits per second
  • 1 Mega bytes per second = 106 bytes per second

 

To gain better understanding about delays in computer networks,

Watch this Video Lecture

 

Next Article- Types Of Channels in Computer Networks

 

Get more notes and other study material of Computer Networks.

Watch video lectures by visiting our YouTube channel LearnVidFun.