Congestion / Flow Control in TCP

Similar documents
Transport Layer. Application / Transport Interface. Transport Layer Services. Transport Layer Connections

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

Transport layer. UDP: User Datagram Protocol [RFC 768] Review principles: Instantiation in the Internet UDP TCP

Transport layer. Review principles: Instantiation in the Internet UDP TCP. Reliable data transfer Flow control Congestion control

TCP so far Computer Networking Outline. How Was TCP Able to Evolve

Chapter 3 outline. 3.5 Connection-oriented transport: TCP. 3.6 Principles of congestion control 3.7 TCP congestion control

Transport Protocols. Raj Jain. Washington University in St. Louis

CSCD 330 Network Programming

Congestion Control In The Internet Part 2: How it is implemented in TCP. JY Le Boudec 2014

Transport Layer. -UDP (User Datagram Protocol) -TCP (Transport Control Protocol)

Congestion Control In The Internet Part 2: How it is implemented in TCP. JY Le Boudec 2014

Chapter 3- parte B outline

COMP/ELEC 429/556 Introduction to Computer Networks

Networked Systems and Services, Fall 2018 Chapter 3

Fall 2012: FCM 708 Bridge Foundation I

TCP. CSU CS557, Spring 2018 Instructor: Lorenzo De Carli (Slides by Christos Papadopoulos, remixed by Lorenzo De Carli)

Congestion Control In The Internet Part 2: How it is implemented in TCP. JY Le Boudec 2015

Networked Systems and Services, Fall 2017 Reliability with TCP

Transmission Control Protocol (TCP)

32 bits. source port # dest port # sequence number acknowledgement number not used. checksum. Options (variable length)

CSCE 463/612 Networks and Distributed Processing Spring 2017

CNT 6885 Network Review on Transport Layer

6.1 Internet Transport Layer Architecture 6.2 UDP (User Datagram Protocol) 6.3 TCP (Transmission Control Protocol) 6. Transport Layer 6-1

Transport Layer: outline

Networking Technologies and Applications

Computer Communication Networks Midterm Review

TSIN02 - Internetworking

8. TCP Congestion Control

Lecture 3: The Transport Layer: UDP and TCP

TSIN02 - Internetworking

Chapter 7. The Transport Layer

User Datagram Protocol (UDP):

Transport Layer: Outline

Transport Protocols. ISO Defined Types of Network Service: rate and acceptable rate of signaled failures.

ITS323: Introduction to Data Communications

TCP: Transmission Control Protocol UDP: User Datagram Protocol TCP - 1

Chapter III: Transport Layer

TCP /IP Fundamentals Mr. Cantu

Topics. TCP sliding window protocol TCP PUSH flag TCP slow start Bulk data throughput

Connection-oriented (virtual circuit) Reliable Transfer Buffered Transfer Unstructured Stream Full Duplex Point-to-point Connection End-to-end service

Outline Computer Networking. TCP slow start. TCP modeling. TCP details AIMD. Congestion Avoidance. Lecture 18 TCP Performance Peter Steenkiste

7. TCP 최양희서울대학교컴퓨터공학부

CS 356: Introduction to Computer Networks. Lecture 16: Transmission Control Protocol (TCP) Chap. 5.2, 6.3. Xiaowei Yang

Chapter 24. Transport-Layer Protocols

Congestion Control In The Internet Part 2: How it is implemented in TCP. JY Le Boudec 2015

TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581

UNIT IV -- TRANSPORT LAYER

Chapter 3 Transport Layer

TSIN02 - Internetworking

TCP Service Model. Today s Lecture. TCP Support for Reliable Delivery. EE 122:TCP, Connection Setup, Reliability

Transport Protocols and TCP

CMSC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala. October 25, 2018

TCP reliable data transfer. Chapter 3 outline. TCP sender events: TCP sender (simplified) TCP: retransmission scenarios. TCP: retransmission scenarios

Outline. TCP: Overview RFCs: 793, 1122, 1323, 2018, steam: r Development of reliable protocol r Sliding window protocols

TCP and Congestion Control (Day 1) Yoshifumi Nishida Sony Computer Science Labs, Inc. Today's Lecture

Chapter 3 outline. 3.5 connection-oriented transport: TCP segment structure reliable data transfer flow control connection management

TSIN02 - Internetworking

TCP/IP Networking. Part 4: Network and Transport Layer Protocols

Multiple unconnected networks

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 9

