William Stallings Data and Computer Communications Chapter 17

  • Slides: 38
Download presentation
William Stallings Data and Computer Communications Chapter 17 Transport Protocols

William Stallings Data and Computer Communications Chapter 17 Transport Protocols

Finding Addresses z Four methods y. Know address ahead of time xe. g. collection

Finding Addresses z Four methods y. Know address ahead of time xe. g. collection of network device stats y. Well known addresses y. Name server y. Sending process request to well known address

Flow Control z Longer transmission delay between transport entities compared with actual transmission time

Flow Control z Longer transmission delay between transport entities compared with actual transmission time y. Delay in communication of flow control info z Variable transmission delay y. Difficult to use timeouts z Flow may be controlled because: y. The receiving user can not keep up y. The receiving transport entity can not keep up z Results in buffer filling up

Coping with Flow Control Requirements (2) z Use fixed sliding window protocol y. See

Coping with Flow Control Requirements (2) z Use fixed sliding window protocol y. See chapter 7 for operational details y. Works well on reliable network x. Failure to receive ACK is taken as flow control indication y. Does not work well on unreliable network x. Can not distinguish between lost segment and flow control z Use credit scheme

Credit Scheme z Greater control on reliable network z More effective on unreliable network

Credit Scheme z Greater control on reliable network z More effective on unreliable network z Decouples flow control from ACK y. May ACK without granting credit and vice versa z Each octet has sequence number z Each transport segment has seq number, ack number and window size in header

Use of Header Fields z When sending, seq number is that of first octet

Use of Header Fields z When sending, seq number is that of first octet in segment z ACK includes AN=i, W=j z All octets through SN=i-1 acknowledged y. Next expected octet is i z Permission to send additional window of W=j octets yi. e. octets through i+j-1

Connection Establishment

Connection Establishment

Not Listening z Reject with RST (Reset) z Queue request until matching open issued

Not Listening z Reject with RST (Reset) z Queue request until matching open issued z Signal TS user to notify of pending request y. May replace passive open with accept

Ordered Delivery z Segments may arrive out of order z Number segments sequentially z

Ordered Delivery z Segments may arrive out of order z Number segments sequentially z TCP numbers each octet sequentially z Segments are numbered by the first octet number in the segment

Retransmission Strategy z Segment damaged in transit z Segment fails to arrive z Transmitter

Retransmission Strategy z Segment damaged in transit z Segment fails to arrive z Transmitter does not know of failure z Receiver must acknowledge successful receipt z Use cumulative acknowledgement z Time out waiting for ACK triggers re-transmission

Timer Value z Fixed timer y. Based on understanding of network behavior y. Can

Timer Value z Fixed timer y. Based on understanding of network behavior y. Can not adapt to changing network conditions y. Too small leads to unnecessary re-transmissions y. Too large and response to lost segments is slow y. Should be a bit longer than round trip time z Adaptive scheme y. May not ACK immediately y. Can not distinguish between ACK of original segment and re-transmitted segment y. Conditions may change suddenly

Two Way Handshake: Obsolete Data Segment

Two Way Handshake: Obsolete Data Segment

Two Way Handshake: Obsolete SYN Segment

Two Way Handshake: Obsolete SYN Segment

Three Way Handshake: State Diagram

Three Way Handshake: State Diagram

Three Way Handshake: Examples

Three Way Handshake: Examples

TCP & UDP z Transmission Control Protocol y. Connection oriented y. RFC 793 z

TCP & UDP z Transmission Control Protocol y. Connection oriented y. RFC 793 z User Datagram Protocol (UDP) y. Connectionless y. RFC 768

TCP Services z Reliable communication between pairs of processes z Across variety of reliable

TCP Services z Reliable communication between pairs of processes z Across variety of reliable and unreliable networks and internets z Two labeling facilities y. Data stream push x. TCP user can require transmission of all data up to push flag x. Receiver will deliver in same manner x. Avoids waiting for full buffers y. Urgent data signal x. Indicates urgent data is upcoming in stream x. User decides how to handle it

TCP Header

TCP Header

Items Passed to IP z TCP passes some parameters down to IP y. Precedence

Items Passed to IP z TCP passes some parameters down to IP y. Precedence y. Normal delay/low delay y. Normal throughput/high throughput y. Normal reliability/high reliability y. Security

