bsci4-ospf single area ppt

35
1 OSPF OSPF in in single area single area June 2007 June 2007

Upload: netvicho

Post on 21-Oct-2015

23 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Bsci4-Ospf Single Area Ppt

1

OSPFOSPF in in

single areasingle area

June 2007June 2007

Page 2: Bsci4-Ospf Single Area Ppt

2OverviewOSPF C/C’s

1- Open Standard link state routing protocol

2- Send partial triggered updates called LSA at start up and at changes

3- Updates is sent on multicast (224.0.0.5 or 224.0.0.6 / unicast addresses)

4- While convergence period a LSDB (Link State DataBase) refreshment updates is sent every 30min.

5- LSDB entries expires after 60 min. (maxage) without refreshment

6- Symbol in routing table is “O”

7- Administrative Distance = 110

8- Metric is cost = 108/BW of interface , BW of interface is T1(1.54Mbps) by default, and can be controlled using , (config-if)#bandwidth <BW in units of Kbps>Max hop count for networks is undefined

9- Support equal load sharing with default of 4 paths and maximum of 6 paths

10- Support Hierarchical design

Page 3: Bsci4-Ospf Single Area Ppt

3• OSPF tables:

1- Neighbor table (adjacency table)

- List of all neighbors (a neighbor is direct connected & understands the same protocol)

#show ip ospf neighbors

2- Topology table (Link State Data Base - LSDB)

Contains all routers and their attached links in the area or network,

or in other way all routes to all destination networks.

All routers within an area has identical copy of it.

#show ip ospf database

3- Routing table (forwarding database)

- Best routes to all destination networks.

#show ip route [ospf]

Page 4: Bsci4-Ospf Single Area Ppt

4• OSPF topologies:1- BMA (Broadcast Multiple Access)Ex: Ethernet & Token ring links

2- Point to pointA network that joins a single pair of routers.Ex: Interfaces running PPP or HDLC or point to point sub interfaces ATM & Frame

Relay

3- NBMA (Non Broadcast Multiple Access)

Ex: Multipoint ATM, Frame Relay & X.25

OSPF autodetects the interface type, so it can detect how the operation will work.

A network that interconnects more than two routers but that has no broadcast capability.

Page 5: Bsci4-Ospf Single Area Ppt

5• OSPF packet types:

1- Hello packet:- Used for neighbor discovery and maintenance of neighbor relationship.- Sent periodically on multicast address 224.0.0.5 (all OSPF routers) every 10sec. on BMA topology, point to point links and NBMA point to point links & every 30sec. on NBMA multipoint topology

2- DDP (DBD): DataBase Description Packet.- It contains summary of entries inside LSDB.

3- LSR: Link State Request packet.- To request a part of LSDB from neighbor.

4- LSU: Link State Update (Group of LSAs)- It is the detailed information for entries inside the LSDB.

5- LSACK: Link State Acknowledgement.- Acknowledges the reception of LSUs.

Page 6: Bsci4-Ospf Single Area Ppt

6

• Operation of OSPF in BMA:1- Neighbor discovery (hello protocol) – forming adjacency:

1.1- down state:

- No communication yet.

1.2 - Initial state:

- The first discovery hello is sent.

Conditions of OSPF routers to be neighbors:1 -Same area ID.

2 -Same hello & dead intervals.3 -Same authentication password.

4- Same Stub area flag.

So B will never reply with a hello until these conditions matches with its values

Page 7: Bsci4-Ospf Single Area Ppt

7• Hello packet:

Version Type packet length

RID

Area ID

Check sum authentication type

Password

Password

Hello interval options (area type) router priority

Router dead interval

DR ID

BDR ID

Neighbor 1

.

.

Neighbor n

• The hello packet is encapsulated into IP packet with protocol field in IP packet indicating OSPF payload encapsulated

Page 8: Bsci4-Ospf Single Area Ppt

8

1.3 – Two way state:- The neighbor relationship is formed.

Note:The Two way state is the final state between Drothers.

Page 9: Bsci4-Ospf Single Area Ppt

9

2- Election of DR & BDR (if not exist)

- DR (Designated Router) is the router having the highest :

a- First router that is ready for OSPF operation (already booted up & has complete configuration)

