1 / 34

CS 372 – introduction to computer networks* Tuesday July 6

Announcements: Lab 2 is due today. CS 372 – introduction to computer networks* Tuesday July 6. * Based in part on slides by Bechir Hamdaoui and Paul D. Paulson. Acknowledgement: slides drawn heavily from Kurose & Ross. application architectures client-server P2P

Download Presentation

CS 372 – introduction to computer networks* Tuesday July 6

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Announcements: Lab 2 is due today CS 372 – introduction to computer networks*Tuesday July 6 * Based in part on slides by Bechir Hamdaoui and Paul D. Paulson. Chapter 3, slide: Acknowledgement: slides drawn heavily from Kurose & Ross

  2. application architectures client-server P2P application service requirements: reliability, bandwidth, delay Transport service model connection-oriented, reliable: TCP unreliable, datagrams: UDP By now, you should know: Chapter 2: Recap • Important concepts: • centralized vs. decentralized • stateless vs. stateful • reliable vs. unreliable msg transfer Chapter 3, slide:

  3. Our goals: understand principles behind transport layer services: multiplexing/demultiplexing reliable data transfer flow control congestion control learn about transport layer protocols in the Internet: UDP: connectionless transport TCP: connection-oriented transport TCP congestion control Chapter 3: Transport Layer Chapter 3, slide:

  4. 1 Transport-layer services 2 Multiplexing and demultiplexing 3 Connectionless transport: UDP 4 Principles of reliable data transfer 5 Connection-oriented transport: TCP segment structure reliable data transfer flow control connection management 6 Principles of congestion control 7 TCP congestion control Chapter 3 outline Chapter 3, slide:

  5. 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 Transport services and protocols Chapter 3, slide:

  6. network layer: logical communication between hosts transport layer: logical communication between processes Household case: 12 kids (East coast house) sending letters to 12 kids (West coast house) Ann is responsible for the house at East coast Bill is responsible for the house at West coast Postal service is responsible for between houses Transport vs. network layer • Household analogy: • kids = processes • letters = messages • houses = hosts • home address = IP address • kid names = port numbers • Ann and Bill = transport protocol • postal service = network-layer protocol Chapter 3, slide:

  7. 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 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 logical end-end transport Internet transport-layer protocols Chapter 3, slide:

  8. 1 Transport-layer services 2 Multiplexing and demultiplexing 3 Connectionless transport: UDP 4 Principles of reliable data transfer 5 Connection-oriented transport: TCP segment structure reliable data transfer flow control connection management 6 Principles of congestion control 7 TCP congestion control Chapter 3 outline Chapter 3, slide:

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

  10. host receives IP datagrams each datagram has source IP address, destination IP address each datagram carries 1 transport-layer segment each segment has source, destination port number host uses IP addresses & port numbers to direct segment to appropriate socket How demultiplexing works 32 bits source port # dest port # other header fields application data (message) TCP/UDP segment format Chapter 3, slide:

  11. 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 Demultiplexing in UDP is based on destination only! Connectionless demultiplexing Chapter 3, slide:

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

  13. 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 Connection-oriented demux Chapter 3, slide:

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

  15. 1 Transport-layer services 2 Multiplexing and demultiplexing 3 Connectionless transport: UDP 4 Principles of reliable data transfer 5 Connection-oriented transport: TCP segment structure reliable data transfer flow control connection management 6 Principles of congestion control 7 TCP congestion control Chapter 3 outline Chapter 3, slide:

  16. “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? less delay: no connection establishment (which can add delay) simple: no connection state at sender, receiver less traffic: small segment header no congestion control: UDP can blast away as fast as desired UDP: User Datagram Protocol [RFC 768] Chapter 3, slide:

  17. 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! UDP: more 32 bits source port # dest port # Length, in bytes of UDP segment, including header checksum length Application data (message) UDP segment format Chapter 3, slide:

  18. 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 …. UDP checksum • Goal: detect “errors” (e.g., flipped bits) in transmitted segment Chapter 3, slide:

  19. 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 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1 wraparound sum checksum Chapter 3, slide:

  20. Selecting logical port numbers • Communicating computers must agree on a port number • Server opens selected port and waits for incoming messages • Client selects local port and sends message to selected server port • Many common services use reserved (well-known) port numbers • Other services use dynamically assigned port numbers • Valid range is [0 .. 65535] , but don’t use “well-known” port numbers for special apps.

  21. Some "well-known" logical port numbers

  22. Question 1: Host C has UDP socket with port number 6789 Both Hosts A & B send UDP segment with destination Port 6789 Would both be directed to same socket at Host C? If so, how would Host C know that these 2 are originated from two different hosts? Answer: Yes IP addresses Review questions • Question 2: • Same scenario but with TCP instead of UDP • Answer: • No! • There is a separate TCP socket for each 4-uplet (IP src, IP dst, src Port, dst Port) Chapter 3, slide:

  23. Announcements: Quiz on Friday, covers chapter 2 CS 372 – introduction to computer networks*Wednesday July 7 * Based in part on slides by Bechir Hamdaoui and Paul D. Paulson. Chapter 3, slide: Acknowledgement: slides drawn heavily from Kurose & Ross

  24. 1 Transport-layer services 2 Multiplexing and demultiplexing 3 Connectionless transport: UDP 4 Principles of reliable data transfer 5 Connection-oriented transport: TCP segment structure reliable data transfer flow control connection management 6 Principles of congestion control 7 TCP congestion control Chapter 3 outline Chapter 3, slide:

  25. 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) Principles of Reliable data transfer Chapter 3, slide:

  26. 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) Principles of Reliable data transfer Chapter 3, slide:

  27. 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) Principles of Reliable data transfer Chapter 3, slide:

  28. rdt_send():called from above, (e.g., by app.). Passed data to deliver to receiver upper layer deliver_data():called by rdt to deliver data to upper udt_send():called by rdt, to transfer packet over unreliable channel to receiver rdt_rcv():called when packet arrives on rcv-side of channel Reliable data transfer: getting started send side receive side Chapter 3, slide:

  29. We will: 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” next state uniquely determined by next event event state 1 state 2 actions Reliable data transfer: getting started Chapter 3, slide:

  30. 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 rdt_send(data) rdt_rcv(packet) Wait for call from below Wait for call from above extract (packet,data) deliver_data(data) packet = make_pkt(data) udt_send(packet) sender receiver rdt1.0: reliable transfer over a reliable channel Chapter 3, slide:

  31. underlying channel may flip bits in packet Receiver can detect bit errors (e.g., use checksum) But still no packet loss questions: (1) how to know and (2) what to do when packet is erroneous: acknowledgements: positive ack (ACK): receiver tells sender that pkt received OK negative ack (NAK): receiver tells sender that pkt had erros retransmission: 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 assume ACK/NAK are error free rdt2.0: channel with bit errors Chapter 3, slide:

  32. receiver Wait for ACK or NAK rdt_rcv(rcvpkt) && corrupt(rcvpkt) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) udt_send(NAK) extract(rcvpkt,data) deliver_data(data) udt_send(ACK) Wait for call from below rdt2.0: FSM specification rdt_send(data) snkpkt = make_pkt(data, checksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && isNAK(rcvpkt) Wait for call from above udt_send(sndpkt) rdt_rcv(rcvpkt) && isACK(rcvpkt) L sender Note: Lmeans “transition to next state” Chapter 3, slide:

  33. Wait for ACK or NAK rdt_rcv(rcvpkt) && corrupt(rcvpkt) udt_send(NAK) rdt2.0: operation with no errors rdt_send(data) receiver snkpkt = make_pkt(data, checksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && isNAK(rcvpkt) Wait for call from above udt_send(sndpkt) rdt_rcv(rcvpkt) && isACK(rcvpkt) Wait for call from below L sender rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) extract(rcvpkt,data) deliver_data(data) udt_send(ACK) Chapter 3, slide:

  34. Wait for ACK or NAK rdt_rcv(rcvpkt) && corrupt(rcvpkt) udt_send(NAK) rdt2.0: error scenario rdt_send(data) snkpkt = make_pkt(data, checksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && isNAK(rcvpkt) Wait for call from above udt_send(sndpkt) rdt_rcv(rcvpkt) && isACK(rcvpkt) Wait for call from below L rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) extract(rcvpkt,data) deliver_data(data) udt_send(ACK) Chapter 3, slide:

More Related