Transport Layer Computer Networks Computer Networks Term A15.

Slides:



Advertisements
Similar presentations
Transport Layer3-1 Homework r Chapter 2#10,13-18 r Due Wed September 17.
Advertisements

Transport Layer 4 Slides from Kurose and Ross
Transport Layer 3-1 Transport services and protocols  provide logical communication between app processes running on different hosts  transport protocols.
Some slides are in courtesy of J. Kurose and K. Ross Review of Previous Lecture Electronic Mail: SMTP, POP3, IMAP DNS Socket programming with TCP.
Chapter 3: Transport Layer
EEC-484/584 Computer Networks Lecture 6 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
1 Outline r Transport-layer services r Multiplexing and demultiplexing r Connectionless transport: UDP r Principles of reliable data transfer.
Transport Layer3-1 Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable.
Transport Layer3-1 Data Communication and Networks Lecture 6 Reliable Data Transfer October 12, 2006.
Transport Layer3-1 Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable data transfer.
Announcement Project 1 due last night, how is that ? Project 2 almost ready, out tomorrow, will post online –Much harder than project 1, start early!
Announcement Project 1 due last night, how is that ? Homework 1 grade, comments out –Will be discussed in the next lecture Homework 2 out Project 2 almost.
Chapter 3 Transport Layer slides are modified from J. Kurose & K. Ross CPE 400 / 600 Computer Communication Networks Lecture 9.
Transport Layer3-1 Reliable Data Transfer. Transport Layer3-2 Principles of Reliable data transfer r important in app., transport, link layers r top-10.
1 Outline r Transport-layer services r Multiplexing and demultiplexing r Connectionless transport: UDP r Principles of reliable data transfer.
Lecture 8 Chapter 3 Transport Layer
3-1 Sect. 3.4 Principles of reliable data transfer Computer Networking: A Top Down Approach Featuring the Internet, 1 st edition. Jim Kurose, Keith Ross.
CPSC 441: Reliable Transport1 Reliable Data Transfer Instructor: Carey Williamson Office: ICT Class.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross Addison-Wesley,
1 Internet transport-layer protocols r reliable, in-order delivery (TCP) m congestion control m flow control m connection setup r unreliable, unordered.
2: Application Layer 1 1DT066 Distributed Information System Chapter 3 Transport Layer.
Some slides are in courtesy of J. Kurose and K. Ross Review of Previous Lecture Electronic Mail: SMTP, POP3, IMAP DNS Socket programming with TCP.
Some slides are in courtesy of J. Kurose and K. Ross Review of Previous Lecture r Transport-layer services r Multiplexing and demultiplexing r Connectionless.
Announcement Homework 1 due last night, how is that ? –Will discuss some problems in the lecture next week Should have completed at least part II of project.
9/30/ /2/2003 The Transport Layer September 30-October 2, 2003.
3-1 Transport services and protocols r provide logical communication between app processes running on different hosts r transport protocols run in end.
8-1 Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable data transfer m flow.
Transport Layer3-1 Data Communication and Networks Lecture 5  Transport Protocols: Multiplexing and Reliable Data Transfer October 7, 2004.
Previous Lecture r P2P file sharing r Socket programming with TCP r Socket programming with UDP.
Review: –What is AS? –What is the routing algorithm in BGP? –How does it work? –Where is “policy” reflected in BGP (policy based routing)? –Give examples.
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 
CSCI 3335: C OMPUTER N ETWORKS C HAPTER 3 T RANSPORT L AYER Vamsi Paruchuri University of Central Arkansas Some.
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley Chapter3_1.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.
Data Communications and Computer Networks Chapter 3 CS 3830 Lecture 12 Omar Meqdadi Department of Computer Science and Software Engineering University.
CS 1652 The slides are adapted from the publisher’s material All material copyright J.F Kurose and K.W. Ross, All Rights Reserved Jack Lange.
Network LayerII-1 RSC Part III: Transport Layer 1. Basic Concepts Redes y Servicios de Comunicaciones Universidad Carlos III de Madrid These slides are,
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.
Transport Layer 3-1 Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services: m sockets m reliable data transfer m.
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 Part.
Transport Layer3-1 Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable.
Lecture91 Administrative Things r Return homework # 1 r Review some problems in homework # 1 r Questions about grading? Yona r WebCT for CSE245 is working!
15-1 Last time □ Reliable Data Transfer ♦ Provide rdt over unreliable network layer ♦ FSM model ♦ rdt 1.0: rdt over reliable channels ♦ rdt 2.0: rdt over.
rdt2.2: a NAK-free protocol
Part 3: Transport Layer: Reliable Data Transfer CSE 3461/5461 Reading: Section 3.4, Kurose and Ross 1.
Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles.
Transport Layer3-1 rdt2.1: sender, handles garbled ACK/NAKs Wait for call 0 from above sndpkt = make_pkt(0, data, checksum) udt_send(sndpkt) rdt_send(data)
Transport Layer 3-1 Chapter 3 outline 3.4 Principles of reliable data transfer.
September 24 th, 2013 CS1652 The slides are adapted from the publisher’s material All material copyright J.F Kurose and K.W. Ross, All Rights.
1 John Magee 10 February 2014 CS 280: Transport Layer: Reliable Data Transfer Most slides adapted from Kurose and Ross, Computer Networking 6/e Source.
Transport Layer 3-1 Chapter 3 Outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross Addison-Wesley,
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.
MULTIPLEXING/DEMULTIPLEXING, CONNECTIONLESS TRANSPORT.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.
Transport Layer Our goals:
Transport Layer3-1 Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.
Introduction 1 Lecture 11 Transport Layer (Reliable Data Transfer) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science.
Introduction 1-1 source application transport network link physical HtHt HnHn M segment HtHt datagram destination application transport network link physical.
Chapter 3 Transport Layer
Chapter 3 outline 3.1 transport-layer services
Last time Reliable Data Transfer
EEC-484/584 Computer Networks
Chapter 3 Transport Layer
rdt2.2: a NAK-free protocol
Computer Networks Term B14
Chapter 3 outline 3.1 transport-layer services
Chapter 3 Transport Layer
Presentation transcript:

