Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Transport Layer Chapter 6. The Transport Service The transport layer is the heart of the whole protocol hierarchy It provides reliable data transport.

Similar presentations


Presentation on theme: "The Transport Layer Chapter 6. The Transport Service The transport layer is the heart of the whole protocol hierarchy It provides reliable data transport."— Presentation transcript:

1 The Transport Layer Chapter 6

2 The Transport Service The transport layer is the heart of the whole protocol hierarchy It provides reliable data transport end to end It masks the diversity of communication subnets, provide a common interface to the upper layer It provides multiple SAPs sharing one network link

3 The Transport Function net 1 net 2 AP 1 AP 2 AP 3 AP 4 transport entity AP 1 transport entity AP 4 subnet end to end 主机 A 主机 B

4 Services Provided to the Upper Layers The network, transport, and application layers.

5 Transport Service Primitives The primitives for a simple transport service.

6 Transport Service Primitives (2) The nesting of TPDUs, packets, and frames.

7 Transport Service Primitives (3) A state diagram for a simple connection management scheme. Transitions labeled in italics are caused by packet arrivals. The solid lines show the client's state sequence. The dashed lines show the server's state sequence.

8 Berkeley Sockets The socket primitives for TCP.

9 Elements of Transport Protocols Addressing Connection Establishment Connection Release Flow Control and Buffering Multiplexing Crash Recovery

10 Comparison of Transport Protocol & Data Link Protocol(1) (a) Environment of the data link layer. (b) Environment of the transport layer.

11 Comparison of Transport Protocol & Data Link Protocol(2) Both have to deal with error control, sequencing, flow control Environment differences Explicit addressing of destinations Initial connection establishment Storage capacity in the subnet Allocation of buffers

12 Addressing TSAPs, NSAPs and transport connections.

13 Addressing(2) How the client gets the server’s TSAP? Well-known TSAP Look up a name server or directory server

14 Addressing(3) How a user process in host 1 establishes a connection with a time-of-day server in host 2.

15 Connection Establishment The connection establishment TPDU could be delayed or duplicated see P497 example Solution & flaw If using throwaway transport addresses, no process server If giving each connection a connection identifier (i.e., a incremented sequence number), a crashed machine can not know which identifier have been used Packet lifetime should be restricted Restricted subnet design Putting a hop counter in each packet Timestamping each packet

16 Connection Establishment Tomlinson T: n times of maximum packet lifetime Make sure both a packet and it’s acknowledgement are dead Each host equipped with a time-of-day clock The clocks at different hosts need not be synchronized Each clock is a binary counter incremented at a small interval (tick) The clock should not stop even if the host goes down Allocate sequence for each TPDU Sequence is long enough, so it won’t be reused before period T When a connection is set up, the lower-order k bits of the clock are used as the initial sequence number The sequence space is larger than the one data link layer used, it limits the throughput of host Prevent sequence numbers from being used for a time T before their potential use as initial sequence numbers (i.e., one TPDU per clock tick)

17 Connection Establishment Tomlinson(2) (a) TPDUs may enter the forbidden region if host send too fast or too slow (b) The resynchronization problem. (too slow)

18 Connection Establishment (3) Three protocol scenarios for establishing a connection using a three-way handshake. CR denotes CONNECTION REQUEST. (a) Normal operation, (b) Old CONNECTION REQUEST appearing out of nowhere. (c) Duplicate CONNECTION REQUEST and duplicate ACK.

19 Connection Release Asymmetric Abrupt disconnection with loss of data.

20 Connection Release (2) The two-army problem.

21 Connection Release (3) Four protocol scenarios for releasing a connection. (a) Normal case of a three-way handshake. (b) final ACK lost. 6-14, a, b

22 Connection Release (4) (c) Response lost. (d) Response lost and subsequent DRs lost. 6-14, c,d

23 Flow Control and Buffering (a) Chained fixed-size buffers. (b) Chained variable-sized buffers. (c) One large circular buffer per connection.

24 Flow Control and Buffering(2) Why transport entity allocates buffers dynamically? Too much connection in transport layer Each connection may be opened or closed frequently Solution Explicit window in acknowledgement Variable-sized window Two flow control factor Buffer space available in the receiver explicit window indication The capacity of the subnet sender monitor the network’s carrying capacity

25 Flow Control and Buffering (3) Dynamic buffer allocation. The arrows show the direction of transmission. An ellipsis (…) indicates a lost TPDU.