CSC 401 Data and Computer Communications Networks

Outline. TCP: Overview RFCs: 793, 1122, 1323, 2018, Development of reliable protocol Sliding window protocols

Lecture 8. TCP/IP Transport Layer (2)

ECE 650 Systems Programming & Engineering. Spring 2018

Sequence Number. Acknowledgment Number. Data

CS457 Transport Protocols. CS 457 Fall 2014

TCP over Wireless. Protocols and Networks Hadassah College Spring 2018 Wireless Dr. Martin Land 1

TCP. 1 Administrivia. Tom Kelliher, CS 325. Apr. 2, Announcements. Assignment. Read From Last Time

CS321: Computer Networks Congestion Control in TCP

COMP 431 Internet Services & Protocols. Transport Layer Protocols & Services Outline. The Transport Layer Reliable data delivery & flow control in TCP

Transport Layer TCP / UDP

Overview. TCP & router queuing Computer Networking. TCP details. Workloads. TCP Performance. TCP Performance. Lecture 10 TCP & Routers

Chapter III: Transport Layer

Chapter 3 Transport Layer

Recap. TCP connection setup/teardown Sliding window, flow control Retransmission timeouts Fairness, max-min fairness AIMD achieves max-min fairness

cs/ee 143 Communication Networks

TCP : Fundamentals of Computer Networks Bill Nace

CS 5520/ECE 5590NA: Network Architecture I Spring Lecture 13: UDP and TCP

Fast Retransmit. Problem: coarsegrain. timeouts lead to idle periods Fast retransmit: use duplicate ACKs to trigger retransmission

TCP Basics : Computer Networking. Overview. What s Different From Link Layers? Introduction to TCP. TCP reliability Assigned reading

Transport Over IP. CSCI 690 Michael Hutt New York Institute of Technology

Flow and Congestion Control

The Transport Layer Reliable data delivery & flow control in TCP. Transport Layer Protocols & Services Outline

Transport Layer Protocols. Internet Transport Layer. Agenda. TCP Fundamentals

Chapter III: Transport Layer

Department of Computer and IT Engineering University of Kurdistan. Transport Layer. By: Dr. Alireza Abdollahpouri

Computer Networking Introduction

Announcements Computer Networking. Outline. Transport Protocols. Transport introduction. Error recovery & flow control. Mid-semester grades

TCP (Part 2) Session 10 INST 346 Technologies, Infrastructure and Architecture

Transport Layer PREPARED BY AHMED ABDEL-RAOUF

Transport Protocols & TCP TCP

Computer Networking Introduction

image 3.8 KB Figure 1.6: Example Web Page

Congestion Control. Brighten Godfrey CS 538 January Based in part on slides by Ion Stoica

RSC Part III: Transport Layer 3. TCP

Information Network 1 TCP 1/2. Youki Kadobayashi NAIST

Suprakash Datta. Office: CSEB 3043 Phone: ext Course page:

CS519: Computer Networks. Lecture 5, Part 4: Mar 29, 2004 Transport: TCP congestion control

Two approaches to Flow Control. Cranking up to speed. Sliding windows in action

Chapter 3 Transport Layer

Transcription:

Congestion and Flow Control in 1

Flow Control and Congestion Control Flow control Sender avoids overflow of receiver buffer Congestion control All senders avoid overflow of intermediate network buffers Buffer fill rate Bytes / second arriving from network Buffer empty rate Bytes / second leaving to network or application layer Buffer file time T Example T overflow overflow = buffer size buffer fill rate buffer empty rate Arriving bytes 64 KB 64 KB = = = 16 seconds 8 KB/sec 4 KB/sec 4 KB/sec Empty Full Leaving bytes 2

Congestion Control Flow control Avoid overflow in receiver buffer Congestion control Avoid overflow in router buffers Flow Control Buffer Router Buffer 3

Queuing Theory Assumptions Segments arrive independently (Poisson statistics) Random length (bytes) Average arrival rate in steady state Segments leave independently (Poisson statistics) Average emptying rate in steady state Results arrival rate ρ = Utilization = empty rate 1 1 1 Latency = = empty rate arrival rate empty rate 1 ρ ρ Buffer Level = Latency arrival rate = 1 ρ 20 18 16 14 12 10 8 6 4 2 0 0 0.1 latency buffer level 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Utilization ρ 4

