Untitled Document
Untitled Document
i. Describe the advantage and the disadvantage of using the Go-Back-N and Selective Repeat protocol.
What other network criteria should be considered to select either of these protocols?
✅
Go-Back-N
✅
Advantage: Simpler Design.
✅
Simpler receiver logic : The receiver only tracks one variable, the next expected sequence number.
It does not need to buffer, out-of-order packets at the receiver, reducing memory usage and implementation
complexity.
✅
Selective-Repeat Protocol
✅
Advantage: High Efficiency.
✅
More efficient in networks with frequent packet loss: Only lost or corrupted packets are resent.
Correctly received out-of-order packets are buffered, reducing unnecessary retransmissions and
maximizing channel utilization.
a. Go-Back-N Protocol
Max Window Size (W) = 2^m - 1, Because in GBN, the receiver only accepts frames in order,
so the sender can send up to 2^m - 1 frames before requiring an acknowledgment.
Example (Let’s say m = 3): Sequence numbers: 0 to 7 (2³ = 8), Max window size W = 7
Sender can send frames 0 to 6 without receiving ACKs. But if it tries to send the 8th frame
(sequence number 7), the receiver may confuse it with an old frame (sequence number 7
from a previous round), due to sequence number wrap around.
That’s why W must be ≤ 2^m - 1, to avoid ambiguity in frame identification.
Max Window Size (W) = 2^(m-1), In SR, both sender and receiver maintain windows.
To avoid ambiguity between new and old frames,
The maximum window size is limited to half the sequence number space.
Example (Let’s say m = 3): Sequence numbers: 0 to 7 (2³ = 8), Max window size W = 4
If you use W = 5 or more, the receiver may receive a new frame (e.g., 0) and not be able to tell
whether it’s from the current round or a previous one. That causes duplicate frame confusion.
Hence, limiting W to 2^(m-1) ensures unique identification of frames in transit.
Answer: Data-link layer is located between the physical and the network layers. The data-link layer provides
services to the network layer; it receives services from the physical layer. The duty scope is node-to-node.
1. Framing : Encapsulate packets into frames for transmission
2. Flow Control : Prevent receiver buffer overflow
3. Error Control : Detect and recover from transmission errors
4. Congestion Control : Minimize frame loss due to overloaded links (rarely used at this layer)
1. Framing
Definition: It is the process of dividing the stream of bits received from the network layer into manageable
units called frames. Purpose: Ensures that the receiver can recognize the start and end of each frame.
Functions: Encapsulation: The data-link layer encapsulates the network layer packet inside a frame before
transmission. Decapsulation: At the receiving end, it extracts the packet from the received frame.
2. Flow Control
Definition: Flow control manages the rate of data transmission between sender and receiver to prevent
overwhelming the receiver. Why Needed: If the sender transmits too fast, the receiver's buffer may overflow,
causing data loss.
Mechanisms: Buffering: Temporary storage of incoming frames. Feedback: The receiver can ask the sender
to pause or slow down (e.g., stop-and-wait or sliding window).
3. Error Control
Definition: Ensures reliable transmission by detecting and possibly correcting errors that may occur during
data transfer. How It Works: Error Detection: Using checksums, CRC, or parity bits to find corrupted frames.
Error Handling: Corrupted frames are either: Corrected at the receiver, or Discarded and retransmitted by the
sender (with ARQ techniques like Go-Back-N or Selective Repeat).
4. Congestion Control
Definition: Prevents too much data from being sent, which can overload the network and cause frame loss.
At Data-Link Layer: Most protocols don’t handle congestion directly, since congestion is typically managed
at the network or transport layer (end-to-end). However, some wide-area networks implement basic
congestion handling at the data-link level.
ii. Assume we need to design a Go-Back-N sliding-window protocol for a network in which the bandwidth is
100 Mbps and the average distance between the sender and receiver is 10,000 km. Assume the average
packet size is 100,000 bits and the propagation speed in the media is 2 × 108 m/s.
Find the maximum size of the send & receive windows & the number of bits in the sequence number field (m)
Given:
● Bandwidth (B) = 100 Mbps = 100×10^6 bps
● Distance = 10,000 km = 10^7 meters
● Propagation Speed (v) = 2×10^8 m/s.
● Packet Size = 100,000 bits
Step 1: Find the Propagation Delay (T )
Tp= Distance/ Propagation Speed = 10^7 / 2×10^8 = 0.05sec, RTT = 0.05*2 = 0.1
So, the sender can have 50 unacknowledged packets in transit to fully utilize the channel.
Maximum Window Size (W) = 50 packets
Example 23.5: Assume that, in a Stop-and-Wait system, the bandwidth of the line is 1 Mbps, and 1 bit takes 20
milliseconds to make a round trip. What is the bandwidth-delay product? If the system data packets are 1,000
bits in length, what is the utilization percentage of the link?
The bandwidth-delay product is (1×10^6) × (20×10^−3) = 20,000 bits. The system can send 20,000 bits during
the time it takes for the data to go from the sender to the receiver and the acknowledgement to come back.
However, the system sends only 1,000 bits. We can say that the link utilization is only 1,000/20,000, or 5 %
What is the utilization percentage of the link in Example 23.5 if we have a protocol that can send up to 15
packets before stopping and worrying about the acknowledgments?
The bandwidth-delay product is still 20,000 bits. The system can send up to 15 packets or 15,000 bits during a
round trip. This means the utilization is 15,000/20,000, or 75 percent. Of course, if there are damaged packets,
the utilization percentage is much less because packets have to be resent.