31
Network Layer Routing IS250 Spring 2010 [email protected]

Network Layer Routing

  • Upload
    joben

  • View
    33

  • Download
    3

Embed Size (px)

DESCRIPTION

Network Layer Routing. IS250 Spring 2010 [email protected]. Outline. Introduction Router operation Metric vs. policy based routing Metric-based routing Shortest path computation Distance vector and link-state algorithms and protocols Policy-based routing - PowerPoint PPT Presentation

Citation preview

Page 1: Network Layer Routing

Network LayerRouting

IS250Spring 2010

[email protected]

Page 2: Network Layer Routing

John Chuang 2

Outline

Introduction- Router operation- Metric vs. policy based routing

Metric-based routing- Shortest path computation- Distance vector and link-state algorithms and protocols

Policy-based routing- Border Gateway Protocol (BGP)

Page 3: Network Layer Routing

John Chuang 3

Two Basic Functions in Packet Switching

Routing- Learn the best route to (or best next-hop for) any given destination- Exchange local link status or destination reachability information

- Compute best path to destinations• Algorithms for computing shortest paths (e.g., Dijkstra’s)

• Policies that reflect business agreements (use BGP)

- Update the routing table Packet forwarding

- For each packet received on an incoming link, forward it to an outgoing link according to the routing table

Page 4: Network Layer Routing

John Chuang 4

Routing of Atoms

Page 5: Network Layer Routing

John Chuang 5

Routing of Bits

Host A Host B

128.32.226.8712.2.14.60

Local loop

Backbone

MAN

Ethernet

Page 6: Network Layer Routing

John Chuang 6

Packet Switch (Router)

Special-purpose computer system- CPU- Memory- I/O interfaces- Software

Connects to- Other packet switches- End hosts

Store-and-forward paradigm- “Stores” packet in memory- Examines packet’s destination address- Looks up next-hop in routing table- “Forwards” packets toward destination (hop-by-hop)

Page 7: Network Layer Routing

John Chuang 7

Control Plane

DestinationAddress

OutgoingLink

Outgoing links

Routing table

Packet

Packet Switch in Action

Cw.x.y.z

Incoming links

Data Plane

Control plane of a router communicates with its counterparts at other routers using routing protocols (e.g., RIP, OSPF, BGP)

Page 8: Network Layer Routing

John Chuang 8

What is the Best Route?

Route selection may be based on:- Latency/hop-count- Bandwidth capacity- Loss rate- Cost- Security requirements- Business relationships (e.g., transit or peering agreements)

- … Two flavors of routing: metric-based and policy-based

Page 9: Network Layer Routing

John Chuang 9

Metric-Based Routing and Policy-Based Routing

Both used in practice for routing on the Internet- Metric-based routing typically employed within a network domain

- Policy-based routing typically employed across network domains

A network domain, also known as an autonomous system (AS), is a collection of IP networks and routers, usually under the control of a single administrative entity, that presents a common routing policy to the Internet- Examples: ISPs, corporations, universities

Page 10: Network Layer Routing

John Chuang 10

Outline

Introduction- Router operation- Metric vs. policy based routing

Metric-based routing- Shortest path computation- Distance vector and link-state algorithms and protocols

Policy-based routing- Border Gateway Protocol (BGP)

Page 11: Network Layer Routing

John Chuang 11

Routing: A Graph Theoretic Perspective

Note that each node has different view of the network, and therefore different routing table

Page 12: Network Layer Routing

John Chuang 12

Shortest Path Computation Algorithm from graph theory Distributed computation (no central authority) A switch

- Must learn route to all destinations- While communicating only with directly connected neighbors

Example:

Page 13: Network Layer Routing

John Chuang 13

Shortest Path Algorithms

Distance vector- Switches exchange routing table info

Link state- Switches exchange link status info

Both used in practice- e.g., RIP (RFC 1058, 1388, 1723) is a distance vector routing protocol, OSPF (RFC 1131, 1247) is a link state routing protocol

Page 14: Network Layer Routing

John Chuang 14

Link-State Routing

Pair of switches periodically- Test link between them- Broadcast link status message to all switches in network

Switch- Receives link status messages- Computes new routes (using Dijkstra’s algorithm)

Page 15: Network Layer Routing

John Chuang 15

Dijkstra’s Algorithm

Shortest Path First (SPF) algorithm Greedy algorithm Input: graph with nodes and weighted edges

Output: shortest paths from source node i to every other node; cost of each path

Page 16: Network Layer Routing

John Chuang 16

Dijkstra’s Algorithm

Source: Doug Comer

Page 17: Network Layer Routing

John Chuang 17

Algorithm Intuition

Start at source node Move outward At each step:

