Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright 2002, S.D. Personick. All Rights Reserved.1 Telecommunications Networking II Topic 20 Transmission Control Protocol (TCP) Ref: Tanenbaum pp:521-545.

Similar presentations


Presentation on theme: "Copyright 2002, S.D. Personick. All Rights Reserved.1 Telecommunications Networking II Topic 20 Transmission Control Protocol (TCP) Ref: Tanenbaum pp:521-545."— Presentation transcript:

1 Copyright 2002, S.D. Personick. All Rights Reserved.1 Telecommunications Networking II Topic 20 Transmission Control Protocol (TCP) Ref: Tanenbaum pp:521-545 Dr. Stewart D. Personick Drexel University

2 Copyright 2002, S.D. Personick. All Rights Reserved.2 Layer 4: Review The layer 4 (Transport Layer) protocol has responsibility to ensuring end-to-end (host-to- host) reliability of communication of packets. It is responsible for detecting lost packets, duplicate packets, and packets arriving out of their intended order Some layer 4 protocols, by design, ensure none of the above

3 Copyright 2002, S.D. Personick. All Rights Reserved.3 Internet Layer 4 Protocols TCP (transmission control protocol): for reliable communication of packets across a network UDP (user datagram protocol): for “best effort” delivery of packets…adds a checksum, but does not acknowledge receipt of packets at layer 4

4 Copyright 2002, S.D. Personick. All Rights Reserved.4 TCP: Transmission Control Protocol Each machine (e.g., host) which supports TCP has a (typically) software-defined “process” (transport entity) which -accepts data from other local processes -breaks the data up into “pieces” not exceeding ~64 Kbytes each [(2**16) - 40 = 65,496] -places these “pieces” into IP datagrams -delivers these datagrams to the IP layer

5 Copyright 2002, S.D. Personick. All Rights Reserved.5 TCP TCP-Transport Entity: a piece of software that implements/executes the TCP protocol TCP-Protocol: the set of “rules” defined in RFC 793, RFC 1122, and RFC 1323

6 Copyright 2002, S.D. Personick. All Rights Reserved.6 Implementing TCP The sender and the receiver (hosts) create “sockets” (abstract I/O entities) that consist of an IP address and local 16 bit port number. Sockets must be explicitly established on the sending and receiving machines Sockets may be used for multiple connections at the same time

7 Copyright 2002, S.D. Personick. All Rights Reserved.7 Certain port numbers below 1024 are reserved for “well known services” : e.g., port 21 is used for FTP (file transfer protocol); port 25 is used for SMTP (simple mail transfer protocol); port 80 is used by servers for incoming WWW connections from clients TCP connections are full-duplex and point-to- point (no multicasting) Implementing TCP

8 Copyright 2002, S.D. Personick. All Rights Reserved.8 TCP entities exchange data in the form of segments A segment consists of a 20-byte TCP header, plus zero or more data bytes Each segment, must fit into a 65,536 byte IP datagram, but segments are typically much smaller Implementing TCP

9 Copyright 2002, S.D. Personick. All Rights Reserved.9 Each transmitted byte is given a sequence number by its sender. The sequence numbers are modulo 2**32. Segments are numbered according to the sequence number of the last byte in the segment The receiving entity acknowledges received segments by their sequence numbers (it can piggyback acknowledgements with data going the other way) Implementing TCP

10 Copyright 2002, S.D. Personick. All Rights Reserved.10 An destination-specified “window size” determines the maximum number of unacknowledged bytes that can be sent Segments must be acknowledged in order (of their sequence numbers) Timers determine whether unacknowledged packets will be resent by their senders As usual, simple as this sounds: “the devil is in the details” Implementing TCP

11 Copyright 2002, S.D. Personick. All Rights Reserved.11 The TCP Header Source port Destination port Sequence number Acknowledgement Window size H.L. Checksum Urgent pointer Options: 0 or more 4-byte words Data (optional) Not used

12 Copyright 2002, S.D. Personick. All Rights Reserved.12 The TCP Header Source and Destination Port numbers Sequence number (# of last byte in segment) Acknowledgement number (# of next byte expected) H.L. : TCP Header length in 4-byte words Unused bits (6)

13 Copyright 2002, S.D. Personick. All Rights Reserved.13 URG (1) set to “1” if the urgent pointer is in use (see below) ACK(1) set to “1” if the acknowledgement sequence number is being used in this segment PSH (1) set to “1” if the receiver is requested to deliver the data to the application upon arrival, and not buffer it while waiting for a buffer to fill The TCP Header

14 Copyright 2002, S.D. Personick. All Rights Reserved.14 RST (1) : reset connection SYN (1) : used to establish connections FIN (1) : used to release connections Window Size : used for flow control; determines the maximum number of bytes that can be sent, starting with the last byte acknowledged by the destination Checksum: checks for errors, and includes a measure of the segment length in bytes The TCP Header

15 Copyright 2002, S.D. Personick. All Rights Reserved.15 Urgent pointer : indicates the byte offset, from the current sequence number at which urgent data can be found (used to deliver time- critical data) Options: as the name implies…example- used during connection establishment to specify the maximum datagram size that a host can accept The TCP Header

16 Copyright 2002, S.D. Personick. All Rights Reserved.16 Congestion Control Tanenbaum pp 529-545 Senders retransmit segments when their timers “timeout” Lack of acknowledgement of a transmitted (sent) segment can be due to network congestion or damage to the segment on a link Various algorithms are used to throttle back the sending of segments when multiple timeouts occur

17 Copyright 2002, S.D. Personick. All Rights Reserved.17 Congestion Control Tanenbaum pp 529-545 Generic approach: If several timeouts occur, the sender dramatically reduces its congestion control window size (the number of unacknowledged segments that can be transmitted for this connection); and subsequently increases this congestion control window size as newly sent segments are acknowledged. [E.g., reduce the window size to 1 segment. Then increase the window size by one segment, for each segment that is acknowledged.]

18 Copyright 2002, S.D. Personick. All Rights Reserved.18 Congestion Control Tanenbaum pp 529-545 Generic approach: If several timeouts occur, the sender dramatically reduces its congestion control window size… Problem: This approach may cause problems when wireless links are used… I.e., packets lost due to damage incurred on wireless links will trigger unnecessary reductions in average transmission rates

19 Copyright 2002, S.D. Personick. All Rights Reserved.19 Large delay-bandwidth- product links Problem: On links with a large product of delay and bandwidth (data rate), the number of “bytes in flight” can get larger than the maximum window size (2**16). There is a protocol modification that allows hosts to specify a larger window size example: (GEO satellite link) 0.24 seconds x 2 x 155Mbps/ 8bits per byte = ~9.3 Megabytes “in flight” (I.e., unacknowledged)

20 Copyright 2002, S.D. Personick. All Rights Reserved.20 A TCP “Conversation” Hellooooo: IP host 129.25.60.1 …. I want to set up a TCP connection on your port number 25 (SMTP); my IP number is 129.113.251.170. My port number is 2057. I can accept up to 32,768 unacknowledged bytes. My byte counter is set at 6253. Okay…. I agree to set up a connection between you and me on my port number 25, your port number 2057. I can accept up to 16,384 unacknowledged bytes. My byte counter is set at 8971, I am expecting byte number 6254 from you. Okay….


Download ppt "Copyright 2002, S.D. Personick. All Rights Reserved.1 Telecommunications Networking II Topic 20 Transmission Control Protocol (TCP) Ref: Tanenbaum pp:521-545."

Similar presentations


Ads by Google