Buffer Throughput (Over)-simplified throughput model throughtput = receive rate maximum receive rate 1 latency throughput at receivers arrival rate buffer utilization = empty rate receive rate (error free in order) goodput = maximum receive rate 1 buffer utilization (from all senders) latency Realistic throughput behavior at receivers High arrival rate at buffer Longer latency + overflow 1 Sender timeouts Re-transmit more segments higher arrival rate at buffer 1 throughput buffer utilization (from all senders) 5

Flow Control Source window Initial source window = maximum number of "unacked" bytes Determined by congestion + flow control Destination window Number of bytes receiver can accept Determined by available space in receiver buffer Buffer level = Previous level + arriving bytes bytes read by lication reads too slowly decrease destination window Sliding window Arriving Window field in header bytes Number of bytes receiver will accept Receiver discards bytes above window size Empty Full Bytes read by 6

Flow Control Example Source Window In Flight 64 KB 64 KB 2 KB 64 KB 4 KB 64 KB 4 KB 4 KB 0 2 KB 2 KB 6 KB 0 KB 0 6 KB 0 0 ACK 4 KB 2+2 = 4 ACK 6 KB 2+4 = 6 ACK 12 KB 6+6 = 12 2 KB 2 KB window = 4 KB 2 KB window = 6 KB 6 KB window = 0 KB Buffer Level 0 0 2 KB 4 KB 6 KB 2 KB reads 4 KB 2 KB 6 KB 8 KB Dest Window 8 KB 8 KB 6 KB 4 KB 0 Persist Timeout 4 KB 0 error ACK 12 KB 6+6 = 12 window = 4 KB 1 B ACK 12 KB + 1B window = 4 KB reads 4 KB 4 KB 4 KB 7

Receive Window Bugs 1 Bug deadlock Receiver advertises window = 0 Window update with window > 0 is lost deadlock Sender Receiver win = 0 1 byte Fix persist timeout Sender attempts small segment ACK contains new window size error win = 0 win > 0 1 byte ACK win > 0 8

Receive Window Bugs 2 Silly Window Problem lication reads received data slowly Receiver advertises small window Data bytes ~ header bytes More segments / file transfer larger total traffic (data + headers) Nagle Algorithm bug fix for Silly Window Sender accumulates application data sends large segments Works badly with Telnet (requires small segments) Receiver side bug fix Receiver keeps 0 window size until it can advertise large window 9

Congestion Control End-to-end congestion control Based on host estimates No feedback from intermediate network nodes Slow-start Begin session with low transmission rate Increase rate until timeouts begin Fast retransmit Do not wait for timeout Re-transmit after duplicate ACKs (dupacks) Congestion avoidance Limit transmission rate after duplicate ACKs Growth rate of transmission rate slows 10

Slow Start Congestion window (cwnd) Source window Maximum number of "unacked" bytes Initial cwnd = 1 MSS (maximum segment size) Data rate = 1 MSS / RTT RTT = round trip time = time from send to ACK Maximum cwnd = destination window Sender Receiver RTT ACK 1 MSS ACK 2 MSS Exponential growth On (ACK) cwnd cwnd + size of data ACKed if (cwnd > maximum cwnd) cwnd max cwnd On (ACK timeout) cwnd initial cwnd = 1 MSS Timeout ACK 3 MSS 11

Computing 's Retransmission Timer RFC 2988 Initialize RTO 3 seconds Sender SEQ Receiver G clock granularity (typically 500 ms) R first RTT measurement (round trip time) SRTT R RTTVAR R/2 RTO max(1 sec, SRTT + max(g, 4 * RTTVAR)) Update after measurements R' RTTVAR (1 - β) * RTTVAR + β * SRTT R' SRTT (1 - α) * SRTT + α * R' RTO max(1 sec, SRTT + max (G, 4 * RTTVAR)) α = 1/8 β = 1/4 RTT ACK 12

Fast Retransmit Better performance with RTO >> RTT 3 duplicate ACKs (dupacks) for segment re-send segment Sender Receiver 13 error SEQ = 100 SEQ = 200 SEQ = 300 ACK = 200 SEQ = 400 SEQ = 500 SEQ = 200 (duplicate) ACK = 200 (duplicate) ACK = 200 (duplicate) ACK = 200 (duplicate) Timeout ACK = 600

