Notizen
OSPF(CCNP)
Inhalt der Notizen (1)
Seite 1
OSPF Basic
- uses multicast IP:224.0.0.5
- uses IP protocol: 89
- Whenever a new network is added, OSPF tree is removed by all routers in same area and rebuilt again
- Type 1: router LSA is used to create the OSPF tree in single area
- more specific network command will add network to area
- OSPF creates SPF tree using Type 1 router LSA and type 2 network LSA. if I get a router LSA, i will destroy the SPF tree and re-create SFP tree again
#show ip ospf
OSPF Nbr:
In Hello packet, below parameters must match:
1) Hello interval 2) Dead interval 3) Area ID 4)subnet mask 5) stub area flag 6) authentication
- if subnet mask is different, hello packet will have different subnet mask and it wont form ngrship
- if interface mtu is different, router with mtu 1500 will stuck in exchange and router with 1450 will stuck in exstart state. interface MTU is shared in DBD packet. Interface MTU is NOT part of Hello packet.
router with higher MTU will accpect DBD and move to exchange state
router with lower MTU will not accept DBD and will stuck in exstart state
parameters which dont have to match but send in hello packet:
1) router id 2) router priority 3) DR/BDR IP 4
-hello/dead in LAN - 10/40 sec
-if hello is changed, dead gets changed automatically
R1#show ip ospf interface fa0/0 | in Hello
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:05
R1(config-if)#ip ospf hello-interval 5
*Mar 1 00:13:41.031: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Dead timer expired
R1#show ip ospf interface fa0/0 | in Hello
Timer intervals configured, Hello 5, Dead 20, Wait 20, Retransmit 5
Hello due in 00:00:04
R1#
- change hello interval to sub second
R1(config-if)#ip ospf dead-interval minimal hello-multiplier 20
-
2-way neighborship: LSA has NOT been exchanged
full neighborship - LSA are exchanged
Duplicate router ID:
- if both routers are in same area : routers will generate a duplicate router id msg
-
-if both routers are in different area: routers will flush each other LSAs and declare OSPF flood war
-R1#show ip ospf database
OSPF authentication:
options:
1) plain text - type 1
2) MD5 - type 2
configuration steps:
step 1)
a)configure per area
#area <> authentication (type 1)
or
#area <> authentication message-digest (type 2)
b) configure per interface
type 0- ip ospf authentication null
type 1 - ip ospf authentication
type 2 - ip ospf authentication message-digest
step 2) key per interface
a) type 1 - ip ospf authentication-key
b) type 2 - ip ospf message-digest-key md5
verify:
#show ip ospf inteface <>
#debug ip ospf hellp
#debug ip ospf adj
OSPF Network Type
When we enable OSPF:
1)OSPF process will look for interfaces in that area
2) OSPF will look into layer 2 encapsulation
- Determined by Layer 2 encapsulation
#show ip ospf interface
-
1) Broadcast: eg ethernet
- nbr are discovered dynamically
- DR/BDR election
-timers : 10/40
- cant statically configure neighbor
Manually configure interface as broadcast:
#ip ospf network broadcast (interface command)
2) NBMA: eg: Frame Relay
- network type of sub-interface will be same as of interface
- nbrs are not discovered dynamically
-interval: 30/120
-nbr to be configured statically:
#neighbor ip-address [priority ] --- > OSFP subcommand
3) point to point:HDLC or PPP
- dynamic nbr discovery
- no dr/bdr
- interval : 10/40
manually configure:
ip ospf network point-to-point (interface subcommand))
4) point to multipoint:
-no dr/bdr
- dynamically discover ngr
-interval 30/120
- each router sends /32 in frame relay cloud
- can statically configure neighbor
5) point to multipoint non broadcast
- no dynamic discovery of ngr
-
LSA
- link state database should be same for all routers in a area
- link state database consists of individual LSA
- SFP is run in link state database per area
- OSPF link state update packets are used to propagate LSA
Type 1: Router LSA
- Router creates only ONE LSA for all links it is connected to.
- cannot be summarized
- doesn't propagate to different areas
-identifies an OSPF router using router-id
#show ip ospf database router
- verify each LSA
#show ip ospf database router x.x.x.x(router id)
Inside Type 1 LSA:
1)Type 1 LSA has link state identifier (LSID): ruter ID
2)link data:
a) interface with no nbr:
- its subnet/mask is advertised
- link is connected to "stub network"
R1#show ip ospf database router
OSPF Router with ID (1.1.1.1) (Process ID 1)
Router Link States (Area 0)
LS age: 6
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 1.1.1.1
Advertising Router: 1.1.1.1
LS Seq Number: 80000001
Checksum: 0x1FE8
Length: 36
Number of Links: 1
Link connected to: a Stub Network
(Link ID) Network/subnet number: 10.0.15.0
(Link Data) Network Mask: 255.255.255.0
Number of TOS metrics: 0
TOS 0 Metrics: 10
b) interface with DR:
- IP address of the DR
-link connected to "transit network"
Link connected to: a Transit Network
(Link ID) Designated Router address: 10.0.123.3
(Link Data) Router Interface address: 10.0.123.1
Number of TOS metrics: 0
TOS 0 Metrics: 10
c) interface with no DR
- list neighbor Router ID
- link is connected to another router(point to point)
- one more LSA as stub will be created for subnet/mask
Number of Links: 2
Link connected to: another Router (point-to-point)
(Link ID) Neighboring Router ID: 3.3.3.3
(Link Data) Router Interface address: 10.0.34.4
Number of TOS metrics: 0
TOS 0 Metrics: 10
Link connected to: a Stub Network
(Link ID) Network/subnet number: 10.0.34.0
(Link Data) Network Mask: 255.255.255.0
Number of TOS metrics: 0
TOS 0 Metrics: 10
d) loopback
- loopback will be advertised as stub network but with /32 mask
c) Virtual links:
-technically, when ospf starts, all links are in stub network.once hello comes, then change the lsa data
- LSA are only good for 1 hours. to poison LSA , send LSA with timer of 1 hour
-
DR/BDR election:
- DR/BDR election is non-preemtive
- router with highest priority wins
- if priority is same, Router with highest router ID wins
- default priority - 1
- if priority is zero, router wont take part in DR/BDR election and will be DROTHER. if all devices is segment has priority as zero. all device will be in DROTHER and will be in 2-way state.
Type 2: Network LSA
- for all multi access networks
- DR generates Type 2 LSA
- why we need type 2 LSA ?
we can create tree with Type 1 but there is no subnet mask
- Type 2 LSA contains details of BDR and other routers.
- type 2 LSA contains details of the subnet mask
R2#show ip ospf database network 10.0.123.2
OSPF Router with ID (2.2.2.2) (Process ID 1)
Net Link States (Area 0)
Routing Bit Set on this LSA
LS age: 338
Options: (No TOS-capability, DC)
LS Type: Network Links
Link State ID: 10.0.123.2 (address of Designated Router)
Advertising Router: 2.2.2.2
LS Seq Number: 8000000E
Checksum: 0xA9D7
Length: 36
Network Mask: /24
Attached Router: 2.2.2.2
Attached Router: 1.1.1.1
Attached Router: 3.3.3.3
Type 3 LSA
- Generated by ABR in case of multiple areas
- ABR generates summary of each network/mask and propagate to other AREAs
- routers know about ABR as type 1 LSA from ABR will have ABR bit set
- ABR generates summary LSA will it as advertising router
- ABR takes type 1 and tyep2 LSA to generate Type 3 summary LSA
- ABR should have atleast one interface in area 0
- Each ABR will create its own Type 3 LSA with next hop as itself
- R3#show ip ospf database summary self-originate
OSPF Router with ID (3.3.3.3) (Process ID 1)
Summary Net Link States (Area 0)
LS age: 174
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 4.4.4.4 (summary Network Number)
Advertising Router: 3.3.3.3
LS Seq Number: 80000001
Checksum: 0xE431
Length: 28
Network Mask: /32
TOS: 0 Metric: 11
Type 4:
Type 5: External LSA
- Generated by ASBR
- default cost of 1
- type 5 LSA goes to all areas in OSPF domain
subtypes:
1) type 1:
2) type 2:
type 2 is default. In type 2, ospf routers are NOT allowed to change cost of external LSA generated by ASBR
SPF calculation
- SPF is run to select shortest path to a node and NOT a prefix.
- Prefix is just an attribute of node
- node has node ID or router ID
OSPF message types
- Hello
- Database descriptor
- Link state request
- Link state update
- Link state ack
OSPF state machine:
1) Down state:
- when nbr is down
2) Attempt:
- when nbr is statically configured
- I am trying to send hello packet but no response
3) Init:
- I've received hello from nbr but hello packet doesn't have my name
- hello packets contains details of all the routers in a segment or broadcast domain
-
4) 2-way state:
- when i see my name in hello packet
- we do DR/BDR election for broadcast domain
-
5) ExStart state:
- master slave relationship is decided
- master comes up with sequence number for exchange of DBD
- router with higher router ID is master
- master slave is decided by router by sending empty DBD packets to each other.
-
6) Exchange state
- DBD will summary of LSA are exchanged. send 1st my slave.
- unicast between routers
- MTU is informed to neighbor. stub flag is informed too
7) Loading state:
- for missing LSA, router send LS request packet. router replies with LS update. I reply with LS ack
8) Full state:
- LSA are in sync
-routers will run SFP algorithm
- DBD are only exchanged only when nbrship comes for 1st time
OTHERS to DR/BDR - 224.0.0.6
DR to OTHERS - 224.0.0.5
-when router needs to flush the LSA from LSDB, it sets the age of the LSA to MAxAge i.e. 3600 sec
OSPF cost calculation:
1) Intra area
- once SPF is run. Router will have full tree of the links.
- router A will advertise a link with cost of X. Router B will calculate the cost of X plus cost of all downstream links and come up with the total cost of reaching the link.
2) inter area
- ABR calculate the cost to a network
- ABR router sends cost of the network to router in other area. routers in other area calculate the cost to reach ABR.
- next hop for other area routers is ABR
Route selection:
Priority by:
Intra-Area (O)
Inter-Area (O IA)
External Type 1 (E1) type 5 subtype 1
NSSA Type 1 (N1)
External Type 2 (E2) type 5 sub-type 2
NSSA Type 2 (N2)
- Type 3 LSA change doesn't cause SFP calculations
https://networklessons.com/ospf/ospf-path-selection-explained/
OSPF metric tuning
3 methods
1) change reference bandwidth
cost = reference bandwidth/interface bandwidth
default reference bandwidth = 100 Mbps
command to change reference bandwidth:
#auto-cost reference-bandwidth <>
2) change bandwidth
#(config-if) bandwidth
3) configure cost
#(config-if) ip ospf cost <>
Route Filtering
- done at ABR and ASBR
- ABR don't convert type1/type2 LSA to Type 3 - if asked for filteration
-
Type 3:
- dont create type 3 LSA. Filter prior to origination
method 1) filter list
#area <> filter-list prefix in |out
in- when "in" is configured, IOS filters prefixes being created and flooded into the configured area
out - when "out" is configured, IOS filters prefixes coming out of the configured area
out - going out from the originating area
in - coming to other other/ not originating area
routing filtering into routing table
-using distribute list
- LSA still in database
- LSA will be propogated to other nbrs
- LSA will not be used to install in the routing table
Summarization
- Summarisation at ABR or ASBR
- Summarisation is done for LSAs, not routes
ABR:
#area <> range <> [cost ]
- above command- area is the area where specific subnet resides
- lowest metric among all specific subnets is advertised
- summary routes in ABR are send as Type 3
ASBR:
- create type 5 summary LSA
Type 5 LSA:
- each redistributed subnet as type 5 LSA
- subnet/mask and originator as ASBR
-cost is listed as 20
-
command:
#summary-address prefix mask (OSPF subcommand)
Default Route
two ways:
1) all ospf domain
# default-information originate
- router check for default route in routing
- ospf create LSA and flood it
-
# default-information originate always
- router DO NOT check for default route if "always" is used
- router creates LSA and flood it
- route create subtype 2 type 5 LSA and propagate
- default route is advertised with cost of 1
- we can't redistribute static default route in OSPF
- We can associate route-map for tracking a route. if that route is present in routing table, default route will be flooded else not
2) only 1 area
- use stub area
- can't be done in area 0 ?
- ABR generate default route to stub area using Type 3 summary LSA
-
Type of Stubby Areas:
- all below stubby areas doesn't allow type 5 LSA
- Totally means type 3 are also not allowed
- redistribution is not allowed in stub
1) Stub
#area <> stub
- allowing type 3 summary
- not allowing type 5 external
- create type 3 summary LSA as default route with cost of 1
-
2) Totally stubby
# stub <> stub no-summary
- only on ABR
- no type 3 and type 5
- create summary LSA with default route
3) not so stubby areas (NSSA)
- if we need a router in stub area as ASBR
- but stub area doesn't allow type 5
- type 7 will be created by asbr
- abr in stub area will convert type 7 to type 5
-- subtype
1) subtype 1 N1
2) subtypoe 2: N2
- default route is not created
#area <> nssa default-information originate
4) totally NSSA
Virtual links:
- connect non-backbone areas to backbone arean when non-backbone area is not directly connected
#area <> virtual-link < remote router id>
- area is transit area
#show ip ospf border-routers - to check ABR RID
- unicast traffic is send over virtual link
- hello are only exchanged during VL bringup
- maxage time is not set
- VL endpoints must be reachable via a normal area
- cant do filtering
-
Authentication
#are <> virtual-link<> authentication
R5#show ip ospf virtual-links
Virtual Link OSPF_VL0 to router 2.2.2.2 is up
Run as demand circuit
DoNotAge LSA allowed.
Transit area 1, via interface FastEthernet0/0, Cost of using 2
Transmit Delay is 1 sec, State POINT_TO_POINT,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:05
Adjacency State FULL (Hello suppressed)
Index 1/4, 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
R5#
OSPF path manipulation
Within an area
change metric:
a)change auto-cost bandwidth
b) change bandwidth
c) change cost
Multiple area:
- use summary route
- filtering
- change metric type
#show ip route summary
#show ip ospf database database-summary
-
Informationen
- Beschreibung
- Notiz am OSPF(CCNP), erstellt von inga pinga am 17/03/2016.
- Erstellt von
- inga pinga · Mär 2016
- Aktualisiert
- 27 Jul 2016
- Aufrufe
- 2
- Bewertung