0% found this document useful (0 votes)
4 views

Lecture 17

Uploaded by

Vidisha Arvind
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Lecture 17

Uploaded by

Vidisha Arvind
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

TCP Basics

Transmission Control Protocol (TCP)


• Service Model:
– Connection Orientation Connection Abstraction
• Illusion of connection over connection less Internet
– Byte stream Abstraction
• no record markers or message boundaries
• Packetization and Re-packetization
– Reliable and Ordered Delivery
• Sequence numbers, ACKs, Retransmission
– Point to Point with Full duplex
Protocol Implemented Entirely at Ends
TCP Encapsulation
TCP Header
TCP Header
• Source Port, Destination Port
– The source and destination port number, along with the source and
destination IP addresses in the IP header, uniquely identify each
connection
• The combination of an IP address and a port number is called
– an endpoint or socket in the TCP literature
• The term "socket" appeared in [RFC0793]
• ultimately adopted as the name of the Berkeley-derived programming
interface for network communications (called "Berkeley sockets").
• It is a pair of sockets or endpoints (the 4-tuple consisting of the client IP
address, client port number, server IP address, and server port number)
that uniquely identifies each TCP connection.
• Important when multiple clients are connecting to a server.
TCP Header
• The Sequence Number field
– identifies the byte in the stream of data
• from the sending TCP to the receiving TCP
• TCP numbers each byte with a sequence number.
• Sequence number of first byte in any segment
represents the sequence number of that segment
• This sequence number is a 32-bit unsigned number
that wraps back around to 0 after reaching (232) − 1.
– More on it later ( This space can be extended using TCP
options)
TCP Header
• The Acknowledgment Number field
– contains the next sequence number
• that the sender of the acknowledgment expects to receive.
• This is therefore the sequence number of the last successfully
received byte of data plus 1 (Different from GBN)
• This field is valid only if the ACK bit field is on
– Sending an ACK costs nothing more than sending any other
TCP segment
• the 32-bit ACK Number field is always part of the header,
• as is the ACK bit field.
TCP Header: Flags
• Currently eight bit fields are defined for the TCP header, older
implementations understand only the last six of them:
1. CWR. Congestion Window Reduced ( sender reduced its sending rate)
2. ECE. ECN Echo (the sender received an earlier congestion notification)
3. URG. Urgent (the Urgent Pointer field is valid; rarely used)
4. ACK. Acknowledgment (the Acknowledgment Number field is valid,
always on after a connection is established)
5. PSH. Push (the receiver should pass this data to the application as soon
as possible; not reliably implemented or used)
6. RST. Reset the connection (connection abort, usually because of an error)
7. SYN. Synchronize sequence numbers to initiate a connection
8. FIN. The sender of the segment is finished sending data to its peer.
TCP Header
• The Header Length field
– length of the header in 32-bit words.
• required because the length of the Options field is
variable.
• With a 4-bit field, TCP is limited to a 60-byte header.
– ?????
– Without options, the size is 20 bytes.
TCP Header
• Window Size field
– Used for TCP’s flow control
• number of bytes, starting with the one specified by the
ACK number that the receiver is willing to accept.
• 16-bit field, limiting the window to 65,535 bytes
– and thereby limiting TCP’s throughput performance.
• Window Scale option (More Later)
TCP Header (Other Fields)
• The TCP Checksum field
– TCP header and data and some fields
• in the IP header using a pseudo-header computation.
• The Urgent Pointer field
– valid only if the URG flag bit field is set
– This "pointer" is a positive offset
• must be added to the Sequence Number field of the
segment
– to yield the sequence number of the last byte of urgent data.
TCP Options
Will be covered in a separate lecture.
• Maximum Segment Size (MSS) Option
• Selective Acknowledgment (SACK) Options
• Window Scale (WSCALE or WSOPT) Option
• Timestamps Option and Protection against Wrapped
Sequence Numbers (PAWS)
• User Timeout (UTO) Option
• Authentication Option (TCP-AO)
Evolution of TCP
1984
1975 Nagel’s algorithm
Three-way handshake to reduce overhead 1987
Raymond Tomlinson of small packets; Karn’s algorithm 1990
In SIGCOMM 75 predicts congestion to better estimate 4.3BSD Reno
collapse round-trip time fast retransmit
delayed ACK’s
1983
BSD Unix 4.2 1986 1988
1974 supports TCP/IP Congestion Van Jacobson’s
TCP described by collapse algorithms
Vint Cerf and Bob Kahn observed congestion avoidance
In IEEE Trans Comm 1982 and congestion control
TCP & IP (most implemented in
RFC 793 & 791 4.3BSD Tahoe)

1975 1980 1985 1990


TCP Through the 1990s
1994 1996
T/TCP SACK TCP
(Braden) (Floyd et al)
Transaction Selective
TCP Acknowledgement

1993 1994 1996 1996


TCP Vegas ECN Hoe FACK TCP
(Brakmo et al) (Floyd) Improving TCP (Mathis et al)
real congestion Explicit startup extension to SACK
avoidance Congestion
Notification

1993 1994 1996


TCP Usage Model
• Connection setup
– 3-way handshake
• Data transport
– Sender writes data and TCP
• Breaks data into segments
• Sends each segment over IP
• Retransmits, reorders and removes duplicates
– Receiver reads data
• Teardown
– 4 step exchange

You might also like