Congestion Avoidance Reno protocol Slow start phase On (ACK && cwnd < ssthresh) cwnd cwnd + size of data ACKed On (ACK timeout) ssthresh cwnd cwnd initial cwnd = 1 MSS RTO 2 * RTO Congestion avoidance phase On (ACK && cwnd > ssthresh) cwnd cwnd + 1 MSS Fast retransmit with fast recovery On (3 dupacks) ssthresh cwnd cwnd cwnd / 2 Retransmit lost packet Wait 1 RTT continue sending For > 3 dupacks cwnd++ on each new dupack 14

Sender with Reno 1 // initialize SEQ = ISN + 1 SendBase = ISN + 1 InFlight = 0 cwnd = 1 MSS Set ssthreshold large (local policy) RTO = timeout interval on (new data from application) Prepare data segment:sequence number = SEQ if InFlight < min{cwnd,sendwindow,recvwindow) Pass segment to SEQ = SEQ + length(data) InFlight = InFlight + length(data) if!(timer running) timer = RTO 15

Sender with Reno 2 if (receive ACK = y) stop timer if (y > SendBase) dupack = 0 newacks = y SendBase // bytes ACKed SendBase = y InFlight = InFlight newacks if (cwnd < ssthresh) cwnd = cwnd + newacks else cwnd = cwnd + 1 MSS if (InFlight > 0) timer = RTO 16

Sender with Reno 3 // if (y > SendBase) else dupack++ if (dupack = 3) SEQ = SendBase = min{unacked SEQ} and resend timer = RTO ssthresh = cwnd cwnd = cwnd / 2 wait 1 RTT // wait for ACK of resent packet if (dupack > 3) cwnd = cwnd + 1 MSS if (timeout) SEQ = SendBase = min{unacked SEQ} and resend ssthresh = cwnd cwnd = initial cwnd = 1 MSS RTO = 2 * RTO timer = RTO 17

Receiver with Reno 1 // initialize Set RecvWindow = receiver buffer size expected = Sender ISN + 1 ack_buffer = 0 ack_max (local policy: delayed ACK trigger) ack_delay = 250 msec (local policy: < 500 msec) Start ACK delay timer = ack_delay if (ACK delay timer = 0 && ack_buffer > 0) Send ACK = expected with updated RecvWindow ACK delay timer = ack_delay ack_buffer = 0 18

Receiver with Reno 2 if (receive SEQ = x) if (x = expected && error-free) expected = expected + length(data) if (NACK = 1) Send ACK = expected with updated RecvWindow ACK delay timer = ack_delay ack_buffer = 0 NACK = 0 else if (ack_buffer < ack_max) nextack = expected ack_buffer++ else if (ack_buffer = ack_max) Send ACK = expected with updated RecvWindow ACK delay timer = ack_delay ack_buffer = 0 else Send ACK = expected with updated RecvWindow ACK delay timer = ack_delay NACK = 1 19

Reno Example 1 Counting in bytes: SEQ = SEQm (1 MSS) ACK = ACKm (1 MSS) ssthresh = 32 Receiver sends ACK for every 4 packets (or ACK delay) Sender Receiver cwnd in flight SEQm Sent Packets Sent ACKm Sent New ACKs 1 1 1 1 (1) 2 1 1+1 = 2 0 2 2 2 2 3 (2) 4 2 2+2 = 4 0 4 4 4 4 7 (4) 8 4 4+4 = 8 0 8 8 8 8 15 (8) 12 4 8+4 = 12 4 20

Reno Example 2 cwnd in flight SEQm Sent Packets Sent ACKm Sent New ACKs 12 4 16 4 12+4 = 16 0 16 16 16 16 31 (16) 20 4 16+4 = 20 12 20 20 32 32 39 (8) 24 4 20+4 = 24 16 24 24 40 40 47 (8) 28 4 24+4 = 28 20 32 4 28+4 = 32 16 32 32 48 48 63 (16) 21

Reno Example 3 cwnd in flight SEQm Sent Packets Sent ACKm Sent New ACKs 32 32 48 48 63 (16) 36 4 32+1 = 33 28 33 32 64 64 67 (4) 40 4 33+1 = 34 28 44 4 34+1 = 35 24 48 4 35+1=36 20 52 4 36+1 = 37 16 56 4 37+1 = 38 12 22

Reno Example 4 cwnd in flight SEQm Sent Packets Sent ACKm Sent New ACKs 38 20 68 68 75 (8) 60 4 38+1 = 39 16 60 0 39 16 60 0 39 16 60 0 19 ssthresh 39 16 19 16 60 60 67 (8) 76 (cumulative) 16 19+16 = 35 0 35 16 76 76 91 (16) 23

