Understanding TCP: Segments, Timers, and Options
Understanding TCP: Segments, Timers, and Options
NETWORKS
HOME ASSIGNMENT- 2
Sanjana Dasari – 22501A12A2
N.Druthi Sai – 22501A1278
CONCEPTS :
1. TCP Segments
Key concepts of TCP Segment
Key functions of TCP Segment
2. TCP Timers
Use of TCP Timer
Types of TCP Timers
3. TCP Options
Use of TCP Options
Key functions of TCP Options
TCP SEGMENTS
TCP (Transmission Control Protocol)
segments are essential units for
reliable data transmission in the TCP/IP
model. Each TCP segment comprises a
header and a payload. The header
includes critical information for
managing connections and ensuring
accurate, orderly data transmission.
Key Components of a TCP Segment
Header:
Contains control information for the segment. The header is typically 20 bytes
long, though it can be longer if options are included. Key fields in the header
include:
Source Port (16 bits): The port number of the sending application.
Destination Port (16 bits): The port number of the receiving application.
Data Offset (4 bits): Specifies the size of the TCP header, indicating where the data begins.
Flags (6 bits): Control flags for managing the state of the connection ( URG,ACK,RST,FIN etc )
Window Size (16 bits): Specifies the size of the receive window, indicating how much data the
receiver is willing to accept.
Checksum (16 bits): Provides error checking for the header and data.
Urgent Pointer (16 bits): Points to the sequence number of the last urgent data byte.
Payload:
The actual data being transmitted, which follows the TCP header. The size of the
payload can vary depending on the amount of data being sent and the
maximum segment size.
Key Functions of a TCP Segment
Reliability: TCP ensures reliable data delivery by using
sequence numbers and acknowledgments. If a segment is lost
or corrupted, it can be retransmitted.
Ordered Data Delivery: Segments are reassembled in the
correct order at the receiving end using sequence numbers.
Flow Control: The window size field helps manage the amount
of data sent before requiring an acknowledgment, preventing
overwhelming the receiver.
Congestion Control: TCP uses algorithms to avoid network
congestion and manage traffic flow efficiently.
Summary :
Definition: Basic units of data transmission in TCP
connections.
Components: Include a header and a payload.
Header Fields: Key fields include Source Port, Destination
Port, Sequence Number, Acknowledgment Number, Data
Offset, Flags (e.g., URG, ACK, PSH, RST, SYN, FIN), Window
Size, Checksum, Urgent Pointer, and optional fields.
Home Service About Us Contact
TCP TIMERS
01
TCP timers are used for various
purposes to manage and
optimize the behavior of TCP
connections.
1.Retransmission Timer:
Purpose: Ensures reliable data delivery.
Function: Determines how long to wait
for an acknowledgment of a sent
segment before retransmitting it if no
acknowledgment is received within the
timeout period.
2.Persist Timer:
Purpose: Avoids deadlock situations with
zero window sizes.
Function: Periodically sends "window
probe" packets to check if the receiver’s
window size has increased and if data can
be sent again.
3.Keep-Alive Timer:
Purpose: Detects idle or dead connections.
4.Time-Wait Timer:
Purpose: Manages connection teardown and
prevents issues with delayed packets.
Function: Keeps the connection in the TIME-
WAIT state for a specific duration after closure to
ensure all packets have been properly processed
and to avoid confusion with delayed segments.
Summary :
The most important point about TCP timers is that they
are crucial for ensuring reliable and efficient data
transmission. They help manage retransmissions, handle
connection timeouts, prevent deadlocks, and maintain
connection stability, ultimately ensuring smooth and
consistent communication between devices over a
network
TCP OPTIONS
TCP options are extra fields
in the TCP header that
enhance functionality
beyond the basic protocol.
They improve network
performance, security, and
reliability by allowing hosts
to negotiate additional
parameters.
TCP options provide flexibility and enhanced functionality for TCP
connections. They include:
Maximum Segment Size (MSS): Limits the size of segments to avoid
fragmentation.
Window Scale: Expands the range of window sizes for high-speed
connections.
Timestamps: Improves RTT measurements and retransmission
management.
Selective Acknowledgment (SACK): Allows acknowledgment of
specific blocks of data to optimize retransmissions.
No-Operation (NOP): Used for padding and alignment.
End of Option List (EOL): Marks the end of the options field.
Timestamp Echo Reply: Part of the Timestamps option for RTT
calculations.
Summary :
Purpose: Extend TCP functionality for performance, security,
and reliability.
Examples: Maximum Segment Size (MSS), Window Scale,
Timestamps, Selective Acknowledgment (SACK), No-Operation
(NOP), End of Option List (EOL), and Padding.
REFERENCE ;
https://broman.dev/download/Computer%20Networking:%20
A%20Top-Down%20Approach%206th%20Edition.pdfg
https://youtu.be/fDWw_2y5Uyg?feature=shared
https://youtu.be/o_uVzGiu2UI?feature=shared
https://youtu.be/V5e9wBdxigE?feature=shared
THANK YOU !!