580 likes | 604 Views
EE 122: Review for 1 st Midterm. Computer Science Division Department of Electrical Engineering and Computer Science University of California, Berkeley, Berkeley, CA 94720-1776 September 28, 2004. Outline. Performance Metrics; Router vs. Switch Layering and End-to-End Arguments
E N D
EE 122: Review for 1st Midterm Computer Science Division Department of Electrical Engineering and Computer Science University of California, Berkeley, Berkeley, CA 94720-1776 September 28, 2004
Outline • Performance Metrics; Router vs. Switch • Layering and End-to-End Arguments • Queueing Theory: Little Theorem and M/M/1 Queue • Routing: Distance Vector and Link State protocol • Router Architecture
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
T Transmission time = P/R time Propagation delay =T = Length/speed_of_light 1/speed = 3.3 nsec in free space 4 nsec in copper 5 nsec in fiber Sending One Packet R bits per second (bps) Bandwidth: R bps Propagation delay: T sec T seconds P bits
Router: Store and Forward • A packet is stored (enqueued) before being forwarded (sent) 5 Mbps 100 Mbps 10 Mbps 10 Mbps Receiver Sender time
Switch: Cut-Through • A packet starts being forwarded (sent) as soon as its header is received R2 = 10 Mbps R1 = 10 Mbps Receiver Sender Header time What happens if R2 > R1 ?
Outline • Performance Metrics; Router vs. Switch • Layering and End-to-End Arguments • Queueing Theory: Little Theorem and M/M/1 Queue • Routing: Distance Vector and Link State protocol • Router Architecture
HTTP Packet radio Layering: The Problem (cont’d) • Re-implement every application for every technology? • No! But how does the Internet architecture avoid this? FTP NFS Telnet Application Coaxial cable Fiber optic Transmission Media
HTTP Packet radio Layering: Solution • Introduce an intermediate layer that provides a single abstraction for various network technologies • New application just need to be written for intermediate layer • New transmission media just need to provide abstraction of intermediate layer SSH NFS SMTP Application Intermediate layer Coaxial cable Fiber optic Transmission Media
Layering • Layering is a particular form of modularization • System is broken into a vertical hierarchy of logically distinct entities (layers) • Service provided by one layer is based solely on the service provided by layer below • Rigid structure: easy reuse, performance suffers
ISO OSI Reference Model for Layers • Application • Presentation • Session • Transport • Network • Datalink • Physical
OSI Model Concepts • Service: what a layer does • Service interface: how to access the service • Interface for layer above • Peer interface (protocol): how peers communicate • Set of rules and formats that govern the communication between two network boxes • Protocol does not govern the implementation on a single machine, but how the layer is implemented between machines
Telnet FTP DNS TCP UDP IP Packet radio LAN Layering: Internet Universal Internet layer: • Internet has only IP at the Internet layer • Many options for modules above IP • Many options for modules below IP Application Transport Internet Net access/ Physical
Implications of Hourglass Single Internet layer module: • Allows networks to interoperate • Any network technology that supports IP can exchange packets • Allows applications to function on all networks • Applications that can run on IP can use any network • Simultaneous developments above and below IP
E2E Arguments: Where to Place Functionality? • Most influential paper about placing functionality is “End-to-End Arguments in System Design” by Saltzer, Reed, and Clark • “Sacred Text” of the Internet • Endless disputes about what it means • Everyone cites it as supporting their position
E2E Arguments: Moderate Interpretation • Think twice before implementing functionality in the network • If hosts can implement functionality correctly, implement it a lower layer only as a performance enhancement • But do so only if it does not impose burden on applications that do not require that functionality
Outline • Performance Metrics; Router vs. Switch • Layering and End-to-End Arguments • Queueing Theory: Little Theorem and M/M/1 Queue • Routing: Distance Vector and Link State protocol • Router Architecture
Little’s Theorem • Assume a system at which packets arrive at rate λ • Let d be mean delay of packet, i.e., mean time a packet spends in the system • Q: What is the mean (average) number of packets in the system (N) ? d = mean delay λ – mean arrival rate system • A: N = λ x d
Example • λ = 1 • d = 5 N = λ x d = 5 d = 5 N = 5 packets packets time 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Queueing: M/M/1 Queue • λ – mean arrival rate (1/λ – mean inter-arrival time) • µ - mean service rate (1/ µ - mean service time) • d – mean delay d = (1/µ)/(1 – u) d 1/µ u (load) 1
Queueing: More Intuition • Q: Why does the delay increases so much when u 1? • A: Because in general the arrival process is bursty not uniform
15 25 35 45 65 55 Packet size 0 5 delay Packet transmission starts Packet transmission ends Queueing: Uniform Arrival (a) λ = 0.1 packets/sec; a packet arrives every 10sec µ = 0.2 packets/sec; a packet is transmitted in 5sec (assume all packets have the same size) u = λ/µ = 0.5 red – packet arrival; blue – number of bits in the queue bits in queue d = 5 sec …. 5 time (sec) 0 10 20 30 40 50 60
Queueing: Uniform Arrival (b) λ = 0.125 packets/sec; a packet arrives every 8 sec bits in queue d = 5 sec …. 13 19 5 time (sec) 29 37 53 0 8 16 24 32 40 45 48 (c) λ = 0.2 packets/sec; a packet arrives every 5 sec bits in queue d = 5 sec …. 10 time (sec) 0 5 15 20 25 30 35 With uniform traffic delay remains constant when utilization <= 1
Queueing: Bursty Arrival During each 50sec interval: - send packets at rate 2λ in the first 25sec (busy period) - no packets during the last 25sec (idle period) Note:average arrival rate still λ (a) λ = 0.1 packets/sec; during busy period a packet arrives every 5 sec bits in queue d = 5 sec time (sec) 10 60 0 5 15 20 25 50 55 65 70 75
Queueing: Bursty Arrival (b) λ = 0.125 packets/sec (u=0.625); during busy period a packet arrives every 4 sec d = 8sec bits in queue time (sec) 8 0 4 12 16 20 24 50 5 10 15 20 25 30 35 d = ((5-0) + (10-4) + (15-8) + (20-12) + (25-16) + (30-20) + (35-24))/7 = = (5+6+7+8+9+10+11)/7 = 8
Queueing: Bursty Arrival (c) λ = 0.2 packets/sec (u = 1); during busy period a packet arrives every 2.5 sec d = 16.25sec bits in queue … time (sec) 22.5 5 0 10 2.5 7.5 5 10 15 20 25 30 35 40 45 50 d = ((5-0) + (10-2.5) + (15-5) + (20-7.5) + (25-10) + … + 50-22.5)/10 = (5+7.5+10+12.5+15+17.5+20+22.5+25+27.5)/10 = 10 With bursty traffic delay increases as utilization increases
Queueing: Uniform vs. Bursty Arrival d • With M/M/1 things get even worse as: • Busy periods get larger as load increases • Packets have different size (exponentially distributed sizes) 16.25 8 5 u (load) 0.5 0.625 1
Outline • Performance Metrics; Router vs. Switch • Layering and End-to-End Arguments • Queueing Theory: Little Theorem and M/M/1 Queue • Routing: Distance Vector and Link State protocol • Router Architecture
5 3 5 2 2 1 3 1 2 1 C D B A E F Routing Problem • Assume • A network with N nodes, where each edge is associated a cost • A node knows only its neighbors and the cost to reach them • How does each node learns how to reach every other node along the shortest path?
Routing Protocols • Compute and maintain routing tables • A node’s routing table contains the information on how to reach every other node in the network • Two routing algorithms • Distance vector • Link state
Host C Host D Host A N2 N1 N3 N5 Host B Host E N4 N6 N7 Distance Vector: Control Traffic • When the routing table of a node changes, the node sends its table to its neighbors • A node updates its table with information received from its neighbors
C D B A Example: Distance Vector Algorithm Node A Node B 3 2 1 1 7 Node C Node D 1 Initialization: 2 for all neighbors V do 3 ifV adjacent to A 4 D(A, V) = c(A,V); 5 else 6 D(A, V) = ∞; …
C D B A (D(C,A), D(C,B), D(C,D)) Example: 1st Iteration (C A) Node A Node B 3 2 1 1 7 … 7 loop: … 12 else if (update D(V, Y) received from V) 13 for all destinations Y do 14 if (destination Y through V) 15 D(A,Y) = D(A,V) + D(V, Y); 16 else 17 D(A, Y) = min(D(A, Y), D(A, V) + D(V, Y)); 18 if (there is a new minimum for dest. Y) 19 send D(A, Y) to all neighbors 20 forever Node C Node D
D(A, D) = min(D(A, D), D(A, C) + D(C,D) = min(∞ , 7 + 1) = 8 D C B A Example: 1st Iteration (C A) Node A Node B 3 2 1 1 7 … 7 loop: … 12 else if (update D(V, Y) received from V) 13 for all destinations Y do 14 if (destination Y through V) 15 D(A,Y) = D(A,V) + D(V, Y); 16 else 17 D(A, Y) = min(D(A, Y), D(A, V) + D(V, Y)); 18 if (there is a new minimum for dest. Y) 19 send D(A, Y) to all neighbors 20 forever (D(C,A), D(C,B), D(C,D)) Node C Node D
C D B A Example: 1st Iteration (C A) Node A Node B 3 2 1 1 7 … 7 loop: … 12 else if (update D(V, Y) received from V) 13 for all destinations Y do 14 if (destination Y through V) 15 D(A,Y) = D(A,V) + D(V, Y); 16 else 17 D(A, Y) = min(D(A, Y), D(A, V) + D(V, Y)); 18 if (there is a new minimum for dest. Y) 19 send D(A, Y) to all neighbors 20 forever Node C Node D
D(A,D) = min(D(A,D), D(A,B) + D(B,D)) = min(8, 2 + 3) = 5 D(A,C) = min(D(A,C), D(A,B) + D(B,C)) = min(7, 2 + 1) = 3 D C B A Example: 1st Iteration (BA, CA) Node A Node B 3 2 1 1 7 … 7 loop: … 12 else if (update D(V, Y) received from V) 13 for all destinations Y do 14 if (destination Y through V) 15 D(A,Y) = D(A,V) + D(V, Y); 16 else 17 D(A, Y) = min(D(A, Y), D(A, V) + D(V, Y)); 18 if (there is a new minimum for dest. Y) 19 send D(A, Y) to all neighbors 20 forever Node C Node D
C D B A Example: End of 1st Iteration Node A Node B 3 2 1 1 7 … 7 loop: … 12 else if (update D(V, Y) received from V) 13 for all destinations Y do 14 if (destination Y through V) 15 D(A,Y) = D(A,V) + D(V, Y); 16 else 17 D(A, Y) = min(D(A, Y), D(A, V) + D(V, Y)); 18 if (there is a new minimum for dest. Y) 19 send D(A, Y) to all neighbors 20 forever Node C Node D
C D B A Example: End of 3nd Iteration Node A Node B 3 2 1 1 7 … 7 loop: … 12 else if (update D(V, Y) received from V) 13 for all destinations Y do 14 if (destination Y through V) 15 D(A,Y) = D(A,V) + D(V, Y); 16 else 17 D(A, Y) = min(D(A, Y), D(A, V) + D(V, Y)); 18 if (there is a new minimum for dest. Y) 19 send D(A, Y) to all neighbors 20 forever Node C Node D Nothing changes algorithm terminates
Host C Host D Host A N2 N1 N3 N5 Host B Host E N4 N6 N7 Link State: Control Traffic • Each node floods its local information to every other node in the network • Each node ends up knowing the entire network topology use Dijkstra to compute the shortest path to every other node
C C C C C C C A A A A A A A D D D D D D D Host C Host D Host A B B B B B B B E E E E E E E N2 N1 N3 N5 Host B Host E N4 N6 N7 Link State: Node State
C D E A B F Example: Dijkstra’s Algorithm D(B),p(B) 2,A D(D),p(D) 1,A D(C),p(C) 5,A D(E),p(E) Step 0 1 2 3 4 5 start S A D(F),p(F) 1 Initialization: 2 S = {A}; 3 for all nodes v 4 if v adjacent to A 5 then D(v) = c(A,v); 6 else D(v) = ; … 5 3 5 2 2 1 3 1 2 1
C D E A B F Example: Dijkstra’s Algorithm D(B),p(B) 2,A D(D),p(D) 1,A D(C),p(C) 5,A 4,D D(E),p(E) 2,D Step 0 1 2 3 4 5 start S A AD D(F),p(F) • … • 8 Loop • 9 find w not in S s.t. D(w) is a minimum; • 10 add w to S; • update D(v) for all v adjacent • to w and not in S: • 12 D(v) = min( D(v), D(w) + c(w,v) ); • 13 until all nodes in S; 5 3 5 2 2 1 3 1 2 1
C D E A B F Example: Dijkstra’s Algorithm D(B),p(B) 2,A D(D),p(D) 1,A D(C),p(C) 5,A 4,D 3,E D(E),p(E) 2,D Step 0 1 2 3 4 5 start S A AD ADE D(F),p(F) 4,E • … • 8 Loop • 9 find w not in S s.t. D(w) is a minimum; • 10 add w to S; • update D(v) for all v adjacent • to w and not in S: • 12 D(v) = min( D(v), D(w) + c(w,v) ); • 13 until all nodes in S; 5 3 5 2 2 1 3 1 2 1
C D E A B F Example: Dijkstra’s Algorithm D(B),p(B) 2,A D(D),p(D) 1,A D(C),p(C) 5,A 4,D 3,E D(E),p(E) 2,D Step 0 1 2 3 4 5 start S A AD ADE ADEB D(F),p(F) 4,E • … • 8 Loop • 9 find w not in S s.t. D(w) is a minimum; • 10 add w to S; • update D(v) for all v adjacent • to w and not in S: • 12 D(v) = min( D(v), D(w) + c(w,v) ); • 13 until all nodes in S; 5 3 5 2 2 1 3 1 2 1
C D E A B F Example: Dijkstra’s Algorithm D(B),p(B) 2,A D(D),p(D) 1,A D(C),p(C) 5,A 4,D 3,E D(E),p(E) 2,D Step 0 1 2 3 4 5 start S A AD ADE ADEB ADEBC D(F),p(F) 4,E • … • 8 Loop • 9 find w not in S s.t. D(w) is a minimum; • 10 add w to S; • update D(v) for all v adjacent • to w and not in S: • 12 D(v) = min( D(v), D(w) + c(w,v) ); • 13 until all nodes in S; 5 3 5 2 2 1 3 1 2 1
C D E A B F Example: Dijkstra’s Algorithm D(B),p(B) 2,A D(D),p(D) 1,A D(C),p(C) 5,A 4,D 3,E D(E),p(E) 2,D Step 0 1 2 3 4 5 start S A AD ADE ADEB ADEBC ADEBCF D(F),p(F) 4,E • … • 8 Loop • 9 find w not in S s.t. D(w) is a minimum; • 10 add w to S; • update D(v) for all v adjacent • to w and not in S: • 12 D(v) = min( D(v), D(w) + c(w,v) ); • 13 until all nodes in S; 5 3 5 2 2 1 3 1 2 1
Distance Vector vs. Link State • Distance Vector: • Highly scalable • Can converge very slowly when cost of a link increase • Not robust • Link state: • Fast convergence • Robust • Less scalable (updates are flooded in the network)
Outline • Performance Metrics; Router vs. Switch • Layering and End-to-End Arguments • Queueing Theory: Little Theorem and M/M/1 Queue • Routing: Distance Vector and Link State protocol • Router Architecture
IP Routers • Router consists of • Set of input interfaces where packets arrive • Set of output interfaces from which packets depart • Some form of interconnect connecting inputs to outputs • Router implements • (1) Forward packet to corresponding output interface • (2) Manage bandwidth and buffer space resources Router 5 7 4 8 6 11 10 2 13 12 3 1