Top Banner
RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15 hops) Distance vectors: exchanged every 30 s ec via RIP Response Message (also call ed “RIP advertisement”) • 封封封 UDP 封封封 , 封封封封 520
105

RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Mar 26, 2015

Download

Documents

Alex Orr
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

RIP ( Routing Information Protocol)

• RFC 1058 and 1723• Included in BSD UNIX in 1982• Distance vector algorithm• Distance metric: number of hops (max = 15 hops)• Distance vectors: exchanged every 30 sec via RIP Re

sponse Message (also called “RIP advertisement”)• 封装在 UDP 报文中 , 端口号为 520 。

Page 2: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Routing Information Protocol (RIP v1)

命令字: 1 请求; 2 响应通常把命令域设为 1 ,然后广播整个路由表

metric

Command (1-6) Version 0

Address Family 0

32-bit IP address

0

0

24 more routes

Page 3: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

RIP: Routing Information ProtocolUses hop count as metric (max: 16 is infinity) Tables (vectors) “advertised” to neighbors every 30 s.

Each advertisement: up to 25 entriesNo advertisement for 180 sec: neighbor/link declared

deadroutes via neighbor invalidatednew advertisements sent to neighbors (Triggered updates)neighbors in turn send out new advertisements (if tables

changed)link failure info quickly propagates to entire netpoison reverse used to prevent ping-pong loops (infinite

distance = 16 hops)

Page 4: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

RIPv1 Problems

• Split horizon/poison reverse does not guarantee to solve count-to-infinity problem– 16 = infinity => RIP for small networks only!– Slow convergence

• Broadcasts consume non-router resources

• RIPv1 does not support subnet masks (VLSMs) – No authentication

Page 5: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

RIPv2

• Provides:– VLSM support– Authentication– Multicasting (地址为: 224.0.0.0)– Tags to support EGP/BGP routes.

• Uses reserved fields in RIPv1 header.

• First route entry replaced by authentication info.

Page 6: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Routing Information Protocol (RIP v2)

metric

Command (1-6) Version 保留Address Family

32-bit IP address

Next hop (32bit)

24 more routes

32-bit Subnet Mask

路由标记

如果在 Address Family 中的数据为 FFFF, 则整个报文为认证( authentication) 报文。路由标记:可带 AS 号,使 RIP 能够从 EGP/BGP routes. 中接受信息

Page 7: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

RIP problems

• Counting-to-infinity problem: – Simple configuration A->B->C. If C fails, B needs

to update and thinks there is a route through A. A needs to update and thinks there is a route thru B.

– No clear solution, except to set “infinity” to be small (eg 16 in RIP)

• Slow convergence after topology change:– Due to count to infinity problem– Also information cannot propagate thru node

until it recalculates routing info.

Page 8: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Properties of Distance Vector Algorithm

• Bad news propagate slowly: the count-to-infinity problem

Page 9: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Properties of Distance Vector Algorithm

• Good news propagate fast

Page 10: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

RIP problems (contd)

• Black-holes:– If one node goes broke and advertises route of zero

to several key networks, all nodes immediately point to it.

• Not the optimal routing tables

the simplistic metric resulting in packets being sent over slow links when better paths are available

• Broadcasts consume non-router resources

Page 11: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

The Bouncing Effect

A

2

1

1

B

C

B

C 21

dest cost

A

C 11

dest cost

A

B 12

dest cost

X

Page 12: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

C Sends Routes to B

A

2 1

B

C

B

C 21

dest cost

A

C 1~

dest cost

A

B 12

dest cost

Page 13: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

B Updates Distance to A

A

2 1

B

C

B

C 21

dest cost

A

C 13

dest cost

A

B 12

dest cost

Page 14: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

B Sends Routes to C

A

2 1

B

C

B

C 21

dest cost

A

C 13

dest cost

A

B 14

dest cost

Page 15: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

C Sends Routes to B

A

2 1

B

C

B

C 21

dest cost

A

C 15

dest cost

A

B 14

dest cost

Page 16: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

How are These Loops Caused?

• Observation 1:– B’s metric increases

• Observation 2:– C picks B as next hop to A– But, the implicit path from C to A includes itsel

f!

Page 17: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Solution 1: Holddowns

• If metric increases, delay propagating information– In our example, B delays advertising route– C eventually thinks B’s route is gone, picks its

own route– B then selects C as next hop

• Adversely affects convergence

Page 18: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Other “Solutions”

