Post on 30-Jan-2016
description
1Spring Semester 2009, Dept. of Computer Science, Technion
Internet NetworkingInternet Networkingrecitation #10recitation #10
Explicit Congestion Notification Explicit Congestion Notification (RFC 3168)(RFC 3168)
Limited Transmit (RFC 3042)Limited Transmit (RFC 3042)
2
Internet Networking
Network Congestion Indication byNetwork Congestion Indication byActive Queue ManagementActive Queue Management - AQM - AQM
Main Idea – router can detect congestion before its queue overflows, and provide an indication of this congestion to the end nodes. This mechanism is called Active Queue Management.
TCP does not have to relay on buffer overflow as the only indication of congestion.
May use several methods for indicating congestion to end-nodes:• Use packet drops, as is currently done.
• Use specific field in a packet header as an indication of congestion.
This has the potential of reducing the impact of loss on latency-sensitive flows.
AQM drops/indicates packets based on the average queue length exceeding a threshold, rather than only when the queue overflows.
3
Internet Networking
AQM Example: Random Early Detection(RED)AQM Example: Random Early Detection(RED)
Drops packets when the buffer is full
(average queue size) < ( minimal threshold )
=> no packets are dropped.
(average queue size) > ( maximal threshold)
=> every arriving packet is dropped.
(minimal threshold)<(average queue size)<(maximal threshold)
=> each arriving packet is dropped with a probability that is a
function of the average queue size.
4
Internet Networking
General PrinciplesGeneral Principles
Co-existence
cooperation with existing TCP mechanisms for adapting to congestion
cooperation with routers' current practice of dropping packets in periods of congestion.
Congestion persistence
congestion events that may last longer than a round-trip time.
Long-time flow
managing flows that are still active when network feedback reaches them.
Asymmetric routing
Data packets path may be different from acknowledgment path.
5
Internet Networking
Congestion Scenario
AQM router
SenderReceiver
Congestion
Congestion
Data packet
ACK
Reduce congestion
window
6
Internet Networking
Congestion Notification in IPCongestion Notification in IP
Two bits from the IP header used for Explicit Congestion Notification.
Bits 6 and 7 in the TOS (Type of Service) octet ECN field:0 0 – Not ECN-Capable Transport0 1 – ECN-Capable Transport (ECT(0))1 0 – ECN-Capable Transport (ECT(1))1 1 – Congestion Experienced (CE)
’00’ - not-ECT code packet that is not using ECN.
’01’ and ’10’ - ECT(0) and ECT(1) set by the sender
Indicate that the end-points of the transport protocol are ECN-capable.
Routers treat the ECT(0) and ECT(1) as equivalent.
’11’ – CE set by a router to indicate congestion to the end nodes.
Routers that have a packet arriving at a full queue drop the packet, just as they do in the absence of ECN.
7
Internet Networking
Congestion Notification in IP (end nodes)Congestion Notification in IP (end nodes)
Upon the receipt of a single CE packet,
The congestion control algorithm must be the same as a response to a single dropped packet.
E.g., ECN-capable TCP source halve its congestion window for either a packet drop or an ECN indication.
• If there were different congestion control responses to a CE code point than to a packet drop, this could result in unfair treatment for different flows.
End-systems react to congestion at most once per window of data
• to avoid reacting multiple times to multiple indications of congestion within a round-trip time.
8
Internet Networking
Congestion Notification in IP (routers)Congestion Notification in IP (routers)
Router set the CE code point of an ECN-Capable packet only if it would otherwise drop the packet as an indication of congestion to the end nodes.
When a CE packet is received by a router, the CE code point is left unchanged, and the packet is transmitted as usual.
Additional treatment should be done for fragmented and encapsulated packets.
Don’t Fragment bit may be set.
9
Internet Networking
AQM router behaviorAQM router behavior
ECT(0)
Congested router Not congested router
CE
CE CE
ECT(0) ECT(0)
CE CE
May also drop the packet
not-ECT not-ECT not-ECTDrops the packet
10
Internet Networking
Congestion Notification in TCPCongestion Notification in TCP
Negotiation between endpoints during connection setup to determine if both support ECN
ECN-Echo flag in the TCP header
• For a receiver to inform the sender when a CE packet has been received
Congestion Window Reduced flag in the TCP header
• For the sender to inform the receiver that the congestion window has been reduced
Two last bits of the Reserved field in the TCP header are designated as ECN-Echo (ECE) and Congestion Window Reduced (CWR) flags.
ECN uses the ECT and CE flags in the IP header for signaling between routers and connection endpoints
ECN uses the ECN-Echo and CWR flags in the TCP header for TCP-endpoint to TCP-endpoint signaling.
11
Internet Networking
Congestion Notification in TCP (sequence of events )Congestion Notification in TCP (sequence of events )
ECT is set in packets transmitted by the sender
indicate that ECN is supported by the transport entities for these packets.
When an ECN-capable router detects:
Congestion
and an ECT code set in the packet it is about to drop
Instead of dropping the packet, it may choose to set the CE code point in the IP header and forwards the packet.
The receiver receives the packet with the CE code point set
sets the ECN-Echo flag in its next TCP ACK sent to the sender.
The sender receives the TCP ACK with ECN-Echo set
reacts as if a packet had been dropped (changes sstresh and cwnd in accordance).
sets the CWR flag in the TCP header of the next packet sent to the receiver
• to acknowledge its receipt of and reaction to the ECN-Echo flag.
12
Internet Networking
TCP InitializationTCP Initialization
In the TCP connection setup phase, the source and destination TCPs exchange information about their willingness to use ECN.
Host A sends an ECN-setup SYN packet (ECE and CWR are set)
Host B sends an ECN-setup SYN-ACK (ECE set, CWR unset) packet.
This asymmetry is necessary for the robust negotiation of ECN-capability with some deployed TCP implementations which simply copy the Reserved field from the received data packet to the ACK packet.
Afterwards the TCP sender sets an ECT code point in the IP header of data packets to indicate to the network that the transport is capable and willing to participate in ECN for this packet.
13
Internet Networking
TCP Initialization (cont.)TCP Initialization (cont.)
SYN, ECE, CWR
SYN+ACK, ECE, CWR=0
Host A Host B
ACK
14
Internet Networking
TCP SenderTCP Sender
If the sender receives an ACK packet with the ECN-Echo flag set in the TCP header
it knows that congestion was encountered in the network on the path from the sender to the receiver.
The indication of congestion should be treated just as a congestion loss in non-ECN-Capable TCP
the TCP source halves the congestion window "cwnd" and reduces the slow start threshold "sstresh".
TCP should not react to congestion indications more than once every window of data.
When an ECN-Capable TCP sender reduces its congestion window for any reason (because of a retransmit timeout, a Fast Retransmit, or in response to an ECN Notification)
the TCP sender sets the CWR flag in the TCP header of the first new data packet sent after the window reduction.
15
Internet Networking
TCP ReceiverTCP Receiver
When TCP receives a CE data packet at the destination end-system
It sets the ECN-Echo flag in the TCP header of the subsequent ACK packet.
To provide robustness against the possibility of a dropped ACK packet carrying an ECN-Echo flag
The TCP receiver sets the ECN-Echo flag in a series of ACK packets sent subsequently (whether they acknowledge CE data packets or non-CE data packets).
The TCP receiver uses the CWR flag received from the TCP sender to determine when to stop setting the ECN-Echo flag.
16
Internet Networking
SenderReceiver
Data packets
ACKs with ECN-Echo
flag set
Router
IP: ECT(0)
IP: ECT(0)
IP: ECT(0)
IP: CE
IP: CE
IP: ECT(0)IP: not-ECTIP: not-ECT
TCP: ECN-Echo
TCP: ECN-Echo
TCP: ECN-Echo
TCP: ECN-Echo
Congestion
Reduce congestion
window
TCP: CWR
cwnd doesn’t
reduced
Stop set ECN-Echo flag
TCP: ECN-Echo=0
17
Internet Networking
TCP/IP changes summaryTCP/IP changes summary
IP changes: Two bits in the IP header to be used for ECN. The not-ECT code point indicates that the transport protocol will ignore
the CE code point. This is the default value for the ECN code point. The ECT code points indicate that the transport protocol is willing and
able to participate in ECN. The router sets the CE code point to indicate congestion to the end
nodes. The CE code point in a packet header must not be reset by a router.
TCP changes: Two bits in the TCP header. Setup phase. The ECN-Echo flag is used by the data receiver to inform the data sender
of a received CE packet. The Congestion Window Reduced (CWR) flag is used by the data sender
to inform the data receiver that the congestion window has been reduced.
18
Internet Networking
Limited TransmitLimited Transmit
cwnd can be smaller than 4.
Due to a large number of packet loss, less than 3 dup acks will arrive.
This causes a timeout rather than a Fast Retransmit.
19
Internet Networking
TCP modificationTCP modification
The sender will send a new segment for each dup-Ack it receives.
The amount of data is limited to cwnd+2
cwnd does NOT change due to a dup-ack.
Follows the "conservation of packets“ congestion control principle since each of the first two duplicate ACKs indicate that a segment has left the network.
20
Internet Networking
ExampleExample
cwnd=3
Congestion avoidance ----
Fast retransmit
Sstresh = 3/2 = 2
Cwnd = sstresh+3=2+3=5
3
4
5
6
7
3
X
ACK(3)
ACK(3)
ACK(3)ACK(3)
ACK(8)
21
Internet Networking
Example #2Example #2
cwnd=3 ------- 3
4
5
6
7
9
8cwnd=4 -------
ACK(3)ACK(3)
ACK(6)
22
Internet Networking
ECN and Limited TransmitECN and Limited Transmit
ECN can inform of congestion without dropping the packet, thus allowing TCP with small cwnd to be aware of congestion while avoiding timeouts.
ECN requires the co-operation of the network, while Limited Transmit does not.
Can be simultaneously used.