Congestion Control
- TCP Vegas
- other ways of detecting congestion
- addressing congestion
- router intervention
- Internet Explicit Congestion Notification
TCP Vegas
- Reno detects congestion after it happens
- Reno also causes congestion by increasing the window until
congestion occurs
- early congestion detection:
as queues get filled in the router, packets take longer, so the RTT increases
- when RTT gets bigger, we can slow our sending
- when RTT gets back to minimum, we can increase our sending
- not standard, but tested to work well
Detecting and Addressing Congestion
- detecting congestion:
- queues get longer
- RTT gets bigger
- data / RTT ( power) starts to drop as you try to send more
- addressing congestion:
- additive increase/multiplicative decrease (needed for stability if
congestion is occurring)
- additive increase/additive decrease (TCP Vegas) -- works as long
as congestion can be avoided
- setting flow rate
- bandwidth reservation
Router Intervention to Avoid or React to Congestion
- Random Early Discard -- causes TCP to back off
- information feed-forward -- the receiver must then return
congestion information to the sender (see Internet ECN, below)
- information feedback -- requires route back to sender, does not
work in Internet (except source quench ICMP, which is deprecated)
- communication time from router to sender may be insufficient if
sender is sending lots of stuff. Also, stability issues -- all senders
could increase their sending rate at the same time
- credits: can only send as much as we have in the "bank", automatically
(but not immediately) replenished
Internet Explicit Congestion Notification
- ECN, explicit congestion notification,
RFC 3168.
- in ECN, two of the bits of the Type of Service (ToS) field are
used to indicate (a) whether congestion notification is requested (ECT),
and (b) whether the packet experienced congestion (CE).
- TCP uses two new bits: ECE (ECN-Echo, to report that a packet
was received with the CE bit set -- bit before URG),
and CWR (Congestion Window Reduced, bit before ECE),
to indicate that the ECE bit was received.
- compatible with hosts and routers that don't do ECN
- typical usage of ECN:
- senders can set ECT
- routers can change ECT to CE to record that congestion
was experienced, perhaps instead of dropping a packet
- transport layer is informed of CE, sends an ECE
- receiver of ECE reduces congestion window, sends CWR
TCP Vegas
- packet scheduling
- FIFO queueing
- fair queueing
Packet Scheduling
- routers have a queue of outgoing packets for each interface
- any number of threads can place packets in the queue
- a single thread removes and sends the front packet in the queue
whenever the previous packet has been sent
- there can be many strategies for placing packets in the queue!
FIFO Queuing
- each packet is placed at the end of the queue
- packets (that take the same route) are never reordered
- delay is proportional to queue size
- works reasonably well in Internet, with TCP congestion control
- if all but one sender do congestion control, and one does not, the one
that doesn't (IP telephony, multicasting) might grab much of the
bandwidth
Fairness
- "everyone" gets the same treatment
- hard to do in a distributed system:
- local fairness (every flow gets the same treatment on this router)
discriminates against flows that cross more routers (parking garage problem)
- global fairness requires global co-ordination, so local fairness
is often the best we can do
Fair Queueing
- one FIFO queue for each flow
- packets are taken in round-robin order from each queue that has them
- problem: large packets counted the same as small packets
- logically, we want to send one bit from each flow in round-robin
order
Fair Queueing with Different size packets
- virtual clock ticks once for each bit sent from all the queues (so
more active queues means slower virtual clock)
- virtual finish time for a packet is start time plus the size of
the packet
- virtual start time is the largest of: finish time for the previous
packet in the queue (a computed quantity), or arrival time
- select and transmit the packet with the lowest virtual finish time
TCP Review
- state management: connection setup and teardown, Transmission
Control Block (TCB)
- reliable transmission via sequence numbers, acknowledgements
- flow control to avoid overwhelming receiver:
- challenges obtaining both reliability and performance
- acknowledgements are not acknowledged, but crucial
information carried in the acknowledgements (e.g. window size)
- congestion control to avoid overwhelming network (or to slow
down when we do) requires adaptive timer
- "good enough" (TCP Reno) may be preferable to "better" (TCP Vegas)
Our network so far
- TCP and IP
- reliable byte-stream and packet transmission among applications
- only application so far: DNS
- only Data Link layer so far: SLIP
- only Physical layer so far: serial lines, which are limited
in speed (about 100,000 b/s max), distance (typically within a
building), and number of hosts (at most two hosts per serial line)