• Split horizon– C does not advertise route to B– Rule: It is never useful to send information about

a route back in the direction from which it came

• Poisoned reverse– C advertises route to B with infinite distance– Rule: If two routers have routes pointing at each

other , advertising reverse routes with a metric of 16 breaks the loop immediately

Page 19: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

An Example Where Reverse-Poison Fails

1

1 1

1

When the link between C and D fails, C will set its distance to D as However, A will then use B to go to D, and B will use A to go to D because there is no reverse-poison between them After such updates, A (and B) will then report new path to C for D, and C will use the path; we thus have the count-to-infinity problem again

Page 20: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Link State Protocols

• Key: Create a network “map” at each node.

• 1. Node collects the state of its connected links and forms a “Link State Packet” (LSP)

• 2. Flood LSP => reaches every other node in the network and everyone now has a network map.

• 3. Given map, run Dijkstra’s shortest path algorithm (SPF) => get paths to all destinations

• 4. Routing table = next-hops of these paths.

Page 21: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Dijkstra’s algorithm

Net topology, link costs known to all nodes accomplished via “link state

broadcast” all nodes have same info

computes least-cost paths from one node (‘source or root”) to all other nodes gives routing table for that n

ode iterative: after k iterations,

know least cost path to k dest.’s

Notation: c(i,j): link cost from node i

to j. cost infinite if not direct neighbors

D(v): current value of path cost from source to dest. V

p(v): predecessor node along path from source to v, that is next v

N: set of nodes whose least cost path definitively known

Page 22: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Dijkstra’s Algorithm1 Initialization: 2 N = {A} 3 for all nodes v 4 if v adjacent to A 5 then D(v) = c(A,v) 6 else D(v) = infty 7 8 Loop 9 find w not in N such that D(w) is a minimum 10 add w to N 11 update D(v) for all v adjacent to w and not in N: 12 D(v) = min( D(v), D(w) + c(w,v) ) 13 /* new cost to v is either old cost to v or known 14 shortest path cost to w plus cost from w to v */ 15 until all nodes in N

Page 23: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Dijkstra’s algorithm: example

Step012345

start NA

ADADE

ADEBADEBC

ADEBCF

D(B),p(B)2,A2,A2,A

D(C),p(C)5,A4,D3,E3,E

D(D),p(D)1,A

D(E),p(E)infinity

2,D

D(F),p(F)infinityinfinity

4,E4,E4,E

A

ED

CB

F

2

2

13

1

1

2

53

5

Page 24: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Dijkstra’s algorithm, discussion

Algorithm complexity: n nodeseach iteration: need to check all nodes, w, n

ot in Nn*(n+1)/2 comparisons: O(n**2)more efficient implementations possible: O

(nlogn)

Page 25: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

OSPF (Open Shortest Path First)

• RFC 2178• A Link State algorithm

– Link costs are configured by network administrator

– Link state packet disseminated to entire AS (via flooding) periodically

– Each router maintains an identical database describing the AS's topology

– Use Dijkstra’s algorithm to compute shortest path routes to all the routers

Page 26: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

OSPF Advanced Features• Security: all OSPF messages authenticated (to prevent malicio

us intrusion), TCP connections used• Multiple same-cost paths allowed (only one path in RIP)• Allow each link to have different costs for different TOS (Typ

e of Service) IP Packets – E.g, high-bandwidth satellite link configured to have a low cost for no

n-time-critical traffic and have a high cost for delay-sensitive traffic– Can compute different routes for each type of traffic

• Integrated unicast and multicast support: – Multicast OSPF (MOSPF, RFC 1584) provides simple extensions to

OSPF to provide for multicast routing

• Support for hierarchy within a single AS

Page 27: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Hierarchical OSPF• Two-level hierarchy: local area, backbone

– An AS is configured into areas, each area runs its own OSPF link-state routing algorithm

– One area in AS is configured to be the backbone area, job is to route traffic between other areas in the AS

Four types of OSPF routers:• Internal routers: in non-backbone areas and only perform intra-AS routi

ng• Area border routers: belong to both an area and the backbone, route pac

kets to outside the area• Backbone routers: perform routing within the backbone but are not area

border routers• Boundary routers: connect to other ASs, exchange routing information

with routers in other ASs

Page 28: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Hierarchical OSPF

Page 29: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

OSPF in IP Packets

• OSPF is a link-state routing protocol– Relies on IP packets for delivery of routing

