Communication and Networking Routing Basicsspinlab.wpi.edu/courses/ece2305_2014/routing.pdfECE2305:...

20
ECE2305: Routing Basics Communication and Networking Routing Basics D. Richard Brown III (selected figures from Stallings Data and Computer Communications 10th edition) D. Richard Brown III 1 / 20

Transcript of Communication and Networking Routing Basicsspinlab.wpi.edu/courses/ece2305_2014/routing.pdfECE2305:...

Page 1: Communication and Networking Routing Basicsspinlab.wpi.edu/courses/ece2305_2014/routing.pdfECE2305: Routing Basics Fixed Routing Basic idea: I Each link is assigned a \cost", typically

ECE2305: Routing Basics

Communication and NetworkingRouting Basics

D. Richard Brown III

(selected figures from Stallings Data and Computer Communications 10th edition)

D. Richard Brown III 1 / 20

Page 2: Communication and Networking Routing Basicsspinlab.wpi.edu/courses/ece2305_2014/routing.pdfECE2305: Routing Basics Fixed Routing Basic idea: I Each link is assigned a \cost", typically

ECE2305: Routing Basics

Routing

I Edge nodes A,B, . . . , F generate packets/ACKs

I Network nodes 1, . . . , 7 route packets/ACKs

I Goal is to correctly/efficiently transfer packets between edge nodes

D. Richard Brown III 2 / 20

Page 3: Communication and Networking Routing Basicsspinlab.wpi.edu/courses/ece2305_2014/routing.pdfECE2305: Routing Basics Fixed Routing Basic idea: I Each link is assigned a \cost", typically

ECE2305: Routing Basics

Terminology and Notation

I Edge nodes A,B, . . . , F

I Network nodes 1, . . . , 7

I Hops: number of links between network nodesI Usually edge↔network links are not counted as hopsI A ↔ 4 is not a hopI 4 ↔ 5 is a hop

I Ni is the set of network nodes directly connected to network node iI N1 = {2, 4}I N5 = {3, 6, 4}I . . .

I Ei the set of edge nodes directly connected to network node iI E1 = {B}I E5 = ∅I E6 = {E,F}I . . .

D. Richard Brown III 3 / 20

Page 4: Communication and Networking Routing Basicsspinlab.wpi.edu/courses/ece2305_2014/routing.pdfECE2305: Routing Basics Fixed Routing Basic idea: I Each link is assigned a \cost", typically

ECE2305: Routing Basics

Elements of Routing for Packet Switched Networks

We want our routing strategy to be simple, robust, fair, efficient, . . . .These criteria must be traded off, however.

Elements of a routing strategy:

D. Richard Brown III 4 / 20

Page 5: Communication and Networking Routing Basicsspinlab.wpi.edu/courses/ece2305_2014/routing.pdfECE2305: Routing Basics Fixed Routing Basic idea: I Each link is assigned a \cost", typically

ECE2305: Routing Basics

Routing Strategies

We will discuss:

1. Flooding

2. Random routing

3. Fixed routing

4. Adaptive routing

Each has various tradeoffs among the performance criteria.

D. Richard Brown III 5 / 20

Page 6: Communication and Networking Routing Basicsspinlab.wpi.edu/courses/ece2305_2014/routing.pdfECE2305: Routing Basics Fixed Routing Basic idea: I Each link is assigned a \cost", typically

ECE2305: Routing Basics

Flooding

Basic idea:

1. Network node i receives apacket from edge/networknode j

2. Network node i checks ifdestination is in Ei

I Yes? Packet is forwardedto destination node anddone

I No? Packet is forwardedto all nodes in Ni exceptnode j (this is the nodethat sent the packet tonode i)

D. Richard Brown III 6 / 20

Page 7: Communication and Networking Routing Basicsspinlab.wpi.edu/courses/ece2305_2014/routing.pdfECE2305: Routing Basics Fixed Routing Basic idea: I Each link is assigned a \cost", typically

ECE2305: Routing Basics

Flooding Advantages and Disadvantages

Advantages:I Guaranteed minimum delay delivery!I Robust since packet travels all routesI Very simple: network nodes don’t need to know anything except Ni

and Ei

I Could be used to set up a virtual circuit (call setup)I Might be useful for broadcast messages

Problems/Disadvantages:I Packets never die

I Fix 1: Have nodes recognize and not forward duplicate packetsI Fix 2: Add maximum hop count to each packet. Each network node

decrements the maximum hop counter until it is zero (like TTL) andthen the packet is dropped

I Destination will likely receive several copies of the packetI Fix: use a unique sequence number and discard duplicates

I Very inefficient due to large amounts of redundant traffic.D. Richard Brown III 7 / 20

Page 8: Communication and Networking Routing Basicsspinlab.wpi.edu/courses/ece2305_2014/routing.pdfECE2305: Routing Basics Fixed Routing Basic idea: I Each link is assigned a \cost", typically

ECE2305: Routing Basics

Random Forwarding

Basic idea:

1. Network node i receives a packet from edge/network node j2. Network node i checks if destination is in Ei

