1 / 43

1DT057 Distributed Information System Chapter 3 Transport Layer

Explore the principles of transport layer services such as multiplexing, reliable data transfer, and congestion control. Learn about UDP and TCP protocols, segment structure, flow control, and more.

srancourt
Download Presentation

1DT057 Distributed Information System Chapter 3 Transport Layer

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. 1DT057Distributed Information SystemChapter 3Transport Layer 2: Application Layer

  2. Chapter 3: Transport Layer 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 Transport Layer

  3. 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 • Congestion control Transport Layer

  4. Transport vs. network layer • network layer: logical communication between hosts • transport layer: logical communication between processes • relies on, enhances, network layer services Transport Layer

  5. 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 • Congestion control Transport Layer

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

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

  8. 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 • 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 Transport Layer

  9. TCP vs. UDP Transport Layer

  10. TCP vs. UDP

  11. TCP vs. UDP

  12. 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 • congestion control Transport Layer

  13. 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 Transport Layer

  14. UDP: MORE • 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! 32 bits source port # dest port # Length, in bytes of UDP segment, including header checksum length Transport Layer Application data (message) UDP segment format

  15. 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 • congestion control Transport Layer

  16. 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) Transport Layer

  17. 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) Transport Layer

  18. 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) Transport Layer

  19. RDT3.0 EXAMPLE Transport Layer

  20. RDT3.0 EXAMPLE Transport Layer

  21. PERFORMANCE OF RDT3.0 • rdt3.0 works, but performance stinks • ex: 1 Gbps link, 15 ms prop. delay, 8000 bit packet: • U sender: utilization – fraction of time sender busy sending Transport Layer • 1KB pkt every 30 msec -> 33kB/sec thruput over 1 Gbps link • network protocol limits use of physical resources!

  22. rdt3.0: stop-and-wait operation sender receiver first packet bit transmitted, t = 0 last packet bit transmitted, t = L / R first packet bit arrives RTT last packet bit arrives, send ACK Transport Layer ACK arrives, send next packet, t = RTT + L / R

  23. 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 • Two generic forms of pipelined protocols: go-Back-N, selective repeat Transport Layer

  24. Pipelining: increased utilization sender receiver first packet bit transmitted, t = 0 last bit transmitted, t = L / R first packet bit arrives RTT last packet bit arrives, send ACK last bit of 2nd packet arrives, send ACK last bit of 3rd packet arrives, send ACK ACK arrives, send next packet, t = RTT + L / R Transport Layer Increase utilization by a factor of 3!

  25. 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 Transport Layer

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

  27. GBN INACTION Transport Layer

  28. GBN Demo http://www.cs.mum.edu/courses/cs450/GoBackN.htm Transport Layer

  29. SELECTIVE REPEAT • receiver individually acknowledges all correctly received pkts • buffers pkts, as needed, for eventual in-order delivery to upper layer • sender only resends pkts for which ACK not received • sender timer for each unACKed pkt • sender window • N consecutive seq #’s • again limits seq #s of sent, unACKed pkts Transport Layer

  30. SELECTIVE REPEAT: SENDER, RECEIVER WINDOWS Transport Layer

  31. Selective repeat in action Transport Layer

  32. Selective Repeat Demo http://www.eecis.udel.edu/~amer/450/TransportApplets/SR/SRindex.html Transport Layer

  33. 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 • Congestion control Transport Layer

  34. TCP: OVERVIEW RFCS: 793, 1122, 1323, 2018, 2581 • full duplex data: • connection-oriented: • flow controlled: • point-to-point: • reliable, in-order byte steam: • pipelined: • send & receive buffers Transport Layer

  35. time TCP seq. #’s and ACKs Host B Host A Seq. #’s: • byte stream “number” of first byte in segment’s data ACKs: • seq # of next byte expected from other side • cumulative ACK User types ‘C’ Seq=42, ACK=79, data = ‘C’ host ACKs receipt of ‘C’, echoes back ‘C’ Seq=79, ACK=43, data = ‘C’ Transport Layer host ACKs receipt of echoed ‘C’ Seq=43, ACK=80 simple telnet scenario

  36. TCP reliable data transfer • TCP creates rdt service on top of IP’s unreliable service • pipelined segments • cumulative ACKs • TCP uses single retransmission timer • retransmissions are triggered by: • timeout events • duplicate ACKs Transport Layer

  37. Host A Host B Seq=92, 8 bytes data ACK=100 Seq=92 timeout timeout X loss Seq=92, 8 bytes data ACK=100 time time lost ACK scenario TCP: RETRANSMISSION SCENARIOS Host A Host B Seq=92, 8 bytes data Seq=100, 20 bytes data ACK=100 ACK=120 Transport Layer Seq=92, 8 bytes data Sendbase = 100 SendBase = 120 ACK=120 Seq=92 timeout SendBase = 100 SendBase = 120 premature timeout

  38. Host A Host B Seq=92, 8 bytes data ACK=100 Seq=100, 20 bytes data timeout X loss ACK=120 time Cumulative ACK scenario TCP RETRANSMISSION SCENARIOS (MORE) Transport Layer SendBase = 120

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

  40. PRINCIPLES OF CONGESTION CONTROL Congestion: • informally: “too many sources sending too much data too fast for network to handle” • different from flow control! • manifestations: • lost packets (buffer overflow at routers) • long delays (queueing in router buffers) Transport Layer

  41. TCP CONGESTION CONTROL: • goal: TCP sender should transmit as fast as possible, but without congesting network • Q: how to find rate just below congestion level • decentralized: each TCP sender sets its own rate, based on implicit feedback: • ACK: segment received (a good thing!), network not congested, so increase sending rate • lost segment: assume loss due to congested network, so decrease sending rate Transport Layer

  42. loss, so decrease rate X TCP congestion control: bandwidth probing • “probing for bandwidth”: increase transmission rate on receipt of ACK, until eventually loss occurs, then decrease transmission rate • continue to increase on ACK, decrease on loss (since available bandwidth is changing, depending on other connections in network) ACKs being received, so increase rate Transport Layer X X X TCP’s “sawtooth” behavior X sending rate time

  43. Chapter 3: Summary • principles behind transport layer services: • multiplexing, demultiplexing • reliable data transfer • flow control • congestion control • instantiation and implementation in the Internet • UDP • TCP Next: • leaving the network “edge” (application, transport layers) • into the network “core” Transport Layer

More Related