Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

CS-4015 – Computer Networks

Assignment 3 – Spring 2024


Last Saved by: Mustahsan
Student Hammad Naqvi
ID: F21605036

Name: Umer mehmood

Batch: 2021

Program: CS

Attempt each question. Marks are specified with each question. (CLO-2, PLO-2)

Question 1: Error Detection using CRC


Given a data stream of 1101011011 and a divisor polynomial 1011, perform the following tasks:
a) Append the necessary zeros to the data stream.

To perform error detection using CRC (Cyclic Redundancy Check), the following steps are taken:

Step 1:
Append Necessary Zeros to the Data Stream
Given data stream:
1101011011
1101011011
Divisor polynomial:
1011
1011

Determine the Degree of the Divisor Polynomial


The degree of the divisor polynomial
1011
1011 is 3 (since the highest power of x is 3)

Append Zeros
To perform CRC, append the number of zeros equal to the degree of the divisor polynomial to the end of the data
stream.

Original data stream: 1101011011

Number of zeros to append: 3

New data stream is 1101011011


CS-4015 – Computer Networks

Assignment 3 – Spring 2024

b) Calculate the CRC code using the divisor polynomial.

c) Verify the CRC code by demonstrating the division process at the receiver end.
CS-4015 – Computer Networks

Assignment 3 – Spring 2024

Question 2: Framing Techniques


Consider a network where frames are transmitted between two computers using the character count
framing method. If the following data frames are transmitted: 5HELLO, 7WORLD12, and
8NETWORKS, decode the received frames and identify any errors if present. Assume that each
frame's length count is transmitted accurately.

In the character count framing method, the first character of each frame indicates the number of characters
(including the count character itself) in that frame. Let’s decode the received frames and check for any errors.

Given frames:
5HELLO
7WORLD12
8NETWORKS

Frame-by-Frame Analysis;
Frame 1: 5HELLO
Count character: 5
Total characters expected: 5
Actual frame: "5HELLO"
Length: 5 characters
Decoded Frame 1: "HELLO"

No errors in this frame.


Frame 2: 7WORLD12:
Count character: 7
Total characters expected: 7
Actual frame: "7WORLD12"
Length: 8 characters (error since it should be 7)

Decoded Frame 2: There is an error because the length is not matching the specified count. The correct
frame should be "7WORLD1" if only 7 characters are to be considered.
CS-4015 – Computer Networks

Assignment 3 – Spring 2024

Frame 3: 8NETWORKS:
Count character: 8
Total characters expected: 8
Actual frame: "8NETWORKS"
Length: 8 characters
Decoded Frame 3: "NETWORKS"

No errors in this frame.

Conclusion

 Frames 1 and 3 are correctly framed and decoded.


 Frame 2 contains an error because it has more characters than specified by the count character.

Question 3: Flow Control with Stop-and-Wait ARQ


A sender transmits a series of frames to a receiver using the Stop-and-Wait ARQ protocol. If the
sender sends frames at a rate of 1000 frames per second, and each acknowledgment takes 1
millisecond to reach the sender, calculate the maximum throughput of the system. Explain the
impact of acknowledgment delay on the overall efficiency of the transmission.

Flow Control with Stop-and-Wait ARQ


Given:
Frame transmission rate: 1000 frames per second
Acknowledgment delay: 1 millisecond (ms)

Calculation of Maximum Throughput


Frame Transmission Time:
The sender transmits 1000 frames per second.
Therefore, each frame takes
CS-4015 – Computer Networks

Assignment 3 – Spring 2024


1/1000seconds to transmit.
Frame transmission time = 1 ms.

Total Round-Trip Time (RTT):


RTT includes the time to send the frame and receive the acknowledgment.
RTT = Frame transmission time + Acknowledgment delay
RTT = 1 ms (for sending the frame) + 1 ms (for receiving the acknowledgment)
RTT = 1 ms + 1 ms = 2 ms

Throughput Calculation:
Throughput is the number of frames successfully transmitted per unit time.
Since one frame can be sent every 2 milliseconds (including the wait for acknowledgment), the
maximum number of frames that can be sent per second is:
Throughput=2 ms1 frame×1000 ms/s=500 frames/second

Impact of Acknowledgment Delay on Efficiency


Efficiency Calculation:
Efficiency is calculated by comparing the time used for actual data transmission to the total time,
including waiting for acknowledgment.
Frame transmission time
Efficiency=RTTFrame transmission time=2 ms1 ms=0.5 or 50%
Impact:
o The acknowledgment delay significantly impacts the efficiency. In this case, the system is
only 50% efficient because the sender spends half the time waiting for acknowledgments.
o As the acknowledgment delay increases, the efficiency of the Stop-and-Wait ARQ protocol
decreases further, leading to reduced throughput.
CS-4015 – Computer Networks

Assignment 3 – Spring 2024


Question 4: Sliding Window Protocol
Consider a sliding window protocol with a window size of 4. The sender has to send a sequence of
10 frames to the receiver. If frames 3 and 6 are lost during transmission, explain how the sliding
window protocol handles retransmission and acknowledgment. Illustrate the process with a diagram
showing the sender and receiver windows at different stages.

Sliding Window Protocol with Window Size 4


Given:
Window size: 4
Total frames: 10
Lost frames: 3 and 6
Process Overview
Initial Transmission:
Sender sends frames 0, 1, 2, 3.
Frame 3 is lost.
Receiver receives frames 0, 1, 2.
Acknowledgments:
Receiver acknowledges frames 0, 1, 2.
Sender receives ACKs for 0, 1, 2 and slides window to send frames 4 and 5.
Sender notices no ACK for frame 3.
Retransmission of Lost Frame 3:
Sender retransmits frame 3.
Receiver receives frame 3 and acknowledges it.
Sending More Frames:
Sender sends frames 6, 7, 8, 9.
Frame 6 is lost.
Receiver receives frames 4, 5, 7, 8, 9.
CS-4015 – Computer Networks

Assignment 3 – Spring 2024


Acknowledgments and Missing Frame:
Receiver acknowledges frames 4, 5, 7, 8, 9.
Sender notices no ACK for frame 6.
Retransmission of Lost Frame 6:
Sender retransmits frame 6.
Receiver receives frame 6 and acknowledges it

Summary:

 The sender transmits frames in batches (window size 4).


 When frames are lost, the sender retransmits after detecting missing ACKs.

You might also like