TCP flow control, congestion avoidance
Transcription
TCP flow control, congestion avoidance
TCP TCP flow control, congestion avoidance Christian Dondrup (cdondrup@techfak...) Tim Nelißen (tnelisse@techfak...) TCP flow control, congestion avoidance 1 TCP Übersicht • • • • • • • • • • Einleitung Sliding Window Delayed Acknowledgements Nagle Algorithm Slow Start Congestion Avoidance Round-Trip Time (RTT) Silly Window Syndrome Quellen Fragen, Anregungen TCP flow control, congestion avoidance 2 TCP Einleitung • Warum lohnt sich ein zweiter Vortrag? • Wir wollte auch einen Vortrag halten • TCP ist nicht wirklich perfekt • Ohne Kontrollen entstehen Congestions TCP flow control, congestion avoidance 3 TCP Sliding Window (Ergänzung) • Das Window besteht aus 3 Pointern • 3ter Pointer wirkt als Grenze TCP flow control, congestion avoidance 4 TCP Delayed Acknowledgements (Ergänzung) • Wartet bis zu 200ms (Timer) • Timer wird beim KernelBoot gestartet • Empfänger sendet gesammelte ACKs TCP flow control, congestion avoidance 5 TCP Delayed Acknowledgements • Zeitdifferenz zwischen Empfang und Senden nicht genau 200ms • RLogin benötigt echo • Server hat kein Delayed ACK TCP flow control, congestion avoidance 6 TCP Nagle Algorithm (RFC 986) •Wann es Sinn macht •Wann man es nicht braucht TCP flow control, congestion avoidance 7 TCP Nagle Algorithm (wann es Sinn macht) • Wird bei langsamen Netzwerken eingesetzt (z.B. RLogin) • 1byte-Befehle werden gesammelt • Entlastet das Netzwerk TCP flow control, congestion avoidance 8 TCP Nagle Algorithm (Wann man es nicht braucht) • X-Window – (small messages wie Mausbewegung) • Funktionstaste – sind 3 byte groß – z.B.: • F1-Taste: ESC + [ + M • F2-Taste: ESC + [ + N TCP flow control, congestion avoidance 9 TCP Nagle Algorithm (Beispiel mit Nagle) • 2tes Packet wird erst nach Empfang des ACKs gesendet • Dauert insgesamt 3.39sec TCP flow control, congestion avoidance 10 TCP Nagle Algorithm (Beispiel ohne Nagle) • Pakete werden direkt gesendet • Geht schneller (da timeout wieder gleich schnell) TCP flow control, congestion avoidance 11 TCP Slow Start Flow Control durch den Sender TCP flow control, congestion avoidance 12 TCP Slow Start • Initialisiert das Congestion Window (cwnd) • Überwacht die Ankommenden ACK‘s • Erhöht das cwnd exponentiell TCP flow control, congestion avoidance 13 TCP Slow Start • Beispiel: – Das cwnd wird mit 1 initialisiert – Bei ACK auf 2 erhöht – Bei den beiden nächsten ACK‘S auf 4 – Dann auf 8 erhöht usw. TCP flow control, congestion avoidance 14 TCP Congestion Avoidance Was tun bei Verstopfung? TCP flow control, congestion avoidance 15 TCP Congestion Avoidance • 1% Paketverlust durch Beschädigung • Verstopfung (Congestion) durch zu hohe Sendegeschwindigkeit TCP flow control, congestion avoidance 16 TCP Congestion Avoidance • Slow Start und Congestion Avoidance sind zwei verschieden Algorithmen • Beide Algorithmen werden aber zusammen implementiert, denn der eine verursacht die Verstopfung und der andere soll sie beheben. TCP flow control, congestion avoidance 17 TCP Congestion Avoidance • Man nehme: – Congestion Window (cwnd) • Wird mit 1 initialisiert – Slow Start threshold size (ssthresh) • Wenn eine Verstopfung auftritt wird das ssthresh auf die Hälfte der Paketzahl gesetzt, aber min. 2 TCP flow control, congestion avoidance 18 TCP Congestion Avoidance • Bei Ankunft eines ACK wird das cwnd erhöht abhängig davon ob Slow Start oder Congestion Avoidance angewandt wird – Wenn das cwnd kleiner oder gleich der ssthresh ist wird Slow Start angewandt, ansonsten Congestion Avoidance TCP flow control, congestion avoidance 19 TCP Congestion Avoidance • Beispiel: – Verstopfung bei 32 – Die ssthresh auf 16 – Das cwnd auf 1 – Slow Start beginnt und erhöht die Paketzahl exponentiell – Ab 16 Pakete übernimmt Congestion Avoidance TCP flow control, congestion avoidance 20 TCP Round-Trip Time (RTT) Woher weiß TCP wie lang eine Runde ist? TCP flow control, congestion avoidance 21 TCP RTT • Fundamental für TCP • Kann sich mit jedem Paket ändern und wird deshalb jedes mal neu berechnet – Jede neue Berechnung geht zu 10% in die geschätzte gesamt Zeit ein TCP flow control, congestion avoidance 22 TCP RTT •R = Geschätzte gesamt RTT •M = Gemessene RTT • = Glättungsfaktor (Empfohlenerweise mit dem Wert 0,9) TCP flow control, congestion avoidance 23 TCP Silly Window Syndrome Was so alles passiert wenn man dies alles nicht beachtet TCP flow control, congestion avoidance 24 TCP Silly Window Syndrome • Beidseitiger Fehler – Der Empfänger bietet ein Fenster mit einem Byte an – Der Sender schickt Daten sofort wenn er sie bekommt • Das Netz bricht unter 41 Byte Paketen zusammen TCP flow control, congestion avoidance 25 TCP Quellen • W. Richard Stevens – TCP/IP Illustrated, Vol.1 • Douglas E. Comer – Internetworking with TCP/IP, Vol.1 TCP flow control, congestion avoidance 26 TCP Fragen & Anregungen Vielen Dank für eure Aufmerksamkeit TCP flow control, congestion avoidance 27