Question? Leave a message!




Principles of Reliable data transfer

Principles of Reliable data transfer
Dr.GriffinWood Profile Pic
Dr.GriffinWood,United Kingdom,Teacher
Published Date:23-07-2017
Website URL
Comment
Transport Layer EECS 489 Computer Networks http://www.eecs.umich.edu/courses/eecs489/w07 Z. Morley Mao Monday Jan 29, 2007 1 Mao W07 Acknowledgement: Some slides taken from Kurose&Ross and Katz&StoicaÆ ƒƒƒ Top-down New approach (E.g., Kurose & Ross) – start from the application layer all the Application way down to the physical layer Advantages – goals are very clear Transport start from application needs Network Disadvantages – harder to understand (IP) some assumptions made about lower Link layers (e.g., packet losses in the Internet are because of congestion) Physical 2 Mao W07ƒ ƒ Transport Layer Our goals: learn about transport layer protocols in the understand principles Internet: behind transport layer services: - UDP: connectionless transport - multiplexing/demultiple xing - TCP: connection- oriented transport - reliable data transfer - TCP congestion control - flow control - congestion control 3 Mao W07ƒƒƒ logical end-end transport Transport services and protocols provide logical communication application transport between app processes running network data link network on different hosts physical data link network physical transport protocols run in end data link physical systems network data link - send side: breaks app physical network data link messages into segments, physical passes to network layer network data link - rcv side: reassembles physical segments into messages, application passes to app layer transport network data link more than one transport physical protocol available to apps - Internet: TCP and UDP 4 Mao W07ƒƒƒƒƒ ƒƒƒ Transport vs. network layer network layer: logical Household analogy: communication between 12 kids sending letters to 12 kids hosts processes = kids transport layer: logical communication between app messages = letters in processes envelopes - relies on, enhances, hosts = houses network layer services transport protocol = Ann and Bill Q: what is an example network-layer protocol = postal property that network service layer does not have, transport layer provides? And vice versa? 5 Mao W07ƒƒƒ logical end-end transport Internet transport-layer protocols application Reliable, in-order delivery transport network (TCP) data link network physical data link - congestion control network physical data link - flow control physical network data link - connection setup physical network data link Unreliable, unordered physical network delivery: UDP data link physical - no-frills extension of “best- effort” IP application transport network Services not available: data link physical - delay guarantees - bandwidth guarantees 6 Mao W07Multiplexing/demultiplexing Multiplexing at send host: Demultiplexing at rcv host: gathering data from multiple delivering received segments sockets, enveloping data with to correct socket header (later used for demultiplexing) = socket = process P4 application P1 P2 P3 application P1 application transport transport transport network network network link link link physical physical physical host 3 host 2 host 1 7 Mao W07ƒƒ How demultiplexing works host receives IP datagrams 32 bits - each datagram has source port dest port source IP address, destination IP address - each datagram carries 1 other header fields transport-layer segment - each segment has source, destination port application number data (recall: well-known port (message) numbers for specific applications) host uses IP addresses & TCP/UDP segment format port numbers to direct segment to appropriate socket 8 Mao W07ƒƒ ƒƒ Connectionless demultiplexing When host receives UDP Create sockets with port segment: numbers: - checks destination port DatagramSocket mySocket1 = new DatagramSocket(99111); number in segment DatagramSocket mySocket2 = - directs UDP segment to new DatagramSocket(99222); socket with that port number UDP socket identified by IP datagrams with different two-tuple: source IP addresses and/or source port (dest IP address, dest port number) numbers directed to same socket 9 Mao W07Connectionless demux (cont) DatagramSocket serverSocket = new DatagramSocket(6428); P1 P2 P1 P3 SP: 6428 SP: 6428 DP: 9157 DP: 5775 SP: 9157 SP: 5775 DP: 6428 DP: 6428 client Client server IP:B IP: A IP: C SP provides “return address” 10 Mao W07ƒƒ ƒƒ Connection-oriented demux TCP socket identified by Server host may support 4-tuple: many simultaneous TCP sockets: - source IP address - each socket identified by its - source port number own 4-tuple - dest IP address Web servers have different - dest port number sockets for each Recv host uses all four connecting client values to direct segment - non-persistent HTTP will to appropriate socket have different socket for each request 11 Mao W07Connection-oriented demux (cont) P1 P6 P2 P1 P4 P5 P3 SP: 5775 DP: 80 S-IP: B D-IP:C SP: 9157 SP: 9157 DP: 80 DP: 80 client Client server S-IP: A S-IP: B IP:B IP: A IP: C D-IP:C D-IP:C 12 Mao W07Connection-oriented demux: Threaded Web Server P1 P2 P1 P4 P3 SP: 5775 DP: 80 S-IP: B D-IP:C SP: 9157 SP: 9157 DP: 80 DP: 80 client Client server S-IP: A S-IP: B IP:B IP: A IP: C D-IP:C D-IP:C 13 Mao W07ƒƒƒƒ ƒƒƒ UDP: User Datagram Protocol RFC 768 “no frills,” “bare bones” Internet transport protocol Why is there a UDP? “best effort” service, UDP no connection establishment segments may be: (which can add delay) -lost simple: no connection state - delivered out of order to at sender, receiver app small segment header connectionless: no congestion control: UDP - no handshaking between can blast away as fast as UDP sender, receiver desired - each UDP segment handled independently of others 14 Mao W07ƒƒƒ UDP Often used for streaming 32 bits multimedia apps - loss tolerant source port dest port Length, in - rate sensitive bytes of UDP checksum length segment, Other UDP uses including - DNS header -SNMP Application Reliable transfer over UDP: add reliability at application data layer (message) - application-specific error recovery UDP segment format 15 Mao W07ƒƒ ƒƒƒ UDP checksum Goal: detect “errors” (e.g., flipped bits) in transmitted segment Sender: Receiver: treat segment contents compute checksum of received as sequence of 16-bit segment integers check if computed checksum checksum: addition (1’s equals checksum field value: complement sum) of - NO - error detected segment contents - YES - no error detected. But sender puts checksum maybe errors nonetheless? value into UDP More later …. checksum field 16 Mao W07ƒƒ 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 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 wraparound 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 sum 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0 checksum 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1 17 Mao W07ƒ ƒƒ Principles of Reliable data transfer important in app., transport, link layers top-10 list of important networking topics characteristics of unreliable channel will determine complexity of reliable data transfer protocol (rdt) 18 Mao W07Reliable data transfer: getting started rdt_send(): called from above, deliver_data(): called by (e.g., by app.). Passed data to rdt to deliver data to upper deliver to receiver upper layer send receive side side udt_send(): called by rdt, rdt_rcv(): called when packet to transfer packet over arrives on rcv-side of channel unreliable channel to receiver 19 Mao W07ƒƒƒ 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 event causing state transition actions taken on state transition state: when in this state “state” next state state event 1 uniquely determined 2 actions by next event 20 Mao W07