This preview shows page 1. Sign up to view the full content.
Unformatted text preview: Data and Computer Communications Communications
Chapter 20 – Transport Protocols Eighth Edition by William Stallings Lecture slides by Lawrie Brown Transport Protocols Transport
The foregoing observations should make us The reconsider the widely held view that birds live only in the present. In fact, birds are aware of more than immediately present stimuli; they remember the past and anticipate the future. remember —The Minds of Birds, Alexander Skutch Transport Protocols Transport end-to-end data transfer service shield upper layers from network details reliable, connection oriented has greater complexity eg. TCP datagram eg. UDP best effort, connectionless Connection Oriented Transport Protocols Transport provides establishment, maintenance & provides termination of a logical connection termination most common service used for a wide variety of applications is reliable but complex first discuss evolution from reliable to first unreliable network services unreliable Reliable Sequencing Network Service Service assume virtually 100% reliable delivery by assume network service of arbitrary length messages network eg. reliable packet switched network with X.25 eg. frame relay with LAPF control protocol eg. IEEE 802.3 with connection oriented LLC service transport service is a simple, end to end protocol transport between two systems on same network between iissues are: addressing, multiplexing, flow control, ssues connection establishment and termination connection Addressing Addressing establish identity of other transport entity by: user identification (host, port)
• a socket in TCP transport entity identification (on host)
• specify transport protocol (TCP, UDP) host address of attached network device
• in an internet, a global internet address network number transport layer passes host to network layer Finding Addresses Finding know address ahead of time well known addresses eg. common servers like FTP, SMTP etc does directory lookup name server sending request to well known address sending which spawns new process to handle it which Multiplexing Multiplexing of upper layers (downward multiplexing) so multiple users employ same transport so protocol protocol user identified by port number or service user access point access may also multiplex with respect to network may services used (upward multiplexing) services eg. multiplexing a single virtual X.25 circuit to eg. a number of transport service user number Flow Control Flow issues: llonger transmission delay between transport entities onger compared with actual transmission time delays communication of flow control info communication variable transmission delay so difficult to use timeouts receiving user can not keep up receiving transport entity can not keep up want TS flow control because: which can result in buffer overflowing managing flow difficult because of gap between managing sender and receiver sender Coping with Flow Control Requirements Requirements do nothing segments that overflow are discarded sender fail to get ACK and will retransmit triggers network flow control but clumsy works well on reliable network does not work well on unreliable network refuse further segments use fixed sliding window protocol use credit scheme Credit Scheme Credit decouples flow control from ACK each octet has sequence number each transport segment has seq number (SN), each ack number (AN) and window size (W) in header ack sends seq number of first octet in segment ACK includes (AN=i, W=j) which means all octets through SN=i-1 acknowledged, want i next permission to send additional window of W=j octets Credit Allocation Credit Sending and Receiving Perspectives Perspectives Establishment and Termination Termination need connection establishment and need termination procedures to allow: each end to know the other exists negotiation of optional parameters triggers allocation of transport entity triggers resources resources Connection State Diagram Connection Connection Establishment Connection Connection Termination Connection either or both sides by mutual agreement graceful or abrupt termination if graceful, initiator must: send FIN to other end, requesting termination place connection in FIN WAIT state when FIN received, inform user and close connection when receives FIN must inform TS user and place when connection in CLOSE WAIT state connection when TS user issues CLOSE primitive, send FIN & when close connection close other end must: Unreliable Network Service Unreliable more difficult case for transport protocol since segments may get lost segments may arrive out of order IP internet, frame relay using LAPF, IEEE 802.3 with IP unacknowledge connectionless LLC unacknowledge ordered delivery, retransmission strategy, duplication ordered detection, flow control, connection establishment & termination, crash recovery termination, examples include issues: Ordered Delivery Ordered segments may arrive out of order hence number segments sequentially TCP numbers each octet sequentially and segments are numbered by the first and octet number in the segment octet Retransmission Strategy Retransmission retransmission of segment needed because retransmission segment damaged in transit segment fails to arrive transmitter does not know of failure receiver must acknowledge successful receipt can use cumulative acknowledgement for efficiency sender times out waiting for ACK triggers sender re-transmission re-transmission Timer Value Timer fixed timer based on understanding of network behavior can not adapt to changing network conditions too small leads to unnecessary re-transmissions too large and response to lost segments is slow should be a bit longer than round trip time may not ACK immediately can not distinguish between ACK of original segment can and re-transmitted segment and conditions may change suddenly adaptive scheme Duplication Detection Duplication if ACK lost, segment duplicated & re-transmitted receiver must recognize duplicates if duplicate received prior to closing connection receiver assumes ACK lost and ACKs duplicate sender must not get confused with multiple ACKs need a sequence number space large enough to not need cycle within maximum life of segment cycle Incorrect Duplicate Detection Detection Flow Control Flow credit allocation quite robust with unreliable net can ack data & grant credit or just one or other lost ACK recovers on next received then send AN=i, W=j to reopen, but this is lost sender thinks window closed, receiver thinks it open have problem if AN=i, W=0 closing window solution is to use persist timer if timer expires, send something could be re-transmission of previous segment Connection Establishment Connection two way handshake A send SYN, B replies with SYN lost SYN handled by re-transmission ignore duplicate SYNs once connected lost or delayed data segments can cause lost connection problems connection eg. segment from old connection Two Way Handshake: Handshake: Obsolete Obsolete Data Segment Segment Two Way Handshake: Two Obsolete SYN Segment Three Way Handshake: Handshake: State State Diagram Diagram Three Way Three Handshake: Examples Connection Termination Connection like connection need 3-way handshake misordered segments could cause: entity in CLOSE WAIT state sends last data segment, entity followed by FIN followed FIN arrives before last data segment ceceiver accepts FIN, closes connection, loses data need to associate sequence number with FIN receiver waits for all segments before FIN receiver sequence number sequence Connection Termination Graceful Close Graceful also have problems with loss of segments also and obsolete segments and need graceful close which will: send FIN i and receive AN i receive FIN j and send AN j wait twice maximum expected segment wait lifetime lifetime Failure Recovery Failure after restart all state info is lost may have half open connection as side that did not crash still thinks it is connected wait for ACK for (time out) * (number of retries) when expired, close connection and inform user close connection using keepalive timer send RST i in response to any i segment arriving user must decide whether to reconnect have problems with lost or duplicate data TCP TCP Transmission Control Protocol (RFC 793) connection oriented, reliable communication over reliable and unreliable (inter)networks two ways of labeling data: data stream push user requires transmission of all data up to push flag receiver will deliver in same manner avoids waiting for full buffers indicates urgent data is upcoming in stream user decides how to handle it urgent data signal TCP Services TCP a complex set of primitives: iincl. passive & active open, active open with ncl. data, send, allocate, close, abort, status data, passive open indicates will accept connections active open with data sends data with open iincl. source port, destination port & address, ncl. timeout, security, data, data length, PUSH & URGENT flags, send & receive windows, connection state, amount awaiting ACK connection and parameters: TCP Header TCP TCP and IP TCP not all parameters used by TCP are in its not header header TCP passes some parameters down to IP precedence normal delay/low delay normal throughput/high throughput normal reliability/high reliability security min overhead for each PDU is 40 octets TCP Mechanisms TCP Connection Establishment three way handshake SYN, SYN-ACK, ACK connection determined by source and connection destination sockets (host, port) destination can only have a single connection can between any unique pairs of ports between but one port can connect to multiple but different destinations (different ports) different TCP Mechanisms TCP Data Transfer data transfer a logical stream of octets octets numbered modulo 223 flow control uses credit allocation of number of flow octets octets data buffered at transmitter and receiver sent when transport entity ready unless PUSH flag used to force send can flag data as URGENT, sent immediately iif receive data not for current connection, RST f flag is set on next segment to reset connection flag TCP Mechanisms TCP Connection Termination graceful close TCP user issues CLOSE primitive transport entity sets FIN flag on last segment sent transport with last of data with entity abandons all attempts to send or receive data RST segment transmitted to other end abrupt termination by ABORT primitive TCP Implementation Options TCP TCP standard precisely specifies protocol have some implementation policy options: send deliver accept retransmit acknowledge implementations may choose alternative implementations options which may impact performance options Send Policy Send if no push or close TCP entity transmits at if its own convenience in credit allocation its data buffered in transmit buffer may construct segment per batch of data may from user from quick response but higher overheads slower response but lower overheads may wait for certain amount of data Deliver Policy in absence of push, can deliver data at in own convenience own may deliver from each segment received higher O/S overheads but more responsive less O/S overheads but slower may buffer data from multiple segments Accept Policy Accept segments may arrive out of order in order only accept segments in order discard out of order segments simple implementation, but burdens network accept all segments within receive window reduce transmissions more complex implementation with buffering in windows Retransmit Policy Retransmit TCP has a queue of segments transmitted TCP but not acknowledged but will retransmit if not ACKed in given time first only - single timer, send one segment only first when timer expires, efficient, has delays when batch - single timer, send all segments when batch timer expires, has unnecessary transmissions timer individual - timer for each segment, complex effectiveness depends in part on receiver’s accept policy accept Acknowledgement Policy Acknowledgement immediate send empty ACK for each accepted segment simple at cost of extra transmissions piggyback ACK on suitable outbound data piggyback segments unless persist timer expires segments when send empty ACK more complex but efficient cumulative Congestion Control Congestion flow control also used for congestion flow control control recognize increased transit times & dropped recognize packets packets react by reducing flow of data Tahoe, Reno & NewReno implementations retransmission timer management retransmission window management RFC’s 1122 & 2581 detail extensions two categories of extensions: Retransmission Timer Management Management static timer likely too long or too short estimate round trip delay by observing pattern of estimate delay for recent segments delay set time to value a bit greater than estimate simple average over a number of segments exponential average using time series (RFC793) RTT Variance Estimation (Jacobson’s algorithm) Use of Exponential Averaging Averaging Jacobson’s RTO Calculation Calculation Exponential RTO Backoff Exponential timeout probably due to congestion dropped packet or long round trip time hence maintaining RTO is not good idea better to increase RTO each time a better segment is re-transmitted re-transmitted RTO = q*RTO commonly q=2 (binary exponential backoff) as in ethernet CSMA/CD Karn’s Algorithm Karn’s if segment is re-transmitted, ACK may be for: first copy of the segment (longer RTT than expected) second copy no way to tell don’t measure RTT for re-transmitted segments calculate backoff when re-transmission occurs use backoff RTO until ACK arrives for segment use that has not been re-transmitted that Window Management Window slow start larger windows cause problem on connection created at start limit TCP to 1 segment increase when data ACK, exponential growth when a timeout occurs perhaps due to congestion set slow start threshold to half current congestion set window window set window to 1 and slow start until threshold beyond threshold, increase window by 1 for each RTT dynamic windows sizing on congestion Window Management Window Fast Retransmit Fast Recovery retransmit timer rather longer than RTT if segment lost TCP slow to retransmit fast retransmit iif receive 4 ACKs for same segment then f immediately retransmit since likely lost immediately lost segment means some congestion halve window then increase linearly avoids slow-start fast recovery User Datagram Protocol User (UDP) connectionless service for application level connectionless procedures specified in RFC 768 procedures unreliable delivery & duplication control not guaranteed reduced overhead least common denominator service uses: inward data collection outward data dissemination request-response real time application UDP Header UDP Summary Summary connection-oriented network and transport connection-oriented mechanisms and services mechanisms TCP services, mechanisms, policies TCP congestion control UDP ...
View Full Document
This note was uploaded on 04/06/2011 for the course EE 5363 taught by Professor Kang during the Spring '09 term at NYU Poly.
- Spring '09