information– Uses protocol number 89

IP Header

Protocol Number

Frame Header

CRCPacket Payload

Frame Payload

89 - OSPF 6 - TCP17 - UDP

89 - OSPF 6 - TCP17 - UDP

Page 30: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

OSPF TerminologyOSPF Terminology

TokenRing

Interfaces

Page 31: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

OSPF TerminologyOSPF Terminology

Neighbors

TokenRing

Interfaces

Page 32: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Neighbors

TokenRing

Interfaces

OSPF TerminologyOSPF Terminology

Cost = 10

Cost = 6Cost = 1785

Page 33: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

OSPF TerminologyOSPF Terminology

Neighbors

TokenRing

Interfaces

Area 1Area 0

Cost = 10

Cost = 6Cost = 1785

Page 34: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

OSPF TerminologyOSPF Terminology

Autonomous System

Neighbors

TokenRing

Interfaces

Area 1Area 0

Cost = 1785

Cost = 10

Cost = 6

Page 35: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Autonomous System

OSPF TerminologyOSPF Terminology

Neighborship Database

Lists Neighbors

Neighbors

TokenRing

Interfaces

Area 1Area 0

Cost = 10

Cost = 6Cost = 1785

Page 36: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Autonomous System

OSPF TerminologyOSPF Terminology

Topology Database

Lists All Routes

Neighborship Database

Lists Neighbors

Neighbors

TokenRing

Interfaces

Area 1Area 0

Cost = 1785

Cost = 10

Cost = 6

Page 37: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Autonomous System

OSPF TerminologyOSPF Terminology

RoutingTable

Lists Best Routes

Topology Database

Lists All Routes

Neighborship Database

Lists Neighbors

Cost = 10

Cost = 1785 Cost = 6

Neighbors

TokenRing

Interfaces

Area 1Area 0

Page 38: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

OSPF Topologies

Point-to-Point

NBMA

Broadcast Multiaccess

X.25Frame Relay

Page 39: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

OSPF 五类报文• Type1 ,Hello 分组,用来发现和维持邻站的可达性• 2 , Database Description, 向邻站给出自己的链路

状态数据库中的所有链路状态项目的摘要信息• 3 , Link State Request 向对方请求发送某些链路

状态项目的详细信息• 4 , Link State Update 用 Flooding 向全网更新链路

状态• 5 , Link State Acknowledgement 对链路更新分组

的确认

Page 40: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

NeighborshipNeighborship

Hello

afadjfjorqpoeru39547439070713

Router IDHello/dead intervalsNeighborsArea-IDRouter priorityDR IP addressBDR IP addressAuthentication passwordStub area flag

* *

* *

* Entry must match on neighboring routers

Hello

AA

DD EE

CCBB

每两个相邻的路由器 10 秒钟交换 Hello 报文40 秒没收到 Hello 报文,该相邻 Router 不可达

Page 41: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Neighborship (cont.)Neighborship (cont.)

Hello

afadjfjorqpoeru39547439070713

Router IDHello/dead intervalsNeighborsArea-IDRouter priorityDR IP addressBDR IP addressAuthentication passwordStub area flag

* *

* *

* Entry must match on neighboring routers

Hello

AA

DD EE

CCBB

Page 42: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

DR and BDRDR and BDR

DRDR BDRBDR

– Hellos elect DR and BDR to represent segment– Each router then forms adjacency with DR and BDR

Page 43: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

– Hello packets exchanged via IP multicast – Router with highest OSPF priority elected

P=1 P=0P=1

Electing the DR and BDRElecting the DR and BDRP=3 P=2

DRDR BDRBDR

Hello

Page 44: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Exchange ProcessExchange Process172.16.5.1/24

E0

172.16.5.2/24

E1A BDown State

Page 45: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Exchange ProcessExchange Process

172.16.5.1/24

E0

172.16.5.2/24

E1

Router BNeighbors List

172.16.5.1/24, int E1

I am router ID 172.16.5.1 and I see no one.

Down State

Init State

A B

Page 46: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Exchange ProcessExchange Process172.16.5.1/24

E0

I am router ID 172.16.5.2, and I see 172.16.5.1.

172.16.5.2/24

E1

Router BNeighbors List

172.16.5.1/24, int E1

I am router ID 172.16.5.1 and I see no one.

Down State

Init State

A B

Page 47: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Exchange ProcessExchange Process172.16.5.1/24

E0

