Title: Communication Networks
1Communication Networks
Jean Walrand Department of EECS University of
California at Berkeley
2Graph Theory
- Routing
- Coloring
- QoS in Ad Hoc Neworks
- Percolations
Note Some slides from Abhay Parekh, others from
Rajarshi Gupta
3Routing
- Shortest Path Principle of Optimality
- Algorithms
- Trees
4Shortest Path
V(E) 6
E
4
10
2
V(B) 4
5
5
4
A
B
D
V(A) 9
F
V(F) 4
V(D) 0
1
10
3
C
V(C) 3
If ABCD is the shortest path from A to D, then
BCD is the shortest path from C to D
V(A) minXL(A, X) V(X) Dynamic
Programming Equation If X achieves minimum,
shortest path goes through X
5Related Idea Optimal Control
6Related Idea Optimal Control
7Algorithms
8Dijkstra
- Goal at node 1 Find the shortest paths from 1 to
all the other nodes. - Strategy at node 1 Find the shortest paths in
order of increasing path length
3
2
1
3
2
1
1
4
1
4
4
6
5
1
Dijkstra, E.W., A Note on Two Problems in
Connexion with Graphs, Numerische Mathematik,
vol. 1, pp. 269-271, 1959.
9Dijkstra (continued)
3
2
3
2
1
0
1
1
4
1
4
4
6
5
1
10Dijkstra (continued)
3
1
3
2
3
2
1
6
0
1
1
4
1
4
4
6
5
3
1
2
11Dijkstra Correctness
- Thm Label v(i) is the shortest path cost to i
- Lemma At one stage, algorithms labels nodes in a
set P. It then adds nodes to P. Labels in P are
the shortest path involving nodes in P. Then when
P V, the theorem holds - Proof of Lemma
- Suppose we have a shorter path using node in T
- Let p, q in P be two nodes in path, with t in T
in between - But if v(p) d(p, t) d(t, q) lt v(p) d(p,
q), - then we would have picked t before q
(Contradiction)
12Bellman-Ford
- Update when receive estimates
- D(i,d) minjeN(i) c(i,j) D(j,d)
3 gets updates from 2 and 5
D(3,1) minc(3,2) D(2,1), c(3,5) D(5,1)
min 3 1 , 1
8 4
13Bellman-Ford
- Focus on destination 1
- Here are the values of D(i,1)
? step
14Counting to Infinity
All links cost 1
A
B
C
3
4
0
A
B
C
5
6
0
Ping-Pong to Eternity
15Bad News Travels Slowly
1
4
3
1
1
1
2
M
1
D(2,1)2, D(3,1)1, D(4,1)2
16Bad News Travels Slowly
1
4
3
1
Node 2 takes about M Iterations to figure out
that D(2,1)M
1
1
2
M
1
- Fundamental Cause After a network change, think
of the network - protocol running from time 0. The initial
conditions are arbitrary - Tricks exist to get around these problems but not
fool proof
17Asynchronous Bellman Ford
- In general, nodes are using different and
possibly inconsistent estimates - If no link changes after some time t, the
algorithm will eventually converge to the
shortest path - No synchronization required at all
18Oscillations
- Link costs must reflect link speed AND congestion
- Under both LSP and DV routing occurs over a tree
- The costs of the links of this tree will increase
- The other links will not be congested
- Their costs will drop
- Routing protocol will shift traffic and create a
new tree - This process of shifting and reshifting can be
severe - Way out Change congestion costs slowly
(exponential averaging) Route dampening
19Oscillations - Example
Heavy Load ? High Delay
2
5
5
4
1
Traffic
3
1
1
Light Load ? Low Delay
20Link State vs. Distance VectorNo clear winner
- LS is robust since it each node computes its own
routes independently - Suffers from the weaknesses of the topology
update protocol. Inconsistency etc. - Excellent choice for a well engineered network
within one administrative domain - E. g. OSPF
- DV works well when the network is large since it
requires no synchronization and has a trivial
topology update algorithm - Suffers from convergence delays
- Very simple to implement at each node
- Excellent choice for large networks
- E.g. RIP
21Trees
? Root
22Useful Trees
- Types of Trees
- Binary Tree
- Each non-leaf node has exactly 2 children
- Ternary Tree
- Height Balanced Tree
- Root chosen s.t. height is minimized
- Bipartite Graphs
- Induced Trees
- Formed by choosing a subset of V,E from G
- Rooted Tree
- Rooted at particular node
- Spanning Tree
- Covers every node
- Subset Spanning Tree
- Covers every node in a chosen subset
23Trees in Networks
- Broadcast Tree
- Search Trees
- BFS
- DFS
- Spanning Tree Protocol (STP) in Bridged Networks
(e.g. Ethernet) - Multicast Tree
- And many, many other places
24Trees and Ethernet
- Tree Feature
- Connected
- No cycles
- Removing any edge makes it disconnected
- Adding any edge forms a cycle
- Every pair of nodes has unique path
- Ethernet Behavior
- Need all LANs to talk
- Loops cause broadcast storms
- Any bridge/port failure needs recomputation
- Need to disable all redundant ports
- Guarantees path with STP
25Concrete Example
- Weight balanced Spanning Tree (WBST)
- Each edge has cost
- e.g. 10/100/1000 Mbps
- Choose spanning tree that has min difference
between min and max edge cost - Want to minimize buffering requirements as
packets move through the network. Also control
jitter. - Complexity
26Recall Spanning Tree Algos
- Kruskals Greedy Algorithm to compute Spanning
Tree - 1. Order the edges in term of weight
- 2. Add lowest cost edge (provided no loops)
- 3. Check if all vertices are connected
- 4. If not, return to step 2
- Any search (BFS/DFS) can check for connectedness
- BFS/DFS may be performed in O(m)
27WBST Algorithm
- Sort edges in increasing order of weight
c1ltc2ltltcm - Initialize diff cm-c1, low 1, high 1
- Take Glow,high G (V, ci low?i?high)
- if Glow,high is connected
- if diff gt (chigh clow)
- diff chigh clow
- Remember low, high
- low low 1
- repeat
- else
- high high 1
- repeat
28WBST Correctness
- Spanning Tree exists
- By checking Glow,high is connected gt spanning
tree must exist - Do this using DFS. Also finds the WBST
- Why balanced
- Keep adding low cost edges till graph connected
- Then try to discard as many low cost edges
- Move both low and high pointers to consider
other ranges - Remember best diff
29WBST Complexity
- In each iteration, we either increment low, or
increment high - So max number of iterations 2m
- Each iteration needs to check connectedness DFS
O(m) - So entire algo is O(m2)
- Think How would we make this algorithm
distributed
30Multicast Trees
- Application Want to send packets from a source
(e.g. internet radio station) to many hosts - Sending n copies of the stream is wasteful
- Solution Form tree rooted at source that spans
all member nodes
31Distributed Algorithm
- Need to know address of group
- First Join
- First member sends route request
- Request will be forwarded all the way to source
- Confirmation flows back to member
- All routers in path will add entry (mc_addr
port) - Subsequent Join
- New member send route request
- Request forwarded to router that has mc_addr
entry - Send confirmation from this point on
- Augment route entry (mc_addr port1, port2)
- Think Optimal multicast tree
32Multicast Algorithm (contd)
- Leave/Pruning
- Node leaving sends leave message to router
- Router removes port from route entry
- If last port entry deleted, send prune message to
parent - Multi-source multicast tree
- Less optimal packets between two branches travel
long distance - But need to minimize state in routers
33Coloring History
- Map coloring Color all countries on a map using
fewest colors - Model Each country is a node, edge if share
boundary - This forms a planar graph (edges dont intersect)
344 5 Color Theorems
- Five color theorem Every planar graph is
5-colorable - Heawood, 1890
- Four Color Theorem Every planar graph is
4-colorable - Conjectured for many years (since 1890)
- Proved by Appel and Haken (1977)
- Can do no better than 4 colors
- K4 (complete graph in 4 vertices) is planar
35Independent Sets (IS)
- Set of nodes that do not have an edge between
them - Set of nodes that can have the same color
- Maximal IS not contained in any other IS
- Result Number of maximal IS in a graph is
exponential
- Graph coloring algorithms find IS
- Finding the chromatic number of a graph is
NP-hard - Many approximations exist
36Approximate Coloring
- Greedy Algorithm
- Order nodes by degree
- Add first node to IS
- Discard all neighbors into a Future bin
- Repeat till set empty
- Start with future bin
- Correctness
- Are the sets generated independent ?
- Are they maximal ?
- Complexity
- Each iteration adds one node, so O(m)
- Discarding neighbors O(n)
- Total O(mn)
- Follow up How far is this from optimal coloring
- Arbitrary or Bounded
- Many approx algos give coloring within 4X, 6X of
optimal
37Cliques
- Definitions
- Clique Complete Subgraph
- Maximal Clique Clique not a subset of any other
- Clique Number ? size of largest clique
? 4
- Observe
- Each node in a clique needs a different color
- So ? ? ?
- Clique is complement of IS
Maximal Cliques ABC, BCEF, CDF
38Perfect Graphs
- A graph is said to be perfect when its
- Chromatic Number ?
- Clique Number ?
- Are equal
- For all induced subgraphs
- Strong Perfect Graph Theorem
- Chudnovsky, Robertson, Seymour, Thomas (2002)
- A graph is perfect if and only if it has no odd
holes or odd anti-holes - Odd-hole is a odd cycle with no chord
- Odd anti-hole is complement of odd-hole