Docsity

TCP Protocol: Understanding Segmentation, Header, and Connection Management, Slides of Fundamentals of E-Commerce

Toggle sidebar
bg1
The TCP Protocol
•Although this protocol sounds simple, there are some
details/issues to be addressed:
–Since segments can be fragmented, it is possible that part of
a transmitted segment arrives but the rest is lost and never
arrives.
–Segments can also arrive out of order, for example, bytes
3072-4095 can arrive but cannot be acknowledged because
bytes 2048-3071 have not come yet.
–Segments can also be delayed so long in transit that the
sender times out and retransmits them.
–If a retransmitted segment takes a different route than the
original, and is fragmented differently, bits and pieces of both
the original and the duplicate can arrive sporadically,
requiring careful administration to achieve a reliable byte
stream.
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download TCP Protocol: Understanding Segmentation, Header, and Connection Management and more Slides Fundamentals of E-Commerce in PDF only on Docsity!

The TCP Protocol

-^ Although this protocol sounds simple, there are

some

details/issues

to be addressed:

-^ Since segments can be fragmented, it is possible that part ofa transmitted segment arrives but the rest is lost and neverarrives. –^ Segments can also arrive out of order, for example, bytes3072-4095 can arrive but cannot be acknowledged becausebytes 2048-3071 have not come yet. –^ Segments can also be delayed so long in transit that thesender times out and retransmits them. –^ If a retransmitted segment takes a different route than theoriginal, and is fragmented differently, bits and pieces of boththe original and the duplicate can arrive sporadically,requiring careful administration to achieve a reliable bytestream.

The TCP Protocol

-^ Finally, with so many networks making up the Internet, it ispossible that a segment may occasionally hit a congested (orbroken) network along its path. • TCP must be prepared to deal with these problems andsolve them in an efficient way. • A considerable effort has gone into optimizing theperformance of TCP streams, even in the face ofnetwork problems. We will discuss some algorithmsnext.

The TCP Segment Header

Fig. 1. The TCP header

The TCP Segment Header

-^ Source port

and^ Destination port

  • identify the local end

points of the connection. • Sequence number

and^ acknowledgement number

(specifies

the next sequence number expected) • TCP header length

  • tells now many 32-bit words are contained in the TCP header (because Options field is ofvariable length) • Next comes a 6-bit field that is not used. • Next come 6 1-bit flags:^ –^ URG^ is set to 1 if the Urgent pointer is in use. The Urgent Pointer isused to indicate a byte offset (from the current sequence number) atwhich urgent data is located^ –^ ACK^ is set to 1 to indicate that the acknowledgement number field isvalid. Otherwise, if set to 0, then this segment does not contain anacknowledgment

The TCP Segment Header • A Checksum^ is also provided for extreme reliability –it checksums the header and the data. • Options^ field was designed to provide a way to addextra facilities not covered by the regular header. Forexample, allow each host to specify the maximumTCP payload it is willing to accept. (using largesegments is more efficient than using small ones)

TCP Connection Management • Connections are established in TCP using a three-way handshake

-^ Host 1 chooses a sequence number,

x, and sends a

CONNECTION REQUEST containing it to host 2. – Host 2 replies with CONNECTION ACCEPTEDacknowledgment

x, and announcing its own initial sequence number,

y.

-^ Finally Host 1 acknowledges host 2’s choice of an initialsequence number in the first data that it sends.

TCP Connection Management

When this segment arrivesat the destination, the TCPentity there checks to see ifthere is a process that hasdone a LISTEN on the portgiven in the Destination portfield. If not, it sends a replywith the RST bit on to rejectthe connection.If some process is listeningon the port, that process isgiven the incoming TCPsegment. It can eitheraccept or reject theconnection. If it accepts, anacknowledgment segment issent back.