Vous êtes sur la page 1sur 26

CSEE W4140 Networking Laboratory

Lecture 4: IP Routing (RIP)


Jong Yul Kim 02.15.2010

Two functions of the network layer (Review)

Routing Collective interactions of all routers to determine the paths that packets take on their trips from source to destination Forwarding The transfer of a packet from an incoming link to an outgoing link within a single router.

Forwarding Table (Review)


Destination 10.1.0.0/24 10.1.2.0/24 10.2.1.0/24 20.1.0.0/16 20.2.1.0/28 Next Hop eth0 eth1 10.1.0.1 10.1.0.1 10.1.0.1

IP datagrams can be directly delivered (eth0 or eth1) or are sent to a router (10.1.0.1)

Delivery with forwarding tables (Review)


Destination 10.1.0.0/24 10.1.2.0/24 10.2.1.0/24 10.3.1.0/24 20.2.0.0/16 30.1.1.0/28 Next Hop R3 direct direct R3 R2 R2 Destination 10.1.0.0/24 10.1.2.0/24 10.2.1.0/24 10.3.1.0/24 20.1.0.0/16 20.2.1.0/28 Next Hop R1 R1 direct R4 direct direct Destination 10.1.0.0/24 10.1.2.0/24 10.2.1.0/24 10.3.1.0/24 20.1.0.0/16 20.2.1.0/28 Next Hop R2 R2 R2 R2 R2 direct

R1
10.2.1.0/24

R2
20.2.1.0/28

H2
10.1.2.0/24 20.1.0.0/16 20.2.1.2/28

to: 20.2.1.2
H1
Destination 10.1.0.0/24 10.1.2.0/24 10.2.1.0/24 10.3.1.0/24 20.1.0.0/16 20.2.1.0/28 Next Hop direct R3 R3 R3 R3 R3

10.1.0.0/24

10.3.0.0/16

R3
Destination 10.1.0.0/24 10.1.2.0/24 10.2.1.0/24 10.3.1.0/24 20.1.0.0/16 20.2.1.0/28 Next Hop direct direct R4 direct R4 R4

R4
Destination 10.1.0.0/24 10.1.2.0/24 10.2.1.0/24 10.3.1.0/24 20.1.0.0/16 20.2.1.0/28 Next Hop R3 R3 R2 direct direct R2

Todays topics

Autonomous System

An autonomous system is a network that is administered by a single organization. The internet is a collection of autonomous systems. Examples of autonomous regions are:

Columbias campus network Telecommunication companys backbone network Regional Internet Service Provider

Routing is done differently within an autonomous system (intradomain routing) and between autonomous system (interdomain routing).

Autonomous System

Interdomain and Intradomain Routing


Intradomain Routing

Interdomain Routing

Routing within an AS Ignores the Internet outside the AS Protocols for Intradomain routing are also called Interior Gateway Protocols or IGPs. Popular protocols are

RIP (simple, old) OSPF (better)

Routing between ASs Assumes that the Internet consists of a collection of interconnected ASs Normally, there is one dedicated router in each AS that handles interdomain traffic. Protocols for interdomain routing are also called Exterior Gateway Protocols or EGPs. Routing protocols:

BGP

Distance Vector Algorithm

Based on the Bellman-Ford equation dx(y) = minv{c(x,v) + dv(y)} dx(y) = least cost path from x to y c(x,v) = link cost from x to v

Example
10.0.1.0/24 .2 .1

Assume: - link cost is 1, i.e., c(v,w) = 1 - all updates occur simultaneously - Initially, each router only knows the cost of connected interfaces

10.0.2.0/24

10.0.3.0/24

10.0.4.0/24

10.0.5.0/24

.2

.1

.2

.1

.2

.1

Router A cost Net via Net

Router B cost via Net

Router C cost via

Router D Net via cost


0 0 1 0 0 2 1 0 0

