Assignment 3
Assignment 3
QUESTION 1
Answer: (a)
Detailed solution:
TCP uses byte-oriented sequence numbering to ensure reliable, ordered, and efficient data
transmission over a network.
QUESTION 2
a) Only (I)
b) Only (II)
c) Both (I) and (II)
d) Neither (I) nor (II)
Answer: (b)
Detailed solution:
The transport layer relies on data structures (e.g., buffers, sequence number tables) to manage
connections, algorithms (e.g., sliding window for flow control, checksum for error detection) to
ensure reliable communication, and system calls (e.g., socket(), send(), recv()) to interact with the OS
kernel, which implements these functionalities abstractly for application-level use.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
Jan 2025
QUESTION 3
Answer: (d)
Detailed solution:
The transport layer provides services like End-to-end packet delivery, Ordered packet delivery,
Reliable data delivery, Connection establishment, and Flow & Congestion control etc. The hop-to-
hop network packet forwarding is supported by data link layer and network layer.
QUESTION 4
What can be a primary mechanism used to ensure the reliable data transfer in a stop-and-wait
algorithm (Noisy Channel)?
a) Employing only error detection and correction codes without requiring acknowledgements.
b) Increasing the timeout interval.
c) Using a sequence number to identify each packet uniquely and waiting for an
acknowledgement for each packet before sending the next packet.
d) Using a sliding window to send multiple packets without waiting for their acknowledgements.
Answer: (c)
Detailed solution:
Stop-and-Wait (Noisy Channel) flow control algorithm uses a sequence number to individually
identify each frame and corresponding acknowledgement. It ensures reliability by attaching a
sequence number to each packet and transmits a packet & waits for an acknowledgment (ACK)
from the receiver before sending the next packet. If the ACK is not received within a timeout period,
the sender retransmits the packet.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
Jan 2025
QUESTION 5
A data of 40 bytes need to be delivered using TCP protocol but a sender can send a segment of
maximum size 12 bytes only. Identify the sequence number of the last segment formed if the sequence
number field uses 5 bits only? [Assume sequence number starts from 0]
a) 1
b) 4
c) 12
d) 31
Answer: (b)
Detailed solution:
TCP uses byte sequencing. It treats data as a continuous stream of bytes rather than discrete packets.
Since the sequence number field uses 5 bits only, it produces sequence numbers ranging from 0 to
31.
The first segment of 12 bytes will use the sequence number range (0-11),
Next segment of 12 bytes will use the sequence number range (12-23),
Next segment of 12 bytes will use the sequence number range (24-31) & (0-3), and
The last segment of 4 bytes will use the sequence number range (4-7).
The sequence number in a TCP segment header refers to the first byte of data in that segment
relative to the start of the stream.
QUESTION 6
A sender uses a sliding window protocol with a window size of 5. The range of sequence numbers
follows modulo 8 ( the sequence number starts from 0 to 7). If the receiver acknowledges packet 1,
what will be the sender’s new window range?
a) 1-5
b) 2-6
c) 3-7
d) 0-4
Answer: (b)
Detailed solution:
When the receiver acknowledges the packet, resulting in a forward slide of the sender’s window. The
sliding window now starts at 2 (the next unacknowledged sequence number) till the allowed window
size.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
Jan 2025
QUESTION 7
“During the three-way handshaking of connection establishment procedure (from Host 1 to Host 2),
Delayed duplicate SYN can be handled by TCP at Host 2 simply by ignoring it, as the sequence
number is invalid”
a) True
b) False
Answer: (a)
Detailed solution:
The TCP 3-Way Handshake is a fundamental process that establishes a reliable connection between
two devices over a TCP/IP network. During the handshake, the client and server exchange initial
sequence numbers. It uses sequence numbers to identify and validate the legitimacy of connection
requests. A delayed duplicate SYN will have an outdated sequence number that doesn't match the
current connection state at Host 2 and can be ignored as invalid sequence number.
QUESTION 8
TCP instance uses a sliding window protocol in the noisy channel. A timeout occurs due to the loss
of a segment (or the acknowledgement). Mark the RIGHT statement among the following-
a) In the case of Go-Back-N ARQ, if any segment of the sliding window is lost, all the segments
of the sliding window are retransmitted while in Selective Repeat ARQ, only the lost packets
are selectively transmitted.
b) In the case of Go-Back-N ARQ, if any segment of the sliding window is lost, only the lost
packets of the sliding window are selectively retransmitted while in Selective Repeat ARQ,
all packets of the sliding window are retransmitted.
c) In both cases, Go-Back-N ARQ and Selective Repeat ARQ, all packets of the sliding window
are retransmitted.
d) In the both cases, Go-Back-N ARQ and Selective Repeat ARQ, only lost packets of the
sliding window are selectively retransmitted.
Answer: (a)
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
Jan 2025
Detailed solution:
In the case of Go-Back-N ARQ, if any segment of the sliding window is lost, all the segments of the
corresponding sliding window are retransmitted while in Selective Repeat ARQ, only the lost packets
are selectively transmitted.
QUESTION 9
Consider a sender using the Go-Back-N ARQ protocol with a window size 5. The sequence number
ranges from 0 to 7 (modulo 8). The sender initially transmits packets with the sequence numbers- 0,
1, 2, 3, and 4. During the transmission, packet 3 is lost in the network. The sender receives a
cumulative ACK for the packet 2. The sender continues sending packet 5, 6, and 7 but the receiver
denies accepting them due to the loss of packet 3.
Identify the range of packets that will be retransmitted by the sender after the timeout of packet 3?
a) 0, 1, 2, 3, and 4.
b) 2, 3, 4, 5, and 6.
c) 3, 4, 5, 6, and 7.
d) 1, 2, 3, 4, and 5.
Answer: (c)
Detailed solution:
In Go-Back-N ARQ, when a timeout occurs, the sender retransmits all packets starting from the lost
packet to all permissible packets in accordance with the window size.
QUESTION 10
A client and a server establish a connection using TCP's three-way handshake. The following details
are given:
● Initial sequence number of the client: 100 and initial sequence number of the server: 300.
● RTT (Round Trip Time): 80ms.
● Each TCP segment carries 40 bytes of header information.
● The server sends a SYN-ACK segment, and the acknowledgement (ACK) segment from the client is
delayed due to congestion, taking 100ms to reach the server.
How much time does it take to establish the connection under such a scenario?
a) 100ms
b) 280ms
c) 180ms
d) 260ms
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
Jan 2025
Answer: (c)
Detailed solution:
In three way handshaking, the connection is established after three steps. In first step, sender sends a
connection request SYN packet to the server. Server responds to client with SYN+ACK packet.
Finally, sender sends a ACK packet to the server. Since RTT = 80ms so for one way packet
transmission will take 40ms. Since, there is a delay during transmission of ACK packet from sender
to server due to congestion and it takes greater time i.e. 100ms. So, the total time needed to complete
this connection procedure will be (time taken for SYN packet + time taken for SYN+ACK packet +
time taken for ACK packet) i.e. (80/2ms+80/2ms+100ms=180ms).