b-OSPF priority (0 – 255) on interface facing the BMA segment, default = 1, priority=0 mean can neither be DR nor BDR

c- Router ID

-Defined value through configuration

-Highest IP address for a logical loopback interface

- Highest IP address for a physical active interface

- BDR is a Backup DR and it has the second highest priority or RID.

- The remaining routers are called Drothers.

- The DR election is non-preemptive (no one can take DR place, even if it has a better priority or RID, unless DR fails)

Note: the rest of operation will be completed between each router and their DR and BDR only

Page 10: Bsci4-Ospf Single Area Ppt

103- Routes discovery:

Page 11: Bsci4-Ospf Single Area Ppt

11LSA Operation

Page 12: Bsci4-Ospf Single Area Ppt

12

RouterA# debug ip ospf adj

*Feb 17 18:41:51.242: OSPF: Interface Serial0/0/1 going Up*Feb 17 18:41:51.742: OSPF: Build router LSA for area 0,router ID 10.1.1.1, seq 0x80000013*Feb 17 18:41:52.242: %LINEPROTO-5-UPDOWN: Line protocol onInterface Serial0/0/1, changed state to up*Feb 17 18:42:01.250: OSPF: 2 Way Communication to 10.2.2.2 onSerial0/0/1, state 2WAY*Feb 17 18:42:01.250: OSPF: Send DBD to 10.2.2.2 onSerial0/0/1 seq 0x9B6 opt 0x52 flag 0x7 len 32*Feb 17 18:42:01.262: OSPF: Rcv DBD from 10.2.2.2 onSerial0/0/1 seq 0x23ED opt0x52 flag 0x7 len 32 mtu 1500 state EXSTART*Feb 17 18:42:01.262: OSPF: NBR Negotiation Done. We are the SLAVE*Feb 17 18:42:01.262: OSPF: Send DBD to 10.2.2.2 onSerial0/0/1 seq 0x23ED opt 0x52 flag 0x2 len 72*Feb 17 18:42:01.294: OSPF: Rcv DBD from 10.2.2.2 onSerial0/0/1 seq 0x23EE opt0x52 flag 0x3 len 72 mtu 1500 state EXCHANGE*Feb 17 18:42:01.294: OSPF: Send DBD to 10.2.2.2 onSerial0/0/1 seq 0x23EE opt 0x52 flag 0x0 len 32*Feb 17 18:42:01.294: OSPF: Database request to 10.2.2.2*Feb 17 18:42:01.294: OSPF: sent LS REQ packet to 192.168.1.102, length 12*Feb 17 18:42:01.314: OSPF: Rcv DBD from 10.2.2.2 onSerial0/0/1 seq 0x23EF opt0x52 flag 0x1 len 32 mtu 1500 state EXCHANGE*Feb 17 18:42:01.314: OSPF: Exchange Done with 10.2.2.2 on Serial0/0/1*Feb 17 18:42:01.314: OSPF: Send DBD to 10.2.2.2 onSerial0/0/1 seq 0x23EF opt 0x52 flag 0x0 len 32*Feb 17 18:42:01.326: OSPF: Synchronized with 10.2.2.2 onSerial0/0/1, state FULL*Feb 17 18:42:01.330: %OSPF-5-ADJCHG: Process 10, Nbr 10.2.2.2on Serial0/0/1 from LOADING to FULL, Loading Done*Feb 17 18:42:01.830: OSPF: Build router LSA for area 0,router ID 10.1.1.1, seq 0x80000014

Creation of Adjacencies

Page 13: Bsci4-Ospf Single Area Ppt

13

RouterA# debug ip ospf adj

Ethernet interface coming up: Election%LINK-3-UPDOWN: Interface ethernet0, changed state to up

OSPF: Interface ethernet0 going UpOSPF: Rcv hello from 192.168.0.11 area 0 from Serial1 10.1.1.2OSPF: End of hello processingOSPF: Build router LSA for area 0, router ID 192.168.0.10OSPF: send hello to 192.168.0.11 on ethernet0 seq 0x20C4 opt 0x2 flag 0x7 len 32 state INIT

