Compact Routing
Message Routing Scheme
Application Layer
Routing Layer
Send(m, dest)
Deliver(m)
Neighbor i Neighbor x Neighbor w Neighbor z Neighbor y
1 2 3 δ-1 δ
The Remaining Network
Routing Function
R: ∀ (u,v) ∈ V2
∃ (x0, x1, ..., xk), ∃ (h0, h1, ..., hk), ∃ (p0, p1, ..., pk), ∃ (q0, q1, ..., qk), s.t. ∀ i ∈ {0,1,...,k}
• (xi,xi+1) ∈ E,
• R(xi,hi,qi) = (hi+1,pi),
• pi = port#(xi → xi+1) on xi,
• qi+1 = port#(xi ← xi+1) on xi+1,
• x0 = u, xk = h0 = v, and q0 = pk = 0 (i.e., toward application layer).
x0 h1
︎
x1p0 p1
appli
︎
vq1 h2
︎
xiqi pi
︎
hi+1xi+1
qi+1 pi+1 xk
︎
hiu v
appli
pk
q0
qk
Routing Function
R: ∀ (u,v) ∈ V2
∃ (x0, x1, ..., xk), ∃ (h0, h1, ..., hk), ∃ (p0, p1, ..., pk), ∃ (q0, q1, ..., qk), s.t. ∀ i ∈ {0,1,...,k-1}
• (xi,xi+1) ∈ E,
• R(xi,hi,qi) = (hi+1,pi),
• pi = port#(xi → xi+1) on xi,
• qi+1 = port#(xi ← xi+1) on xi+1,
• x0 = u, xk = h0 = v, and q0 = pk = 0 (i.e., toward application layer).
R is simple if for every node x, header h, and port q, there exists a port function P s.t. R(x,h,q) = (h, P(x,h)).
input port sender
receiver ID output port
i.e., R does not depend of the input port (q) and does not change the header (h).
Simple Routing Function
The Shortest Path Routing
2
13 34 22
15
52
10 7
9 6 74
47 28
50
3 68 85 30
a b c
ed
2 d
3 a
6 d
7 0
9 b
10 e 13 d 15 e 22 d 28 d 30 b 34 d 47 d 50 d 52 c 68 d 74 d 85 b
Process 7
R(7,28,0) = (28, )
port of application on Process 7 sender
receiver ID
output port appli
︎
28P(7,28) = d
N · ( d log
2N e + d log
2e ) + O(1) bits O(N log N ) bits
Simple Routing Function
The Shortest Path Routing
• PROS
-
Shortest Path-
Computing time depends on the size of the routing table-
Well-known-
Easy to implement• CONS
Efficiency
•
Shortest Path•
Minimize the resources (Memory)•
Minimize/Maximize the number of routes•
Minimize the number of messages (overhead)•
Fast computing•
No deadlock•
Universality (Works on any graph topology)•
Minimize the header changes (0 → simple)•
Fault-tolerant•
Adaptatives ...Efficiency
•
Let R a routing function•
Let dG(u,v) be the length of the shortest path between u and v.•
Let dR(u,v) be the length of the path induced by R between u and v, (i.e., dR(u,v) = |x0, x1, ..., xk|).•
The stretch of a routing function R over a graph G is equal to :8u,v
max
2V2d
R(u, v)
d
G(u, v)
Two Extreme Cases
•
Flooding-
No routing table: O(log n) bits (header)-
Computation time: O(1)-
O(M) (copies of) messages-
Unbounded stretch•
Shortest Path Routing-
Bit routing table: O(N log N) bits-
Optimal stretch, equal to1Issue
Memory vs. Stretch
How reducing the memory size with the
best stretch as possible?
Compact Routing
• Implicit Routing
• Interval Routing
• Prefix Routing
Implicit Routing
• Ring
• Acyclic (Tree)
• Star
• Complete Networks
• Grid
• Torus
• Hypercube
...
Topological Awareness
Example
Δ = 2
Not sufficient in general...
?
?
• Routes using «appropriate» edge labels that provide to the sender a «direction» to receiver
Sense of Direction
• (Informal) Definition:
A triple (G,λ,β) is a Sense of Direction (SoD) iff the following conditions hold:
-
λ is a local orientation,-
there exists a consistent coding function f-
there exists a consistent decoding function f-1 for f.← each edge labels is different
← global consistency
SoD in Rings
left
left
left
left left
left left left
right
right
right
right right
right right
right
← local orientationglobal consistency
SoD in Rings
left
left
left
left left
left left left
right
right
right
right right
right right
right
if dest = myself then deliver m;
else send m to left;
•
Strech = n-1•
Space = 0 bit (optimal)•
#message : optimalSoD in Rings
7
4 6
3 1 0
2
5
left
left
left
left left
left left left
right
right
right
right right
right right
right if dest = myself
then deliver m;
else if (dest - myself) % n >⎣n/2⎦ then send to right;
else send to left;
•
Strech = 1(optimal)
•
Space = log n bits•
#message : optimalSoD in Trees
parent
r
lr = 0u
lu
T
uv
lv = lu +|Tu| 1parent
w
parent•
Interval routing (cf. waveapplications)
•
Hierarchical & Prefix Routing (cf. next chapter)•
Strech = 1(optimal)•
Space = (Δ+1) * log n bits•
#message : optimalSoD in (Hyper)Lattice
North
South
West Est
W N S
E W
S E
W N S
E
W N S
E
W N S
E
W N S
E
W NE N
S E S
E
N S E
N S E
N S E
N S E
NE
W N S
E W
S E
W N S
E
W N S
E
W N S
E
W N S
E
W NE W N
S E W
S E
W N S
E
W N S
E
W N S
E
W N S
E
W NE W N
S E W
S E
W N S
E
W N S
E
W N S
E
W N S
E
W NE W N
S E W
S E
W N S
E
W N S
E
W N S
E
W N S
E
W NE W N
S W
S
W N S W N
S W N
S W N
S W N
00 01 02 03 04 05 06
10 11 12 13 14 15 16
20 21 22 23 24 25 26
60 61 62 63 64 65 66
if dest[1] = myself[1]
then if dest[2] = myself[2]
then deliver m;
else if dest[2] < myself[2]
then send m to W;
else send m to E;
else if dest[1] < myself[1]
then send m to N;
else send m to S;
•
Strech = 1(optimal)•
Space = 2log (√n) + 4*2 bits [O(log n) bits]SoD in Torus
North
South
West Est
W N S
E W N
S E
W N S
E
W N S
E
W N S
E
W N S
E
W N S
E W N
S E W N
S E
W N S
E
W N S
E
W N S
E
W N S
E
W N S
E
W N S
E W N
S E
W N S
E
W N S
E
W N S
E
W N S
E
W N S
E W N
S E W N
S E
W N S
E
W N S
E
W N S
E
W N S
E
W N S
E W N
S E W N
S E
W N S
E
W N S
E
W N S
E
W N S
E
W N S
E W N
S E W N
S E
W N S
E
W N S
E
W N S
E
W N S
E
W N S
E W N
S E W N
S E
W N S
E
W N S
E
W N S
E
W N S
E
W N S
E
•
Strech = 1(optimal)•
Space = 2log (√n) + 4*2 bits [O(log n) bits]SoD in Hypercubes
0 2
3 1
tmp = dest xor myself;
if tmp = 0 then deliver m;
else dim = a position of a ‘1’ in tmp;
send m to dim;
•
Strech = 1(optimal)•
Space = dim + dim. log dim bits [O(log n) with n = 2dim]0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
0 0
0 0
0 0
0 0
1 1
1 1
1 1
1 1
2
2
2
2
2
2
2
2 3
3 3
3 3
3 3
3
Interval Routing
• Space : Δ * (log n + log Δ) bits
→ [Version with (Δ+1) * log n bits]
→ Dijkstra based algorithm : Δ * n * log n
• Traffic concentrated on the tree → Congestion and unreliability (disconnected components)
Tree-labeling Scheme
• Space : Δ * (log n + log Δ) bits
→ [Version with (Δ+1) * log n bits]
→ Dijkstra based algorithm : Δ * n * log n
• Traffic concentrated on the tree → Congestion and unreliability (disconnected components)
• Any spanning tree → MST or BFST
• No bound on the ratio between D
Gand D
T(D:
Diameter)
Tree-labeling Scheme
D G vs. D T
The tree can always be chosen s.t. ∀u,v, d(u,v) ≤ 2D
G• (General) Interval Labeling Scheme (ILS)
• Extension to non-tree networks
• Uses the same routing algorithm as for tree networks (cf. wave applications)
General Interval Routing
• Build a DFST (cf. waves)
• Preorder (re)labeling (cf. wave applications)
• Port renaming:
DFS ILS
↵uv =
⇢ lv if v =P arent) (lu+|Tu|) =N)^(9w2Lu : Lw = 0) (i)
(lu+|Tu|)%N otherwise (ii)
0
17 1 10
8
2
9 6
3 12 13
16 11
14
15 7
5 4
r
DFS ILS
1 12
10 17 2
6
6
3 6 2 10
6 10
8 10
6 6
5 10
8
10 9 10
1 7 1
4
9 10
0 0 10
10
10 10
13 17 15
16 11
0
12 16 13 12 13 16
16
18 16 16
15
17
•
Strech = 1•
Space = Δ log (n) + log (n) bits [O(Δ log n bits]Prefix Routing
Definition
•
Let Σ be an alphabet. Σ* is the set of string over Σ. ε is the empty word.•
Each port channel is labelled with a string so so that each label is a prefix of the destination address.•
The port labelled with the longest prefix of the destination address is chosen.Exemple : The ports of a node are labelled with aabb, abba, aab, aabc, and aa. The destination is aabbc.
aabb, aab, and aa are prefix of the destination label. The message is forwarded thru the longest prefix, i.e., aabb.
Similarities
•
Sense of direction in some regular graphs.0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
0 0
0 0
0 0
0 0
1 1
1 1
1 1
1 1
2
2
2
2
2
2
2
2 3
3 3
3 3
3 3
3
•
Hierarchical routing (can be based on clustering)↵uv =
⇢ lv if v = P arent ) (9w 2 Lu : Lw = 0) (i)
✏ otherwise (ii)
Prefix Forwarding
• Build a (rooted) spanning tree T of G (cf.
waves)
• Transform T into a Prefix Labeling Scheme Tree (PLS-Tree) over G as follows:
1. The root of T is labelled with ε.
2. ∀ u, ∀ v1,...,vk, v
ibeing a child of u in T, then l
vi= l
ua
isuch that ∀ i,j ∈[1..k], a
i≠ a
j. 3. Port renaming:
↵uv =
⇢ lv if v = P arent ) (9w 2 Lu : Lw = 0) (i)
✏ otherwise (ii)
PLS Tree
ε
bba a b
abaaa
aa
abaaaa
aba
baa
ab bab
bb ba
baba
babaa
abaa abba
abb
r
a
b bba aa
aba
aba
ab aba aa
ε aba
abaaa ε
ε
abba ε
abaaa
ε abaaa
ε 7
abb
abaaaaε
ε ba
b
ε ε
bb bba ε ε
a
baa if dest = myself
then deliver m;
else α = the longest prefix port label w.r.t. dest;
send m to α;
PLS Tree
ε
bba
b a
abaaa
aa
abaaaa
aba
baa
ab bab
bb ba
baba
babaa
abaa abba
abb
r
a
b bba aa
aba
aba
ab aba aa
ε aba
abaaa ε
ε
abba ε
abaaa
ε abaaa
ε 7
abb
abaaaaε
ε ba
b
ε ε
bb bba ε ε
a
baa if dest = myself
then deliver m;
else α = the longest prefix port label w.r.t. dest;
send m to α;
•
Strech = 1•
Space = Δ . hT . log maxΔ bits[O(Δ.D) bits in the best case, O(Δ.n) bits in the worst case]