Selective Acknowledgment Option Selective ACK (SACK) Permits ACK for segments with gaps Option negotiated between hosts Defined in RFC 2018 Example Last ACK = 5000 Send 8 segments 500 data bytes / segment Case 1 Case 2 First 4 segments received and last 4 dropped Receiver returns normal ACK = 5000 + 4 * 500 = 7000 No SACK option field First segment lost and 7 segments received For each segment receiver returns segment with ACK = 5000 SACK option field with start + end ACK Data 5000 5500 6000 6500 7000 7500 8000 8500 ACK 5000 5000 5000 5000 5000 5000 5000 Option Field Start End 5500 5999 5500 6499 5500 6999 5500 7499 5500 7999 5500 8499 5500 8999 24

Active Queue Management (AQM) Standard Queue At receiver Full buffer drop excess packets At sender No ACK timeout signal congestion Random Early Detection (RED) Router Sender Detects congestion early Drops random packets Sees dupacks or timeout Assumes congestion Lowers cwnd 1 Arriving packets 0.85 1 latency Empty Full throughput at receivers buffer utilization (all senders) Leaving packets 25

RED Algorithm Algorithm for each packet arrival calculate avg = average queue size if min th avg < max th calculate probability p a with probability p a : mark arriving packet for drop else if max th avg mark arriving packet for drop Parameters max p = maximum mark probability (0.1 to 0.5) min th ~ 5 max th ~ 30 p b max p (avg min th ) / (max th min th ) p a p b / (1 count p b ) count = number of consecutive dropped packets 26

AQM with ECN Explicit Congestion Notification (RFC 3168) 1. router predicts congestion RED with mark (no drop) 2. router indicates congestion to receiver in header 3. Receiver indicates congestion to sender in ACK header 3 segment with ECN datagram 85% 1 2 Full datagram with ECN 27

Explicit Congestion Notification (ECN) datagram 4 bits 4 bits 6 bits 2 bits 16 bits Version Hlen Differentiated Services Code Point (DSCP) QoS requirements DSCP ECN Identification Flags Fragment Offset (13 bits) Time to Live Protocol Header Checksum Source Address Destination Address Options Data Explicit Congestion Notification (ECN) Total Length (header + data in bytes) 00 01 10 11 Not ECN capable ECT(0) ECN Capable Transport (0) ECT(1) ECN Capable Transport (1) CE (Congestion Experienced) For retransmissions To allow protocol error checking 28

Explicit Congestion Notification (ECN) header flags HLEN source port not used checksum 32 bits sequence number (SEQ) acknowledgement number (ACK) flags Options destination port window size urgent pointer NS ECN nonce concealment protection CWR Congestion Window Reduced (CWR) flag URG Urgent pointer ECE ECN Echo ACK Acknowledgment PSH Push buffer RST Reset SYN Synchronize FIN No more data 29

ECN Negotiation client SYN ECE = CWR = 1 in SYN server ECE = 1 in SYN-ACK ECT(0), ECT(1) in SYN and SYN-ACK client server SYN with ECE = CWR = 1 SYN ACK with ECE = 1 CWR = 0 ACK 30

ECN Operation 1 No congestion Measure long term average buffer level n Compare with threshold level th segment ECE = CWR = 0 datagram ECN = 01 (ECT) n < th datagram ECN = 01 (ECT) 31

ECN Operation 2 No congestion ACK ECE = CWR = 0 datagram ECN = 01 (ECT) n < th datagram ECN = 01 (ECT) 32

ECN Operation 3 Incipient congestion Router Sees ECN = ECT in incoming header Sets ECN = CE in outgoing header Notifies receiver of incoming congestion segment ECE = CWR = 0 datagram ECN = 10 (ECT) n > th datagram ECN = 11 (CE) 33

ECN Operation 4 Incipient congestion Receiver Sets ECE = 1 in header Notifies sender of congestion ACK ECE = 1 CWR = 0 datagram ECN = 10 (ECT) n < th datagram ECN = 10 (ECT) 34

ECN Operation 5 Incipient congestion Sender Lowers congestion window (once per RTT) Sets CWR = 1 in header (ACK of ECE to receiver) segment ECE = 0 CWR = 1 datagram ECN = 01 (ECT) n > th datagram ECN = 11 (CE) 35

