0% found this document useful (0 votes)
6 views4 pages

Flow Control and Protocols in TCP/IP

Uploaded by

krishna10924
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views4 pages

Flow Control and Protocols in TCP/IP

Uploaded by

krishna10924
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CSN 341 - Assignment 4

Divyansh Verma
Krishna Aggarawal
Atharav Joshi

Question 1: Flow Control in the Transport Layer


Why is flow control important?
Flow control is crucial in the transport layer to ensure that a sender does not
overwhelm a receiver with too much data at once. It helps to regulate the rate
at which data is sent, based on the receiver’s capacity to process and store
it. Without flow control, faster senders could lead to buffer overflows at the
receiving end, which can cause data loss, reduced throughput, and increased
retransmissions. This ultimately degrades overall network performance.

How TCP Implements Flow Control


TCP (Transmission Control Protocol) implements flow control using a mech-
anism known as the sliding window. The sliding window keeps track of the
amount of data that the sender can transmit before it must wait for an ac-
knowledgment from the receiver. This mechanism works as follows:
• The receiver advertises a window size, which indicates how much data it
can handle without being overwhelmed.
• The sender transmits data up to this window size and waits for acknowl-
edgments before sliding the window forward and sending more data.

Impact of Improper Flow Control


Improper flow control can lead to several issues:
• Buffer Overflow: If the sender transmits data faster than the receiver
can process, the receiver’s buffer may overflow, causing packet loss.
• Network Congestion: Excessive unregulated data transmission can lead
to network congestion, affecting not only the sender and receiver but also
other network users.
Both these issues can reduce the efficiency of data transmission and lead
to frequent retransmissions, increasing latency and degrading overall network
performance.

1
Question 2: Significance of Port Numbers in the
Transport Layer
Importance of Port Numbers
Port numbers in the transport layer serve as endpoints for communication be-
tween two devices. They allow the multiplexing and demultiplexing of data
streams, enabling multiple applications to communicate over the same network
connection without interference.
For example:
• HTTP uses port number 80.
• DNS uses port number 53.

• HTTPS uses port number 443.

Multiplexing and Demultiplexing


Multiplexing allows multiple applications or services to use a single network
interface by assigning each of them a unique port number. Demultiplexing is
the process at the receiving end, where incoming packets are directed to the
correct application based on the destination port number.

Potential Issues with Port Numbers


• Port Number Conflicts: When two applications are assigned the same
port number, a conflict arises, leading to potential communication failures.
• Port Number Misuse: If unauthorized applications use well-known port
numbers, it can lead to security vulnerabilities or service disruptions.

Question 3: Selective-Repeat vs. Go-Back-N Pro-


tocols
Selective-Repeat
In the Selective-Repeat protocol, only the packets that are lost or corrupted are
retransmitted. This increases efficiency as fewer packets need to be resent.

Go-Back-N
In the Go-Back-N protocol, if an error occurs, the sender retransmits all packets
starting from the last acknowledged packet. While simpler to implement, it is
less efficient than Selective-Repeat, as more packets may need to be retransmit-
ted unnecessarily.

2
Piggybacking in Bidirectional Communication
Piggybacking is a technique used in bidirectional communication where acknowl-
edgments are combined with data being sent in the opposite direction. This
reduces the overhead of sending separate acknowledgment packets, improving
overall efficiency.

Practical Considerations
In real-world applications, piggybacking requires careful timing; if no data is
ready to be sent in the reverse direction, the acknowledgment might be delayed,
which can affect performance in time-sensitive applications.

Question 4: Trade-offs Between TCP and UDP


in Low-Latency Scenarios
TCP vs. UDP
TCP provides reliable data transmission with error correction, but at the cost
of added latency due to acknowledgments, retransmissions, and flow control.
UDP (User Datagram Protocol), on the other hand, is connectionless and does
not provide built-in error correction, making it much faster but less reliable.

Application-Specific Considerations
• Online Gaming: UDP is preferred because low latency is crucial, and
some packet loss is tolerable for real-time updates.
• Video Conferencing: UDP is generally used due to the need for low
latency. Packet loss is acceptable, as the human brain can tolerate minor
video and audio imperfections.
• Stock Trading: TCP is typically used due to the need for reliable and ac-
curate data transmission, where even a small error can result in significant
financial losses.

Question 5: Sequence Numbers and Acknowledg-


ments in TCP
Role of Sequence Numbers and Acknowledgments
Sequence numbers in TCP ensure that packets are delivered in the correct or-
der. Each packet is assigned a sequence number, and the receiver uses acknowl-
edgments (ACKs) to inform the sender of successfully received packets. This
mechanism ensures reliable data transmission.

3
Preventing Issues
• Packet Duplication: Sequence numbers allow the receiver to detect
duplicate packets and discard them.
• Out-of-Order Delivery: The receiver can use sequence numbers to re-
order packets that arrive out of order.

TCP Recovery Example


If a packet is lost or arrives out of order, TCP can recover through retransmis-
sions. For example, if packet 5 is lost, the receiver will continue to acknowledge
packet 4. The sender will then retransmit packet 5 once it realizes it has not
been acknowledged.

You might also like