Transport LayerChapter 3: Transport LayerChapter 3 outlineTransport services and protocolsTransport vs. network layerInternet transport-layer protocolsSlide 7Multiplexing/demultiplexingHow demultiplexing worksConnectionless demultiplexingConnectionless demux (cont)Connection-oriented demuxConnection-oriented demux (cont)Connection-oriented demux: Threaded Web ServerSlide 15UDP: User Datagram Protocol [RFC 768]UDP: moreUDP checksumSlide 19Principles of Reliable data transferSlide 21Slide 22Reliable data transfer: getting startedSlide 24Rdt1.0: reliable transfer over a reliable channelRdt2.0: channel with bit errorsrdt2.0: FSM specificationrdt2.0: operation with no errorsrdt2.0: error scenariordt2.0 has a fatal flaw!rdt2.1: sender, handles garbled ACK/NAKsrdt2.1: receiver, handles garbled ACK/NAKsrdt2.1: discussionrdt2.2: a NAK-free protocolrdt2.2: sender, receiver fragmentsrdt3.0: channels with errors and lossrdt3.0 senderrdt3.0 in actionSlide 39Performance of rdt3.0rdt3.0: stop-and-wait operationPipelined protocolsPipelining: increased utilizationGo-Back-NGBN: sender extended FSMGBN: receiver extended FSMGBN in actionSelective RepeatSelective repeat: sender, receiver windowsSelective repeatSelective repeat in actionSelective repeat: dilemmaSlide 53TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581TCP segment structureTCP seq. #’s and ACKsTCP Round Trip Time and TimeoutSlide 581Transport Layer2Chapter 3: Transport LayerOur goals: understand principles behind transport layer services:multiplexing/ demultiplexingreliable data transferflow controlcongestion controllearn about transport layer protocols in the Internet:UDP: connectionless transportTCP: connection-oriented transportTCP congestion control3Chapter 3 outline3.1 Transport-layer services3.2 Multiplexing and demultiplexing3.3 Connectionless transport: UDP3.4 Principles of reliable data transfer3.5 Connection-oriented transport: TCPsegment structurereliable data transferflow controlconnection management3.6 Principles of congestion control3.7 TCP congestion control4Transport services and protocolsprovide logical communication between app processes running on different hoststransport protocols run in end systems send side: breaks app messages into segments, passes to network layerrcv side: reassembles segments into messages, passes to app layermore than one transport protocol available to appsInternet: TCP and UDPapplicationtransportnetworkdata linkphysicalapplicationtransportnetworkdata linkphysicalnetworkdata linkphysicalnetworkdata linkphysicalnetworkdata linkphysicalnetworkdata linkphysicalnetworkdata linkphysicallogical end-end transport5Transport vs. network layernetwork layer: logical communication between hoststransport layer: logical communication between processes relies on, enhances, network layer servicesHousehold analogy:sending lettersprocesses = peopleapp messages = letters in envelopeshosts = housestransport protocol = sorting and collecting mail within housenetwork-layer protocol = postal service6Internet transport-layer protocolsreliable, in-order delivery (TCP)congestion control flow controlconnection setupunreliable, unordered delivery: UDPno-frills extension of “best-effort” IPservices not available: delay guaranteesbandwidth guaranteesapplicationtransportnetworkdata linkphysicalapplicationtransportnetworkdata linkphysicalnetworkdata linkphysicalnetworkdata linkphysicalnetworkdata linkphysicalnetworkdata linkphysicalnetworkdata linkphysicallogical end-end transport7Chapter 3 outline3.1 Transport-layer services3.2 Multiplexing and demultiplexing3.3 Connectionless transport: UDP3.4 Principles of reliable data transfer3.5 Connection-oriented transport: TCPsegment structurereliable data transferflow controlconnection management3.6 Principles of congestion control3.7 TCP congestion control8Multiplexing/demultiplexingapplicationtransportnetworklinkphysicalP1applicationtransportnetworklinkphysicalapplicationtransportnetworklinkphysicalP2P3P4P1host 1host 2host 3= process= socketdelivering received segmentsto correct socketDemultiplexing at rcv host:gathering data from multiplesockets, enveloping data with header (later used for demultiplexing)Multiplexing at send host:9How demultiplexing workshost receives IP datagramseach datagram has source IP address, destination IP addresseach datagram carries 1 transport-layer segmenteach segment has source, destination port number host uses IP addresses & port numbers to direct segment to appropriate socketsource port # dest port #32 bitsapplicationdata (message)other header fieldsTCP/UDP segment format10Connectionless demultiplexingCreate sockets with port numbers:sin1.sin_port = 1234;bind(socket1, &sin1, …);sin2.sin_port = 1235;bind(socket2, &sin2, …);UDP socket identified by two-tuple:(dest IP address, dest port number)When host receives UDP segment:checks destination port number in segmentdirects UDP segment to socket with that port numberIP datagrams with different source IP addresses and/or source port numbers directed to same socket11Connectionless demux (cont)sin.sin_port = 6428; bind(sock, &sin, …);ClientIP:BP2client IP: AP1P1P3serverIP: CSP: 6428DP: 9157SP: 9157DP: 6428SP: 6428DP: 5775SP: 5775DP: 6428SP provides “return address”(returned by recvfrom)12Connection-oriented demuxTCP socket identified by 4-tuple: source IP addresssource port numberdest IP addressdest port numberrecv host uses all four values to direct segment to appropriate socketServer host may support many simultaneous TCP sockets:each socket identified by its own 4-tupleWeb servers have different sockets for each connecting clientnon-persistent HTTP will have different socket for each request13Connection-oriented demux (cont)ClientIP:BP1client IP: AP1P2P4serverIP: CSP: 9157DP: 80SP: 9157DP: 80P5P6P3D-IP:CS-IP: AD-IP:CS-IP: BSP: 5775DP: 80D-IP:CS-IP: B14Connection-oriented demux: Threaded Web ServerClientIP:BP1client IP: AP1P2serverIP: CSP: 9157DP: 80SP: 9157DP: 80P4P3D-IP:CS-IP: AD-IP:CS-IP: BSP: 5775DP: 80D-IP:CS-IP: B15Chapter 3 outline3.1 Transport-layer services3.2 Multiplexing and demultiplexing3.3 Connectionless transport: UDP3.4 Principles of reliable data transfer3.5 Connection-oriented transport: TCPsegment structurereliable data
View Full Document