t=0: 10.0.1.0 10.0.2.0 t=1: 10.0.1.0 10.0.2.0 10.0.3.0 10.0.2.2 t=2: 10.0.1.0 10.0.2.0 10.0.3.0 10.0.4.0

0 0

t=0: 10.0.2.0 10.0.3.0 t=1: 10.0.1.0 10.0.2.0 10.0.3.0 10.0.4.0 t=2: 10.0.1.0 10.0.2.0 10.0.3.0 10.0.4.0 10.0.5.0

0 0

t=0: 10.0.3.0 10.0.4.0 t=1: 10.0.2.0 10.0.3.0 10.0.4.0 10.0.5.0 t=2: 10.0.1.0 10.0.2.0 10.0.3.0 10.0.4.0 10.0.5.0

0 0

t=0: 10.0.4.0 10.0.5.0 t=1: 10.0.3.0 10.0.4.1 10.0.4.0 10.0.5.0 t=2: 10.0.2.0 10.0.3.0 10.0.4.0 10.0.5.0

0 0 1

10.0.2.1 10.0.3.2 10.0.2.1 10.0.3.2 10.0.3.2

1 0 0 1 1 0 0 1 2

10.0.3.1 10.0.4.2 10.0.3.1 10.0.3.1 10.0.4.2

1 0 0 1 2 1 0 0 1

10.0.2.2 10.0.2.2

0 0 1 2

10.0.4.1 10.0.4.1 -

Example
10.0.1.0/24 10.0.2.0/24 10.0.3.0/24 10.0.4.0/24 10.0.5.0/24 .2 .1 .2 .1 .2 .1 .2 .1

Router A cost Net


t=2: 10.0.1.0 10.0.2.0 10.0.3.0 10.0.4.0

Router B cost Net


t=2: 10.0.1.0 10.0.2.0 10.0.3.0 10.0.4.0 10.0.5.0 t=3: 10.0.1.0 10.0.2.0 10.0.3.0 10.0.4.0 10.0.5.0

Router C cost Net


t=2: 10.0.1.0 10.0.2.0 10.0.3.0 10.0.4.0 10.0.5.0 t=3: 10.0.1.0 10.0.2.0 10.0.3.0 10.0.4.0 10.0.5.0

Router D Net
t=2: 10.0.2.0 10.0.3.0 10.0.4.0 10.0.5.0

via
10.0.2.2 10.0.2.2

via
10.0.2.1 10.0.3.2 10.0.3.2

via
10.0.3.1 10.0.3.1 10.0.4.2

via
10.0.4.1 10.0.4.1 -

0 0 1 2

1 0 0 1 2

2 1 0 0 1

t=3: 10.0.1.0 10.0.2.0 10.0.3.0 10.0.4.0 10.0.5.0

10.0.2.2 10.0.2.2 10.0.2.2

0 0 1 2 3

10.0.2.1 10.0.3.2 10.0.3.2

1 0 0 1 2

10.0.3.1 10.0.3.1 10.0.4.2

2 1 0 0 1

t=3: 10.0.1.0 10.0.2.0 10.0.3.0 10.0.4.0 10.0.5.0

10.0.4.1 10.0.4.1 10.0.4.1 -

Now, routing tables have converged !

cost
2 1 0 0 3 2 1 0 0

Characteristics of Distance Vector Routing

Periodic Updates: Updates to the routing tables are sent at the end of a certain time period. Typical value in n seconds. Triggered Updates: If a metric changes on a link, a router immediately sends out an update without waiting for the end of the update period. Full Routing Table Update: Most distance vector routing protocols send their neighbors the entire routing table (not only entries which change). Route invalidation timers: Routing table entries are invalid if they are not refreshed. A typical value is to invalidate an entry if no update is received after 3-6 update periods.

The Count-to-Infinity Problem


A A
A 's R o u t in g T a b le to C C v ia
(n e x t h o p )