OSPF: 2 Way Communication to 192.168.0.11 on Ethernet0, state 2WAYOSPF: end of Wait on interface Ethernet0OSPF: DR/BDR election on Ethernet0OSPF: Elect BDR 192.168.0.12OSPF: Elect DR 192.168.0.12 DR: 192.168.0.12 (Id) BDR: 192.168.0.12 (Id)OSPF: Rcv DBD from 172.16.1.1 on FastEthernet0/0 seq 0x14B 7 opt 0x52 flag 0x7 len 32 mtu 1500 state EXSTARTOSPF: First DBD and we are not SLAVE

<…>

Creation of Adjacencies

Page 14: Bsci4-Ospf Single Area Ppt

144 – Choosing routes:• Each router in the area places itself into the root of the tree that is built.• The best path is calculated with respect to the lowest total cost of links to a specific

destination.• Forming the routing table by applying the SPF algorithm (Dijkstra algorithm) on the

LSDB to form the RTG table.

Page 15: Bsci4-Ospf Single Area Ppt

15

Operation of OSPF in point to point

- The same operation of BMA but no DR & BDR exists.

Page 16: Bsci4-Ospf Single Area Ppt

16

• At convergence :

- No further updates unless the LSDB time expires (30 min.)

- periodic keepalive hellos are sent, dead interval is 4*hello.

Hello/dead=10/40 sec for BMA & P-P, 30/120 sec for NBMA multipoint.

- Each link-state entry also has a maximum age of 60 minutes. If a link-

state entry has not been refreshed within 60 minutes, it is removed from

the LSDB.

Page 17: Bsci4-Ospf Single Area Ppt

17• At change:

Page 18: Bsci4-Ospf Single Area Ppt

18Convergence stability: To solve the flapping link problem, OSPF uses the convergence stability rules (timers).

1 -SPF delay time: (5sec.) -Time to wait after hearing last update so as the router can perform the

SPF calculation .

2 -SPF hold time: (10sec.) -Delay between two SPF calculations .

Page 19: Bsci4-Ospf Single Area Ppt

19- Basic configuration:(config)# router ospf <process id> ! process id = 1-65535 & can never be 0, a maximum of 32 process could be supported by ospf ! process id = 1-65535 & can never be 0, a maximum of 32 process could be supported by ospf

(config-router)#network <net. add.> <w.c.m> area <area id>

Or

Router(config-if)# ip ospf process-id area area-id!! Optional method to enable OSPF explicitly on an interface Optional method to enable OSPF explicitly on an interface

Page 20: Bsci4-Ospf Single Area Ppt

20

or

0

00

00

or

Page 21: Bsci4-Ospf Single Area Ppt

21

