Module 4 ACN
1. End-to-End Protocols
Common Properties of Transport Protocols
1. Guarantees message delivery – ensures reliability, i.e., no loss of data.
2. Delivers messages in order – preserves the sequence of transmitted data.
3. Delivers at most one copy – avoids duplication of data at the receiver.
4. Supports arbitrarily large messages – breaks large data into smaller
segments and reassembles them at the receiver.
5. Synchronization between sender and receiver – uses acknowledgments and
sequence numbers to keep both ends in sync.
6. Flow control – prevents the sender from overwhelming the receiver’s buffer
capacity.
7. Multiplexing support – allows multiple application processes on a host to
communicate simultaneously using ports.
Typical Limitations of the Network
1. Message drops – packets may be lost due to congestion or errors.
2. Message reordering – packets may arrive out of order due to different
routing paths.
3. Duplicate delivery – the same packet may be delivered more than once.
4. Finite size restriction – networks enforce a maximum transmission unit
(MTU), limiting message size.
5. Arbitrary delays – packets can be delayed unpredictably due to congestion,
buffering, or routing changes.
⸻
Simple Demultiplexer (UDP)
• UDP (User Datagram Protocol) is a connectionless transport protocol.
• It extends host-to-host delivery (provided by IP) into process-to-process
delivery using port numbers.
• Each application process on a host is identified by a port. When a UDP
packet arrives, the destination port number in the header tells the OS which
application should receive it.
• This mechanism is called demultiplexing because packets from many
sources are distributed (demultiplexed) to the correct process.
• The UDP header is very small (8 bytes) and contains: Source Port,
Destination Port, Length, and Checksum.
• UDP does not provide reliability, ordering, or congestion control, but it is fast
and lightweight.
• Because of its simplicity, it is used in applications like DNS, DHCP, VoIP, online games,
and video streaming where low latency is more important than reliability.
The figure shows how UDP provides process-to-process delivery by using ports.
• Packets arrive from the network layer into the UDP module.
• Each packet contains a destination port number in its header.
• Based on this port number, UDP demultiplexes the packet and puts it into
the correct queue.
• Each queue is linked to an application process running on the host.
• Thus, multiple applications (e.g., DNS, streaming, chat) can run at the same
time and share the same network.
• This mechanism ensures that even though all packets arrive at the same
host, they are delivered to the right process.
⸻⸻
Reliable Byte Stream (TCP)
Key fields in the TCP header are:
1. Source Port & Destination Port (16 bits each) – identify sending and
receiving processes.
2. Sequence Number (32 bits) – indicates the byte number of the first data
byte in the segment.
3. Acknowledgment Number (32 bits) – indicates the next expected byte from
the other side.
4. Window Size (16 bits) – used for flow control, shows available buffer size.
5. Flags – control bits: SYN (setup), ACK (acknowledge), FIN (close), RST
(reset), PSH (push data), URG (urgent).
6. Checksum (16 bits) – error detection for header + data.
• TCP (Transmission Control Protocol) provides a reliable, connection-
oriented, byte-stream service between two processes.
• The sending application writes data as a continuous stream of bytes into the
send buffer.
• TCP takes bytes from this buffer and divides them into segments for
transmission.
• These segments are sent across the network, and at the receiving end, TCP
collects them into the receive buffer.
• The receiving application then reads the bytes in the same order as they
were written by the sender.
• TCP ensures that all bytes are delivered reliably, without loss, duplication,
or reordering.
• If packets are lost or corrupted, TCP uses acknowledgments and
retransmissions to guarantee delivery.
• Thus, applications do not need to worry about packet boundaries, errors, or
reordering—TCP hides these details and provides a clean, ordered byte stream.
-------------------------
TCP Connection Establishment (Three-Way Handshake)
Process:
1. SYN: Client sends a segment with the SYN flag and its initial sequence
number to request a connection.
2. SYN-ACK: Server replies with a segment that has both SYN and ACK flags
set, acknowledging the client’s SYN and sending its own initial sequence number.
3. ACK: Client sends back an ACK to confirm, and the connection is
established.
State Transitions:
• Client: CLOSED → SYN_SENT → ESTABLISHED
• Server: CLOSED → LISTEN → SYN_RCVD → ESTABLISHED
TCP Connection Termination (Four-Way Handshake)
Process:
1. FIN: One side (initiator) sends a FIN to indicate it has finished sending data.
2. ACK: The other side responds with an ACK, acknowledging the FIN.
3. FIN: The responder then sends its own FIN when it is done sending.
4. ACK: Finally, the initiator replies with an ACK to acknowledge the
responder’s FIN.
This ensures that both sides close the connection gracefully and all remaining
data is delivered before termination.
-------------------
Sliding Window Protocol
Purpose
• Provides flow control (so sender doesn’t overwhelm receiver).
• Ensures reliable delivery of data.
Window Concepts
• Send Window:
• Portion of data sent but not yet acknowledged.
• Limits how much sender can transmit without waiting.
• Receive Window:
• Free buffer space available at the receiver.
• Controls how much new data receiver can accept.
• Window Advertisement:
• Receiver informs sender about its available buffer space (using
acknowledgment messages).
Sliding Window Operation
1. Sender transmits data up to the allowed window size.
2. Receiver acknowledges received frames (may use cumulative ACKs).
3. Sender slides its window forward after ACKs are received.
4. Process continues until all data is delivered reliably.
-----------------
End-to-End Issues in TCP
1. Segmentation
• TCP cannot send very large messages directly.
• A large message is divided into smaller packets called segments.
• Each segment has a sequence number so the receiver can arrange
them.
• This makes transmission easier and fits within the network’s Maximum
Transmission Unit (MTU).
2. Reassembly
• At the receiver side, TCP uses the sequence numbers to rebuild the
original message.
• If segments arrive out of order, TCP correctly arranges them.
• If a segment is lost or corrupted, TCP asks for retransmission.
3. Error Handling
• TCP provides error detection using checksums.
• Lost, duplicated, or damaged packets are detected and resent.
• Ensures reliable, ordered delivery of data to the application.
------------------------
FIFO (First In, First Out) Queuing – Page 493
• Also called First-Come, First-Served (FCFS).
• The first packet that arrives is the first to be transmitted.
• Works like a queue at a ticket counter – whoever comes first is served first.
Key Points:
1. Packets enter a buffer (queue).
2. They wait until their turn to be transmitted.
3. If the buffer is full, new arriving packets are dropped (this is called Tail Drop
because the newest ones at the “tail” are dropped).
4. No importance is given to which flow the packet belongs to or how critical it
is.
Tail Drop
• Not the same as FIFO itself, but a drop policy used with FIFO.
• When the buffer is full, any new arriving packet is discarded.
Example:
• Imagine a printer queue: the first document you send gets printed first. If the
tray is full, the new document you send is simply rejected.
-------------------------
Fair Queuing (FQ)
• Fair Queuing is a method to ensure that all traffic flows get a fair share of
bandwidth.
• Unlike FIFO (which mixes all packets in a single line), FQ keeps separate
queues for each flow (e.g., each TCP connection, each VoIP call).
• The router then sends packets one by one from each queue in a round-
robin fashion.
How it Works
1. Each traffic flow gets its own queue.
2. The router picks packets from these queues in turns (round-robin).
3. If a queue is empty, it is skipped.
4. This way, no flow can take more than its fair share.
⸻
Why it is Needed
• In FIFO, one aggressive source (like a heavy download) can fill the queue
and cause packet drops for others.
• FQ prevents this by sharing bandwidth equally, so everyone gets service.
Advantages
• Prevents one user from hogging the bandwidth.
• Ensures fairness among multiple flows.
• Protects small or delay-sensitive flows (like voice calls) from being starved.
Disadvantages
• More complex to implement than FIFO.
• Requires identifying each flow.
Example:
Imagine four people talking to the same person on a phone (router). Instead of letting one person
talk continuously, the listener gives each one a turn to speak — that’s how FQ works.
-----------------
Different TCP Congestion Control Mechanisms
1. Slow Start (Page 276)
• Starts with a small congestion window (cwnd).
• The window grows exponentially for each acknowledgment (ACK)
received.
• Helps discover the available bandwidth without overloading the
network.
2. Congestion Avoidance (Page 276–277)
• After a certain threshold (ssthresh), growth becomes linear.
• Adds one segment per round-trip time (RTT) to avoid congestion.
3. Fast Retransmit (Page 277)
• If the sender receives three duplicate ACKs, it assumes a packet loss.
• Retransmits the missing packet without waiting for timeout.
4. Fast Recovery (Page 277–278)
• After fast retransmit, instead of going back to slow start, it:
• Cuts cwnd to half.
• Continues congestion avoidance (linear growth) instead of starting from
scratch.
5. Additive Increase/Multiplicative Decrease (AIMD) (Page 275)
• Core principle: Gradually increases sending rate (additive) and reduces
drastically (multiplicative) when congestion is detected.
--------------
End-to-End Issues
End-to-end issues focus on communication between two endpoints (source and destination),
ensuring data is transmitted reliably and efficiently.
Key End-to-End Issues:
1. Reliability (Page 134)
• Ensuring data is delivered without errors, loss, or duplication.
• Achieved using acknowledgments (ACKs), retransmissions, and
checksums.
2. Flow Control (Page 135)
• Prevents the sender from overwhelming the receiver.
• TCP uses a sliding window protocol to manage this.
3. Congestion Control (Page 135–136)
• Avoids overloading the network with too many packets.
• Mechanisms include Slow Start, Congestion Avoidance, etc.
4. Segmentation and Reassembly (Page 133–134)
• Large messages are split into smaller segments.
• Receiver reassembles them in correct order.
5. Error Detection and Correction (Page 134)
• Ensures data integrity using checksums or cyclic redundancy checks
(CRC).
---------------
Sliding Window Revisited
The sliding window protocol is used in TCP to manage flow control and reliable data transfer.
Key Concepts (Page 161–162)
1. Window Size
• Defines how many bytes (or segments) can be sent before needing an
acknowledgment (ACK).
• Helps balance efficiency and congestion.
2. Sender Window
• Tracks the range of data sent but not yet acknowledged.
3. Receiver Window
• Indicates how much data the receiver can accept (advertised window).
4. Acknowledgments (ACKs)
• Slide the window forward as data is received and acknowledged.
5. Pipelining
• Allows multiple packets to be sent before receiving ACKs, improving
throughput.
Revisited Focus (Page 162–163)
• The “revisited” concept emphasizes interaction with congestion control.
• Window size is now affected by both:
• Flow control window (receiver capacity)
• Congestion window (network capacity)
Effective window = min(flow control window, congestion window)
--------------
Triggering Transmission
This refers to when and how a sender decides to transmit data over the network.
Key Points:
1. Data-driven transmission
• Transmission is triggered as soon as data becomes available from the
application layer.
2. Timer-driven transmission
• If the sender has partial data (not a full segment), a timer may trigger
transmission to avoid delays.
3. Acknowledgment-driven transmission
• Transmission is often triggered by receiving an acknowledgment (ACK),
which allows the sliding window to move forward.
4. Interactive vs. Bulk Data Transfer
• Interactive: frequent small packets (triggered quickly).
• Bulk transfer: sends large continuous streams, triggered by data
readiness and window availability.
--------