TCP Mechanisms (1) z Connection establishment y. Three way handshake y. Between pairs of

TCP Mechanisms (1) z Connection establishment y. Three way handshake y. Between pairs of ports y. One port can connect to multiple destinations

TCP Mechanisms (2) z Data transfer y. Logical stream of octets y. Octets numbered

TCP Mechanisms (2) z Data transfer y. Logical stream of octets y. Octets numbered modulo 223 y. Flow control by credit allocation of number of octets y. Data buffered at transmitter and receiver

TCP Mechanisms (3) z Connection termination y. Graceful close y. TCP users issues CLOSE

TCP Mechanisms (3) z Connection termination y. Graceful close y. TCP users issues CLOSE primitive y. Transport entity sets FIN flag on last segment sent y. Abrupt termination by ABORT primitive x. Entity abandons all attempts to send or receive data x. RST segment transmitted

Implementation Policy Options z Send z Deliver z Accept z Retransmit z Acknowledge

Implementation Policy Options z Send z Deliver z Accept z Retransmit z Acknowledge

Send z If no push or close TCP entity transmits at its own convenience

Send z If no push or close TCP entity transmits at its own convenience z Data buffered at transmit buffer z May construct segment per data batch z May wait for certain amount of data

Deliver z In absence of push, deliver data at own convenience z May deliver

Deliver z In absence of push, deliver data at own convenience z May deliver as each in order segment received z May buffer data from more than one segment

Accept z Segments may arrive out of order z In order y. Only accept

Accept z Segments may arrive out of order z In order y. Only accept segments in order y. Discard out of order segments z In windows y. Accept all segments within receive window

Retransmit z TCP maintains queue of segments transmitted but not acknowledged z TCP will

Retransmit z TCP maintains queue of segments transmitted but not acknowledged z TCP will retransmit if not ACKed in given time y. First only y. Batch y. Individual

Acknowledgement z Immediate z Cumulative

Acknowledgement z Immediate z Cumulative

Congestion Control z RFC 1122, Requirements for Internet hosts z Retransmission timer management y.

Congestion Control z RFC 1122, Requirements for Internet hosts z Retransmission timer management y. Estimate round trip delay by observing pattern of delay y. Set time to value somewhat greater than estimate y. Simple average y. Exponential average y. RTT Variance Estimation (Jacobson’s algorithm)

Use of Exponential Averaging

Use of Exponential Averaging

Jacobson’s RTO Calculation

Jacobson’s RTO Calculation

Exponential RTO Backoff z Since timeout is probably due to congestion (dropped packet or

Exponential RTO Backoff z Since timeout is probably due to congestion (dropped packet or long round trip), maintaining RTO is not good idea z RTO increased each time a segment is re-transmitted z RTO = q*RTO z Commonly q=2 y. Binary exponential backoff

Karn’s Algorithm z If a segment is re-transmitted, the ACK arriving may be: y.

Karn’s Algorithm z If a segment is re-transmitted, the ACK arriving may be: y. For the first copy of the segment x. RTT longer than expected y. For second copy z No way to tell z Do not measure RTT for re-transmitted segments z Calculate backoff when re-transmission occurs z Use backoff RTO until ACK arrives for segment that has not been re-transmitted

Window Management z Slow start yawnd = MIN[credit, cwnd] y. Start connection with cwnd=1

Window Management z Slow start yawnd = MIN[credit, cwnd] y. Start connection with cwnd=1 y. Increment cwnd at each ACK, to some max z Dynamic windows sizing on congestion y. When a timeout occurs y. Set slow start threshold to half current congestion window xssthresh=cwnd/2 y. Set cwnd = 1 and slow start until cwnd=ssthresh x. Increasing cwnd by 1 for every ACK y. For cwnd >=ssthresh, increase cwnd by 1 for each RTT

UDP z User datagram protocol z RFC 768 z Connectionless service for application level

UDP z User datagram protocol z RFC 768 z Connectionless service for application level procedures y. Unreliable y. Delivery and duplication control not guaranteed z Reduced overhead z e. g. network management (Chapter 19)

UDP Uses z Inward data collection z Outward data dissemination z Request-Response z Real

UDP Uses z Inward data collection z Outward data dissemination z Request-Response z Real time application

UDP Header

UDP Header

Required Reading z Stallings chapter 17 z RFCs

Required Reading z Stallings chapter 17 z RFCs