Transport Layer Computer Networks Computer Networks Term A15

Kurose’s Chapter 3 Outline Computer Networks Transport Layer 2  3.1 Transport-layer services  3.2 Multiplexing and demultiplexing  3.3 Connectionless transport: UDP  3.4 Principles of reliable data transfer  3.5 Connection-oriented transport: TCP –segment structure –reliable data transfer –flow control –connection management  3.6 Principles of congestion control  3.7 TCP congestion control

Transport Services and Protocols  provide logical communication between app processes running on different hosts  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  more than one transport protocol available to apps –Internet: TCP and UDP application transport network data link physical application transport network data link physical logical end-end transport Computer Networks Transport Layer 3

Internet Transport Layer Protoc ols  reliable, in-order delivery (TCP) –congestion control –flow control –connection setup  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 network data link physical network data link physical network data link physical application transport network data link physical logical end-end transport Computer Networks Transport Layer 4

Kurose’s Chapter 3 Outline Computer Networks Transport Layer 5  3.1 Transport-layer services  3.2 Multiplexing and demultiplexing [Brief Look]  3.3 Connectionless transport: UDP  3.4 Principles of reliable data transfer  3.5 Connection-oriented transport: TCP –segment structure –reliable data transfer –flow control –connection management  3.6 Principles of congestion control  3.7 TCP congestion control

Connection-Oriented Demux  TCP socket identified by 4-tuple: –source IP address –source port number –dest IP address –dest port number  receiving 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. Computer Networks Transport Layer 6

7 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 Connection-Oriented Demux

Computer Networks Transport Layer 8 Connection-Oriented Demux Client IP:B P1 client IP: A P1P2 server IP: C SP: 9157 DP: 80 SP: 9157 DP: 80 P3 D-IP:C S-IP: A D-IP:C S-IP: B SP: 5775 DP: 80 D-IP:C S-IP: B P4 Threaded Web Server