- Find node u that- has not been considered before; and- is closest to source

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

Page 18: Network Layer Routing

John Chuang 18

Dijkstra’s Algorithm Example

DistancePredecessor

Page 19: Network Layer Routing

John Chuang 19

Node A’s Routing Table

Destination Address

Next Hop (Cost)

B B (2)

C D (3)

D D (1)

E D (2)

F D (4)

Page 20: Network Layer Routing

John Chuang 20

Routing Dynamics

Dijkstra’s Algorithm has a run-time of O(|V|2+|E|), but the routers run the algorithm continuously to keep their routing tables updated

Link states constantly updated- New links can be added to network- Latency can change continuously- if link goes down, cost = infinity

Routing tables may have transient inconsistency- Link state messages take time to propagate across network

- Routers not synchronized in running route computation algorithm

- Transient routing loops or routing black-holes

Page 21: Network Layer Routing

John Chuang 21

Outline

Introduction- Router operation- Metric vs. policy based routing

Metric-based routing- Shortest path computation- Distance vector and link-state algorithms and protocols

Policy-based routing- Border Gateway Protocol (BGP)

Page 22: Network Layer Routing

John Chuang 22

Internet Routing Protocols

Interior Gateway Protocols (IGPs)- Intra-AS or intra-domain- Metric-based routing (e.g., hops, latency, cost)- AS free to choose IGP and metric- Examples: RIP, OSPF, IBGP

Exterior Gateway Protocols (EGPs)- Inter-AS or inter-domain- Policy-based routing- All AS’s have to use the same EGP (currently BGP v4)

Page 23: Network Layer Routing

John Chuang 23

Route Advertisement Instead of computing shortest paths based on DV or LS information, inter-domain routing is based on advertisements of routes

Example: ISP1 sends route advertisement to ISP2- ISP1 is willing to receive packets, destined to end-hosts within its domain, from ISP2

- ISP2 will enter this information into its routing table

Page 24: Network Layer Routing

John Chuang 24

Network Interconnection

AS3 is a transit-provider of AS1:- For a payment, AS3 agrees to advertise route to AS1 to rest of Internet

AS2 and AS3 are peers:- Exchange route advertisements (without any payments)

Backbone A

Backbone B

Backbone C

Transit

transit

peering

AS 1

AS 2

AS 3

Page 25: Network Layer Routing

John Chuang 25

Stub, Transit, and Multi-homed

Three different types of AS:- Stub AS- Transit AS- Multi-homed AS

AS 3

AS 1

AS 4

AS 2

AS 5

Page 26: Network Layer Routing

John Chuang 26

Border Gateway Protocol (BGP)

Version 4: RFC 1771 (March 1995) Routing among Autonomous Systems No routing metrics Provisions for policies

- Individual AS’s control advertisement of routes

Facilities for transit routing- transit vs. stub domains- Multi-homing

Reliable transport- Two BGP peers establish TCP session

Page 27: Network Layer Routing

John Chuang 27

BGP Attributes

Community attribute (no-advertise, no-export, internet) controls propagation of advertisement

Page 28: Network Layer Routing

John Chuang 28

Community Attribute

No Export

No Advertise

Internet

Page 29: Network Layer Routing

John Chuang 29

BGP Attributes

Community attribute (no-export, no-advertise, internet) controls propagation of advertisement

Other attributes used for selecting best path among multiple paths to same destination:- Weight (local to a router)- Local preference (propagated throughout AS)- Multi-exit discriminator (suggestion to external AS)

- Origin (IGP, EGP, Incomplete)- AS_Path (AS hop count, loop detection)- Next hop (IP Address)

Page 30: Network Layer Routing

John Chuang 30

BGP Path Selection1. If the path specifies a next hop that is

inaccessible, drop the update. 2. Prefer the path with the largest weight. 3. If the weights are same, prefer the path with largest

local preference. 4. If the local preferences are same, prefer the path

originated by BGP running on this router. 5. If no route was originated, prefer the route that

with shortest AS_path.6. If all paths have the same AS_path length, prefer the

path with the lowest origin type (where IGP < EGP < incomplete).

7. If the origin codes are same, prefer the path with lowest MED attribute.

8. If the paths have same MED, prefer external over internal path.

9. If the paths are same, prefer path through the closest IGP neighbor.

10. Prefer path with lowest IP address, as specified by the BGP router ID.

Page 31: Network Layer Routing

John Chuang 31

Summary

Packet switching as key network layer responsibility

Packet switching = routing + packet forwarding

Internet uses combination of metric-based routing (intra-domain) and policy-based routing (inter-domain)- Metric-based routing: shortest path computation based on distance vector or link state algorithms

- Policy-based routing: route advertisements