CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim 02.15.2010.

26
CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim 02.15.2010
  • date post

    20-Jan-2016
  • Category

    Documents

  • view

    220
  • download

    0

Transcript of CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim 02.15.2010.

Page 1: CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim 02.15.2010.

CSEE W4140Networking Laboratory

Lecture 4: IP Routing (RIP)

Jong Yul Kim02.15.2010

Page 2: 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.”

Page 3: CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim 02.15.2010.

Forwarding Table (Review)

Destination Next Hop

10.1.0.0/2410.1.2.0/2410.2.1.0/2420.1.0.0/1620.2.1.0/28

eth0eth110.1.0.110.1.0.110.1.0.1

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

Page 4: CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim 02.15.2010.

D e s t i n a t i o n N e x t H o p 1 0 . 1 . 0 . 0 / 2 4 1 0 . 1 . 2 . 0 / 2 4 1 0 . 2 . 1 . 0 / 2 4 1 0 . 3 . 1 . 0 / 2 4 2 0 . 1 . 0 . 0 / 1 6 2 0 . 2 . 1 . 0 / 2 8

d i r e c t R 3 R 3 R 3 R 3 R 3

H 1

R 1 R 2

R 3 R 4

H 2

1 0 . 2 . 1 . 0 / 2 4

2 0 . 1 . 0 . 0 / 1 61 0 . 1 . 2 . 0 / 2 4

1 0 . 1 . 0 . 0 / 2 4 1 0 . 3 . 0 . 0 / 1 6

2 0 . 2 . 1 . 0 / 2 8

2 0 . 2 . 1 . 2 / 2 8

D e s t i n a t i o n N e x t H o p 1 0 . 1 . 0 . 0 / 2 4 1 0 . 1 . 2 . 0 / 2 4 1 0 . 2 . 1 . 0 / 2 4 1 0 . 3 . 1 . 0 / 2 4 2 0 . 1 . 0 . 0 / 1 6 2 0 . 2 . 1 . 0 / 2 8

d i r e c t d i r e c t R 4 d i r e c t R 4 R 4

D e s t i n a t i o n N e x t H o p 1 0 . 1 . 0 . 0 / 2 4 1 0 . 1 . 2 . 0 / 2 4 1 0 . 2 . 1 . 0 / 2 4 1 0 . 3 . 1 . 0 / 2 4 2 0 . 1 . 0 . 0 / 1 6 2 0 . 2 . 1 . 0 / 2 8

R 3 R 3 R 2 d i r e c t d i r e c t R 2

D e s t i n a t i o n N e x t H o p 1 0 . 1 . 0 . 0 / 2 4 1 0 . 1 . 2 . 0 / 2 4 1 0 . 2 . 1 . 0 / 2 4 1 0 . 3 . 1 . 0 / 2 4 2 0 . 2 . 0 . 0 / 1 6 3 0 . 1 . 1 . 0 / 2 8

R 3 d i r e c t d i r e c t R 3 R 2 R 2

D e s t i n a t i o n N e x t H o p 1 0 . 1 . 0 . 0 / 2 4 1 0 . 1 . 2 . 0 / 2 4 1 0 . 2 . 1 . 0 / 2 4 1 0 . 3 . 1 . 0 / 2 4 2 0 . 1 . 0 . 0 / 1 6 2 0 . 2 . 1 . 0 / 2 8

R 1 R 1 d i r e c t R 4 d i r e c t d i r e c t

D e s t i n a t i o n N e x t H o p 1 0 . 1 . 0 . 0 / 2 4 1 0 . 1 . 2 . 0 / 2 4 1 0 . 2 . 1 . 0 / 2 4 1 0 . 3 . 1 . 0 / 2 4 2 0 . 1 . 0 . 0 / 1 6 2 0 . 2 . 1 . 0 / 2 8

R 2 R 2 R 2 R 2 R 2 d i r e c t

to:20.2.1.2

Delivery with forwarding tables (Review)

Page 5: CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim 02.15.2010.

Today’s topics

Page 6: CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim 02.15.2010.

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: Columbia’s campus network Telecommunication company’s backbone network Regional Internet Service Provider

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

Page 7: CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim 02.15.2010.

Autonomous System

Page 8: CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim 02.15.2010.

Interdomain and Intradomain Routing

Intradomain Routing Routing within an AS Ignores the Internet outside

the AS Protocols for Intradomain

routing are also called Interior Gateway Protocols or IGP’s.

Popular protocols are RIP (simple, old) OSPF (better)

Interdomain Routing Routing between AS’s Assumes that the Internet

consists of a collection of interconnected AS’s

Normally, there is one dedicated router in each AS that handles interdomain traffic.

Protocols for interdomain routing are also called Exterior Gateway Protocols or EGP’s.

Routing protocols: BGP

Page 9: CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim 02.15.2010.

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

Page 10: CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim 02.15.2010.
Page 11: CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim 02.15.2010.

Example

Router A Router B Router C Router D

10.0.2.0/24 10.0.3.0/24 10.0.4.0/24 10.0.5.0/2410.0.1.0/24

.1.2.2.2.2 .1.1.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

t=0:10.0.1.0 - 010.0.2.0 - 0

Net via cost

