Performance Modeling EECS 489 Computer Networks http://www.eecs.umich.edu/~zmao/eecs489 Z. Morley Mao Tuesday Sept 14, 2004 Acknowledgement: Some slides taken from Kurose&Ross and Katz&Stoica 1
Administrivia First programming assignment will be available Thursday Due date 9/28 Late days: 5 days for everyone Discussion section time GSI Office hours: - Monday from 12:00-1:00, Wednesday 4:30-5:30, and Friday 2:00-3:00. Due dates of assignments and schedule posted 2
Outline Motivations Timing diagrams Metrics Evaluation techniques 3
Motivations Understanding network behavior Improving protocols Verifying correctness of implementation Detecting faults Monitor service level agreements Choosing providers Billing 4
Outline Motivations Timing diagrams Metrics Evaluation techniques 5
Timing Diagrams Sending one packet Queueing Switching - Store and forward - Cut-through Fluid view 6
Definitions Link bandwidth (capacity): maximum rate (in bps) at which the sender can send data along the link Propagation delay: time it takes the signal to travel from source to destination Packet transmission time: time it takes the sender to transmit all bits of the packet Queuing delay: time the packet need to wait before being transmitted because the queue was not empty when it arrived Processing Time: time it takes a router/switch to process the packet header, manage memory, etc 7
Sending One Packet Bandwidth: R bps Propagation delay: T sec R bits per second (bps) T seconds P bits Transmission time = P/R T time Propagation delay =T = Length/speed For 1Km 1/speed = 3.3 usec in free space 4 usec in copper 5 usec in fiber 8
Sending one Packet: Examples P = 1 Kbyte R = 1 Gbps 100 Km, fiber => T = 500 usec P/R = 8 usec T >> P/R T time P/R P = 1 Kbyte R = 100 Mbps 1 Km, fiber => T = 5 usec P/R = 80 usec T << P/R T P/R time 9
Queueing The queue has Q bits when packet arrives packet has to wait for the queue to drain before being transmitted P bits Q bits Capacity = R bps Propagation delay = T sec Queueing delay = Q/R P/R T time 10
Queueing Example P bits Q bits Packet arrival P = 1 Kbit; R = 1 Mbps P/R = 1 ms 0 0.5 1 7 7.5 Time (ms) Q(t) 2 Kb 1.5 Kb 1 Kb 0.5 Kb Delay for packet that arrives at at time t, t, d(t) = Q(t)/R + P/R Time packet 1, d(0) = 1ms packet 2, d(0.5) = 1.5ms packet 3, d(1) = 2ms 11
Switching: Store and Forward A packet is stored (enqueued) before being forwarded (sent) 10 Mbps 5 Mbps 100 Mbps 10 Mbps Sender Receiver time 12
Store and Forward: Multiple Packet Example 10 Mbps 5 Mbps 100 Mbps 10 Mbps Sender Receiver time 13
Switching: Cut-Through A packet starts being forwarded (sent) as soon as its header is received R1 = 10 Mbps R2 = 10 Mbps Sender Receiver Header time What happens if R2 > R1? 14
Fluid Flow System Packets are serviced bit-by-bit as they arrive Q(t) = queueing size at time t a(t) arrival rate e(t) departure rate Q(t) Rate or Queue size a(t) e(t) Q(t) t 15
Outline Motivations Timing diagrams Metrics Throughput Delay Evaluation techniques 16
Throughput Throughput of a connection or link = total number of bits successfully transmitted during some period [t, t + T) divided by T Link utilization = throughput of the link / link rate Bit rate units: 1Kbps = 10 3 bps, 1Mbps = 10 6 bps, 1 Gbps = 10 9 bps [For memory: 1 Kbyte = 2 10 bytes = 1024 bytes] - Some rates are expressed in packets per second (pps) relevant for routers/switches where the bottleneck is the header processing 17
Example: Windows Based Flow Control Connection: - Send W bits (window size) - Wait for ACKs - Repeat Assume the round-triptime is RTT seconds Throughput = W/RTT bps RTT RTT Source Destination Numerical example: - W = 64 Kbytes - RTT = 200 ms RTT - Throughput = W/T = 2.6 Mbps time 18
Throughput: Fluctuations Throughput may vary over time Throughput max mean min Time 19
Delay Delay (Latency) of bit (packet, file) from A to B - The time required for bit (packet, file) to go from A to B Jitter - Variability in delay Round-Trip Time (RTT) - Two-way delay from sender to receiver and back Bandwidth-Delay product - Product of bandwidth and delay storage capacity of network 20
Delay: Illustration 1 1 2 Latest bit seen by time t Sender Receiver at point 1 at point 2 Delay time 21
Delay: Illustration 2 1 2 Sender Receiver 1 Packet arrival times at 1 2 Delay Packet arrival times at 2 22
Little s Theorem Assume a system (e.g., a queue) at which packets arrive at rate a(t) Let d(i) be the delay of packet i, i.e., time packet i spends in the system What is the average number of packets in the system? a(t) arrival rate Intuition: d(i) = delay of packet i system Assume arrival rate is a = 1 packet per second and the delay of each packet is s = 5 seconds What is the average number of packets in the system? 23
Little s Theorem Latest bit seen by time t d(i) = delay of packet i x(t) = number of packets in transit (in the system) at time t Sender 1 2 Receiver x(t) T time What is the system occupancy, i.e., average number of packets in transit between 1 and 2? 24
Little s Theorem Latest bit seen by time t d(i) = delay of packet i x(t) = number of packets in transit (in the system) at time t Sender 1 2 Receiver S= area x(t) T time Average occupancy = S/T 25
Little s Theorem Latest bit seen by time t 1 2 d(i) = delay of packet i x(t) = number of packets in transit (in the system) at time t Sender P S(N) S(N-1) d(n-1) Receiver x(t) S= area time T S = S(1) + S(2) + + S(N) = P*(d(1) + d(2) + + d(n)) 26
Little s Theorem Latest bit seen by time t 1 2 d(i) = delay of packet i x(t) = number of packets in transit (in the system) at time t Sender P S(N) S(N-1) d(n-1) Receiver x(t) S= area time Average occupancy T S/T = (P*(d(1) + d(2) + + d(n)))/t = ((P*N)/T) * ((d(1) + d(2) + + d(n))/n) Average arrival time Average delay 27
Little s Theorem 1 2 Latest bit seen by time t d(i) = delay of packet i x(t) = number of packets in transit (in the system) at time t Sender a(i) S(N) S(N-1) d(n-1) Receiver x(t) S= area time T Average occupancy = (average arrival rate) x (average delay) 28
Little s Theorem Summary The avg number of customers in a stable system over some time interval is equal to their average arrival rate multiplied by their average time in the system Independent of detailed probability distributions Applies to any system, regardless of the arrival time process or what the "system" looks like inside. No assumptions about the schedule of service - (in order or out of order) Applies to systems within systems Requirement: the system needs to be stable - Not in transition state, e.g., starting up or shutting down 29
Outline Motivations Timing diagrams Metrics Evaluation techniques 30
Evaluation Techniques Measurements - gather data from a real network - e.g., ping www.umich.edu - realistic, specific Simulations: run a program that pretends to be a real network - e.g., NS network simulator, Nachos OS simulator Models, analysis - write some equations from which we can derive conclusions - general, may not be realistic Usually use combination of methods 31
Analysis Example: M/M/1 Queue: exponential inter-arrival and service time and a single server a s Arrivals are Poisson with rate a Service times are exponentially distributed with mean 1/s - s - rate at which packets depart from a full queue Average delay per packet: T = 1/(s a) = (1/a)/(1 u), where u = a/s = utilization Numerical example, 1/a = 1ms; u = 80% Q = 5ms 32
Simulation Model of traffic Model of routers, links Simulation: - Time driven: X(t) = state at time t X(t+1) = f(x(t), event at time t) - Event driven: E(n) = n-th event Y(n) = state after event n T(n) = time when even n occurs [Y(n+1), T(n+1)] = g(y(n), T(n), E(n)) Output analysis: estimates, confidence intervals 33
Evaluation: Putting Everything Together Reality Abstraction Plausibility Model Derivation Tractability Conclusion Prediction Realism Hypothesis Usually favor plausibility, tractability over realism - Better to have a few realistic conclusions than none (could not derive) or many conclusions that no one believes (not plausible) 34