Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright 1999, S.D. Personick. All Rights Reserved. Telecommunications Networking II Lecture 32 Transmission Control Protocol (TCP) Ref: Tanenbaum pp:521-545.

Similar presentations


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

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

2 Copyright 1999, S.D. Personick. All Rights Reserved. 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 1999, S.D. Personick. All Rights Reserved. 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 1999, S.D. Personick. All Rights Reserved. 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 -places these “pieces” into IP datagrams -delivers these datagrams to the IP layer

5 Copyright 1999, S.D. Personick. All Rights Reserved. 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 1999, S.D. Personick. All Rights Reserved. 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 1999, S.D. Personick. All Rights Reserved. Implementing TCP 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)

8 Copyright 1999, S.D. Personick. All Rights Reserved. Implementing TCP 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,535 byte IP datagram, but segments are typically much smaller

9 Copyright 1999, S.D. Personick. All Rights Reserved. Implementing TCP 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)

10 Copyright 1999, S.D. Personick. All Rights Reserved. Implementing TCP 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”

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

12 Copyright 1999, S.D. Personick. All Rights Reserved. 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 32-byte words Unused bits (6)

13 Copyright 1999, S.D. Personick. All Rights Reserved. The TCP Header 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

14 Copyright 1999, S.D. Personick. All Rights Reserved. The TCP Header 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

15 Copyright 1999, S.D. Personick. All Rights Reserved. The TCP Header 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

16 Copyright 1999, S.D. Personick. All Rights Reserved. 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 Complex algorithms are used to throttle back the sending of segments when timeouts occur

17 Copyright 1999, S.D. Personick. All Rights Reserved. A TCP “Conversation” Hellooooo: IP host 144.118.32.1…. I want to set up a TCP connection on your port number 25 (SMTP); my IP number is 129.113.251.170. I can accept 1048 byte IP datagrams Okay…. I agree to set up a connection between you and I on port number 25. I can accept 2096 byte IP datagrams Thanks

18 Copyright 1999, S.D. Personick. All Rights Reserved. Congestion Control Tanenbaum pp 529-545 Generic approach: If a timeout occurs, the sender dramatically reduces the rate at which it transmits segments (bytes per second); and then increases this rate as newly sent segments are acknowledged Problem: This approach may cause problems when wireless links are used

19 Copyright 1999, S.D. Personick. All Rights Reserved. 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 = ~9.3 Megabytes in flight


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

Similar presentations


Ads by Google