I am router ID 172.16.5.2, and I see 172.16.5.1.

Router ANeighbors List

172.16.5.2/24, int E0

172.16.5.2/24

E1

Router BNeighbors List

172.16.5.1/24, int E1

I am router ID 172.16.5.1 and I see no one.

Down State

Init State

Two-Way State

A B

Page 48: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Discovering RoutesDiscovering Routes

E0

172.16.5.1

DRE0

172.16.5.3

No, I will start exchange because I have a higher router ID.

I will start exchange because I have router ID 172.16.5.1.Hello

afadjfjorqpoeru39547439070713

Hello

afadjfjorqpoeru39547439070713

Exstart State

Page 49: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Discovering RoutesDiscovering Routes

Here is a summary of my link-state database.DBD

afadjfjorqpoeru39547439070713

Exchange State

Here is a summary of my link-state database.DBD

afadjfjorqpoeru39547439070713

E0

172.16.5.1

DRE0

172.16.5.3

No, I will start exchange because I have a higher router ID.

I will start exchange because I have router ID 172.16.5.1.Hello

afadjfjorqpoeru39547439070713

Hello

afadjfjorqpoeru39547439070713

Exstart State

Page 50: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Discovering Routes (cont.)Discovering Routes (cont.)

E0

172.16.5.1

E0

172.16.5.3

Thanks for the information!LSAck

afadjfjorqpoeru39547439070713

LSAck

afadjfjorqpoeru39547439070713

DR

Page 51: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Discovering Routes (cont.)Discovering Routes (cont.)

I need the complete entry for network 172.16.6.0/24.

Here is the entry for network 172.16.6.0/24.

Thanks for the information!

LSR

afadjfjorqpoeru39547439070713

LSAck

afadjfjorqpoeru39547439070713

LSU

afadjfjorqpoeru39547439070713

Loading State

E0

172.16.5.1

E0

172.16.5.3

Thanks for the information!LSAck

afadjfjorqpoeru39547439070713

LSAck

afadjfjorqpoeru39547439070713

DR

Page 52: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Discovering Routes (cont.)Discovering Routes (cont.)

Full State

I need the complete entry for network 172.16.6.0/24.

Here is the entry for network 172.16.6.0/24.

Thanks for the information!

LSR

afadjfjorqpoeru39547439070713

LSAck

afadjfjorqpoeru39547439070713

LSU

afadjfjorqpoeru39547439070713

Loading State

E0

172.16.5.1

E0

172.16.5.3

Thanks for the information!LSAck

afadjfjorqpoeru39547439070713

LSAck

afadjfjorqpoeru39547439070713

DR

Page 53: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Choosing RoutesChoosing Routes

Topology TableNet Cost Out Interface10.2.2.0 6 To010.3.3.0 7 To010.3.3.0 10 E0

TokenRing

Cost=10

Cost=6FDDI

Cost=1

A B C

This is the best route to 10.3.3.0.

10.1.1.0/24 10.2.2.0/24 10.3.3.0/24

10.4.4.0/24

Page 54: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Maintaining Routing InformationMaintaining Routing Information

• Router A tells all OSPF DRs on 224.0.0.6

xx

Link-State Change

LSU1

DRDR

AA BB

Page 55: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Maintaining Routing InformationMaintaining Routing Information

LSU

2

• Router A tells all OSPF DRs on 224.0.0.6

• DR tells others on 224.0.0.5

xx

Link-State Change

LSU1

DRDR

AA BB

Page 56: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

LSU

3

Maintaining Routing InformationMaintaining Routing Information

LSU

2

xx

Link-State Change

LSU1

DRDR

AA BB

• Router A tells all OSPF DRs on 224.0.0.6

• DR tells others on 224.0.0.5

Page 57: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Maintaining Routing InformationMaintaining Routing Information

I need to update my routing table.

4

LSU

3

LSU

2

xx

Link-State Change

LSU1

DRDR

AA BB

• Router A tells all OSPF DRs on 224.0.0.6

• DR tells others on 224.0.0.5

Page 58: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Maintaining Routing Information (cont.)

Maintaining Routing Information (cont.)

Is entry inlink-state

database? LSA

LSU

No

Run SPF to calculate new routing table

Add to database

Flood LSA

End

Send LSAckto DR

Page 59: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Maintaining Routing Information (cont.)

Maintaining Routing Information (cont.)

Yes

Is seq. # the same?

Yes