Kurose’s Chapter 3 Outline Computer Networks Transport Layer 9  3.1 Transport-layer services  3.2 Multiplexing and demultiplexing  3.3 Connectionless transport: UDP  3.4 Principles of reliable data transfer  3.5 Connection-oriented transport: TCP –segment structure –reliable data transfer –flow control –connection management  3.6 Principles of congestion control  3.7 TCP congestion control

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  connectionless: –no handshaking between UDP sender, receiver –each UDP segment handled independently of others. Why is there a UDP?  no connection establishment (which can add delay)  simple: no connection state at sender, receiver  small segment header  no congestion control: UDP can blast away as fast as desired. Computer Networks Transport Layer 10

UDP Details  often used for streaming multimedia apps –loss tolerant –rate sensitive  other UDP uses –DNS –SNMP  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 Computer Networks Transport Layer 11

UDP Checksum 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 …. Goal: detect “errors” (e.g., flipped bits) in transmitted segment Computer Networks Transport Layer 12

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 wraparound sum checksum Computer Networks Transport Layer 13

Kurose’s Chapter 3 Outline  3.1 Transport-layer services  3.2 Multiplexing and demultiplexing  3.3 Connectionless transport: UDP  3.4 Principles of reliable data transfer  3.5 Connection-oriented transport: TCP –segment structure –reliable data transfer –flow control –connection management  3.6 Principles of congestion control  3.7 TCP congestion control Computer Networks Transport Layer 14 We will use Tanenbaum’s Data Link Layer Treatment to study this in place of K&R’s Transport Layer Discussion.

Principles of Reliable Data Transfer  important in application, transport, and data link layers  top-10 list of important networking topics!  characteristics of unreliable channel will determine complexity of reliable data transfer protocol (rdt) Computer Networks Transport Layer 15

Principles of Reliable Data Transfer  characteristics of unreliable channel will determine complexity of reliable data transfer protocol (rdt) Computer Networks Transport Layer 16  important in application, transport, and data link layers  top-10 list of important networking topics!

Principles of Reliable Data Transfer  characteristics of unreliable channel will determine complexity of reliable data transfer protocol (rdt). Computer Networks Transport Layer 17  important in application, transport, and data link layers  top-10 list of important networking topics!

Reliable Data Transfer: Getting Started send side receive side rdt_send(): called from above, (e.g., by app.). Passed data to deliver to receiver upper layer udt_send(): called by rdt, to transfer packet over unreliable channel to receiver rdt_rcv(): called when packet arrives on rcv-side of channel deliver_data(): called by rdt to deliver data to upper Computer Networks Transport Layer 18

TCP Segment Structure source port # dest port # 32 bits application data (variable length) sequence number acknowledgement number Receive window Urg data pointer checksum F SR PAU head len not used Options (variable length) URG: urgent data (generally not used) ACK: ACK # valid # bytes rcvr willing to accept counting by bytes of data (not segments!) Internet checksum (as in UDP) {needed now for error detection} Computer Networks Transport Layer 19

WARNINGWARNING Explanation of Reliable Data Transport Reliable Data Transport will now be explained using the Data Link Layer Computer Networks Transport Layer 20

Reliable data transfer: getting started We’ll:  incrementally develop sender, receiver sides of reliable data transfer protocol (rdt)  consider only unidirectional data transfer –but control info will flow on both directions!  use finite state machines (FSM) to specify sender, receiver state 1 state 2 event causing state transition actions taken on state transition state: when in this “state” next state uniquely determined by next event event actions Computer Networks Transport Layer 21

Rdt1.0: Reliable Transfer over a Reliable Channel  underlying channel perfectly reliable –no bit errors –no loss of packets  separate FSMs for sender, receiver: –sender sends data into underlying channel –receiver read data from underlying channel Wait for call from above packet = make_pkt(data) udt_send(packet) rdt_send(data) extract (packet,data) deliver_data(data) Wait for call from below rdt_rcv(packet) sender receiver Computer Networks Transport Layer 22

