Documente Academic
Documente Profesional
Documente Cultură
An Overview of OSPF
OSPF is a link-state IGP used within an AS
OSPF floods link-state advertisements
OSPF routers use the received LSAs to create a
complete database of the network
OSPF uses the shortest-path-first algorithm to
calculate the best path to each destination
network
OSPF
AS 64512
2010 Juniper Networks, Inc. All rights reserved.
ISP X
AS 64587
www.juniper.net | 2
www.juniper.net | 3
Type 2
Type 3
Type 4
LinkState
Update
Type 5
Link-State
Acknowledgme
nt
R1
R2
Link-State Request
Link-State Update
Link-State Acknowledgment
www.juniper.net | 4
Hello Packet
Type
1
Hello
Type 2
Type 3
Type 4
LinkState
Update
Type 5
Link-State
Acknowledgme
nt
Router
priority
Designated
router
Backup designated
router
Neighbo
r
www.juniper.net | 5
Type 2
Type 3
Type 4
LinkState
Update
Type 5
Link-State
Acknowledgme
nt
www.juniper.net | 6
Type 2
Type 3
Type 4
LinkState
Update
Type 5
Link-State
Acknowledgme
nt
www.juniper.net | 7
Type 2
Type 3
Type 4
LinkState
Update
Type 5
Link-State
Acknowledgme
nt
www.juniper.net | 8
Type 2
Type 3
Type 4
LinkState
Update
Type 5
Link-State
Acknowledgme
nt
www.juniper.net | 9
Adjacency Formation
R2
R1
Down
2Way
ExStart
Exchange
Loading
Full
2010 Juniper Networks, Inc. All rights reserved.
Down
Init
2Way
DD (Seq=x, Master)
DD (Seq=y, Master)
DD (Seq=y, Slave)
DD (Seq=y+1, Master)
DD (Seq=y+1, Slave)
DD (Seq=y+n, Master)
DD (Seq=y+n, Slave)
LS Request
LS Update
LS Request
LS Update
ExStart
Exchange
Full
www.juniper.net | 10
Adjacency Optimization (1 of 2)
By default, OSPF attempts to form
adjacencies with all neighbors discovered on
all interfaces
On a broadcast media like Ethernet, this approach
is suboptimal because it would require a full mesh
of adjacencies
Adjacencie
s
www.juniper.net | 11
Adjacency Optimization (2 of 2)
OSPF elects a DR to represent the segment
Minimizes OSPF processes and reduces traffic on
segment
A BDR is also elected to recover if the DR fails
DR
BDR
DR
DR
DROther
DROther
DROther
www.juniper.net | 12
BDR
DR
Priority: 128
RID: 192.168.100.100
www.juniper.net | 13
R2 (RID: 1.1.1.2)
BDR
Adjacencie
s
DROther
DROther
2-way
R4 (RID: 1.1.1.4)
R3 (RID: 1.1.1.3)
user@R1> show ospf neighbor
Address
Interface
172.25.0.4
ge-0/0/1.0
172.25.0.3
ge-0/0/1.0
172.25.0.2
ge-0/0/1.0
State
Full
Full
Full
ID
1.1.1.4
1.1.1.3
1.1.1.2
Pri
128
128
254
Dead
33
38
38
State
Full
Full
2Way
ID
1.1.1.1
1.1.1.2
1.1.1.3
Pri
255
254
128
Dead
37
35
34
www.juniper.net | 14
Area 0
Area 0
Area 2
Area 1
Area 0
Area 2
www.juniper.net | 15
OSPF Areas
AS 65415
Area 0.0.0.1
Areas
Area 0.0.0.0
Area 0.0.0.2
www.juniper.net | 16
OSPF Routers
Backbone routers have at
least one link in OSPF Area
0.0.0.0
Area 0.0.0.1
Area 0.0.0.0
Area 0.0.0.2
Interarea Routes
(Summary Routes)
Not-So-Stubby
Area
Backbone
(0.0.0.0)
RIP
External Routes
BGP
Default Route
www.juniper.net | 18
Network Links
Type 2
Summary Links
Type 3 and Type 4
External Links
Type 5
ABR Describe
Originated by ABRs.
networks in the AS but outside of
area (Inter-area). Also describe the
location of the ASBR.
ASBR
Originated by an ASBR. Describe
external destination prefixes or a
default route.
ASBR
www.juniper.net | 19
Not-SoStubby
Area
Totally
Stubby Area
Backbone
(0.0.0.0)
RIP
BGP
www.juniper.net | 20
www.juniper.net | 21
Configuring OSPF
[edit protocols]
user@R1# show
ospf {
area <area-id> {
<area options>;
interface <interface-name> {
<interface options>;
}
}
}
ospf3 {
area <area-id> {
<area options>;
interface <interface-name> {
<interface options>;
}
}
}
www.juniper.net | 22
The Router ID
OSPF uses the RID to identify the router from
which a packet originated
You can manually define the RID under the [edit
routing-options] hierarchy
[edit routing-options]
user@R1# show
router-id 192.168.100.1;
www.juniper.net | 23
172.18.1.0/24
ge-1/0/0
ge-0/0/3
172.26.1.0/30
R1 - lo0/RID:
192.168.1.1
ge-0/0/1
ge-0/0/2
R2 - lo0/RID:
192.168.1.2
172.26.2.0/30
172.26.3.0/30
ge-0/0/1
ge-0/0/3 ge-1/0/1
ge-0/0/2
172.26.4.0/30
R3 - lo0/RID:
192.168.1.3
R4 - lo0/RID:
192.168.1.4
www.juniper.net | 24
[edit protocols]
user@R4# show
ospf {
area 0.0.0.2 {
interface ge-1/0/1.0;
interface lo0.0;
}
}
[edit protocols]
ABRs
user@R2# show
ospf {
area 0.0.0.0 {
interface ge-0/0/1.0;
interface ge-0/0/2.0 {
Increased
metric 100;
metric for
}
secondary
interface lo0.0;
}
area 0.0.0.1 {
interface ge-0/0/3.0;
}
}
[edit protocols]
user@R3# show
ospf {
area 0.0.0.0 {
interface ge-0/0/1.0;
interface ge-0/0/2.0 {
metric 100;
}
path
interface lo0.0;
}
area 0.0.0.2 {
interface ge-0/0/3.0;
}
}
www.juniper.net | 25
www.juniper.net | 26
Area 0.0.0.0
Area 0.0.0.1
ge-0/0/1
172.18.1.0/24
ge-1/0/0
ge-0/0/3
172.26.1.0/30
R1 - lo0/RID:
192.168.1.1
ge-0/0/1
ge-0/0/2
R2 - lo0/RID:
192.168.1.2
172.26.2.0/30
172.26.3.0/30
Area 0.0.0.2
ge-0/0/1
ge-0/0/3 ge-1/0/1
ge-0/0/2
172.26.4.0/30
R3 - lo0/RID:
192.168.1.3
R4 - lo0/RID:
192.168.1.4
www.juniper.net | 27
State
Full
Full
Full
Area 0.0.0.0
Area 0.0.0.1
ge-0/0/1
172.18.1.0/24
ge-1/0/0
ge-0/0/3
172.26.1.0/30
R1 - lo0/RID:
192.168.1.1
ID
192.168.1.3
192.168.1.3
192.168.1.1
ge-0/0/1
ge-0/0/2
R2 - lo0/RID:
192.168.1.2
172.26.2.0/30
172.26.3.0/30
Pri
128
128
128
Dead
39
36
34
Area 0.0.0.2
ge-0/0/1
ge-0/0/3 ge-1/0/1
ge-0/0/2
172.26.4.0/30
R3 - lo0/RID:
192.168.1.3
R4 - lo0/RID:
192.168.1.4
www.juniper.net | 28
172.18.1.0/24
172.26.4.0/30
www.juniper.net | 29
ospf
ospf
ospf
ospf
ospf
interface
route
database
statistics
log
www.juniper.net | 30
ge-0/0/1
172.18.1.0/24
ge-0/0/3
172.26.1.0/30
R1 - lo0/RID:
192.168.1.1
BDR ID
192.168.1.2
192.168.1.3
0.0.0.0
192.168.1.1
Nbrs
1
1
0
1
Area 0.0.0.0
Area 0.0.0.1
ge-1/0/0
DR ID
192.168.1.3
192.168.1.2
192.168.1.2
192.168.1.2
ge-0/0/1
ge-0/0/2
R2 - lo0/RID:
192.168.1.2
172.26.2.0/30
172.26.3.0/30
ge-0/0/1
ge-0/0/2
R3 - lo0/RID:
192.168.1.3
www.juniper.net | 31
Path
Type
Intra
Intra
Ext2
Intra
Intra
Intra
Inter
Intra
Intra
Intra
Inter
Route
Type
AS BR
Area BR
Network
Network
Network
Network
Network
Network
Network
Network
Network
NH
Metric
Type
IP
1
IP
1
IP
0
IP
1
IP
1
IP
100
IP
2
IP
1
IP
0
IP
1
IP
2
NextHop
Interface
ge-0/0/3.0
ge-0/0/1.0
ge-0/0/3.0
ge-0/0/3.0
ge-0/0/1.0
ge-0/0/2.0
ge-0/0/1.0
ge-0/0/3.0
lo0.0
ge-0/0/1.0
ge-0/0/1.0
Nexthop
addr/label
172.26.1.1
172.26.2.2
172.26.1.1
172.26.2.2
172.26.1.1
172.26.2.2
172.26.2.2
Age
56
Seq
0x80000005
Age
96
| 33
Elapsed
0.000003
www.juniper.net | 34
Sent
52
9
2
46
37
Total
Received
17
7
2
45
33
retransmitted
:
flooded
:
flooded high-prio :
retransmitted
:
transmitted to nbr:
requested
:
acknowledged
:
Last 5 seconds
Sent
Received
0
0
0
0
0
0
0
0
0
0
0,
40,
10,
0,
8,
2,
39,
last
last
last
last
last
last
last
5
5
5
5
5
5
5
seconds
seconds
seconds
seconds
seconds
seconds
seconds
:
:
:
:
:
:
:
0
0
0
0
0
0
0
www.juniper.net | 35
Protocol traceoptions
www.juniper.net | 36
Checklist
No neighbor
detected
Stuck in ExStart
state
Stuck in 2-way
state
www.juniper.net | 37
Using Traceoptions
Use traceoptions to identify adjacency
formation issues; a sample configuration is
shown:
[edit protocols]
user@R1# show
ospf {
traceoptions {
file trace-ospf;
flag error detail;
flag event detail;
}
area 0.0.0.0 {
interface ge-1/0/0.0;
interface lo0.0;
}
}
R1 - lo0:
192.168.1.1
Area 0.0.0.0
ge-1/0/0
.1
ge-0/0/3
172.26.1.0/30
.2
R2 - lo0:
192.168.1.2
www.juniper.net | 38
Area 0.0.0.0
R1 - lo0:
192.168.1.1
ge-1/0/0
.1
ge-0/0/3
172.26.1.0/30
.2
R2 - lo0:
192.168.1.2
www.juniper.net | 39
Receive errors:
410 area mismatches
17 mtu mismatches
81 Hellos received with our router ID
www.juniper.net | 40