IP2 (1c) IP Routing Open Shortest Path First (OSPF)

Listed by “ show ip ospf database nssa-external ”. Metric 10. Forwarding address. 172.320.157.254. Mask 255.255.255.0. 10.83.10.0. Type 7. ASBR. Router ID.
328KB taille 4 téléchargements 298 vues
IP2 (1c) IP Routing Open Shortest Path First (OSPF) Hervé TREMEUR AT&T Labs AT&T Global Network [email protected] IP2 Training

CISCO router introduction

Contents (1) Open Shortest Path First (cont.) y y y y y y y y y y

NSSA External LSAs (type 7) Stub area Totally Stub area Not-So-Stubby Area Which LSAs are allowed in which area ? OSPF Route Table OSPF authentication OSPF Packet Formats OSPF Packet Header Hello packet

CISCO router introduction

Contents (2) Open Shortest Path First y y y y y y y y y y y

Database Description packet Link State Request packet Link State Update packet Link State Acknowledgement packet OSPF LSA Formats : LSA Header Router LSA (1) Router LSA (2) Network LSA Network and ASBR summary LSA Autonomous System External LSA NSSA External LSA

CISCO router introduction

NSSA External LSAs (type 7) (1) Originated by ASBR router within Not-so-stubby-area (NSSA)

y NSSA External LSAs are flooded only inside NSSA area y Almost identical to As External LSAs (flooded throughout OSPF domain) y Listed by “ show ip ospf database nssa-external ” 1 0 .8 3 .1 0 .0 /2 4

Type 7 10.83.10.0 Mask 255.255.255.0 Metric 10 Forwarding address

1 7 2 .2 0 .5 7 .2 5 4 ASBR R o u te r ID 1 9 2 .1 6 8 .3 0 .6 0

ABR

N S S A A re a O S P F D o m a in

172.320.157.254

CISCO router introduction

NSSA External LSAs (type 7) (2) •NI-PE2-7513LP#sh ip ospf database nssa-external OSPF Router with ID (172.30.128.10) (Process ID 1) •

Type-7 AS External Link States (Area 22)

• Routing Bit Set on this LSA • LS age: 1803 • Options: (No TOS-capability, Type 7/5 translation, DC) • LS Type: AS External Link • Link State ID: 135.44.161.0 (External Network Number ) • Advertising Router: 172.20.50.50 • LS Seq Number: 80000086 • Checksum: 0xCAA6 • Length: 36 • Network Mask: /24 •

Metric Type: 2 (Larger than any link state path)



TOS: 0



Metric: 20



Forward Address: 172.20.50.50



External Route Tag: 0

CISCO router introduction

Stub area (1) Stub area definition

y area into which AS external LSAs are not flooded y If type 5 LSAs are not known inside an area, type 4 LSAs are unnecessary, these LSAs are also blocked

y

ABR at the edge of the stub area will use Network Summary area LSAs to advertise a single default route (destination 0.0.0.0) into the area.

y Because the default route is carried in type 3 LSAs, it will not be advertised outside of the area

ASBR

A re a 2

A re a 0

CISCO router introduction

Stub area (2) Stub area advantages

y