Ignore LSAIs entry inlink-state

database? LSA

LSU

No

Run SPF to calculate new routing table

Add to database

Flood LSA

Send LSAckto DR

End

32bit 序号,序号越大,状态越新OSPF 规定,增长速率不超过每 5 秒一次, 600 年内不会产生重复号

Page 60: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Maintaining Routing Information (cont.)

Maintaining Routing Information (cont.)

No

Send LSUwith newer

information to source

Is seq. #higher?

No

Yes

Is seq. # the same?

Yes

Ignore LSAIs entry inlink-state

database? LSA

LSU

No

Run SPF to calculate new routing table

Add to database

Flood LSA

Send LSAckto DR

End End

Page 61: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Maintaining Routing Information (cont.)

Maintaining Routing Information (cont.)

Yes

Go to A

A

No

Send LSUwith newer

information to source

Is seq. #higher?

No

Yes

Is seq. # the same?

Yes

Ignore LSAIs entry inlink-state

database? LSA

LSU

No

Run SPF to calculate new routing table

Add to database

Flood LSA

Send LSAckto DR

End End

Page 62: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Point-to-Point Neighborship

– Router dynamically detects its neighboring router using the Hello protocol

– No election: Adjacency is automatic as soon as the two routers can communicate

– OSPF packets are always sent as multicast 224.0.0.5

Page 63: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

外部网关协议•不同 AS 为什么不能用 IGP, 原因:• Internet 规模太大,使 Inter-AS 路由选择非常困难

• AS 内部的路由协议各自定义• Inter-AS 路由选择必须考虑有关策略。例如:我国国内的站点互访不应经过国外兜圈子

Page 64: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

路由策略特点• 仅仅影响到达目标路由的下一跳• 不影响分组的目标地址,它影响用于到达目标的路径。

• 不允许数据流采用与 AS所选择路由不同的路径发往另一个 AS

• 仅仅影响数据流怎样到达 AS,不影响 AS内部路由• 可以实现任何于跳与跳范式相联系的规则• 检测源地址,所以它是在入站接口上进行配置• 内部路由优先于外部路由。

Page 65: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

BGP 路由模型•在 BGP 接点中, BGP 路由表与 IP 路由表是分开的。

• BGP 路由表用来确定如何将路由信息发送给对等路由器。

• IP 路由表在组织上又可分为: a. AS 内部路由表。 b. 其他 AS 通告的路径

• IP 路由表用于最终的路由选择。

策略引擎 BGP 路由表

IP 路由表

Page 66: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

BGP 运行过程•建立 AS 间的拓扑图。该拓扑图是通过各AS 的 BGP 路由器交换路由信息获得的。

•各 AS 通过邻居关系连接在一起,各个 AS之间的链路构成了所谓的树。

• BGP 按距离—矢量算法计算最短路径。• BGP 保留到每一个目的站的完整路由。

Page 67: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

BGP Operations (Simplified)

Establish session on TCP port 179

Exchange all active routes

Exchange incremental updates

AS1

AS2

While connection is ALIVE exchangeroute UPDATE messages

BGP session

Page 68: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Internet Inter-AS Routing: BGP

• BGP (Border Gateway Protocol, FRC 1771): the de facto standard inter-AS routing protocol

• Path vector protocol:– Similar to distance vector protocol– Each BGP router broadcasts to neighbors (peers) entire path

(i.e, sequence of ASs) to a destination AS, but not the cost to destination

• E.g., Gateway X may send its neighbors the path to destination Z: Path (X,Z) = X,Y1,Y2,Y3,Z

• BGP distributes path info among ASs, but leaves the policy for making the route selections up to the network admin

Page 69: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

BGP (cont’d)Suppose: gateway X sends its path to peer W• W may or may not select path offered by X

– Cost, policy (don’t route via competitors AS), loop prevention reasons.

• If W selects path advertised by X, then Path (W,Z) = W, Path (X,Z) = W,X,Y1,Y2,Y3,Z• Note: X can control incoming traffic by controlling its

route advertisements to peers:– E.g., don’t want to route traffic to Z don’t advertise

any routes to Z

Page 70: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

BGP (cont’d)• BGP messages exchanged using TCP, port 179• BGP messages:

– OPEN: opens TCP connection to peer, identifies and authenticates itself, sent when a BGP gateway wants to first establish contact with a BGP peer

– UPDATE: advertises new path (or withdraws old path)– KEEPALIVE: keeps connection alive in absence of UPDA