t=0:10.0.2.0 - 010.0.3.0 - 0

Net via cost

t=0:10.0.3.0 - 010.0.4.0 - 0

Net via cost

t=0:10.0.4.0 - 010.0.5.0 - 0

Net via cost

t=1:10.0.1.0 - 010.0.2.0 - 0 10.0.3.0 10.0.2.2 1

t=2:10.0.1.0 - 010.0.2.0 - 0 10.0.3.0 10.0.2.2 110.0.4.0 10.0.2.2 2

t=2:10.0.1.0 10.0.2.1 1 10.0.2.0 - 010.0.3.0 - 010.0.4.0 10.0.3.2 110.0.5.0 10.0.3.2 2

t=1:10.0.1.0 10.0.2.1 1 10.0.2.0 - 010.0.3.0 - 010.0.4.0 10.0.3.2 1

t=2:10.0.1.0 10.0.3.1 2 10.0.2.0 10.0.3.1 1 10.0.3.0 - 010.0.4.0 - 010.0.5.0 10.0.4.2 1

t=1:10.0.2.0 10.0.3.1 1 10.0.3.0 - 010.0.4.0 - 010.0.5.0 10.0.4.2 1

t=2:10.0.2.0 10.0.4.1 210.0.3.0 10.0.4.1 110.0.4.0 - 010.0.5.0 - 0

t=1:10.0.3.0 10.0.4.1 110.0.4.0 - 010.0.5.0 - 0

Page 12: CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim 02.15.2010.

Example

Router A Router B Router C Router D

10.0.2.0/24 10.0.3.0/24 10.0.4.0/24 10.0.5.0/2410.0.1.0/24

.1.2.2.2.2 .1.1.1

t=3:10.0.1.0 - 010.0.2.0 - 0 10.0.3.0 10.0.2.2 110.0.4.0 10.0.2.2 210.0.5.0 10.0.2.2 3

Net via cost

t=3:10.0.1.0 10.0.2.1 1 10.0.2.0 - 010.0.3.0 - 010.0.4.0 10.0.3.2 110.0.5.0 10.0.3.2 2

Net via cost

t=3:10.0.1.0 10.0.3.1 2 10.0.2.0 10.0.3.1 1 10.0.3.0 - 010.0.4.0 - 010.0.5.0 10.0.4.2 1

Net via cost

t=3:10.0.1.0 10.0.4.1 310.0.2.0 10.0.4.1 210.0.3.0 10.0.4.1 110.0.4.0 - 010.0.5.0 - 0

Net via cost

Now, routing tables have converged !

t=2:10.0.1.0 - 010.0.2.0 - 0 10.0.3.0 10.0.2.2 110.0.4.0 10.0.2.2 2

t=2:10.0.1.0 10.0.2.1 1 10.0.2.0 - 010.0.3.0 - 010.0.4.0 10.0.3.2 110.0.5.0 10.0.3.2 2

t=2:10.0.1.0 10.0.3.1 2 10.0.2.0 10.0.3.1 1 10.0.3.0 - 010.0.4.0 - 010.0.5.0 10.0.4.2 1

t=2:10.0.2.0 10.0.4.1 210.0.3.0 10.0.4.1 110.0.4.0 - 010.0.5.0 - 0

Page 13: CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim 02.15.2010.

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.

Page 14: CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim 02.15.2010.

The Count-to-Infinity ProblemAA BB CC1 1

A's Routing Table B's Routing Table

C

to costvia(next hop)

2B C

to costvia(next hop)

1C

now link B-C goes down

C 2 C oo

C oo-C 2B

C oo C 3

C 3AC oo-

C 4 C oo

C oo-C 4B

Page 15: CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim 02.15.2010.

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?

Page 16: CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim 02.15.2010.

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 A’s current route to C

Split Horizon does not solve count-to-infinity in all cases!

Page 17: CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim 02.15.2010.

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

Page 18: CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim 02.15.2010.

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.

Page 19: CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim 02.15.2010.

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

Page 20: CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim 02.15.2010.

RIPv2 Packet Format

One RIP message can have up to 25 route entries

1: request2: response

2: for IP0…0: request full rou-ting table

Address of destination

Cost (measured in hops)

IP header UDP header RIPv2 Message

Command Version Set to 00.00

IP address

Subnet Mask

address family route tag

Next-Hop IP address

metric (1-16)

on

e r

ou

te e

ntr

y(2

0 b

yte

s)

Up to 24 more routes (each 20 bytes)

32 bits

2: RIPv2

Page 21: CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim 02.15.2010.

RIPv2 Packet FormatIP header UDP header RIPv2 Message

Command Version Set to 00.00

IP address

Subnet Mask

address family route tag

Next-Hop IP address

metric (1-16)

on

e r

ou

te e

ntr

y(2

0 b

yte

s)

Up to 24 more routes (each 20 bytes)

32 bits

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

Identifies a better next-hop address on the same subnet than the advertising router, if one exists (otherwise 0….0)

Subnet mask for IP address

Page 22: CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim 02.15.2010.

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.

Page 23: CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim 02.15.2010.

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.

Page 24: CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim 02.15.2010.

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

Page 25: CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim 02.15.2010.

Quagga

Extinct animal…

Page 26: CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim 02.15.2010.

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