Presentation is loading. Please wait.

Presentation is loading. Please wait.

Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 1 Transport Protocols.

Similar presentations


Presentation on theme: "Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 1 Transport Protocols."— Presentation transcript:

1 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 1 Transport Protocols

2 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 2 Outline Introduction TCP UDP

3 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 3 Introduction Internet Protocol (IP) provides “unreliable datagram service” between hosts Transport protocols provide end-to-end delivery between endpoints of a connection; e.g., processes or programs

4 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 4 Introduction (cont’d) shield the user from the details of the underlying communications systems relieves applications and other upper-layer protocols from changing communications networks and services eg: User Datagram Protocol (UDP), Transmission Control Protocol (TCP)

5 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 5 UDP and TCP/IP Layering Use IP to provide data delivery for applications, TCP end-to-end protocol

6 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 6 Outline Introduction TCP UDP

7 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 7 TCP TCP is the most widely used transport protocol Provides reliable data delivery by using unreliable IP datagrams Recovery from loss, or duplication of packets Reliable delivery to the high-level applications

8 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 8 Features of TCP Connection oriented: application requests connection to destination and then uses the connection to deliver data Point-to-point: A TCP connection has two endpoints Reliability: TCP guarantees data will be delivered without loss, duplication or transmission error

9 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 9 Features of TCP (cont’d) Full duplex: the endpoints of a TCP connection exchange data in both directions simultaneously Stream interface: application delivers data to the TCP as a continuous stream, with no boundaries Reliable connection establishment: three-way handshake guarantees reliable, synchronized startup between endpoints Graceful connection shutdown: TCP guarantees delivery of all data after shutdown requested by application

10 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 10 Design Issues Addressing Ordered delivery Retransmission strategy Duplicate detection Flow control Connection establishment Connection termination

11 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 11 Addressing A protocol port represents a particular transport service (TS) user TCP defines an endpoint as a pair of integers (host, port), eg: (128.10.2.3, 25) TCP uses the connection, not the protocol port, as its fundamental abstraction; connections are identified by a pair of endpoints, eg: (128.10.2.3, 25) and (128.26.0.36, 1069) defines a connection Because TCP identifies a connection by a pair of endpoints, a given TCP port number can be shared by multiple connections on the same machine

12 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 12 Ordered Delivery Application delivers arbitrarily large chunks of data to TCP as a “stream” TCP breaks this data into segments, each of which fits into an IP datagram Segments may arrive out of order TCP numbers each sent data octet sequentially Segments are numbered by the number of the first octet in the segment

13 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 13 Retransmission Strategy When segment is lost, or damaged in transit, transmitter does not know its failure Receiver must acknowledge successful receipt of data – positive ack One ACK can acknowledge many segments (cumulative acknowledgement) Time out waiting for ACK triggers re-transmission

14 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 14

15 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 15 Setting the Timeout Inappropriate timeout can cause poor performance: –Too long - sender waits longer than necessary before retransmission –Too short - sender generates unnecessary traffic Timeout must be different for each connection and set dynamically –Hosts on same LAN should have shorter timeout than hosts 20 hops away –Delivery time across internet may change over time because of loading; timeout must accommodate changes

16 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 16 Picking a timeout value Timeout should be based on round trip time (RTT) Sender does not know RTT of any packet before transmission Sender picks retransmission timeout (RTO) based on previous RTTs Specific method is called adaptive retransmission algorithm

17 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 17 RTOs for Different Network Delays

18 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 18 Flow Control TCP uses sliding window for flow control Receiver specifies window –(AN = i, W = j ) –Called window advertisement (W=j) –Specifies which bytes in the data stream can be sent –Carried in segment along with ACK (AN= i) Sender can transmit any bytes, in any size segment, between last acknowledged byte and within window size

19 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 19 Sliding window with acknowledgments

20 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 20 Connection Establishment If the network is reliable, Two-way Handshake suffices: –A send SYN, B replies with SYN –Lost SYN handled by re-transmission, can lead to duplicate SYNs –Ignore duplicate SYNs once connected

21 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 21 Connection Termination Either or both sides By mutual agreement Abrupt termination Or graceful termination –Close Wait state must accept incoming data until ACK for FIN received

22 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 22 Problems with Two-way Handshake In an unreliable network, lost or delayed segments can cause problems in connection or termination

23 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 23 Problem 1: Obsolete Data Segment

24 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 24 Problem 2: obsolete SYN Segment

25 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 25 Solution: Three-way Handshake

26 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 26 Three-way Handshake: Examples

27 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 27 Close a TCP Connection

28 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 28 Close a TCP Connection (cont’d) A modified three-way handshake is used to close a TCP connection (full duplex) To close its half of the connection, the sending TCP finishes transmitting the remaining data, waits for the receiver to acknowledge it, and then send a FIN segment. Then, the receiving TCP acknowledges the FIN segment. Meanwhile, data can continue to flow in the other half of the connection, until it is closed Associate sequence number with FIN Receiver waits for all segments before FIN sequence number

29 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 29 Congestion Control Implemented by senders Dynamic window flow control Two phases: Slow Start and Congestion Avoidance 3 parameters are used: –W_max, maximum window size advertised by receiver –W_t, threshold, initially set to half of W_max –W, congestion window

30 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 30 Slow Start Initially, W=1, increasing W for each Ack received before timeout (exponential increase: W=1,2,4,8,16 …) when W=W_t, congestion avoidance mode is entered when a packet loss is detected, W_t=0.5W, and then set W=1

31 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 31 Congestion Avoidance W increases by 1 when all Acks for a full congestion window of packets are received W cannot exceed W_max same as Slow Start, when a packet loss is detected, W_t=0.5W, W=1

32 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 32 Window Dynamics (an example) window size

33 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 33 Features Slow Start allows users to quickly/exponentially attain maximum transmission rates when bandwidth is available (not slow at all!) Congestion Avoidance forces users to cautiously/linearly increase the window size near congestion point, allowing them to make use of the bandwidth that may become available

34 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 34 Figure 17.14 TCP Header TCP Header

35 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 35 Outline Introduction TCP UDP

36 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 36 UDP Provide a connectionless (unreliable) service; delivery and duplicate protection are not guaranteed. Low overhead, which may be adequate in many cases, e.g. for network management There is a checksum in the header. If an error is detected, the segment is discarded and no further action is taken.

37 Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 37 UDP Header


Download ppt "Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 1 Transport Protocols."

Similar presentations


Ads by Google