TES; also ACKs OPEN message– NOTIFICATION: reports errors in previous message; also

used to close connection

Page 71: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Autonomous Systems (AS)

AS = set of routers and networks under the same administrationNo theoretical limit to the size of the ASAll parts within an AS remain connected.

If two networks rely on core-AS to connect, they don’t belong to a single AS

AS is identified by a 16-bit AS numberAt least one border router per AS.

This router also collects reachability information (“external routes”) and diffuses it internally and vice versa

Page 72: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Autonomous Systems (Continued)

• AS types: – Stub AS => only single connection to one other AS =>

it carries only local traffic.– Multihomed AS: Connected to multiple AS, but does n

ot allow transit traffic– Transit AS: carries transit traffic under policy restrictio

ns

• Traffic types: – Local = traffic originating or terminating at AS. – Transit = non-local traffic

Page 73: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Many Routing Processes Can Run on a Single Router

Forwarding Table

OSPFDomain

RIPDomain

BGP

OS kernel

OSPF Process

RIP Process

RIP Routing tables

OSPF Routing tables

BGP Process

BGP Routing tables

Forwarding Table Manager

Page 74: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

IPv6

The New Internet Protocol

Page 75: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Outline

• The Protocol (new ICMP)• Addressing and Routing (provider addressing)• Autoconfiguration• Security• Support of Real-time Communication• Deployment Strategy

Page 76: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

The Design of IPv6

• IPv4 design was very good IPv6 should keep most of it

• It could only increase the size of addresses and keep every thing the same

• Experience brought lessons for improvement

Page 77: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

IPv6 Header (40 bytes)

Version Prio Flow Label

Payload Length Next Header Hop Limit

Source Address

Destination Address

0 3116

40 bytes

128 bits

128 bits

Page 78: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

IPv4 Header (20 bytes)

Version

identification DF MF Fragment offset

Source Address

Destination Address

0 3116

20 bytes 32 bits

32 bits

Hd len ToS

Tot len

Hd chksumprotocolTTL

Options (if any)

Page 79: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Note that while

the IPV6 address are four times as large as the IPV4 address,

the header length is only twice as big.

Page 80: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Notations of IPv6 Addresses

• 128 bit is represented as:– 8 integers (16-bit) separated by colons

• each integer is represented by 4 hex digits

Example:

FEDC:BA98:7654:3210:FEDC:BA98:7664:3210

Page 81: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Simplifications

• Skip leading zeros– Example:1080:0000:0000:0000:0008:0800:200C:417A – is reduced to: 1080:0:0:0:8:800:200C:417A

• A set of consecutive nulls is replaced by :: (at most one :: inside an address) – the above address is reduced to:

• 1080::8:800:200C:417A

Page 82: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Comparison of Headers

• V6: 6 fields + 2 addr• V4: 10 fields + 2 addr + options• Deleted:

– Header length – type of service– identification, flags, fragment offset– Header Checksum

• Added:– Priority– Flow label

• Renamed:– length -> Payload length– Protocol -> Next header– time to live -> Hop Limit

• Redefined: Option mechanism

Page 83: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Simplifications• Fixed format headers

– no options -> no need for header length– options expressed as Extension headers

• No header checksum– reduce cost of header processing, no checksum updates at

each router– minimal risk as encapsulation of media access protocols

(e.g..., Ethernet, PPP) have checksum

• No segmentation– hosts should use path MTU discovery– otherwise use the minimum MTU (536 bytes)

Page 84: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Renaming

• Total Length Payload Length– not include header length– max length 64Kbytes with provision for larger packets

using “jumbo gram” option• Protocol Type Next header, can be set to:

– Protocol type (UDP,TCP, etc..)– Type of first extension header

• TTL Hop limit– “Truth in advertising!”,– number of hops NOT number of seconds

Page 85: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

New Fields

• Flow label & Priority– to facilitate the handling of real time traffic

Page 86: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Options Extension Headers

Routers treats packets with options as “second class citizens” because it is slow to process, thus programmers tend not use them and options almost became obsolete.

Page 87: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Daisy Chain of Headers

TCP Header + Data

IPv6 HeaderNext Header=TCP

TCP Header + DataIPv6 HeaderNext Header=Routing

Routing HeaderNext Header=TCP

Page 88: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

IPv6 extension headers

• Hop-by-hop options

• Routing

• Fragment

• Destination options

