Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Deadline: Thursday, June 5, 2024: CS-4015 - Computer Networks Assignment 3 - Spring 2024

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

CS-4015 – Computer Networks

Assignment 3 – Spring 2024


Deadline: Thursday, June 5, 2024 Last Saved by: Mustahsan Hammad Naqvi
Instructions:
1. Type your name and Student ID at the places mentioned Student ID: F21605049
2. Save the document with your student ID
3. Upload your assignment through Class Room Name: Khalid Hussain
4. No marks would be awarded if
a. Assignment is copied Batch:2021
b. File is corrupt/does not open
Program: BSCS
c. Submitted through email/in-person

Attempt each question. Marks are specified with each question. (CLO-2, PLO-2)
20 – Marks
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.
b) Calculate the CRC code using the divisor polynomial.
CS-4015 – Computer Networks

Assignment 3 – Spring 2024

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.

Given frames:
5HELLO
7WORLD12
8NETWORKS

Frame-by-Frame Analysis;
Frame 1:
CS-4015 – Computer Networks

Assignment 3 – Spring 2024


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
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
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.

ARQ-based flow control


Given:
Frame transmission rate: 1000 frames/second.
Acknowledgement delay: one millisecond (ms).
CS-4015 – Computer Networks

Assignment 3 – Spring 2024


Calculating the Maximum Throughput
Frame Transmission Time: The sender transmits 1000 frames/second.
So, each frame takes
1/1000seconds to transmit.
Frame transmission time = 1 ms
Total Round-Trip Time (RTT):
RTT refers to the time it takes to send a frame and receive acknowledgment.
RTT = Frame transmission time + acknowledgment delay.
RTT = 1 ms (for delivering the frame) + 1 ms (to get the acknowledgment)
RTT = 1 + 1 = 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),
maximum number of frames that can be sent per second is:
Throughput=2 ms1 frame×1000 ms/s=500 frames/second

Effect of Acknowledgment Delay on Efficiency


Efficiency Calculations:

Efficiency is assessed by comparing the time spent on actual data transmission to the total time.
This includes waiting for acknowledgement.
Frame transmission time.
Efficiency equals RTTFrame transmission time=2 ms; 1 ms=0.5 or 50%.

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.
CS-4015 – Computer Networks

Assignment 3 – Spring 2024


CS-4015 – Computer Networks

Assignment 3 – Spring 2024


CS-4015 – Computer Networks

Assignment 3 – Spring 2024

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:
The sender re-transmits frame 3.
The receiver receives and recognizes frame 3.

Sending More Frames:


Sender sends frames 6, 7, 8, 9.
Frame 6 is lost.
Receiver receives frames 4, 5, 7, 8, 9.

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
CS-4015 – Computer Networks

Assignment 3 – Spring 2024


Summary: • The transmitter sends frames in bunches (window size 4).
When frames are lost, the sender retransmits based on missing ACKs.

You might also like