Rdt2.0: Channel with Bit Errors  underlying channel may flip bits in packet –checksum to detect bit errors  the question: how to recover from errors: –acknowledgements (ACKs): receiver explicitly tells sender that pkt received OK. –negative acknowledgements (NAKs): receiver explicitly tells sender that pkt had errors. –sender retransmits pkt on receipt of NAK.  new mechanisms in rdt2.0 (beyond rdt1.0 ): –error detection –receiver feedback: control msgs (ACK,NAK) rcvr->sender Computer Networks Transport Layer 23

rdt3.0: Channels with Errors and Loss New assumption: underlying channel can also lose packets (data or ACKs) –checksum, seq. #, ACKs, retransmissions will be of help, but not enough Approach: sender waits “reasonable” amount of time for ACK  retransmits if no ACK received in this time  if pkt (or ACK) just delayed (not lost): –retransmission will be duplicate, but use of seq. #’s already handles this –receiver must specify seq # of pkt being ACKed  requires countdown timer Computer Networks Transport Layer 24

rdt3.0 Sender sndpkt = make_pkt(0, data, checksum) udt_send(sndpkt) start_timer rdt_send(data) Wait for ACK0 rdt_rcv(rcvpkt) && ( corrupt(rcvpkt) || isACK(rcvpkt,1) ) Wait for call 1 from above sndpkt = make_pkt(1, data, checksum) udt_send(sndpkt) start_timer rdt_send(data) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && isACK(rcvpkt,0) rdt_rcv(rcvpkt) && ( corrupt(rcvpkt) || isACK(rcvpkt,0) ) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && isACK(rcvpkt,1) stop_timer udt_send(sndpkt) start_timer timeout udt_send(sndpkt) start_timer timeout rdt_rcv(rcvpkt) Wait for call 0from above Wait for ACK1  rdt_rcv(rcvpkt)    Computer Networks Transport Layer 25

Pipelining and Sliding Windows  Lecture returns back to this point after Data Link Layer.  Diagrams from textbook!! Computer Networks Transport Layer 26

Pipelined Protocols Pipelining:: sender allows multiple, “in-flight”, yet-to-be-acknowledged packets. –range of sequence numbers must be increased –buffering at sender and/or receiver  Two generic forms of pipelined protocols: Go-Back- N and Selective Repeat Computer Networks Transport Layer 27

Pipelining increases 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! Computer Networks Transport Layer 28

Pipelining Protocols Go-back-N: overview  sender: up to N unACKed pkts in pipeline  receiver: only sends cumulative ACKs –doesn’t ACK pkt if there’s a gap  sender: has timer for oldest unACKed pkt –if timer expires: retransmit all unACKed packets Selective Repeat: overview  sender: up to N unACKed packets in pipeline  receiver: ACKs individual pkts  sender: maintains timer for each unACKed pkt –if timer expires: retransmit only unACKed packet. Computer Networks Transport Layer 29

Go-Back-NGo-Back-N Sender:  k-bit seq # in pkt header  “window” of up to N, consecutive unACKed pkts allowed r ACK(n): ACKs all pkts up to, including seq # n - “cumulative ACK” m may receive duplicate ACKs (see receiver) r timer for each in-flight pkt r timeout(n): retransmit pkt n and all higher seq # pkts in window. Computer Networks Transport Layer 30

GBN: Sender Extended FSM Wait start_timer udt_send(sndpkt[base]) udt_send(sndpkt[base+1]) … udt_send(sndpkt[nextseqnum-1]) timeout rdt_send(data) if (nextseqnum < base+N) { sndpkt[nextseqnum] = make_pkt(nextseqnum,data,chksum) udt_send(sndpkt[nextseqnum]) if (base == nextseqnum) start_timer nextseqnum++ } else refuse_data(data) base = getacknum(rcvpkt)+1 If (base == nextseqnum) stop_timer else start_timer rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) base=1 nextseqnum=1 rdt_rcv(rcvpkt) && corrupt(rcvpkt)  Computer Networks Transport Layer 31