• Authentication

• Encryption Security Payload

Page 89: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Protocol & Header Types

Decimal Keyword Header Type0 HBH hop-by-hop3 ICMP Inet Control4 IP v4 encapsul.6 TCP17 UDP43 RH Routing hdr

Page 90: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Routing HeaderNext Header 0 Num addrs Next Addr

strict/loose bit mask (24)Reserved

Address[0]

Address[Num Addrs -1]

………………………...

Routers will only look at the routing header if they recognize one of their addresses in the destination field of the main header

Page 91: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Fragment Header• Routers do not fragment oversized packets

• Sender is to fragment &

Receiver is to reassemble

Next Header Reserved Fragment offset Res M

Identification

Page 92: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Destination Option Header

Will only be examined by the station

specified in the destination address.

Next Header Hdr Ext Len

Options

Option Type Opt Data Len Option Data

Page 93: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Hop-by-Hop Option Header

Will be examined by each router.

Has same form as destination options hdr.

194 Opt Len = 4

Jumbo Payload Length

To satisfy networking requirement of supercomputers,the Jumbo payload option is used to send very large packets (the IPv6 length field is set to zero):

Page 94: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

ICMP…. Streamlined

• Removed unused functions in ICMP of v4

• Incorporate IGMP of v4

Type Code Checksum

Message Body

Page 95: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

ICMP Error Messages

1 Destination Unreachable. Codes: 0 No route to destination 1 destination prohibited 3 Address unreachable 4 Port unreachable

2 Packet Too Big contain next hop MTU. used for path MTU discovery

3 Time Exceeded. Codes: 0 Hop limit exceeded 1 Fragment reassebly time exceed

4 Parameter ProblemNo error message in response to multicast or ICMP packets

Page 96: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Other ICMP messages128 Echo Request129 Echo Reply

130 Group Membership Query131 Group Membership Report132 Group Membership Termination

133 Router Solicitation134 Router Advertisement135 Neighbor Solicitation136 Neighbor Advertisement137 Redirect

Page 97: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Impact on Upper LayersUpper-layer Checksums

pseudoheader transport header transport data

Source Address

Destination Address

0 Next header Payload Length

: Mandatory (even UDP)

Page 98: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Domain Name Service32-bit address to 128-bit address

Programming interfaceAddress data structures AF_INET6, PF_INET6, in_addr6, sockaddr_in6

Name-to-address translation functions Address conversion functions

Page 99: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Points of ControversyPoints of Controversy

• Do we need more than 255 Hops?– allowing hop count to be very large, looping packets

will be relayed many times before being discarded

• Should packets be larger than 64K?– allowing very large packets increase the size of queues

and the variability of queuing delays

• Can we live without checksum?– Some IPv4 routers started to cut corners by not

verifying checksums to gain advantage over competition. By removing checksum altogether offers all routers the same advantage.

Page 100: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Real-time Support & Flows

• A proper handling of flows is required for high-quality multimedia communications in the new Internet

• A flow is a sequence of packets sent from a particular source to a particular (unicast or multicast) destination for which the source desires special handling by the intervening routers.

Page 101: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Real-time flows & Data Queues

S

R1

R2

R3

data

The flow label & source address are used to assert which packets belong to what flows

In IPv6 port numbers deep inside due to daisy chaining Even may not be visible due to encryption

Page 102: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

SecurityIf security is provided at the IP level it

becomes standard service that all applications can use

It is absolutely necessary to implement if we want to develop of commercial use the Internet, e.g...., to deter sniffing attacks on passwords and credit card numbers.

Page 103: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

HeadersAuthentication header

Guarantee that the source address is authentic &

the packet has not been altered during transmission.

Encryption headerGuarantee that only legitimate receivers

will be able to read the content of the packet

Page 104: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

Transitioning the Internet

• At the beginning, all IPv6-capable hosts will also be IPv4-capable so as to retain connectivity with the existing Internet.

• To transform IPv4 into a dual-stack IPv6-capable host, it should include:– The IPv6 basic code– Handling IPv6 within TCP & UDP– Modify socket interface to support new addresses– Handling the interface with the name service

Page 105: RIP ( Routing Information Protocol) RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15.

The 6-Bone• The Similar to the M-Bone, Initially the

connectivity is achieved by tunneling

• IPv6 packet will be encapsulated within IPv4 packets.

IPv6 domain

IPv6 domain

R R

IPv4 onlyNetwork