I Yes? Packet is forwarded to destination node and doneI No? Packet is forwarded to one randomly chosen node in Ni except

node j (this is the node that sent the packet to node i)

Note that the forwarding probabilities can be non-uniform.

Advantages/Disadvantages/Problems:

1. Very simple: network nodes don’t need to know anything except Ni

and Ei

2. Potentially robust

3. Much less redundant traffic than flooding

4. Better fairness than flooding

5. Packet may take a long time to deliver

6. Packet may travel more hops than necessaryD. Richard Brown III 8 / 20

Page 9: Communication and Networking Routing Basicsspinlab.wpi.edu/courses/ece2305_2014/routing.pdfECE2305: Routing Basics Fixed Routing Basic idea: I Each link is assigned a \cost", typically

ECE2305: Routing Basics

Random Forwarding Example

I A wants to send a packet to D

I A→ 4

I 4 randomly chooses between 1, 5, and 7: 4→ 7

I 7 can only forward to 6: 7→ 6

I 6 can only forward to 5: 6→ 5

I 5 randomly chooses between 3 and 4: 5→ 4

I . . .

D. Richard Brown III 9 / 20

Page 10: Communication and Networking Routing Basicsspinlab.wpi.edu/courses/ece2305_2014/routing.pdfECE2305: Routing Basics Fixed Routing Basic idea: I Each link is assigned a \cost", typically

ECE2305: Routing Basics

Fixed Routing

Basic idea:

I Each link is assigned a “cost”, typically proportional to delay and inverselyproportional to throughput

I Prior to forwarding any packets, the network builds a table of optimum (lowestcost) routes between each pair of network nodes

I The lowest cost route may not be the same as the minimum hop route

I These routes are permanent

D. Richard Brown III 10 / 20

Page 11: Communication and Networking Routing Basicsspinlab.wpi.edu/courses/ece2305_2014/routing.pdfECE2305: Routing Basics Fixed Routing Basic idea: I Each link is assigned a \cost", typically

ECE2305: Routing Basics

Fixed Routing: Routing Table Example

D. Richard Brown III 11 / 20

Page 12: Communication and Networking Routing Basicsspinlab.wpi.edu/courses/ece2305_2014/routing.pdfECE2305: Routing Basics Fixed Routing Basic idea: I Each link is assigned a \cost", typically

ECE2305: Routing Basics

Fixed Routing: Key Concepts

I Each network node k = 1, . . . , N only keeps the relevant part of thecentral routing table in its memory. This can be thought of as a “nextnode” vector indexed by destination:

Sk =

sk,1...

sk,N

=

next node if destination is 1...

next node if destination is N

I Given a destination node, each network node knows the next node for

the minimum cost route

I Network nodes may also need to know all Ei to determine whichnetwork node is the correct destination for a given edge node

D. Richard Brown III 12 / 20

Page 13: Communication and Networking Routing Basicsspinlab.wpi.edu/courses/ece2305_2014/routing.pdfECE2305: Routing Basics Fixed Routing Basic idea: I Each link is assigned a \cost", typically

ECE2305: Routing Basics

Fixed Routing Example (Symmetric Link Costs)

I First build 7× 7 centralized routing table (on board) and E1, . . . , E7

I A wants to send a packet to D

I A→ 4 with destination address D

I 4 knows D ∈ E3, looks at routing table, and routes 4→ 1

I 1 knows D ∈ E3, looks at routing table, and routes 1→ 2

I 2 knows D ∈ E3, looks at routing table, and routes 2→ 3

I 3 knows D is a connected edge node and delivers the packetD. Richard Brown III 13 / 20

Page 14: Communication and Networking Routing Basicsspinlab.wpi.edu/courses/ece2305_2014/routing.pdfECE2305: Routing Basics Fixed Routing Basic idea: I Each link is assigned a \cost", typically

ECE2305: Routing Basics

Fixed Routing: Advantages/Disadvantages

Advantages:

I If cost=delay, then messages are delivered with minimum delay

I No redundant traffic

I Fairly simple (not as simple as flooding or random forwarding)

Disadvantages/Problems:I Establishes virtual circuits:

I less robust to network problemsI may not react to congestion

I Overhead from setting up routing tables

I How to find the minimum cost routes? (Section 19.4: Dijkstra’sAlgorithm, Bellman-Ford Algorithm)

I More knowledge needed by network nodes than flooding/randomforwarding

I Lack of flexibility

D. Richard Brown III 14 / 20

Page 15: Communication and Networking Routing Basicsspinlab.wpi.edu/courses/ece2305_2014/routing.pdfECE2305: Routing Basics Fixed Routing Basic idea: I Each link is assigned a \cost", typically

ECE2305: Routing Basics

Adaptive Routing

Basic idea:

I Routing decisions are dynamic and are based on the current networkconditions

I Routes updated when network state changes, e.g.,I Node failure detectedI New nodes added to the networkI Congestion detected

I Used in almost all packet switching networks

I Can be very complex to implement

Three classes of adaptive routing schemes:

1. Use only local information (isolated adaptive routing)2. Use information from adjacent nodes

I Distributed or centralized

3. Use information from all other nodesI Distributed or centralized

