1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on...

44
1 Forwarding vs. Routing Forwarding vs Routing – forwarding: • To select an output port based on destination address and routing table – routing: • Process by which routing table is built • Based on graph algorithms

description

3 Graph Abstraction Graph abstraction for routing algorithms: Graph nodes are routers Graph edges are physical links –link cost Delay $ cost, or Congestion level

Transcript of 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on...

Page 1: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

1

Forwarding vs. Routing

• Forwarding vs Routing– forwarding:

• To select an output port based on destination address and routing table

– routing: • Process by which routing table is built• Based on graph algorithms

Page 2: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

2

Goal• Determine “good” path (sequence of routers) thru network

from source to destination• “good” path:

– typically means minimum cost path– other definitions possible (available path)

Page 3: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

3

Graph Abstraction

Graph abstraction for routing algorithms:

• Graph nodes are routers• Graph edges are physical links

– link cost• Delay• $ cost, or • Congestion level

4

36

21

9

1

1D

A

FE

B

C

Page 4: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

4

Factors

• Factors– Static factor

• Topology (does not change frequently)– Dynamic

• load (link cost): changes with network traffic

Page 5: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

5

Next-Hop Forwarding• Performed by router• Uses table of routes• Tables gives next hop

R1 R2 R3

Interface 1 Interface 2

A

B

E

C

DF

Table for Router R2Destination Next HopA interface 1B interface 1C interface 2D interface 2E computer EF computer F

Page 6: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

6

Source of Routing Table Information• Manual

– Table created by hand– Useful in small networks– Useful if routes never change

• Automatic routing– Software creates/updates routing table– Needed in large networks– Changes routes when failure occurs

Page 7: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

7

Relationship of Routing To Graph Theory

1 2

3 4

Table for Node 1: Table for Node 2: Table for Node 3: Table for Node 4:

Dest NextHop Dest NextHop Dest NextHop Dest NextHop

1 - 1 (2, 3) 1 (3, 1) 1 (4, 3)

2 (1, 3) 2 - 2 (3, 2) 2 (4, 2)

3 (1, 3) 3 (2, 3) 3 - 3 (4, 3)

4 (1, 3) 4 (2, 4) 4 (3, 4) 4 -

•Node models router

•Edge model connection

Page 8: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

8

Shortest Path Computation Algorithms from graph theory No central authority (distributed computation) A router (automatic routing)

- Must learn route to each destination- Only communicates with directly attached neighbors

Page 9: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

9

Algorithms For Computing Shortest Paths

• Distance - sum of weights along the path to the destination

Two Algorithms: Distance Vector (DV)

- Routers exchange information in their routing tables Link-state

- Routers exchange link status information Both used in practice

Page 10: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

10

Overview of Distance Vector Algorithm

Periodic, two-way exchange between neighbors During exchange, router sends

- List of pairs- Each pair gives (destination, distance)

Receiver- Compares each item in list to local routes- Changes routes if better path exists

Page 11: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

11

Distance Vector Intuition• Let

- N be neighbor that sent the routing message- V be destination in a pair- D be distance in a pair- C be D plus the cost to reach the sender

If no local route to V or local route has cost > C– install a route with next hop N and cost C

Else ignore pair

Page 12: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

12

Example of Distance Vector Routing

• Consider transmission of one DV message• Node 2 sends to 3, 5, and 6• Node 6 installs cost 8 to route to 2• Later 3 sends update to 6• 6 changes route to make 3 the next hop for destination 2

1

5

2

6

3

7

49

68

3

2

11

5

3

Page 13: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

13

More Detail on Distance Vector • Each node maintains a set of triples

– (Destination, Cost, NextHop)• Exchange updates directly connected neighbors

– periodically (on the order of several seconds)– whenever table changes (called triggered update)

• Each update is a list of pairs:– (Destination, Cost)

• Update local table if receive a “better” route– smaller cost– came from next-hop

• Refresh existing routes; delete if they time out

Page 14: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

14

Example

Destination Cost NextHop A 1 A C 1 C D 2 C E 2 A F 2 A G 3 A

D

G

A

