Kommunikationssysteme [KS] Dr.-Ing. Falko Dressler Computer Networks and Communication Systems Department of Computer Sciences University of Erlangen-Nürnberg http://www7.informatik.uni-erlangen.de/~dressler/ dressler@informatik.uni-erlangen.de [KS], WS 2005/2006 2-2.1
Course Overview Network Infrastructure Basics of communication networks, packet- / circuit switched networks, telephone networks, ATM Quality of Service and Multimedia Policing, scheduling, AQM, audio/video streaming, conferencing and VoIP, IntServ, DiffServ, ATM, MPLS Simulation Tools, accomplishment, measures Protocol Engineering FSM, SDL, MSC, UML Wireless / Mobile Communications GSM, UMTS, mobility issues, WLAN, WPAN, WSN Network Security Threats and security goals, basic mechanisms [KS], WS 2005/2006 2-2.2
Scheduling Scheduling the manner in which queued packets are selected for transmission e.g., at output ports of routers FIFO (first in first out) scheduling: a single queue is maintained, packets are sent in order of arrival to queue as long as the queue is not empty, the oldest remaining packet is taken next Drawbacks of FIFO: no special treatment of flows possible flows of larger packets get better service greedy flows can crowd out more cautious ones [KS], WS 2005/2006 2-2.3
Scheduling Priority scheduling: packets are classified into priority classes class may depend on marking or other header info, e.g. IP source/dest, port numbers, ToS, etc. transmit highest priority queued packet, FIFO in same class non-preemptive [KS], WS 2005/2006 2-2.4
Scheduling Round robin scheduling (Fair Queuing): multiple classes cyclically scan class queues, serving one packet from each class, skip empty queues work-conserving (link is never idle when packet to transmit) no advantage for greedy flows fair, but flows with short packets are penalized [KS], WS 2005/2006 2-2.5
Scheduling [KS], WS 2005/2006 2-2.6
Scheduling Processor Sharing (PS): bit-by-bit round robin idealized, not practical to implement each class queue receives the same share of available capacity: if there are N queues with a packet to send, each queue receives (1/N) th of the available capacity long packets no longer receive an advantage Exact description R(t) number of rounds up to time t (normalized to output data rate) in one round each queue can transmit as many bits as the link can transmit in one real time unit example: link with 1 Gbps, time unit 1 s, one round is time of single queue to transmit 1 Gb we can think of R(t) as virtual time, recording the rate of service seen by the packet at the head of a queue an equivalent definition is R (t) = 1/max[1, N(t)] [KS], WS 2005/2006 2-2.7
Scheduling Definition of all required quantities R(t) number of rounds up to time t N(t) nonempty queues at time t P a i number of rounds to transmit packet i in queue a τ a i arrival time for packet i in queue a S a i value of R(t) at start of transmission of packet i in queue a F a i value of R(t) at end of transmission of packet i in queue a Recurrence relations the recurrence relations show how the system evolves in virtual time: F a i = Sa i + Pa i S a i = max[fa i-1, R(τa i )] not possible to derive real finishing time on its arrival because it depends on future arrivals [KS], WS 2005/2006 2-2.8
Scheduling Example PS: thin black solid lines [KS], WS 2005/2006 2-2.9
Scheduling Bit-Round Fair Queuing (BRFQ): entire packets instead of bits emulates PS simple rule: whenever a packet finishes transmission, the next packet sent is the one with smallest value of F a i (as seen at the start of transmission) throughput and average delay experienced under BRFQ converges to that under PS as time increases [KS], WS 2005/2006 2-2.10
Scheduling Example BRFQ: grey bars [KS], WS 2005/2006 2-2.11
Scheduling Comparison of FIFO, FQ and BRFQ [KS], WS 2005/2006 2-2.12
Scheduling Generalized Processor Sharing (GPS): PS/BRFQ fairly allocate available capacity among all active flows not able to provide different amounts of the capacity to different flows for QoS support such differential allocation capability is needed with GPS, each flow a is assigned a weight w a that determines how many data are transmitted from that queue during each round if all queues are filled, in each round Σw a /R bits are transmitted in each round again idealized, not practical to implement Example link with 1 Gbps, time unit 1 s w a = 0.3 one round is time of queue a to transmit 0.3 Gb if all queues are filled, one round is time to transmit Σw a Gb [KS], WS 2005/2006 2-2.13
Scheduling Calculation of GPS schedules Work a i (t) = work already performed at flow a for packet i at time t Rest a i (t) = remaining work at flow a for packet i at time t = Pa i (t)- Worka i (t) Speed a (t) = speed at flow a at time t = wa / for periods without discrete change we have: Rest a i (t+δ) = Resta i (t) - Speeda (t) Δ R(t) = S a i + Worka i (t)/w a w α α nonempty Properties the virtual packet length is hence multiplied by 1/w a the recurrence relationships of PS generalize to: F a i = Sa i + Pa i /w a S a i = max[fa i-1, R(τa i )] as a consequence, for a non-empty flow i a minimum fraction r i = w i / Σw a of the link capacity is guaranteed [KS], WS 2005/2006 2-2.14
Scheduling Weighted Fair Queuing (WFQ): entire packets instead of bits same rule as in BRFQ: whenever a packet finishes transmission, the next packet sent is the one with smallest value of F a i but with recurrence relationships from GPS minimum rate similar as in GPS (adapted to packets) [KS], WS 2005/2006 2-2.15
Scheduling WFQ vs. FIFO w1 = 0.5 w2 =... = w11 = 0.05 [KS], WS 2005/2006 2-2.16
Active Queue Management Traditionally: passive queue management in routers two states: no packet drop 100% packet drop once the buffer reaches a certain value variants tail-drop drop-from-front push-out [KS], WS 2005/2006 2-2.17
Active Queue Management Problems with passive queue management a trade-off between the buffer size and QoS: larger buffers result in higher throughput, but longer delay global synchronization traffic burst fills queues so packets get lost many TCP connections enter slow start traffic drops so network becomes under utilized connections leave slow start at same time causing burst lock-out a single connection monopolises the buffer space, gives rise to fairness problems full queue queue is full for a long period of time, long queuing delay [KS], WS 2005/2006 2-2.18
Active Queue Management Active Queue Management provide preventive measures to manage a buffer to eliminate problems associated with PQM characteristics: preventive random packet drop is performed before the buffer is full the probability of preventive packet drop increases with the increasing level of congestion goals: reduce dropped packets support low-delay interactive services avoid lock-out and global synchronization [KS], WS 2005/2006 2-2.19
Active Queue Management Random early detect (RED) calculate the average queue size (exponentially weighted moving average) if average is below lower threshold: queue if average between lower and upper threshold: drop with probability if average beyond upper threshold: drop [KS], WS 2005/2006 2-2.20
Active Queue Management Calculation of drop probability fraction of the region less than average: F = avg TH TH TH max min min a first probability P b = F P max variable count gives packets since last discard drop probability: P a Pb = 1 count P b = 1/P b 1 count [KS], WS 2005/2006 2-2.21
Random Early Detection Algorithm RED Algorithm calculate the average queue size avg if avg < TH min queue packet else if TH min avg < TH max calculate probability P a with probability P a discard packet else with probability 1-P a queue packet else if avg TH max discard packet [KS], WS 2005/2006 2-2.22
Active Queue Management Performance comparison (simulation) [KS], WS 2005/2006 2-2.23
Active Queue Management RED parameters parameter choice affects performance significantly some recommendations weight for averaging w q = 0.002 P max = 0.02 Min TH = 5 packets Max TH = at least 3 Min TH selection of optimal values is an open issue [KS], WS 2005/2006 2-2.24
Policing Policing regulation of the rate at which packets are injected into the network at the source/entry of the network/internal mostly: average rate, peak rate, maximum burst size Example: without regulation a source injects bursts of size B = 1 MB link rate is R = 100 Mbps burst length is = B R 20 2 8 b = s 83.9 ms 10 b L 8 injection rate 100 Mbps arriving packets? network 83.9 ms t [KS], WS 2005/2006 2-2.25
Policing Leaky bucket actually a queue can regulate average rate can smooth out bursts Example bursts of size B = 1 MB every second drain out rate r = 10 Mbps arriving packets bucket capacity b drain out rate r departing packets burst length is = B R = 2 20 L 7 10 8 b b 839 ms injection rate 10 Mbps 1 s 2 s t [KS], WS 2005/2006 2-2.26
Policing token fill rate r Token bucket bucket holding up to b tokens arriving packets packet wait area departing? packets regulator: remove tokens and forward packet bucket is a counter tokens can represent packets or bytes (assumed here) a packet may be forwarded if there are sufficient tokens to match size if so, the packet is forwarded and the bucket drained out of the corresponding number of tokens if not: drop, queue, mark, relegate to best-effort, data sent in time T cannot exceed rt+b [KS], WS 2005/2006 2-2.27
Policing Setting token bucket parameters r regulates the long term rate, either the average rate or the peak rate but not both b regulates the amount by which the data rate can exceed the average rate for short periods of time, but how exactly? Maximum burst size R line rate (maximum forwarding rate of regulator) B maximum burst size, L maximum burst length we know: B = L R and also: B = b + L r (a full bucket + additional tokens generated during the burst) hence: L R = b + L r and L = b R r = b /R 1 r /R also: b B = 1 r /R [KS], WS 2005/2006 2-2.28
Policing Example bursts of size B = 1 MB line rate R = 100 Mbps, token generation rate r = 10 Mbps bucket capacity b = 250 KB injection rate 100 Mbps 250 KB B = = 250 KB / 0.9 277.8 KB 10 Mbps 1 100 Mbps 277.8 2 8 b L = B /R s = 22.7 ms 8 10 b 10 Example 22.7 ms 613 ms b = 500 KB, r = 8 Mbps, R = 10 Mbps t 500 KB B = = 500 KB / 0.2 = 8 Mbps 1 10 Mbps 2,500 KB [KS], WS 2005/2006 2-2.29
Policing Policing average and peak rate two token buckets in tandem: first one with a small bucket for the peak rate, second for average rate with a bucket appropriate for the bursts Example peak rate 10 Mbps, average rate 2 Mbps, max. burst size B = 10 MB r 1 = 10 Mbps, b 1 = 1 r 2 = 2 Mbps r2 2 Mbps b2 = B 1 = 10 MB 1 = 8 MB R 10 Mbps (by taking the peak rate r 1 as the line speed R) [KS], WS 2005/2006 2-2.30
Policing Token bucket variants shaper: queue for arriving packets, nonconfirming and other packets are delayed arriving packets t dropper: no queue for arriving packets, non-confirming packets are dropped marker: no queue for arriving packets, non-confirming packets are marked and can be dropped later token bucket as a leaky bucket: b = 1, queue for arriving packets departing packets t t [KS], WS 2005/2006 2-2.31
Policing Token bucket + GPS: bounded delay flows limited by token buckets r i, b i GPS scheduling with weights w i = r i delay bound: bi Di R r / similar bound exists for token bucket + WFQ i r j arriving traffic token rate, r 1 bucket size, b 1 GPS per-flow weight r i [KS], WS 2005/2006 2-2.32