memory can be conserved and performance improved by making area 2 stub area (the database is reduced

Restrictions on Stub area

1. All router s in stub area must have identical link state database , all stub routers will set a flag (E bit) in heir Hello packet to zero . Adjacencies will be established between two routers if they match the E bit.

2. Virtual link can not be configured within or transit a stub area 3. No router in a stub area can be an ASBR ( ASBR produces LSA type 5 not possible in stub area)

4. A stub area may have more than one ABR , but with the defaults route, the internal routers can not determine which router is the gateway to the ASBR

CISCO router introduction

Totally Stub area For Stub area memory is saved by

y

blocking the propagation of LSAs type 5 and type 4

y

Using default route to reach destinations external to the OSPF domain

totally stub area save more memory by

y

Blocking type 3 LSAs (Summary LSAs)

y

Uses default route to reach also all destinations external to the area

CISCO router introduction

Not-So-Stubby Area (1) Not So-Stubby area definition

y

Allow external routes to be advertised into the OSPF domain while keeping the characteristics of the stub area to the rest of domain.

Not So-Stubby area operation RIP

ASBR

Area 2

Area 0

y

RIP speaker has Default route pointing to Area 2 router

y

OSPF routers must know about the networks attached to RIP router

y

To do this, the ASBR in an NSSA will originate Type 7 LSAs to advertise the external destination

CISCO router introduction

Not-So-Stubby Area (2) ASBR router within Not So-Stubby area

y

The NSSA external LSAs are flooded throughout the NSSA but are blocked at the ABR.

y

The NSSA External LSA has a flag in its header (P bit)

y

NSSA ASBR has the option of setting or clearing (P) bit

y

If (P) bit set to 1, NSSA ABR will translate the LSA type 7 into LSA type 5 and flood it to OSPF domain.

RIP

Type 7 Type 5 ASBR Type 7

Type 7

Area 2

Type 7

Area 0

CISCO router introduction

Which LSAs are allowed in which area ? LSAs types allowed per area type Area Type

LSA 1 & 2 LSA 3 & 4

LSA Yes

5

LSA No

Backbone (area 0)

Yes

Yes

Non Backbone, non stub

Yes

Yes

Yes

No

Stub

Yes

Yes

No

No

Totally Stub

Yes

No

No

No

Not-So-Stubby

Yes

Yes

No

Yes

7

CISCO router introduction

OSPF Route Table (1) SPF algorithm processing

y

The Dijktra’s algorithm is used to calculate the Shortest Path Tree from the LSAs in the Link State Database

y

The SPF algorithm is run once to build the branches of the tree which are the links of each node ( router) in the area

y

The algorithm is then run a second time to add the stub networks (leaves) to each router

Cisco default OSPF cost (not specified in RFC 2328)

y

The cost of a route is the sum of all costs of outgoing interfaces to a destination

y

Cisco router calculate default cost : Cost = 10**8 / BW ,( BW in bps)

y

Example : on FastEthernet interface (100 Mbps), Cost = 1

y

The cost on the interfaces may be changed by “ ip ospf cost “command

CISCO router introduction

OSPF Route Table (2) Cisco default interface costs Interface type

Cost ( 10**8 / (BW)

FDDI Fast Ethernet

1

HSSI

2

16 Mbps Token Ring

6

Ethernet

10

E1 (2.048 Mbps)

50

T1 (1.544 Mbps

64

DS0 (64 Kbps)

1562

Tunnel (9K)

11111

CISCO router introduction

OSPF Route Table (3) Destination Types : Each route entry will be classified according to a destination type, the destination types will be network or router

y

Network entries are the addresses of networks to reach, the command “show ip route “ is used to display them

y

Router entries are routes to ABRs and ASBRs, the command “show ip ospf border-routers “ is used to display them

Path types :

y

Intra-area paths to destination inside the same area

y

Inter-area paths to destination in another area, tagged with IA

y

Type 1 external paths, tagged E1, the cost is the sum oft his external cost plus the cost of the path to the ASBR

y

Type 2 external paths, tagged E2, the cost is only the external cost

CISCO router introduction

OSPF Route Table (4) Route table look up : (steps to select the best route)

y

Select the route with the most specific match to the destination address.

y

Path types are prioritized in the following order :

1. Intra-area paths 2. Inter-area paths 3. E1 external paths 4. E2 external paths y

Load balancing over four equal-cost paths (4 by default) and (6 maximum with command “ maximum-paths =6 “’

CISCO router introduction

OSPF authentication OSPF can authenticates all packets exchanged between neighbors :

y

Simple password or

y

MD5 cryptographic checksums

y

Must be done for entire Area

Router R1 (MD5 example) : interface Serial0 ip address 172.30.128.166 255.255.255.252 ip ospf message-digest-key 10 md5 cisco interface Serial1

172.30.128.164 / 30

ip address 172.30.128.178 255.255.255.252

R1

ip ospf message-digest-key 10 md5 cisco .166

router ospf 50 router-id 172.30.128.3

.178 172.30.128.176 / 30

log-adjacency-changes area 1 authentication message-digest area 1 stub

Area 0

network 172.30.128.164 0.0.0.3 area 1

Area 1

network 172.30.128.176 0.0.0.3 area 1

CISCO router introduction

OSPF Packet Formats OSPF packet is composed of series of encapsulation

y

Cisco’’s maximum packet size : 1500 bytes IP Header Protocol # (89)

OSPF Packet

OSPF Packet Header

OSPF Packet Data

Packet Typespecific Data

LSA

LSA

LSA Header

LSA

LSA

LSA Data

LSA

CISCO router introduction

OSPF Packet Header OSPF packet begins with 24 bytes header - Version: OSPF version 2

3 2 B its

- Type : 1 hello, 2 database description Type

V e rs io n

P a c k e t L e n g th

4 Link state update

R o u te r Id

5 Link State Acknowledgement

A re a Id C hecksum

A u Type

- Area ID of the origin area

A u th e n tic a tio n

P a c k e t D a ta

If A u T y p e = 2 , th e a u th e n tic a tio n fie ld is K e y ID

C ry p to g ra p h ic S e q u e n c e N u m b e r

- Packet length of the OSPF packet - Router Id of the originating router

A u th e n tic a tio n

0x0000

3 Link State request,

A u th e n tic a tio n d a ta le n g h t

- Authentication= password if au type =1 - Authentication= key ID Authentication data length ,cryptographic sequence number if au type =2 - Key ID : identities the secret key used to create the message digest - Authentication data length :length in octet of the message digest - Cryptographic S N : non decreasing number used to replay attacks

CISCO router introduction

Hello packet Hello packet carries parameters on which neighbors must agree in order to form adjacency 3 2 B it s Type

V e r s io n

P a c k e t L e n g th R o u te r Id A re a Id

C hecksum

A u Type A u t h e n tic a t io n A u t h e n t ic a t io n N e tw o rk M a s k

H e llo I n t e r v a l

O p t io n s R o u t e r d e a d in t e r v a l D e s ig n a t e d r o u t e r

B a c k u p d e s ig n a t e d r o u t e r N e ig h b o r

N e ig h b o r

R o u t e r P r io r it y

CISCO router introduction

Database Description packet Database description packet is used when adjacency is being established 32 Bits

Type

Version

Packet Length R outer Id Area Id

C hecksum

Au Type Authentication Authentication

Interface M TU

O ptions D D Sequence N um ber

LSA H eaders

00000

I

M MS

CISCO router introduction

Link State Request packet Ask to neighbor for its copy of the LSAs 3 2 B its

V e r s io n

T ype 3

P a c k e t L e n g th

R o u te r Id A r e a Id C hecksum

A u T ype A u th e n tic a tio n A u th e n tic a tio n L in k S ta te ty p e L in k s ta te ID A d v e r tis in g r o u te r

L in k S ta te T y p e L in k S ta te ID A d v e r tis in g R o u te r

CISCO router introduction

Link State Update packet Used in flooding LSAs , answer to Link State Request 32 B its

V ersion

T ype 4

P acket Length

R outer Id A rea Id C hecksum

A u T ype A uthentication A uthentication N um ber of LS A s

LS A s

CISCO router introduction

Link State Acknowledgement packet Each LSA received from a neighbor must be acknowledged 32 Bits

Version

Type 5

Packet Length

Router Id Area Id Checksum

Au Type Authentication Authentication

LSA Headers

CISCO router introduction

OSPF LSA Formats : LSA Header The LSA Header

32 Bits

Age

Type

Options Link State ID Advertising Router Sequence Number

Checksum

Lenght

CISCO router introduction

Router LSA (1) The Router LSA is produced by all routers (router’s links, states, outgoing cost) 3 2 B its

Type = 1

O p tio n s

Age

L in k S ta te ID A d v e r tis in g R o u te r Sequence N um ber C hecksum 00000

V

E B

Lenght 0x00

N u m b e r o f L in k s L in k ID L in k D a ta

L in k T y p e

N um ber of TO S

M e tr ic

TOS

0x00

Y O S M e tr ic

L in k ID L in k D a ta

CISCO router introduction

Router LSA (2) Link Type

connection

1

Point-to-point connection to another router

2

Connection to a transit network

3

Connection to a stub network

4

Virtual Link

Link Type

Value of Link ID Field

1

Neighboring router’s router ID

2

IP address of the DR’s interface

3

IP Network or subnet address

4

Neighboring router’s router ID

Link Type

Value of Link Data Field

1

IP address of the originating router’s interface to the network

2

IP address of the originating router’s interface to the network

3

Network’s IP address or subnet mask

4

MIB-II ifindex value for the originating router’s interface.

CISCO router introduction

Network LSA The Network LSA is produced by DRs 32 Bits

Age

Type = 2

Options Link State ID Advertising Router Sequence Number

Checksum

Lenght Network Mask Attached Router

Attached Router

CISCO router introduction

Network and ASBR summary LSA The Network Summary LSA (Type 3) and ASBR summary LSA (type 4) have identical format with some contents Differences (type,link state ID,..) 32 Bits

Age

Type = 3 or 4

Options Link State ID Advertising Router Sequence Number

Checksum

Lenght Network Mask

0x00

Metric

TOS

TOS Metric

0x00

Metric

CISCO router introduction

Autonomous System External LSA Originated by ASBR

3 2 B its

Age

Type = 5

O p tio n s L in k S ta te ID A d v e rtis in g R o u te r S equence N um ber

C hecksum

Lenght N e tw o rk M a s k

E

M e tric

0000000

F o rw a rd in g a d d re s s E x te rn a l R o u te T a g N e tw o rk M a s k E

TOS

T O S M e tric F o rw a rd in g a d d re s s E x te rn a l R o u te T a g

N e tw o rk M a s k E

0000000

M e tric F o rw a rd in g a d d re s s E x te rn a l R o u te T a g

CISCO router introduction

NSSA External LSA Originated by ASBR 3 2 B it s

Type = 7

O p t io n s

Age

L in k S t a t e I D A d v e r t is in g R o u t e r S equence N um ber C hecksum

Lenght N e tw o rk M a s k

E

M e t r ic

TOS

F o r w a r d in g a d d r e s s E x te rn a l R o u te T a g N e tw o rk M a s k

N e tw o rk M a s k E

TOS

M e t r ic F o r w a r d in g a d d r e s s E x te rn a l R o u te T a g