- classless link state protocol
- use dijski spf algorithm
-maintains active adjacencies
-supports vlsm
-supports topology + nlri summarization (summarise out of classful boundary)
The rfc relation to ospf is 2328
- higer bandwidth is lower cost
- each router should have full map of it local area and does independent calculation
of the spf algorithm
- For external routes local router calculate there best path to the Area Border
Router
to enable ospf
router ospf "proccess id" = process id is only locally significatnt does not need to
match to form adjancies
you must have a up up interface in order for ospf to run as it will be used for ospf
router id
enable the ospf process on interface with
router ospf 1
network "address" "wildcard mask" area "area id"
or
you could enable directly on interface
int fa0/0
ip ospf "process-id" area "area id"
network statements can overlap most specfic wins
for unnumbered interfaces you would use the network statement for the interface the
unnumbered is referencing
verfication of ospf is enable
-----------------------------
show ip ospf
show ip ospf interface "brief"
verify adjacencies
------------------
show ip ospf neighbor
debug ip ospf adj
verify ospf database
---------------------
sh ip ospf database " router | network | summary | "
Neighbor & Topology discovery
-------------------------------
like eigrp ospf uses hello packets default is dependent on network type
- transport via ip protocol 89 (ospf)
- send multicast to 224.0.0.5 or 224.0.0.6 or unicasts
hello packets contain attributes that the neighbors must agree on to form adjacency
not all ospf neighbors form a adjacency
unique attributes for a ospf router
-local router id
- locatl interface ip address
common attributes
- interface area-id - so what lsa flooding domain you are in
- hello & dead interval - should match,dead interval opposite to eigrp this means how
long i willwait before declaring a neighbor down
-inteface network address - on same subnet (you may run in to trouble with ppp with
mismatch subets or ip unnumbered interfaces
-interface mtu - this should match across neighbors
-network type- needs to be compatiable so p2p or nmba or broadcast etc
-authentication- null,clear text and md5
-stub flag- nssa,stub,totally stub etc
Router id
--------------
The ospf router id is selected by the following if no manual router id is specfied it
highest loopback ip address on the router if no loopback are configured it is the
highest ip on phyical interface
ospf states in neighbor forming
================================
down
init
2-way(recieved a hello with it router id in it)
exstart
exchange
loading
full
OSPF PACKET TYPES
-----------------------------
OSPF has 5 main packet types Hello,DBD,LSR,LSU and LSACK
They all share the same 20 byte common packet header
Type will describe whether a hello,dbd,lsr,lsu,lsack follows
Hello- used for neighbor discovery and maintains supervision on neighbor relationship
DBD- Database desciption used to send a the lsa headers of all know ospf routes as scaled down description of database for neighboring routers. It is also used in the master slave election The first dbd from each neighbor is used for this purpose.
LSR- Link State Request used to retrieve precise information from neighboring database that is missing in our database typically a neighbor will compare it database to DBD sent if inconsistent it will request the particular missing attributes via LSR request packet
LSU - Link State Update Packets are used in the flooding of the database to other neighbors a LSU contains multiple lsa (link state advertisements) LSU are also used for giving specfic information in regard to LSR requests
LSACK
Is used to acknowledge each lsa it is sent in response to a LSU packet
OSPF LSA TYPES Local Area
--------------------------
OSPF TYPE 1 LSA- Router - local link states of router
OSPF TYPE 2 LSA-NETWORK- Generated by DR for summary of links on segment
OSPF TYPE 3 + 4 LSA these are the summary lsa generated by ABR. Type 3 summary of networks in a rea Type 4 to advertise route to ASBR
TYPE 5 LSA Generated by ASBR Describing external routes
OSPF
OSPF TYPE 2 LSA- Network- generated by DR on broadcast segment listing what
networks are joined togther by the segment
LAB
----
For the LAB i will just setup a singular OSPF area and look at the show commands check the DR election show ip ospf database lsa types in singular area
sw4 (layer 2 switch)
=====================
switch4(config)#no ip routing
switch4(config)#vlan 100
switch4(config-vlan)#exit
switch4(config)#int fa0/6
switch4(config-if)#switchport
switch4(config-if)#switchport access vlan 100
switch4(config-if)#int fa0/4
switch4(config-if)#switchport
switch4(config-if)#switchport access vlan 100
switch4(config-if)#interface range fa0/16 - 18
switch4(config-if-range)#shut
switch4(config-if-range)#switchport
switch4(config-if-range)#channel-group 2 mode desira
Creating a port-channel interface Port-channel 2
switch4(config-if-range)#exit
switch4(config)#int po2
switch4(config-if)#switchport access vlan 100
switch4(config-if)#
r4
---
r4(config)#int fa0/0
r4(config-if)#ip address 10.229.254.4 255.255.255.0
r4(config-if)#no shut
r4(config)#int lo0
r4(config-if)#ip address 4.4.4.4 255.255.255.255
4(config)#router ospf 1
r4(config-router)#network 10.229.254.0 0.0.0.255 area 0
r4(config-router)#exit
sw2
----
switch2(config)#int po8
switch2(config-if)#ip address 10.229.254.2 255.255.255.0
switch2(config-if)#int lo0
switch2(config-if)#ip address 2.2.2.2 255.255.255.255
switch2(config-if)#exit
switch2(config)#
I will put a debug just to watch the neighbor relationship form between r4 and sw2p
switch2#debug ip ospf adj
OSPF adjacency events debugging is on
switch2#debug ip ospf event
OSPF events debugging is on
switch2#debug packet
Packet debugging is on
switch2#
switch2(config)#router ospf 1
switch2(config-router)#network 10.229.254.0 0.0.0.255 area 0
00:13:47: OSPF: Interface Port-channel8 going Up
00:13:47: OSPF: Send hello to 224.0.0.5 area 0 on Port-channel8 from 10.229.254.2
00:13:48: OSPF: Rcv hello from 4.4.4.4 area 0 from Port-channel8 10.229.254.4
00:13:48: OSPF: 2 Way Communication to 4.4.4.4 on Port-channel8, state 2WAY
00:13:48: OSPF: Backup seen Event before WAIT timer on Port-channel8
00:13:48: OSPF: DR/BDR election on Port-channel8
00:13:48: OSPF: Elect BDR 2.2.2.2
00:13:48: OSPF: Elect DR 4.4.4.4
00:13:48: OSPF: Elect BDR 2.2.2.2
00:13:48: OSPF: Elect DR 4.4.4.4
00:13:48: DR: 4.4.4.4 (Id) BDR: 2.2.2.2 (Id)
00:13:48: OSPF: Send DBD to 4.4.4.4 on Port-channel8 seq 0x75D opt 0x52 flag 0x7 len 32
00:13:48: OSPF: End of hello processing
00:13:48: OSPF: Rcv DBD from 4.4.4.4 on Port-channel8 seq 0x105B opt 0x52 flag 0x7 len 32 mtu 1500 state EXSTART
00:13:48: OSPF: NBR Negotiation Done. We are the SLAVE
00:13:48: OSPF: Send DBD to 4.4.4.4 on Port-channel8 seq 0x105B opt 0x52 flag 0x0 len 32
00:13:48: OSPF: Rcv DBD from 4.4.4.4 on Port-channel8 seq 0x105C opt 0x52 flag 0x3 len 52 mtu 1500 state EXCHANGE
00:13:48: OSPF: Send DBD to 4.4.4.4 on Port-channel8 seq 0x105C opt 0x52 flag 0x0 len 32
00:13:48: OSPF: Rcv DBD from 4.4.4.4 on Port-channel8 seq 0x105D opt 0x52 flag 0x1 len 32 mtu 1500 state EXCHANGE
00:13:48: OSPF: Exchange Done with 4.4.4.4 on Port-channel8
00:13:48: OSPF: Send LS REQ to 4.4.4.4 length 12 LSA count 1
00:13:48: OSPF: Send DBD to 4.4.4.4 on Port-channel8 seq 0x105D opt 0x52 flag 0x0 len 32
00:13:48: OSPF: Rcv LS UPD from 4.4.4.4 on Port-channel8 length 64 LSA count 1
00:13:48: OSPF: Synchronized with 4.4.4.4 on Port-channel8, state FULL
00:13:48: %OSPF-5-ADJCHG: Process 1, Nbr 4.4.4.4 on Port-channel8 from LOADING to FULL, Loading Done
00:13:48: OSPF: Build router LSA for area 0, router ID 2.2.2.2, seq 0x80000001
00:13:48: OSPF: Rcv LS UPD from 4.4.4.4 on Port-channel8 length 64 LSA count 1
00:13:48: OSPF: Rcv LS UPD from 4.4.4.4 on Port-channel8 length 60 LSA count 1
00:13:53: OSPF: Rcv LS UPD from 4.4.4.4 on Port-channel8 length 64 LSA count 1
00:13:57: OSPF: Send hello to 224.0.0.5 area 0 on Port-channel8 from 10.229.254.2
00:13:58: OSPF: Rcv hello from 4.4.4.4 area 0 from Port-channel8 10.229.254.4
ok the first thing we notice straight away is the router id being used are 4.4.4.4 and 2.2.2.2 these are the highest ip address on the loopbacks so they automatically being decided as the router id.
We start in down then when s2 recieves a hello packet back from r4 with s2 router id in it we go to the two way state. THen we start the election the highest ip is 4.4.4.4 r4 and is selected as the DR while s2 2.2.2.2 is selected a bdr for the broadcast segment we go into exstart when we recieved database descriptor dbd packet
. We next go into exchange where we are sending + recieving ls request and ls responses for networks we done not have. Once the exchange is done we go to loading state once we are decieded we are synchonised we go to the full state.
Now lets bring r6 into the equation
lets advertise the loopback 2.2.2.2 network via ospf on sw2
router ospf 1
network 2.2.2.2 0.0.0.0 area 0
switch2(config-router)#
00:25:24: OSPF: Interface Loopback0 going Up
00:25:25: OSPF: Build router LSA for area 0, router ID 2.2.2.2, seq 0x80000004
00:25:25: OSPF: Add Type 1 LSA ID 2.2.2.2 Adv rtr 2.2.2.2 Seq 80000004 to Port-channel8 4.4.4.4 retransmission list
00:25:25: OSPF: Add Type 1 LSA ID 2.2.2.2 Adv rtr 2.2.2.2 Seq 80000004 to Port-channel8 flood list
00:25:25: OSPF: Sending update over Port-channel8 without pacing
00:25:25: OSPF: Flooding update on Port-channel8 to 224.0.0.5 Area 0
00:25:25: OSPF: Send Type 1, LSID 2.2.2.2, Adv rtr 2.2.2.2, age 1, seq 0x80000004 (0)
00:25:25: OSPF: Remove Type 1 LSA ID 2.2.2.2 Adv rtr 2.2.2.2 Seq 80000004 from Port-channel8 flood list
00:25:25: OSPF: Stop Port-channel8 flood timer
00:25:27: OSPF: rcv. v:2 t:5 l:44 rid:4.4.4.4
aid:0.0.0.0 chk:B0FF aut:0 auk: from Port-channel8
00:25:27: OSPF: Received ACK from 4.4.4.4 on Port-channel8
00:25:27: OSPF: Rcv Ack Type 1, LSID 2.2.2.2, Adv rtr 2.2.2.2, age 1, seq 0x80000004
00:25:27: OSPF: Remove Type 1 LSA ID 2.2.2.2 Adv rtr 2.2.2.2 Seq 80000004 from 4.4.4.4 retransmission list
00:25:28: OSPF: rcv. v:2 t:1 l:48 rid:4.4.4.4
aid:0.0.0.0 chk:CEBC aut:0 auk: from Port-channel8
so we can see we are building the router lsa type 1 and multicasting the update to 224.0.0.5
ok lets bring r6 in the equation now. Remeber the DR and BDR have been elected r6 has a higher loopback we will check will preempt the previous election
r6
---
r6(config)#int fa0/0
r6(config-if)#ip address 10.229.254.6 255.255.255.0
r6(config-if)#no shut
r6(config)#int lo0
r6(config-if)#ip address 6.6.6.6 255.255.255.0
r6(config-if)#exit
r6(config)#router ospf 1
r6(config-router)#network 10.229.254.0 0.0.0.255 area 0
r6(config-router)#network 6.6.6.6 0.0.0.255 area 0
r6(config-router)#
*Dec 28 14:16:42.007: OSPF: Interface FastEthernet0/1 going Up
*Dec 28 14:16:42.007: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/1 from 10.229.254.6
*Dec 28 14:16:42.475: OSPF: rcv. v:2 t:1 l:52 rid:4.4.4.4
aid:0.0.0.0 chk:C2AC aut:0 auk: from FastEthernet0/1
*Dec 28 14:16:42.475: OSPF: Rcv hello from 4.4.4.4 area 0 from FastEthernet0/1 10.229.254.4
*Dec 28 14:16:42.479: OSPF: 2 Way Communication to 4.4.4.4 on FastEthernet0/1, state 2WAY
*Dec 28 14:16:42.479: OSPF: End of hello processing
*Dec 28 14:16:42.507: OSPF: Build router LSA for area 0, router ID 6.6.6.6, seq 0x80000002, process 1
*Dec 28 14:16:43.047: OSPF: rcv. v:2 t:1 l:52 rid:2.2.2.2
aid:0.0.0.0 chk:C2AC aut:0 auk: from FastEthernet0/1
*Dec 28 14:16:43.047: OSPF: Rcv hello from 2.2.2.2 area 0 from FastEthernet0/1 10.229.254.2
*Dec 28 14:16:43.047: OSPF: 2 Way Communication to 2.2.2.2 on FastEthernet0/1, state 2WAY
*Dec 28 14:16:43.047: OSPF: Backup seen Event before WAIT timer on FastEthernet0/1
*Dec 28 14:16:43.047: OSPF: DR/BDR election on FastEthernet0/1
*Dec 28 14:16:43.047: OSPF: Elect BDR 2.2.2.2
*Dec 28 14:16:43.047: OSPF: Elect DR 4.4.4.4
*Dec 28 14:16:43.047: DR: 4.4.4.4 (Id) BDR: 2.2.2.2 (Id)ex
*Dec 28 14:16:43.047: OSPF: Send DBD to 2.2.2.2 on FastEthernet0/1 seq 0x1F3D opt 0x52 flag 0x7 len 32
*Dec 28 14:16:43.047: OSPF: Send DBD to 4.4.4.4 on FastEthernet0/1 seq 0x1C90 opt 0x52 flag 0x7 len 32
*Dec 28 14:16:43.047: OSPF: End of hello processing
*Dec 28 14:16:48.047: OSPF: Send DBD to 2.2.2.2 on FastEthernet0/1 seq 0x1F3D opt 0x52 flag 0x7 len 32
*Dec 28 14:16:48.047: OSPF: Retransmitting DBD to 2.2.2.2 on FastEthernet0/1 [1]
*Dec 28 14:16:48.047: OSPF: Send DBD to 4.4.4.4 on FastEthernet0/1 seq 0x1C90 opt 0x52 flag 0x7 len 32
*Dec 28 14:16:48.047: OSPF: Retransmitting DBD to 4.4.4.4 on FastEthernet0/1 [1]
*Dec 28 14:16:48.047: OSPF: rcv. v:2 t:2 l:32 rid:4.4.4.4
aid:0.0.0.0 chk:9146 aut:0 auk: from FastEthernet0/1
*Dec 28 14:16:48.047: OSPF: Rcv DBD from 4.4.4.4 on FastEthernet0/1 seq 0xCAC opt 0x52 flag 0x7 len 32 mtu 1500 state EXSTART
*Dec 28 14:16:48.047: OSPF: First DBD and we are not SLAVE
*Dec 28 14:16:48.047: OSPF: rcv. v:2 t:2 l:92 rid:4.4.4.4
aid:0.0.0.0 chk:ABE9 aut:0 auk: from FastEthernet0/1
*Dec 28 14:16:48.047: OSPF: Rcv DBD from 4.4.4.4 on FastEthernet0/1 seq 0x1C90 opt 0x52 flag 0x2 len 92 mtu 1500 state EXSTART
*Dec 28 14:16:48.047: OSPF: NBR Negotiation Done. We are the MASTER
*Dec 28 14:16:48.051: OSPF: Send DBD to 4.4.4.4 on FastEthernet0/1 seq 0x1C91 opt 0x52 flag 0x3 len 52
*Dec 28 14:16:48.051: OSPF: Database request to 4.4.4.4
*Dec 28 14:16:48.051: OSPF: sent LS REQ packet to 10.229.254.4, length 36
*Dec 28 14:16:48.051: OSPF: rcv. v:2 t:2 l:32 rid:2.2.2.2
aid:0.0.0.0 chk:8093 aut:0 auk: from FastEthernet0/1
*Dec 28 14:16:48.051: OSPF: rcv. v:2 t:2 l:92 rid:2.2.2.2
aid:0.0.0.0 chk:AD40 aut:0 auk: from FastEthernet0/1
*Dec 28 14:16:48.051: OSPF: Rcv DBD from 2.2.2.2 on FastEthernet0/1 seq 0x2163 opt 0x52 flag 0x7 len 32 mtu 1500 state EXSTART
*Dec 28 14:16:48.051: OSPF: First DBD and we are not SLAVE
*Dec 28 14:16:48.051: OSPF: Rcv DBD from 2.2.2.2 on FastEthernet0/1 seq 0x1F3D opt 0x52 flag 0x2 len 92 mtu 1500 state EXSTART
*Dec 28 14:16:48.051: OSPF: NBR Negotiation Done. We are the MASTER
*Dec 28 14:16:48.051: OSPF: Send DBD to 2.2.2.2 on FastEthernet0/1 seq 0x1F3E opt 0x52 flag 0x3 len 52
*Dec 28 14:16:48.055: OSPF: Database request to 2.2.2.2
*Dec 28 14:16:48.055: OSPF: sent LS REQ packet to 10.229.254.2, length 36
*Dec 28 14:16:48.055: OSPF: rcv. v:2 t:2 l:32 rid:4.4.4.4
aid:0.0.0.0 chk:8168 aut:0 auk: from FastEthernet0/1
*Dec 28 14:16:48.055: OSPF: rcv. v:2 t:3 l:36 rid:4.4.4.4
aid:0.0.0.0 chk:DDB7 aut:0 auk: from FastEthernet0/1
*Dec 28 14:16:48.055: OSPF: rcv. v:2 t:4 l:156 rid:4.4.4.4
aid:0.0.0.0 chk:DB48 aut:0 auk: from FastEthernet0/1
*Dec 28 14:16:48.055: OSPF: Rcv DBD from 4.4.4.4 on FastEthernet0/1 seq 0x1C91 opt 0x52 flag 0x0 len 32 mtu 1500 state EXCHANGE
*Dec 28 14:16:48.055: OSPF: Send DBD to 4.4.4.4 on FastEthernet0/1 seq 0x1C92 opt 0x52 flag 0x1 len 32
*Dec 28 14:16:48.055: OSPF: rcv. v:2 t:2 l:32 rid:2.2.2.2
aid:0.0.0.0 chk:82BF aut:0 auk: from FastEthernet0/1
*Dec 28 14:16:48.055: OSPF: rcv. v:2 t:4 l:156 rid:2.2.2.2
aid:0.0.0.0 chk:DF4C aut:0 auk: from FastEthernet0/1
*Dec 28 14:16:48.059: OSPF: Rcv DBD from 2.2.2.2 on FastEthernet0/1 seq 0x1F3E opt 0x52 flag 0x0 len 32 mtu 1500 state EXCHANGE
*Dec 28 14:16:48.059: OSPF: Send DBD to 2.2.2.2 on FastEthernet0/1 seq 0x1F3F opt 0x52 flag 0x1 len 32
*Dec 28 14:16:48.059: OSPF: rcv. v:2 t:2 l:32 rid:4.4.4.4
aid:0.0.0.0 chk:8167 aut:0 auk: from FastEthernet0/1
*Dec 28 14:16:48.059: OSPF: rcv. v:2 t:4 l:76 rid:4.4.4.4
aid:0.0.0.0 chk:98C aut:0 auk: from FastEthernet0/1
*Dec 28 14:16:48.059: OSPF: Rcv DBD from 4.4.4.4 on FastEthernet0/1 seq 0x1C92 opt 0x52 flag 0x0 len 32 mtu 1500 state EXCHANGE
*Dec 28 14:16:48.059: OSPF: Exchange Done with 4.4.4.4 on FastEthernet0/1
*Dec 28 14:16:48.059: OSPF: Synchronized with 4.4.4.4 on FastEthernet0/1, state FULL
*Dec 28 14:16:48.059: %OSPF-5-ADJCHG: Process 1, Nbr 4.4.4.4 on FastEthernet0/1 from LOADING to FULL, Loading Done
ok we can see here that the dr and bdr were already set so even though we have a higher rid it does not come into play
unless r4 which is the dr there will not be another reelection
ok we will bring r5 into the equation now
so firstly we will configure the interface on
r4
---
r4(config)#int s0/1/0
r4(config-if)#ip address 172.25.13.4 255.255.255.0
r4(config-if)#no shut
r4(config)#router ospf 1
r4(config-router)#network 172.25.13.0 0.0.0.255 area 0
r4(config-router)#
r5
---
r5#config t
Enter configuration commands, one per line. End with CNTL/Z.
r5(config)#int s0/1/0
r5(config-if)#ip address 172.25.13.5 255.255.255.0
r5(config-if)#ip ospf 1 area 0
just to show configuring on singular interface
*Dec 28 14:24:03.115: OSPF: Interface Serial0/1/0 going Up
*Dec 28 14:24:03.115: OSPF: Send hello to 224.0.0.5 area 0 on Serial0/1/0 from 172.25.13.5
*Dec 28 14:24:03.615: OSPF: Build router LSA for area 0, router ID 5.5.5.5, seq 0x80000001, process 1
*Dec 28 14:24:08.231: OSPF: rcv. v:2 t:1 l:48 rid:4.4.4.4
aid:0.0.0.0 chk:DA88 aut:0 auk: from Serial0/1/0
*Dec 28 14:24:08.231: OSPF: Rcv hello from 4.4.4.4 area 0 from Serial0/1/0 172.25.13.4
*Dec 28 14:24:08.235: OSPF: 2 Way Communication to 4.4.4.4 on Serial0/1/0, state 2WAY
*Dec 28 14:24:08.235: OSPF: Send DBD to 4.4.4.4 on Serial0/1/0 seq 0x24BF opt 0x52 flag 0x7 len 32
*Dec 28 14:24:08.235: OSPF: End of hello processing
*Dec 28 14:24:08.235: OSPF: rcv. v:2 t:2 l:32 rid:4.4.4.4
aid:0.0.0.0 chk:99EA aut:0 auk: from Serial0/1/0
*Dec 28 14:24:08.235: OSPF: Rcv DBD from 4.4.4.4 on Serial0/1/0 seq 0x408 opt 0x52 flag 0x7 len 32 mtu 1500 state EXSTART
*Dec 28 14:24:08.235: OSPF: First DBD and we are not SLAVE
*Dec 28 14:24:08.235: OSPF: rcv. v:2 t:2 l:132 rid:4.4.4.4
aid:0.0.0.0 chk:A306 aut:0 auk: from Serial0/1/0
*Dec 28 14:24:08.235: OSPF: Rcv DBD from 4.4.4.4 on Serial0/1/0 seq 0x24BF opt 0x52 flag 0x2 len 132 mtu 1500 state EXSTART
*Dec 28 14:24:08.239: OSPF: NBR Negotiation Done. We are the MASTER
*Dec 28 14:24:08.239: OSPF: Send DBD to 4.4.4.4 on Serial0/1/0 seq 0x24C0 opt 0x52 flag 0x3 len 52
*Dec 28 14:24:08.239: OSPF: Database request to 4.4.4.4
*Dec 28 14:24:08.239: OSPF: sent LS REQ packet to 172.25.13.4, length 60
*Dec 28 14:24:08.239: OSPF: rcv. v:2 t:2 l:32 rid:4.4.4.4
aid:0.0.0.0 chk:7939 aut:0 auk: from Serial0/1/0
*Dec 28 14:24:08.239: OSPF: Rcv DBD from 4.4.4.4 on Serial0/1/0 seq 0x24C0 opt 0x52 flag 0x0 len 32 mtu 1500 state EXCHANGE
*Dec 28 14:24:08.239: OSPF: Send DBD to 4.4.4.4 on Serial0/1/0 seq 0x24C1 opt 0x52 flag 0x1 len 32
*Dec 28 14:24:08.243: OSPF: rcv. v:2 t:4 l:268 rid:4.4.4.4
aid:0.0.0.0 chk:7237 aut:0 auk: from Serial0/1/0
*Dec 28 14:24:08.243: OSPF: rcv. v:2 t:2 l:32 rid:4.4.4.4
aid:0.0.0.0 chk:7938 aut:0 auk: from Serial0/1/0
*Dec 28 14:24:08.243: OSPF: Rcv DBD from 4.4.4.4 on Serial0/1/0 seq 0x24C1 opt 0x52 flag 0x0 len 32 mtu 1500 state EXCHANGE
*Dec 28 14:24:08.243: OSPF: Exchange Done with 4.4.4.4 on Serial0/1/0
*Dec 28 14:24:08.243: OSPF: Synchronized with 4.4.4.4 on Serial0/1/0, state FULL
*Dec 28 14:24:08.243: %OSPF-5-ADJCHG: Process 1, Nbr 4.4.4.4 on Serial0/1/0 from LOADING to FULL, Loading Done
notice that as we are directly connected to r4 from r5 the network type is point to point we have dr bdr election as it is network type point there is master slave for the commmunication of flooding lsa but that is it
ok now we will bring r2 into the area to complete the config this will be the same as the above a point to point network so dr/bdr election
r2
---
r2(config)#int lo0
r2(config-if)#ip address
*Mar 1 03:36:31.699: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed
r2(config-if)#ip address 22.22.22.22 255.255.255.0
r2(config-if)#int f0/0
r2(config-if)#ip address 10.164.49.22 255.255.255.0
r2(config-if)#no shut
r2(config-if)#router ospf 1
r2(config-router)#network 22.22.22.0 0.0.0.255 area 0
r2(config-router)#network 10.164.49.0 0.0.0.255 area 0
r2(config-router)#
s2
--
switch2(config)#int fa0/2
switch2(config-if)#no switchport
switch2(config-if)#ip ospf network point-to-point
switch2(config-if)#ip address 10.164.49.2 255.255.255.0
switch2(config-if)#no shut
switch2(config)#router ospf 1
switch2(config-router)#network 10.164.49.0 0.0.0.255 area 0
ok we will have a look a few of the commands
switch2#sh ip ospf
Routing Process "ospf 1" with ID 2.2.2.2
Start time: 00:13:33.745, Time elapsed: 00:47:27.957
Supports only single TOS(TOS0) routes
Supports opaque LSA
Supports Link-local Signaling (LLS)
Supports area transit capability
Router is not originating router-LSAs with maximum metric
Initial SPF schedule delay 5000 msecs
Minimum hold time between two consecutive SPFs 10000 msecs
Maximum wait time between two consecutive SPFs 10000 msecs
Incremental-SPF disabled
Minimum LSA interval 5 secs
Minimum LSA arrival 1000 msecs
LSA group pacing timer 240 secs
Interface flood pacing timer 33 msecs
Retransmission pacing timer 66 msecs
Number of external LSA 0. Checksum Sum 0x000000
Number of opaque AS LSA 0. Checksum Sum 0x000000
Number of DCbitless external and opaque AS LSA 0
Number of DoNotAge external and opaque AS LSA 0
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
Number of areas transit capable is 0
External flood list length 0
Reference bandwidth unit is 100 mbps
Area BACKBONE(0)
Number of interfaces in this area is 3 (1 loopback)
Area has no authentication
SPF algorithm last executed 00:01:16.051 ago
SPF algorithm executed 20 times
Area ranges are
Number of LSA 7. Checksum Sum 0x03D1F1
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
from the sh ip ospf we can see we have a router id of 2.2.2.2 we min hold time between 2 consective runs of spf of 10000 msecs that means if we run the spf algorithm and another change comes along we will wait 10000 msecs before rerunning the spf this is to prevent overloading of the processing
we can see timere lsa intervals of 5 seconds etc
we can see we have 3 interfaces in area 0 one of the m is loopback only 1 area is int the router area 0
we have no authentication switched on in the area
switch2#sh ip ospf neigh
Neighbor ID Pri State Dead Time Address Interface
22.22.22.22 0 FULL/ - 00:00:35 10.164.49.22 FastEthernet0/2
4.4.4.4 1 FULL/DR 00:00:38 10.229.254.4 Port-channel8
6.6.6.6 1 FULL/DROTHER 00:00:37 10.229.254.6 Port-channel8
switch2#
from the sh ip ospf neighbors we can see we have 3 adjacncies one 22.22.22.22 is point to point signified by FULL/- meaning there is no DR requirement this interface could be point to point point to multi point to multi non broadcast
we have full adjacncy with 4.4.4.4 and 4.4.4.4 is the DR
we have full adjacency with 6.6.6.6 and is a DROTHER meaning it is not dr or bdr
witch2#sh ip ospf neigh detail
Neighbor 22.22.22.22, interface address 10.164.49.22
In the area 0 via interface FastEthernet0/2
Neighbor priority is 0, State is FULL, 6 state changes
DR is 0.0.0.0 BDR is 0.0.0.0
Options is 0x52
LLS Options is 0x1 (LR)
Dead timer due in 00:00:34
Neighbor is up for 00:06:55
Index 3/3, retransmission queue length 0, number of retransmission 0
First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)
Last retransmission scan length is 0, maximum is 0
Last retransmission scan time is 0 msec, maximum is 0 msec
Neighbor 4.4.4.4, interface address 10.229.254.4
In the area 0 via interface Port-channel8
Neighbor priority is 1, State is FULL, 6 state changes
DR is 10.229.254.4 BDR is 10.229.254.2
Options is 0x52
LLS Options is 0x1 (LR)
Dead timer due in 00:00:37
Neighbor is up for 00:52:42
Index 1/1, retransmission queue length 0, number of retransmission 0
First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)
Last retransmission scan length is 0, maximum is 0
Last retransmission scan time is 0 msec, maximum is 0 msec
Neighbor 6.6.6.6, interface address 10.229.254.6
In the area 0 via interface Port-channel8
Neighbor priority is 1, State is FULL, 6 state changes
DR is 10.229.254.4 BDR is 10.229.254.2
Options is 0x52
LLS Options is 0x1 (LR)
Dead timer due in 00:00:35
Neighbor is up for 00:36:58
Index 2/2, retransmission queue length 0, number of retransmission 1
First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)
Last retransmission scan length is 1, maximum is 1
Last retransm
if we do the detail version of the command we get more info in regard to our adjacncies
switch2#sh ip ospf int
FastEthernet0/2 is up, line protocol is up (connected)
Internet Address 10.164.49.2/24, Area 0
Process ID 1, Router ID 2.2.2.2, Network Type POINT_TO_POINT, Cost: 1
Transmit Delay is 1 sec, State POINT_TO_POINT,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:07
Supports Link-local Signaling (LLS)
Index 3/3, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 22.22.22.22
Suppress hello for 0 neighbor(s)
Loopback0 is up, line protocol is up
Internet Address 2.2.2.2/32, Area 0
Process ID 1, Router ID 2.2.2.2, Network Type LOOPBACK, Cost: 1
Loopback interface is treated as a stub Host
Port-channel8 is up, line protocol is up (connected)
Internet Address 10.229.254.2/24, Area 0
Process ID 1, Router ID 2.2.2.2, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State BDR, Priority 1
Designated Router (ID) 4.4.4.4, Interface address 10.229.254.4
Backup Designated router (ID) 2.2.2.2, Interface address 10.229.254.2
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:03
Supports Link-local Signaling (LLS)
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 2
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 2, Adjacent neighbor count is 2
Adjacent with neighbor 4.4.4.4 (Designated Router)
Adjacent with neighbor 6.6.6.6
Suppress hello fo
if we use sh ip ospf interfaces we can see what interfaces are running ospf + what cost the interface is which will be used by spf + what network type + dr + bdr
We can see the hello + dead intervals
switch2#sh ip ospf database
OSPF Router with ID (2.2.2.2) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 709 0x8000000B 0x00756C 4
4.4.4.4 4.4.4.4 1886 0x80000009 0x00CED8 4
5.5.5.5 5.5.5.5 1686 0x80000004 0x00ABED 3
6.6.6.6 6.6.6.6 529 0x80000004 0x00A846 2
22.22.22.22 22.22.22.22 710 0x80000005 0x00D355 2
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
10.229.254.4 4.4.4.4 688 0x80000003 0x003FC1
switch2#
ok this should match across all routers in this area
we can see that for example link id 4.4.4.4 has 4 attached links(interfaces) in ospf
We can get details of these links by doing the
switch2#sh ip ospf database router 4.4.4.4
OSPF Router with ID (2.2.2.2) (Process ID 1)
Router Link States (Area 0)
LS age: 65
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 4.4.4.4
Advertising Router: 4.4.4.4
LS Seq Number: 8000000A
Checksum: 0xCCD9
Length: 72
Number of Links: 4
Link connected to: another Router (point-to-point)
(Link ID) Neighboring Router ID: 5.5.5.5
(Link Data) Router Interface address: 172.25.13.4
Number of TOS metrics: 0
TOS 0 Metrics: 64
Link connected to: a Stub Network
(Link ID) Network/subnet number: 172.25.13.0
(Link Data) Network Mask: 255.255.255.0
Number of TOS metrics: 0
TOS 0 Metrics: 64
Link connected to: a Stub Network
(Link ID) Network/subnet number: 4.4.4.4
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: a Transit Network
(Link ID) Designated Router address: 10.229.254.4
(Link Data) Router Interface address: 10.229.254.4
Number of TOS metrics: 0
TOS 0 Metrics: 1
The DR is 4.4.4.4 is sending out network lsa in regard to what is attached to the segment. So all routers are aware of what is attached to the segment.
switch2#sh ip ospf database network 10.229.254.4
OSPF Router with ID (2.2.2.2) (Process ID 1)
Net Link States (Area 0)
Routing Bit Set on this LSA
LS age: 916
Options: (No TOS-capability, DC)
LS Type: Network Links
Link State ID: 10.229.254.4 (address of Designated Router)
Advertising Router: 4.4.4.4
LS Seq Number: 80000003
Checksum: 0x3FC1
Length: 36
Network Mask: /24
Attached Router: 4.4.4.4
Attached Router: 2.2.2.2
Attached Router: 6.6.6.6
so if you see here 4.4.4.4 is saying that the following are attached to the broadcast segment which are 4.4.4.4,2.2.2.2,6.6.6.6
so for example sw2 2.2.2.2 knows in order to have a full picture of the area it needs to recieve the router lsa with the local link states from these attached routers.
so look at r4 router lsa
r2#sh ip ospf database router 4.4.4.4
OSPF Router with ID (22.22.22.22) (Process ID 1)
Router Link States (Area 0)
LS age: 633
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 4.4.4.4
Advertising Router: 4.4.4.4
LS Seq Number: 8000000A
Checksum: 0xCCD9
Length: 72
Number of Links: 4
Link connected to: another Router (point-to-point)
(Link ID) Neighboring Router ID: 5.5.5.5
(Link Data) Router Interface address: 172.25.13.4
Number of TOS metrics: 0
TOS 0 Metrics: 64
Link connected to: a Stub Network
(Link ID) Network/subnet number: 172.25.13.0
(Link Data) Network Mask: 255.255.255.0
Number of TOS metrics: 0
TOS 0 Metrics: 64
Link connected to: a Stub Network
(Link ID) Network/subnet number: 4.4.4.4
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: a Transit Network
(Link ID) Designated Router address: 10.229.254.4
(Link Data) Router Interface address: 10.229.254.4
Number of TOS metrics: 0
TOS 0 Metrics: 1
r2#
it is telling r2 about it local connections 172.25.13.0/24 network and the r5 loopback 5.5.5.5
so in this way r2 can learn complete topology
all routers in the topology should have the exact same database a full information of all networks + layout in the topology
r2#sh ip ospf database
OSPF Router with ID (22.22.22.22) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 221 0x8000000D 0x00716E 4
4.4.4.4 4.4.4.4 760 0x8000000A 0x00CCD9 4
5.5.5.5 5.5.5.5 559 0x80000005 0x00A9EE 3
6.6.6.6 6.6.6.6 1347 0x80000004 0x00A846 2
22.22.22.22 22.22.22.22 221 0x80000007 0x00889C 3
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
10.229.254.4 4.4.4.4 1506 0x80000003 0x003FC1
r2#
they will independently run the spf algorithm for the best paths to the network but it can be done in this way as all the routers will have the same info so loops will not happen.
No comments:
Post a Comment