Presentation is loading. Please wait.

Presentation is loading. Please wait.

Prof. Younghee Lee 1 1 Computer Networks u Lecture 5: Transport services and protocols Prof. Younghee Lee * Some part of this teaching materials are prepared.

Similar presentations


Presentation on theme: "Prof. Younghee Lee 1 1 Computer Networks u Lecture 5: Transport services and protocols Prof. Younghee Lee * Some part of this teaching materials are prepared."— Presentation transcript:

1 Prof. Younghee Lee 1 1 Computer Networks u Lecture 5: Transport services and protocols Prof. Younghee Lee * Some part of this teaching materials are prepared referencing the lecture note made by F. Kurose, Keith W. Ross(U. of Massachusetts)

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

3 Prof. Younghee Lee 3 3 Transport vs. network layer u network layer: logical communication between hosts u transport layer: logical communication between processes –relies on, enhances, network layer services Household analogy: 12 kids sending letters to 12 kids u processes = kids u app messages = letters in envelopes u hosts = houses u transport protocol = Ann and Bill u network-layer protocol = postal service

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

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

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

7 Prof. Younghee Lee 7 7 Connection-oriented demux (cont) Client IP:B P1 client IP: A P1P2P4 server IP: C SP: 9157 DP: 80 SP: 9157 DP: 80 P5P6P3 D-IP:C S-IP: A D-IP:C S-IP: B SP: 5775 DP: 80 D-IP:C S-IP: B

8 Prof. Younghee Lee 8 8 Connection-oriented demux: Threaded Web Server Client IP:B P1 client IP: A P1P2 server IP: C SP: 9157 DP: 80 SP: 9157 DP: 80 P4 P3 D-IP:C S-IP: A D-IP:C S-IP: B SP: 5775 DP: 80 D-IP:C S-IP: B

9 Prof. Younghee Lee 9 9 UDP: User Datagram Protocol [RFC 768]  “ no frills, ” “ bare bones ” Internet transport protocol  “ best effort ” service, UDP segments may be: –lost –delivered out of order to app u connectionless: –no handshaking between UDP sender, receiver –each UDP segment handled independently of others Why is there a UDP? u no connection establishment (which can add delay) u simple: no connection state at sender, receiver u small segment header u no congestion control: UDP can blast away as fast as desired

10 Prof. Younghee Lee 10 UDP: more u often used for streaming multimedia apps –loss tolerant –rate sensitive u other UDP uses –DNS –SNMP u reliable transfer over UDP: add reliability at application layer –application-specific error recovery! source port #dest port # 32 bits Application data (message) UDP segment format length checksum Length, in bytes of UDP segment, including header

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

12 Prof. Younghee Lee 12 rdt3.0: stop-and-wait operation first packet bit transmitted, t = 0 senderreceiver RTT last packet bit transmitted, t = L / R first packet bit arrives last packet bit arrives, send ACK ACK arrives, send next packet, t = RTT + L / R

13 Prof. Younghee Lee 13 Pipelined protocols Pipelining: sender allows multiple, “ in-flight ”, yet-to-be- acknowledged pkts –range of sequence numbers must be increased –buffering at sender and/or receiver u Two generic forms of pipelined protocols: go-Back-N, selective repeat

14 Prof. Younghee Lee 14 Pipelining: increased utilization first packet bit transmitted, t = 0 senderreceiver RTT last bit transmitted, t = L / R first packet bit arrives last packet bit arrives, send ACK ACK arrives, send next packet, t = RTT + L / R last bit of 2 nd packet arrives, send ACK last bit of 3 rd packet arrives, send ACK Increase utilization by a factor of 3!

15 Prof. Younghee Lee 15 Go-Back-N Sender: u k-bit seq # in pkt header  “ window ” of up to N, consecutive unack ’ ed pkts allowed  ACK(n): ACKs all pkts up to, including seq # n - “ cumulative ACK ” –may deceive duplicate ACKs (see receiver) u timer for each in-flight pkt u timeout(n): retransmit pkt n and all higher seq # pkts in window

16 Prof. Younghee Lee 16 GBN in action

17 Prof. Younghee Lee 17 Selective Repeat u receiver individually acknowledges all correctly received pkts –buffers pkts, as needed, for eventual in-order delivery to upper layer u sender only resends pkts for which ACK not received –sender timer for each unACKed pkt u sender window –N consecutive seq # ’ s –again limits seq #s of sent, unACKed pkts

18 Prof. Younghee Lee 18 Selective repeat: sender, receiver windows

19 Prof. Younghee Lee 19 Selective repeat data from above : u if next available seq # in window, send pkt timeout(n): u resend pkt n, restart timer ACK(n) in [sendbase,sendbase+N]: u mark pkt n as received u if n smallest unACKed pkt, advance window base to next unACKed seq # sender pkt n in [rcvbase, rcvbase+N-1] u send ACK(n) u out-of-order: buffer u in-order: deliver (also deliver buffered, in-order pkts), advance window to next not- yet-received pkt pkt n in [rcvbase-N,rcvbase-1] u ACK(n) otherwise: u ignore receiver

20 Prof. Younghee Lee 20 Selective repeat in action

21 Prof. Younghee Lee 21 Selective repeat: dilemma Example:  seq # ’ s: 0, 1, 2, 3 u window size=3 u receiver sees no difference in two scenarios! u incorrectly passes duplicate data as new in (a) Q: what relationship between seq # size and window size?


Download ppt "Prof. Younghee Lee 1 1 Computer Networks u Lecture 5: Transport services and protocols Prof. Younghee Lee * Some part of this teaching materials are prepared."

Similar presentations


Ads by Google