1 / 30

Network Protocols: Design and Analysis

Network Protocols: Design and Analysis. Polly Huang EE NTU http://cc.ee.ntu.edu.tw/~phuang phuang@cc.ee.ntu.edu.tw. TCP Overview. Connection establishment: Connectionless communication: Congestion avoidance: Differentiated services: Duplicate packet detection: Flow control: .

edana
Télécharger la présentation

Network Protocols: Design and Analysis

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. Network Protocols: Design and Analysis Polly Huang EE NTU http://cc.ee.ntu.edu.tw/~phuang phuang@cc.ee.ntu.edu.tw

  2. TCP Overview

  3. Connection establishment: Connectionless communication: Congestion avoidance: Differentiated services: Duplicate packet detection: Flow control: loss recovery: message or record boundaries: ordered data delivery to the application: out-of-order data delivery to the application: quality-of-service: urgent data indication: What does TCP Provide?

  4. Where and Why is TCP Used? • where: anywhere reliable communication is needed • file transfer/ftp, http, p2p; e-mail smpt; remote login/telnet; db transfer/dns; some real audio • why? • connection oriented—can be easier to manage (ex. firewall config) • has the right features (congestion ctl, etc.) • widely deployed => interoperability, understood, exhaustively studied, pretty good implementations • doing your own protocol is a lot of work

  5. abstraction: reliable ordered point-to-point byte-stream mechanisms window-based flow control sequence numbers/ordering, 3-way handshake reliability (ACK, retx policies) congestion control RTT estimation TCP in a Nutshell

  6. TCP Header Source port Destination port Sequence number Flags: SYN FIN RESET PUSH URG ACK Acknowledgement Advertised window Flags Hdr len 0 Checksum Urgent pointer Options (variable) Data

  7. Agenda • connection setup and teardown • initial sequence number selection • passive/active open • time-wait • flow control • congestion control practice and theory • loss recovery • security • performance

  8. A B SYN SYN+ACK-A ACK-B Three-Way Handshake • why? • passes buffer sizes • connection startup • set up initial seq number • options • is someone there?

  9. Connection Setup States passive vs. active (and both active!) (error recovery is not on this figure)

  10. Initial Sequence Number Selection • Why not just start at 0? • want to avoid accidental replay of old packets (tcp connection: src + dest ip address + port) • Approach: • randomly chosen • OR semi-sequentally

  11. Tear-down Packet Exchange Sender Receiver FIN FIN-ACK Data write Data ack FIN FIN-ACK

  12. Connection Tear-down

  13. Connection Tear-down • either side can close • or one side can close and the other stay open • one side must maintain state (TIME_WAIT) for 2 minutes, why? • suppress old packets

  14. Agenda • connection setup and teardown • flow control • setting window sizes • Nagle’s algorithm • silly window syndrome • protection against wrap-around • congestion control practice and theory • loss recovery • security • performance

  15. Flow Control • Window sizes are passed in every packet • beware: implementations often have separate TCP and socket buffers • effective window is the minimum of the two

  16. Flow Control • Why? • avoid overrunning receiver • Solutions • TCP have a sliding window w/how much data can be outstanding • (OR could have a rate)

  17. Window Flow Control: Sender effective window advertised window (from receiver) Sent but not acked Not yet sent Sequence numbers send buffer last byte ACKed last byte sent

  18. Window Flow Control: Receiver Receive buffer (possible window) ACKed but not delivered to user recv’d but not ACKed Sequence numbers missing data advertised window

  19. Window Advancement Issues • What if window is full? • sender sends full window, but ACK is lost • sender sends 1-byte probes (solicits new ACK) • Silly window syndrome (RFC-813) • receiver dribbles out small window advances • Silly Window Avoidance: delay ACKing (receiver) or sending small segments (sender) • Sender who dribbles out data (like telnet) • Nagle’s algorithm (RFC-896): send 1st partial packet, but not more until it’s ACKed or you have a full packet

  20. Problem: Rapid Wrap-Around • Wraparound time vs. Link speed: • 1.5Mbps: 6.4 hours • 10Mbps: 57 minutes • 45Mbps: 13 minutes • 100Mbps: 6 minutes • 622Mbps: 55 seconds • 1.2Gbps: 28 seconds • Protection Against Wrapped Sequences (PAWS extension): Use timestamp to distinguish sequence number wraparound

  21. Agenda • connection setup and teardown • flow control • congestion control theory • what and why • how • congestion control practice • loss recovery • security • performance

  22. 10 Mbps 1.5 Mbps 10 Mbps Congestion Collapse • If both sources send full speed, the router is completely overwhelmed • congestion collapse: senders lose data from congestion and they resend, causing more congestion (can be self-reinforcing) • has been observed many times

  23. Congestion Control vs. Flow Control • What does flow control do? • avoids overrunning the receiver • What does congestion control do? • avoid overrunning router buffers; avoid saturating the network • What mechanism do they use? • both use windows: (flow control) wnd, (congestion control) cwnd: actual window used is the MIN of wnd and cwnd

  24. Congestion Control Goals • control network buffer usage • avoid congestion collapse • want to fairly allocate network resources • make good use of network bandwidth: power

  25. throughput delay (throughput) power := load load delay Power and Load knee • throughput and delay change due to load • want to optimize power (From [Ramakrishnan90a])

  26. Fairness • Also want fairness • should treat all users equally • but it’s not so easy • what is a user? host, flow, person? • if n flows through a link, each should get n-1 of the bandwidth • R&J’s fairness index: (Sxi)2/n(Sxi2) • but what if flows have different needs? different RTTs?

  27. Congestion Control Design • Avoidance or control? (R&J:) • avoidance keeps system at knee of curve • requires some congestion signal • control responds to loss after the fact • TCP • Which is TCP? • congestion control (according to R&J’s definition) • How does TCP do it? • slow start, congestion avoidance, exponential backoff

  28. When to increase/decrease? A control theory problem observe network reduce window if congested increase window if not congested Constraints: efficency fairness stability (too much oscillation is bad) out-of-date info RTT is fundamental limit to how quickly you can react How to Adjust Window?

  29. Linear Control Xi(t + 1) = ai(t,f) + bi(t,f) Xi(t) • Formulation allows for the feedback signal: • to change additively: ai(t) • to change multiplicatively: bi(t) • can consider feedback • What does TCP do and why? • AIMD: additive increase, multiplicative decrease • Types of feedback in Internet? • packet loss or ECN (explicit congestion notification) or in R&J “binary feedback” DECBit

  30. Agenda • connection setup and teardown • flow control • congestion control theory • congestion control practice (in TCP) • loss recovery • security • performance => next sets of slides

More Related