Define the router ID:(config-router #)router-id <ip address<

Loopback interface:(config #)int loopback 0

(config-if #)ip address <ip> <mask<

Router#clear ip ospf process !This command will clear process which will help the router to use the This command will clear process which will help the router to use the

new RIDnew RID

Optional configuration: OSPF Router ID

Page 22: Bsci4-Ospf Single Area Ppt

22

- Defining router priority:(config)# int e0/0(config-if)# ip ospf priority <no.>

- Defining interface cost:1- (config-if)# ip ospf cost <no.>2- (config-if)# bandwidth <no. in kbps>3- (config-router)# ospf auto-cost reference-bandwidth <no.>

- Ospf timers:(config-router)# timer spf <spf delay time> <spf hold time>(config-if)# ip ospf hello-interval <no. in sec>(config-if)# ip ospf dead-interval <no. in sec>

- Defining the no. of paths for load sharing:(config-router)# maximum-paths <no.>

Optional configuration:

Page 23: Bsci4-Ospf Single Area Ppt

23OSPF Router Authentication– OSPF supports 2 types of authentication:

• Simple password (or plain text) authentication• MD5 authentication

Configuring OSPF Password Authentication

Router(config-if)# ip ospf authentication-key password! Assigns a ! Assigns a simple passwordsimple password to be used with neighboring routers to be used with neighboring routersorRouter(config-if)#ip ospf message-digest-key key-id md5 key! Assigns a ! Assigns a hash based passwordhash based password to be used with neighboring routers to be used with neighboring routers

Activate the authentication on interface:Router(config-if)#ip ospf authentication [message-digest | null]

OrOrRouter(config-router)# area area-id authentication [message-digest]

Page 24: Bsci4-Ospf Single Area Ppt

24Example Simple Password Authentication Configuration

Example MD5 Authentication Configuration

Page 25: Bsci4-Ospf Single Area Ppt

25

Page 26: Bsci4-Ospf Single Area Ppt

26

#show ip routeRouterA# show ip route ospf

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP, D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area, E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP, i - IS-IS, L1 - IS-ISlevel-1, L2 - IS-IS level-2, * - candidate default

Gateway of last resort is not set10.0.0.0 255.255.255.0 is subnetted, 2 subnets

O 10.2.1.0 [110/10] via 10.64.0.2, 00:00:50, Ethernet0

#show ip ospf neighborsRouterB# show ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface10.64.0.1 1 FULL/BDR 00:00:32 10.64.0.1 Ethernet010.2.1.1 1 FULL/- 00:00:38 10.2.1.1 Serial0

TroubleshootingTroubleshooting

Page 27: Bsci4-Ospf Single Area Ppt

27

#show ip ospf interfaceRouterA# show ip ospf interface e0

Ethernet0 is up, line protocol is up Internet Address 10.64.0.1/24, Area 0 Process ID 1, Router ID 10.64.0.1, Network Type BROADCAST, Cost: 10 Transmit Delay is 1 sec, State BDR, Priority 1 Designated Router (ID) 10.64.0.2, Interface address 10.64.0.2 Backup Designated router (ID) 10.64.0.1, Interface address 10.64.0.1 Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 Hello due in 00:00:02 Neighbor Count is 1, Adjacent neighbor count is 1 Adjacent with neighbor 10.64.0.2 (Designated Router) Suppress hello for 0 neighbor(s)

TroubleshootingTroubleshooting

Page 28: Bsci4-Ospf Single Area Ppt

28

RouterB# show ip ospf

Routing Process "ospf 1" with ID 10.2.1.1 Supports only single TOS(TOS0) routes SPF schedule delay 5 secs, Hold time between two SPFs 10 secs Number of DCbitless external LSA 0 Number of DoNotAge external LSA 0 Number of areas in this router is 1. 1 normal 0 stub 0 nssa Area BACKBONE(0) (Active) Number of interfaces in this area is 2 Area has no authentication SPF algorithm executed 10 times Area ranges are Link State Update Interval is 00:30:00 and due in 0:07:16 Link State Age Interval is 00:20:00 and due in 00:07:15 Number of DCbitless LSA 0 Number of indication LSA 0 Number of DoNotAge LSA 0

#show ip ospf

Page 29: Bsci4-Ospf Single Area Ppt

29

#show ip protocols

- To let any changes appear on the CLI in a live manner:(config-router)#log-adjacency-changes#debug ip ospf adjacency#debug ip ospf packet

RouterC# show ip ospf database

OSPF Router with ID (10.2.1.1) (Process ID 10) Router Link States (Area 1)

Link ID ADV Router Age Seq# Checksum Link count 10.2.1.1 10.2.1.1 48 0x80000001 0xB112 210.64.0.2 10.64.0.2 104 0x80000008 0xB112 2

10.64.0.1 10.64.0.1 212 0x80000006 0x3F44 2

#show ip ospf database

RouterC# debug ip ospf packet

OSPF: rcv. v:2 t:1 l:48 rid:10.64.0.2 aid:0.0.0.0 chk:6AB2 aut:0 auk:

Page 30: Bsci4-Ospf Single Area Ppt

30OSPF operation in NBMA networksDue to based on layer 3 concepts all devices on NBMA segment mustbe in the same subnet, so OSPF (layer 3 protocol) need to treat them as direct neighbors, on the other hand using layer 2 concepts they may not be directly connected (no PVC between all of them) they are not next hops to each others, but OSPF can treat them in some cases as direct neighbors as in the case of NBMA mode.

Page 31: Bsci4-Ospf Single Area Ppt

31OSPF operation in NBMA networks

or partial mesh

Page 32: Bsci4-Ospf Single Area Ppt

32• Configuration for NBMA networks:(config)# int s0/0(config-if)# ip ospf network { non-broadcast / broadcast / point-to-multipoint [non-broadcast]/ point-to-point}

- To define the neighbor statically:(config-router)# neighbor <ip> [priority <no.>] [database-filter all]

Note :The default mode for main interface & multipoint subinterface is non-broadcast and for point to point sub interface

is point to point.

Page 33: Bsci4-Ospf Single Area Ppt

33

RouterA(config)# router ospf 100RouterA(config-router)# network 130.130.0.0 0.0.255.255 area 0RouterA(config-router)# network 140.140.0.0 0.0.255.255 area 0RouterA(config-router)# neighbor 140.140.1.2 priority 0RouterA(config-router)# neighbor 140.140.1.3 priority 0

Priority 0 , tells the local router that it is the DR (all its neighbors have 0 priority), this method is used to define DR statically

Ex1: Routers in an NBMA mode

RouterA# show ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface130.130.1.1 1 full/ — 0:00:35 128.12.1.2 s0201.23.13.1 0 full/drother 0:00:36 140.140.1.2 s1192.100.1.1 0 full/drother 0:00:34 140.140.1.3 s1

Page 34: Bsci4-Ospf Single Area Ppt

34Ex2: Routers in Multipoint mode

RouterA(config)# router ospf 100RouterA(config-router)# network 140.140.0.0 0.0.255.255 area 0RouterA(config-router)# network 130.130.0.0 0.0.255.255 area 0RouterA(config)# interface serial 0RouterA(config-if)# encapsulation hdlcRouterA(config-if)# ip address 130.130.1.2 255.255.255.0RouterA(config)# interface serial 1RouterA(config-if)# encapsulation frame-relayRouterA(config-if)# ip address 140.140.1.1 255.255.255.0RouterA(config-if)# ip ospf network point-to-multipoint

RouterB(config)# router ospf 100RouterB(config-router)# network 140.140.0.0 0.0.255.255 area 0RouterB(config)# interface serial 0RouterB(config-if)# ip address 140.140.1.2 255.255.255.0RouterB(config-if)# encapsulation frame-relayRouterB(config-if)# ip ospf network point-to-multipoint

130.130.1.2S0

RouterA# show ip ospf interface s1

Serial1 is up, line protocol is up Internet Address 140.140.1.1/24, Area 1 Process ID 100, Router ID 120.120.1.1, Network Type Point-To-Multipoint, Cost: 64 Transmit Delay is 1 sec, State: Point_To_Multipoint Timer intervals configured,Hello 30, Dead 120, Wait 120, Retransmit 5 Hello due in 00:00:11 Neighbor count is 2, Adjacent neighbor count is 2 Adjacent with neighbor 140.140.1.2 Adjacent with neighbor 140.140.1.3

Page 35: Bsci4-Ospf Single Area Ppt

35Ex3: Routers using point-to-point subinterfaces

RouterA(config)# router ospf 100RouterA(config-router)# network 140.140.0.0 0.0.255.255 area 0RouterA(config-router)# network 130.130.0.0 0.0.255.255 area 0RouterA(config)# interface serial 0RouterA(config-if)# encapsulation pppRouterA(config-if)# ip address 130.130.1.2 255.255.255.0RouterA(config)# interface serial 1.1 point-to-pointRouterA(config-subif)# frame-relay interface-dlci 101RouterA(config-subif)# ip address 140.140.1.1 255.255.255.0RouterA(config-subif)#interface serial 1.2 point-to-pointRouterA(config-subif)# frame-relay interface-dlci 102RouterA(config-subif)# ip address 140.140.2.1 255.255.255.0

RouterA# show ip ospf interface s1

Serial1 is up, line protocol is up Internet Address 140.140.1.1/24, Area 1 Process ID 100, Router ID 120.120.1.1, Network Type Point-To-point, Cost: 64 Transmit Delay is 1 sec, State: Point_To_point Timer intervals configured,Hello 30, Dead 120, Wait 120, Retransmit 5 Hello due in 00:00:11 Neighbor count is 2, Adjacent neighbor count is 2 Adjacent with neighbor 140.140.1.2 Adjacent with neighbor 140.140.1.3

130.130.1.2S0