ECN Operation 6 Incipient congestion Receiver Sees CWR = 1 in sender header CE in header new incoming ECE = 1 in ACK header ACK ECE = 1 CWR = 0 datagram ECN = 01 (ECT) n < th datagram ECN = 01 (ECT) 36

ECN Operation 7 Continued congestion Sender Lowers congestion window once per RTT Sets CWR = 1 in header (ACK of ECE) segment ECE = 0 CWR = 1 datagram ECN = 01 (ECT) n > th datagram ECN = 11 (CE) 37

ECN Operation 8 Continued congestion Receiver Sees CWR = 1 in sender header CE in header new incoming ECE = 1 in ACK header ACK ECE = 1 CWR = 0 datagram ECN = 01 (ECT) n < th datagram ECN = 01 (ECT) 38

ECN Operation 9 End of congestion Sender sets CWR = 1 in header (ACK of ECE) Router sends ECN = 01 in header (signals no congestion) segment ECE = 0 CWR = 1 datagram ECN = 01 (ECT) n < th datagram ECN = 01 (ECT) 39

ECN Operation 10 End of congestion Receiver sends ECE = 0 in header (signals no congestion) ACK ECE = CWR = 0 datagram ECN = 01 (ECT) n < th datagram ECN = 01 (ECT) 40

ECN Operation 11 End of congestion Sender clears CWR and begins raising congestion window Router sends ECN = 01 in header segment ECE = CWR = 0 datagram ECN = 01 (ECT) n < th datagram ECN = 01 (ECT) 41

RED and ECN Goodput Parameters min th = 5 max th = 30 10 9.5 9 Goodput (Mbps) 8.5 8 7.5 7 6.5 6 5.5 5 ECN (max_p=0.1) RED (max_p=0.1) ECN (max_p=0.5) RED (max_p=0.5) 0 100 200 300 400 500 600 Number of flows Ref: Kinicki and Zheng, A Performance Study of Explicit Congestion Notification (ECN) with Heterogeneous Flows 42

RED and ECN Delay Parameters min th = 5 max th = 30 max p =0.5 0.2 0.18 One-way delay (Seconds) 0.16 0.14 0.12 0.1 0.08 0.06 0.04 0.02 0 ECN (Fragile flows) ECN (Average flows) ECN (Robust flows) RED (Fragile flows) RED (Average flows) RED (Robust flows) 0 100 200 300 400 500 600 Number of flows 43

Goodput with 120 flows Parameters min th = 5 max th = 30 Goodput (Mbps) 10 9.5 9 8.5 8 7.5 7 6.5 6 5.5 5 ECN (max_th=15) RED (max_th=15) ECN (max_th=30) RED (max_th=30) 0 0.2 0.4 0.6 0.8 1 max_p 44

ECN Nonce (RFC 3540) Problem Unscrupulous or poorly implemented receiver Clears ECN-Echo no congestion signals to sender Gives receiver advantage over connections that behave properly Sender header with ECN = 01 = ECT(0) or ECN = 10 = ECT(1) Except retransmissions (Not ECN Capable) and CE packets Keeps per-packet map of SEQ to nonce (0 or 1) Router Forwards packet or overwrites ECT with ECN = 11 = CE Receiver Keeps cumulative ACK number (standard ) Keeps cumulative sum % 2 of received nonces for ACKed packets NS flag in header = sum of nonces for ACKed packets CE packets use nonce = 0 45

Nonce Example Honest Receiver Sender NS initialized to 1 Sent in SYN ACK and ACK of handshake Receiver SEQ_1 ECT(0) SEQ_2 ECT(0) Nonce Sum 1 SEQ_3 ECT(1) SEQ_4 ECT(0) SEQ_5 ECT (1) ACK_3 NS = 0 Sender sees correct NS SEQ_5 CE nonce = 0 1 0 0 0 ACK_6 NS = 0 ECE = 1 Sender sees correct NS 46

Nonce Example Cheating Receiver Receiver ignores CE Does not set ECE Guesses nonce sum after CE Sender Receiver 47 SEQ_1 ECT(1) sum = 0 SEQ_2 ECT(0) sum = 0 SEQ_3 ECT(1) sum = 1 SEQ_4 ECT(0) sum = 1 SEQ_5 ECT (1) sum = 0 SEQ_3 CE nonce = 0 ACK_3 NS = 0 (guess) Sender sees wrong NS Guess 0 0 0 0 1 SEQ_6 ECT(0) sum = 0 1 ACK_6 NS = 1 (guess) Sender sees wrong NS