GBN: Receiver Extended FSM ACK-only: always send ACK for correctly-received pkt with highest in-order seq # –may generate duplicate ACKs –need only remember expectedseqnum  out-of-order pkt: –discard (don’t buffer) -> no receiver buffering! –Re-ACK pkt with highest in-order seq # Wait udt_send(sndpkt) default rdt_rcv(rcvpkt) && notcurrupt(rcvpkt) && hasseqnum(rcvpkt,expectedseqnum) extract(rcvpkt,data) deliver_data(data) sndpkt = make_pkt(expectedseqnum,ACK,chksum) udt_send(sndpkt) expectedseqnum++ expectedseqnum=1 sndpkt = make_pkt(expectedseqnum,ACK,chksum)  Computer Networks Transport Layer 32

Selective Repeat  receiver individually acknowledges all correctly received packets. –buffers packets, as needed, for eventual in-order delivery to upper layer.  sender only resends packets for which ACK not received. –sender timer for each unACKed packet  sender window –N consecutive sequence #’s –again limits sequence #s of sent, unACKed packets Computer Networks Transport Layer 33

Selective Repeat Sender, Receiver Windows Computer Networks Transport Layer 34

Selective Repeat data from above :  if next available seq # in window, send pkt timeout(n):  resend pkt n, restart timer ACK(n) in [sendbase,sendbase+N]:  mark pkt n as received  if n smallest unACKed pkt, advance window base to next unACKed seq # sender pkt n in [rcvbase, rcvbase+N-1] r send ACK(n) r out-of-order: buffer r in-order: deliver (also deliver buffered, in-order pkts), advance window to next not-yet-received pkt pkt n in [rcvbase- N,rcvbase-1] r ACK(n) otherwise: r ignore receiver Computer Networks Transport Layer 35

Selective Repeat in Action 36 slidingwindow

Selective Repeat Dilemma Example:  seq #’s: 0, 1, 2, 3  window size=3  receiver sees no difference in two scenarios!  incorrectly passes duplicate data as new in (a) Q: What is the required relationship between seq # size and window size? Computer Networks Transport Layer 37

Kurose’s Chapter 3 Outline  3.1 Transport-layer services  3.2 Multiplexing and demultiplexing  3.3 Connectionless transport: UDP  3.4 Principles of reliable data transfer  3.5 Connection-oriented transport: TCP –segment structure –reliable data transfer –flow control –connection management  3.6 Principles of congestion control  3.7 TCP congestion control Computer Networks Transport Layer 38

TCP Flow Control  receive side of TCP connection has a receive buffer:  speed-matching service: matching send rate to receiving application’s drain rate. r app process may be slow at reading from buffer. sender won’t overflow receiver’s buffer by transmitting too much, too fast flow control IP datagrams TCP data (in buffer) (currently) unused buffer space application process Computer Networks Transport Layer 39

TCP Flow Control: how it works (suppose TCP receiver discards out-of-order segments)  unused buffer space: = rwnd = RcvBuffer-[LastByteRcvd - LastByteRead]  receiver: advertises unused buffer space by including rwnd value in segment header  sender: limits # of unACKed bytes to rwnd –guarantees receiver’s buffer doesn’t overflow.  rwnd known as the receiver’s advertised window. IP datagrams TCP data (in buffer) (currently) unused buffer space application process rwnd RcvBuffer Computer Networks Transport Layer 40

Kurose’s Chapter 3 Outline  3.1 Transport-layer services  3.2 Multiplexing and demultiplexing  3.3 Connectionless transport: UDP  3.4 Principles of reliable data transfer  3.5 Connection-oriented transport: TCP –segment structure –reliable data transfer –flow control –connection management  3.6 Principles of congestion control  3.7 TCP congestion control Computer Networks Transport Layer 41