D. Richard Brown III 15 / 20

Page 16: Communication and Networking Routing Basicsspinlab.wpi.edu/courses/ece2305_2014/routing.pdfECE2305: Routing Basics Fixed Routing Basic idea: I Each link is assigned a \cost", typically

ECE2305: Routing Basics

Adaptive Routing Example: Distance Vector Routing

Used in first-generation ARPANET. Basic idea:

I N is the number of network nodes

I Like fixed routing, each node k = 1, . . . , N has a “next node” vectorindexed by destination

Sk[n] =

sk,1[n]...

sk,N [n]

=

next node if destination is 1...

next node if destination is N

I Each network node k = 1, . . . , N also has a “distance vector”

Dk[n] =

dk,1[n]...

dk,N [n]

=

least known delay to node 1...

least known delay to node N

.

I Periodically, nodes exchange distance vectors with neighbors

I Each node k = 1, . . . , N then updates its “next node” and distance vectors

D. Richard Brown III 16 / 20

Page 17: Communication and Networking Routing Basicsspinlab.wpi.edu/courses/ece2305_2014/routing.pdfECE2305: Routing Basics Fixed Routing Basic idea: I Each link is assigned a \cost", typically

ECE2305: Routing Basics

Distance Vector Routing: How to Update Sk[n] and Dk[n]

Recall Nk is the set of neighbors for network node k.

After the distance vector exchange, node k has Di[n] from all i ∈ Nk.

Node k then updates all of its least known delays and next nodes. Forj = 1, . . . N but j 6= k we compute

dk,j [n+ 1] = mini∈Nk

(dk,i[n] + di,j [n])

sk,j [n] = arg mini∈Nk

(dk,i[n] + di,j [n])

Intuition:

I dk,i[n] is the least known delay k → i where i is a neighbor of k.

I di,j [n] is the least known delay i → j.

I Node k searches through all of its neighbors (i ∈ Nk) to find the newleast known delay to each destination node j = 1, . . . , N .

D. Richard Brown III 17 / 20

Page 18: Communication and Networking Routing Basicsspinlab.wpi.edu/courses/ece2305_2014/routing.pdfECE2305: Routing Basics Fixed Routing Basic idea: I Each link is assigned a \cost", typically

ECE2305: Routing Basics

Distance Vector Routing Example (part 1 of 2)

Suppose N = 6, k = 1, and Nk = {2, 3, 4}. The current state at node k is

Sk[n] =

—23433

and Dk[n] =

00.020.050.010.060.08

After the distance vector exchange, node k receives the distance vectors

D2[n] =

0.030

0.030.020.030.05

and D3[n] =

0.070.040

0.020.010.03

and D4[n] =

0.050.020.020

0.010.03

Node k must now update its distance vector and next node vector...

D. Richard Brown III 18 / 20

Page 19: Communication and Networking Routing Basicsspinlab.wpi.edu/courses/ece2305_2014/routing.pdfECE2305: Routing Basics Fixed Routing Basic idea: I Each link is assigned a \cost", typically

ECE2305: Routing Basics

Distance Vector Routing Example (part 2 of 2)

Updating elements of the distance and next node vectors at network node k = 1:

j = 1 : skip

j = 2 : d1,2[n+ 1] = mini∈{2,3,4}

(d1,i[n] + di,2[n]) = 0.02 ⇒ s1,2[n+ 1] = 2

j = 3 : d1,3[n+ 1] = mini∈{2,3,4}

(d1,i[n] + di,3[n]) = 0.03 ⇒ s1,3[n+ 1] = 4

j = 4 : d1,4[n+ 1] = mini∈{2,3,4}

(d1,i[n] + di,4[n]) = 0.01 ⇒ s1,3[n+ 1] = 4

j = 5 : d1,5[n+ 1] = mini∈{2,3,4}

(d1,i[n] + di,5[n]) = 0.02 ⇒ s1,3[n+ 1] = 4

j = 6 : d1,6[n+ 1] = mini∈{2,3,4}

(d1,i[n] + di,6[n]) = 0.04 ⇒ s1,3[n+ 1] = 4

These values then are used to populate the vectors D1[n+ 1] and S1[n+ 1].

Note this procedure is performed at all network nodes k = 1, . . . , N .

D. Richard Brown III 19 / 20

Page 20: Communication and Networking Routing Basicsspinlab.wpi.edu/courses/ece2305_2014/routing.pdfECE2305: Routing Basics Fixed Routing Basic idea: I Each link is assigned a \cost", typically

ECE2305: Routing Basics

Final Remarks

I Four types of routing covered:1. Flooding2. Random forwarding3. Fixed routing4. Adaptive routing

I Adaptive routing is the most common method (but can be verycomplex)

I Distance vector routingI Link-state routingI ...

I Exterior/interior routing protocols used in large-scale networks, e.g.,the border gateway protocol (BGP) and open shortest path first(OSPF) (see section 19.3)

I Efficient algorithms for finding least-cost routes (see section 19.4):I Dijkstra’s algorithmI Bellman-Ford algorithm

D. Richard Brown III 20 / 20