Presentation is loading. Please wait.

Presentation is loading. Please wait.

Transport Layer Our goals:

Similar presentations


Presentation on theme: "Transport Layer Our goals:"— Presentation transcript:

1 Transport Layer Our goals:
understand principles behind transport layer services: multiplexing/demultiplexing reliable data transfer flow control congestion control Services of transport layer are constrained by N/W layer. learn about transport layer protocols in the Internet: UDP: connectionless transport TCP: connection-oriented transport TCP congestion control TCP : Segment UDP: Datagram

2 Transport services and protocols
provide logical communication between app processes running on different hosts transport protocols run in end systems sending side: breaks app messages into segments, passes to network layer receiving side: reassembles segments into messages, passes to app layer more than one transport protocol available to apps Internet: TCP and UDP application transport network data link physical network data link physical network data link physical network data link physical logical end-end transport network data link physical network data link physical application transport network data link physical

3 Transport vs. network layer
network layer: logical communication between hosts transport layer: logical communication between processes relies on, enhances, network layer services IP (Internet Protocol) is a Network Layer protocol Unreliable Best Effort Service No ordering of segments No guaranteed delivery

4 Internet transport-layer protocols
reliable, in-order delivery (TCP) congestion control flow control connection setup Integrity checking unreliable, unordered delivery: UDP no-frills extension of “best-effort” IP services not available: delay guarantees bandwidth guarantees application transport network data link physical network data link physical network data link physical network data link physical logical end-end transport network data link physical network data link physical application transport network data link physical

5 Multiplexing/demultiplexing
Multiplexing at send host: Demultiplexing at rcv host: delivering received segments to correct socket gathering data from multiple sockets, enveloping data with header (later used for demultiplexing) = socket = process application transport network link physical P1 P2 P3 P4 host 1 host 2 host 3

6 Connectionless demultiplexing
Create sockets with port numbers: DatagramSocket mySocket1 = new DatagramSocket(49911); DatagramSocket mySocket2 = new DatagramSocket(49922); UDP socket identified by two-tuple: (dest IP address, dest port number) When host receives UDP segment: checks destination port number in segment directs UDP segment to socket with that port number IP datagrams with different source IP addresses and/or source port numbers directed to same socket

7 Connectionless demux (cont)
DatagramSocket serverSocket = new DatagramSocket(6428); P2 P1 P1 P3 SP: 6428 DP: 9157 SP: 6428 DP: 5775 SP: 9157 DP: 6428 SP: 5775 DP: 6428 client IP: A Client IP:B server IP: C SP provides “return address”

8 Connection-oriented demux
TCP socket identified by 4-tuple: source IP address source port number dest IP address dest port number recv host uses all four values to direct segment to appropriate socket Server host may support many simultaneous TCP sockets: each socket identified by its own 4-tuple Web servers have different sockets for each connecting client non-persistent HTTP will have different socket for each request

9 Connection-oriented demux (cont)
P1 P4 P5 P6 P2 P1 P3 SP: 9157 DP: 80 S-IP: A D-IP:C SP: 5775 DP: 80 D-IP:C S-IP: B SP: 9157 DP: 80 D-IP:C client IP: A Client IP:B server IP: C S-IP: B

10 Connection-oriented demux: Threaded Web Server
P1 P4 P5 P6 P2 P1 P3 SP: 5775 DP: 80 S-IP: B D-IP:C SP: 9157 SP: 9157 DP: 80 client IP: A DP: 80 Client IP:B server IP: C S-IP: A S-IP: B D-IP:C D-IP:C

11 UDP

12 Position of UDP in the TCP/IP protocol suite

13 UDP: User Datagram Protocol [RFC 768]
“best effort” service, UDP segments may be: lost delivered out of order to app connectionless: no handshaking between UDP sender, receiver each UDP segment handled independently of others

14 User datagram format Application data (message) UDP segment format
source port # dest port # 32 bits Application data (message) UDP segment format length checksum Length, in bytes of UDP segment, including header

15 UDP Cont… often used for streaming multimedia apps loss tolerant
rate sensitive reliable transfer over UDP: add reliability at application layer application-specific error recovery!

16 UDP Advantages No extra processing of data.
No connection establishment (which can add delay) Simple: no connection state at sender, receiver Small packet header overhead No congestion control: UDP can blast away as fast as desired

17 The following is a dump of a UDP header in hexadecimal format.
a. What is the source port number? b. What is the destination port number? c. What is the total length of the user datagram? d. What is the length of the data? e. Is the packet directed from a client to a server or vice versa? f. What is the client process?

18 Solution a. The source port number is the first four hexadecimal digits (CB84)16 or b. The destination port number is the second four hexadecimal digits (000D)16 or 13. c. The third four hexadecimal digits (001C)16 define the length of the whole UDP packet as 28 bytes. d. The length of the data is the length of the whole packet minus the length of the header, or 28 – 8 = 20 bytes. e. Since the destination port number is 13 (well-known port), the packet is from the client to the server. f. The client process is the Daytime

19 Given UDP header in hexadecimal format: 0632 000D 001C E217
i) Source port number? ii) Destination port number? iii) Total length of user datagram? iv) Length of data? What is client process? v) Is the packet directed from a client to server or vice-versa? Given UDP  header in hexadecimal format: D 00 1C E2 17 1. The source port number is that is 1586 in decimal 2. The destination port number is that is 13 3. The total length of the user datagram is that is 28bytes 4. The length of the data = 28-8 = 20 bytes. The client process is Daytime because destination port number(Destination port number represents Daytime process) 5. The packet is directed from a client to a server because destination port number is 13.

20 UDP checksum Goal: detect “errors” (e.g., flipped bits) in transmitted segment Sender: treat segment contents as sequence of 16-bit integers checksum: addition (1’s complement sum) of segment contents sender puts checksum value into UDP checksum field Receiver: compute checksum of received segment check if computed checksum equals checksum field value: NO - error detected YES - no error detected. But maybe errors nonetheless? More later ….

21 Internet Checksum Example
Note When adding numbers, a carryout from the most significant bit needs to be added to the result Example: add two 16-bit integers Kurose and Ross forgot to say anything about wrapping the carry and adding it to low order bit + 1 wraparound sum checksum

22

23 s

24 Sliding Window The seq number are modulo 2m, hence seq no= (0 to 2m -1). Say m=4 and size of window is 7.

25 Flow and Error Control Mechanisms
Stop-and-Wait Protocol Pipelining Go-back-N Protocol Selective Repeat Protocol

26 Stop-and Wait Protocol
Sender and receiver use window size of 1 The sender sends one packet at a time and waits for an ack before sending the next one If pkt lost or corrupted receiver silently discards pkt. After time-out sender retransmits packet

27

28

29 Stop-and-Wait implements:
Flow Control by forcing the sender to wait for an ack Error Control by discarding corrupted pkts and letting the sender resend unacked packets on timer expires. Inefficient Low channel utilization

30 RTT = 30 millisec R = 1 Gbps Packet size (L) = 1,000 bytes Td = ? Utilizationsender = ?

31

32 Pipelining Transmission
Go-Back-N Selective Repeat


Download ppt "Transport Layer Our goals:"

Similar presentations


Ads by Google