F

E

B

C

• Cost = HopCount

Final Routing Table for B

Page 15: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

15

Distance Vector AlgorithmGiven:

a local routing table, a weight for each link that connects to another router, and an incoming routing messageCompute:

an updated routing tableMethod:

Maintain a distance field in each routing table entry;Initialize routing table with a single entry that has the destination equal to the local router, the next-hop unused, and the distance to zero;Repeat forever { wait for the next routing message to arrive over the network from a neighbor; Let N be the sending router; for each entry in the message {Let V be the destination in the entry and let D be the distance;Compute C as D plus the weight assigned to the link over which the message arrived;Examine and update the local routing table:if (no route exists to V) add an entry to the local routing table for destination V with next-hop N and distance C;else if (a route exists that has next-hop N) replace the distance in existing route with C; else if (a route exists with distance greater than C) change the next-hop to N and distance to C;}

Page 16: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

16

Routing Loop Example that terminates (DV)

• Suppose, F detects that link to G has failed• F sets distance to G to infinity and sends update to A• A sets distance to G to infinity since it uses F to reach G• A receives periodic update from C with 2-hop path to G• A sets distance to G to 3 and sends update to F• F decides it can reach G in 4 hops via ANote that the system becomes stable at end

D

G

A

F

E

B

C

Page 17: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

17

Routing Loop Example

• Suppose, link from A to E fails• A advertises distance of infinity to E, but B and C advertise a distance of 2 to E • Depending on the exact timing of events, the following might happen:

– Upon hearing that E can be reached in 2 hops from C, B decides it can reach E in 3 hops; advertises this to A

– A decides it can reach E in 4 hops; advertises this to C– C decides that it can reach E in 5 hops; and so on.– This cycle stops when the distances to E reach a very large number considered as

infinity• Known as count-to-infinity problem

D

G

A

F

E

B

C

Page 18: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

18

Loop-Breaking Heuristics• Solution 1

– Use a small number as an approximation of infinity (Example: Set infinity to 16)– Will limit the time to count to infinity

• Solution 2– When a node sends a routing update to its neighbors, it does not send those routes

it learned from each neighbor back to that neighbor– Example: If B has the route (E, 2, A) in its table, then it knows it must have

learned this route from A, and so whenever B sends a routing update to A, it does not include the route (E, 2) in that update

– Known as split horizon

• Solution 3– Split horizon with poison reverse (stronger variation of split horizon)– Example: B actually sends that route back to A, but it puts negative information

in the route to ensure that A will not eventually use B to get to E.

• Last two solutions only work for routing loops that involve two nodes

Page 19: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

19

RIP: Routing Information Protocol• Uses straightforward implementation of distance-vector

routing algorithm• It supports multiple address families• Most widely used routing protocols in IP networks• Distributed with BSD version of Unix• A router running RIP:

– sends its advertisement every 30 seconds– sends an update message whenever an update from another router

causes it to change its routing table

• Usage limited to small networks - those with no paths longer than 15 hops

Page 20: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

20

Link-State Routing (LS Routing) Overcomes instabilities in DV Pairs of routers periodically:

- Test link between them- Broadcast link status message i.e., send to all nodes (not just

neighbors) information about directly connected links (not entire routing table); Also known as flooding

Router- Receives status messages on links- Computes new routes

• Uses Dijkstra's algorithm

Page 21: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

21

Example of Link-State Information

• Assume nodes 2 and 3– Test link between 2 and 3– Broadcast information

• Each node– Receives information– Re-computes routes as needed

1

5

2

6

3

7

49

68

3

2

11

5

3

Page 22: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

22

Link State Packet (LSP)

• Link State Packet (LSP)– id of the node that created the LSP– cost of link to each directly connected neighbor– sequence number (SEQNO)– time-to-live (TTL) for this packet

Page 23: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

23

Reliable flooding• Store most recent LSP from each node

– A smaller sequence number would imply an older LSP and would be discarded

• Forward LSP to all nodes but one that sent it– It helps to bring an end to the flooding of an LSP

• Generate new LSP periodically– increment SEQNO

• Start SEQNO at 0 when reboot• Decrement TTL of each stored LSP

– discard when TTL=0• Transmission of LSPs is made reliable using acks and

retransmissions just as in the link-layer protocol

Page 24: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

24

Dijkstra's Shortest Path Algorithm

• Input- Graph with weighted edges- Node, n

Output- Set of shortest paths from n to each node- Cost of each path

Called Shortest Path First (SPF) algorithm

Page 25: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

25

Algorithm Intuition

• Start with self as source node Move outward At each step

- Find node u such that it Has not been considered Is "closest" to source

- Compute Distance from u to each neighbor v If distance shorter, make path from u go through v

Page 26: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

26

Result of Dijkstra’s Algorithm

• Example routes from node 6– To 3, next hop = 3, cost = 2– To 2, next hop = 3, cost = 5– To 5, next hop = 3, cost = 11– To 4, next hop = 7, cost = 8

1

5

2

6

3

7

49

68

3

2

11

5

3

Page 27: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

27

Dijkstra’s AlgorithmGiven: a graph with a nonnegative weight assigned to each edge and a designated source nodeCompute: the shortest distance from the source node to each other node and a next-hop routing table

Method:Initialize set S to contain all nodes except the source node:Initialize array D so that D[v] is the weight of the edge from the source to v if such an edge exists, and infinity otherwise;Initialize entries of R so that R[v] is assigned v if an edge exists from the source to v, and zero otherwise;while (set S is not empty) { choose a node u from S such that D[u] is minimum; if (D[u] is infinity) { no path exists to nodes in S; quit; }

delete u from set S; for each node v such that (u,v) is an edge {

if (v is still in S) { c = D[u] + weight(u,v); if (c < D[v]) { R[v] = u; D[v] = c; }

} } }

Page 28: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

28

OSPF: Open Shortest Path First Protocol• Most widely used link-state routing protocol• “Open” refers to nonproprietary standard introduced by IETF• Additional features over basic link-state algorithm

– Authentication of routing messages• Uses a simple 8-byte password for authentication• Can deter malicious users and prevent problems due to

misconfiguration – Additional hierarchy

• Allows a domain to be partitioned into areas so that a router within a domain does not necessarily need to know how to reach every network. Only it needs to know to get to the right area

– Load balancing• OSPF allows multiple routes to the same place to be assigned the

same cost and will cause traffic to be distributed evenly over those routes.

Page 29: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

29

Hierarchical OSPF

Page 30: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

30

Hierarchical OSPF

• Two-level hierarchy: local area and backbone.• Link-state advertisements do not leave respective areas.• Nodes in each area have detailed area topology; they only

know direction (shortest path) to networks in other areas.• Area Border routers “summarize” distances to networks in

the area and advertise them to other Area Border routers.• Backbone routers run an OSPF routing algorithm limited to

the backbone.• Boundary routers connect to other ASs (autonomous

systems).

Page 31: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

31

Routing for Mobile Hosts• A router called home agent running on home network of the mobile host works

as a proxy– Receives and forwards packets for the mobile host

• All agents periodically announces their presence (broadcast)• When mobile host leaves its home network

– it registers with foreign agent in foreign network and provides the address of its home agent to foreign agent

– foreign agent communicates with home agent for all packet delivery to mobile host

Internetwork

Foreign agent(12.0.0.6)

Mobile host(10.0.0.9)

Home agent(10.0.0.3)

Home network(network 10)

Sending host

Page 32: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

32

Page 33: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

33

How to Make Routing Scale

• Flat versus Hierarchical Addresses• Inefficient use of Hierarchical Address Space

– A network with two hosts needs two class C addresses (2/255 = 0.78% efficient)

– A network with 256 hosts needs 256 class B addresses (256/65535 = 0.39% efficient)

• Still Too Many Networks– routing tables do not scale– route propagation protocols do not scale

• Solution:– Classless Interdomain Routing (CIDR)

Page 34: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

34

CIDR

• IP classes disappear at least for inter-domain routing purpose

• A scalable solution for routing• Network numbers are <length, value> pairs

– length represents number of bits in network prefix– value is an actual IP address

• Slash notation is used instead of mask– a.b.c.d/n (Ex; 165.95.11.101/28)

• Also called supernetting

Page 35: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

35

Routing in the Internet

• The Global Internet consists of Autonomous Systems (AS) interconnected with each other

• Types of AS– Stub AS: small corporation (only carry local traffic)– Multihomed AS: large corporation (no transit)– Transit AS: provider (carry both transit and local traffic)

• Two-level routing: – Intra-AS: administrator is responsible for choice– Inter-AS: unique standard

Page 36: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

36

Internet AS Hierarchy

Page 37: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

37

Internet StructureRecent Past (Tree structure in 1990)

NSFNET backboneStanford

BARRNETregional

BerkeleyPARC

NCAR

UA

UNM

Westnetregional

UNL KU

ISU

MidNetregional…

Page 38: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

38

Internet StructureToday’s Multibackbone Internet

Backbone service provider

Peeringpoint

Peeringpoint

Large corporation

Large corporation

Smallcorporation

“Consumer ” ISP

“Consumer” ISP

“ Consumer” ISP

Page 39: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

39

Route Propagation• Know a smarter router

– hosts know local router– local routers know site routers– site routers know core router– core routers know everything

• Autonomous System (AS)– corresponds to an administrative domain– examples: University, company, backbone network– assign each AS a 16-bit number

• Two-level route propagation hierarchy– interior gateway protocol (each AS selects its own) for intradomain

routing – exterior gateway protocol (Internet-wide standard) for interdomain

routing

Page 40: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

40

Popular Interior Gateway Protocols• RIP: Route Information Protocol

– developed for XNS– distributed with Unix– distance-vector algorithm– based on hop-count

• OSPF: Open Shortest Path First– recent Internet standard– uses link-state algorithm– supports load balancing – supports authentication

• IGRP: Interior Gateway Routing Protocol (Cisco propr.)– Similar to RIP

Page 41: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

41

EGP: Exterior Gateway Protocol• Overview

– designed for tree-structured Internet– concerned with reachability, not optimal routes

• Protocol messages– neighbor acquisition: one router requests that another be

its peer; peers exchange reachability information– neighbor reachability:

• one router periodically tests if the another is still reachable; exchange HELLO/ACK messages;

– routing updates: • peers periodically exchange their routing tables (distance-vector)

Page 42: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

42

BGP-4: Border Gateway Protocol• AS Types

– stub AS: has a single connection to one other AS• carries local traffic only

– multihomed AS: has connections to more than one AS• refuses to carry transit traffic

– transit AS: has connections to more than one AS• carries both transit and local traffic

• Each AS has:– one or more border routers– one BGP speaker that advertises:

• local networks• other reachable networks (transit AS only)• gives path information

Page 43: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

43

BGP Example• Speaker for AS2 advertises reachability to P and Q

– network 128.96, 192.4.153, 192.4.32, and 192.4.3, can be reached directly from AS2

• Speaker for backbone advertises– networks 128.96, 192.4.153, 192.4.32, and 192.4.3 can be reached along

the path (AS1, AS2).• Speaker can cancel previously advertised paths

Backbone network(AS 1)

Regional provider A(AS 2)

Regional provider B(AS 3)

Customer P(AS 4)

Customer Q(AS 5)

Customer R(AS 6)

Customer S(AS 7)

128.96192.4.153

192.4.32192.4.3

192.12.69

192.4.54192.4.23

Page 44: 1 Forwarding vs. Routing Forwarding vs Routing forwarding: To select an output port based on destination address and routing table routing: Process by.

44

Why different Intra- and Inter-AS routing ?

• Policy: Inter is concerned with policies (which provider we must select/avoid, etc). Intra is contained in a single organization, so, no policy decisions necessary

• Scale: Inter provides an extra level of routing table size and routing update traffic reduction above the Intra layer

• Performance: Intra is focused on performance metrics; needs to keep costs low. In Inter it is difficult to propagate performance metrics efficiently (latency, privacy etc). Besides, policy related information is more meaningful.

We need BOTH!