B B
B 's R o u t i n g T a b le to C v ia
(n e x t h o p )

C C

cost 2

cost 1 oo

B B C

C -

n o w lin k B - C g o e s d o w n

2 2 oo C oo 4 C 4 C C C

C oo C 3 C oo

oo

Count-to-Infinity

The reason for the count-to-infinity problem is that each node only has a next-hop-view For example, in the first step, A did not advertise that its route (with cost 2) to C went through node B How can the Count-to-Infinity problem be solved?

Count-to-Infinity

The reason for the count-to-infinity problem is that each node only has a next-hop-view For example, in the first step, A did not realize that its route (with cost 2) to C went through node B How can the Count-to-Infinity problem be solved? Solution 1: Never advertise the cost to a neighbor if this neighbor is the next hop on the current path (Split Horizon)

Example: A would not send the first routing update to B, since B is the next hop on As current route to C Split Horizon does not solve count-to-infinity in all cases!

Count-to-Infinity

The reason for the count-to-infinity problem is that each node only has a next-hop-view For example, in the first step, A did not realize that its route (with cost 2) to C went through node B How can the Count-to-Infinity problem be solved? Solution 2: Always advertise the entire path in an update message (Path vectors)

If routing tables are large, the routing messages require substantial bandwidth BGP uses this solution

RIP - Routing Information Protocol

A simple intradomain protocol Straightforward implementation of Distance Vector Routing Each router advertises its distance vector every 30 seconds (or whenever its routing table changes) to all of its neighbors. RIP always uses 1 as link cost. Maximum hop count is 15, with 16 equal to . Routes expire (set to 16) after 3 minutes if they are not updated.

RIP Messages

Dedicated port for RIP is UDP port 520. Two types of messages:

Request messages used to ask neighboring nodes for an update Response messages contains an update

RIPv2 Packet Format


IP header UDP header

RIPv M essage 2

2: RIPv2

1: request 2: response 2: for IP 00: request full routing table Address of destination Cost (measured in hops) One RIP message can have up to 25 route entries

Command Version address fam ily

Set to00.00 route tag one route entry (20 bytes)

IP address Subnet M ask Next-Hop IP address metric(1-16) Up to24 more routes (each 20 bytes )

32 bits

RIPv2 Packet Format


IP header UDP header

RIPv M essage 2

Subnet mask for IP address Identifies a better next-hop address on the same subnet than the advertising router, if one exists (otherwise 0.0)

IP address Subnet M ask Next-Hop IP address metric(1-16) Up to24 more routes (each 20 bytes )

32 bits

one route entry (20 bytes)

Used to carry information from other routing protocols (e.g., autonomous system number)

Command Version address fam ily

Set to00.00 route tag

Routing with RIP

Initialization: Send a request packet (command = 1, address family=0..0) on all interfaces:

RIPv2 uses multicast address 224.0.0.9, if possible

requesting routing tables from neighboring routers Request received: Routers that receive above request send their entire routing table Response received: Update the routing table Regular routing updates: Every 30 seconds, send all or part of the routing tables to every neighbor in an response message Triggered Updates: Whenever the metric for a route change, send entire routing table.

RIP Problems

RIP takes a long time to stabilize

Even for a small network, it takes several minutes until the routing tables have settled after a change

RIP has all the problems of distance vector algorithms, e.g., count-to-Infinity

Cisco routers use split horizon, hold-down timer, and triggered updates to avoid count-to-infinity

The maximum path in RIP is 15 hops.

Main Points of Lab 4 Parts 1~4

Zebra Quagga Routing Software RIP


Configuration Format and content of advertisements Convergence after link failure Count-to-infinity problem

Quagga

Extinct animal

Homework

Prelab 4 due on Friday (02.19.2010) Lab report 4.1 due by beginning of lab 4.2 next week Reading Assignment

Textbook Lab 4 parts 5 ~ 7

Vous aimerez peut-être aussi