26 Multiplexing (a) Upward multiplexing. (b) Downward multiplexing.

27 The Internet Transport Protocols TCP Transmission Control Protocol RFC793 Connection-oriented protocol Byte-stream UDP User Datagram Protocol RFC768 Connectionless Protocol TCP/IP STACK Application TCP UDP Host-to-Network Host-to-Network IP IP

28 UDP The UDP header.

29 The TCP Service Model Socket IP address (NSAP) and Port (16-bit, TSAP) Each connection is identified by a pair of sockets Well-known ports Reserved for standard services RFC1700 TCP connection Full-duplex Point-to-point Byte-stream, not message stream

30 The TCP Service Model Some well-known ports. PortProtocol Use 21 FTP File transfer 23 Telnet Remote login 25 SMTP E-mail 69 TFTP Trivial File Transfer Protocol 79 FingerLookup info about a user 80 HTTP World Wide Web 110 POP-3 Remote e-mail access 119 NNTP USENET news

31 The TCP Service Model (2) (a) Four 512-byte segments sent as separate IP datagrams. (b) The 2048 bytes of data delivered to the application in a single READ CALL.

32 TCP Protocol 32-bits sequence Count byte, not segment Segment=20bytes head + n bytes data MSS (Maximum Segment Size) Limited by IP datagram length Limited by MTU of each data link, so router could fragment a segment Variable sized sliding window Limited by IP datagram length Limited by MTU of each data link, so router could fragment a segment Reorder the segment Disordered and duplicated segments received by the receiver Accumulated acknowledgement

33 The TCP Segment Header TCP Header.

34 The TCP Segment Header (2) The pseudoheader included in the TCP checksum.

35 TCP Options MSS Window scale RFC1323 Selective repeat RFC1106

36 TCP Connection Establishment three-way handshake (a) TCP connection establishment in the normal case. (b) Call collision. 6-31

37 TCP Connection Release Host 1 Host 2 FIN=1, Seq=x Ack= x+1 Application request releasing connection Notify application Application request releasing connection Notify application FIN=1, Seq= y Ack= y+1 Release the whole connection  Use timer to avoid the two-army problem

38 TCP Connection Management Modeling The states used in the TCP connection management finite state machine.

39 TCP Connection Management Modeling (2) TCP connection management finite state machine. The heavy solid line is the normal path for a client. The heavy dashed line is the normal path for a server. The light lines are unusual events. Each transition is labeled by the event causing it and the action resulting from it, separated by a slash.

40 TCP Transmission Policy window management Window management in TCP.

41 TCP Transmission Policy efficiency TCP/IP overhead=20 bytes TCP head + 20 bytes IP head When used in TELNET connection, 1 data bytes carried with 40 bytes overhead Improvement algorithm Delay acknowledgement and window update reduce the load placed by the receiver Nagle’s algorithm send one segment unless either of the following condition exist: 1.acknowledgement to last segment has been received 2.buffered data fills half the window or a maximum segment

42 TCP Transmission Policy silly window syndrome Clark’s solution The receiver should not send a window update until it can handle the MSS or its buffer is half empty, whichever is smaller

43 TCP Congestion Control The reason for packet timeout Noise on a transmission line Packet discard at a congested router TCP congestion control algorithm Assumption: all timeouts are caused by congestion Two flow factor 1.receiver capacity: receiver window 2.network capacity: congestion window

44 TCP Congestion Control network capacity and receiver capacity (a) A fast network feeding a low capacity receiver. (b) A slow network feeding a high-capacity receiver.

45 TCP Congestion Control Slow Start Algorithm An example of the Internet congestion algorithm.

46 TCP Timer Management (a) Probability density of ACK arrival times in the data link layer. (b) Probability density of ACK arrival times for TCP.

47 TCP Timer Management Jacobson dynamic algorithm M how long the successful acknowledgement took α a smoothing factor that determines how much weight is given to the old value. Typically a = 7/8. RTT (Round Trip Time) the best current estimate of the round-trip time to the destination RTT= αRTT+(1- α)M D mean deviation of estimate D=αD+(1-α)|RTT-M | Timeout=RTT+4*D Karn’s algorithm do not update RTT on any segments that have been retransmitted, instead, the timeout is doubled on each failure until the segments get through the first time


Download ppt "The Transport Layer Chapter 6. The Transport Service The transport layer is the heart of the whole protocol hierarchy It provides reliable data transport."

Similar presentations


Ads by Google