Você está na página 1de 43

Junos OS and the OSPF Routing

Protocol
UNDERSTANDING THE BASICS OF OSPF

Martin Brown
NETWORK SECURITY ENGINEER

@martinbrown2k
The basics of OSPF

Summary How OSPF calculates the best route


The OSPF database
How OSPF forms adjacencies
How OSPF advertises routes
Controlling the OSPF database size
Configuring and monitoring OSPF
Introduction to Our Environment

ge-0/0/0 ge-0/0/1

fe-0/0/1 SRX-03 fe-0/0/1

fe-0/0/7 fe-0/0/7
fe-0/0/0 fe-0/0/0

SRX-01 SRX-02
Introduction to Our Layer 3 Environment

ge-0/0/0 ge-0/0/1
10.10.10.0/24 172.16.100.0/24
fe-0/0/1 SRX-03 fe-0/0/1
10.1.1.0/24 172.16.1.0/24
fe-0/0/7 fe-0/0/7
fe-0/0/0 fe-0/0/0
192.168.0.0/24
SRX-01 SRX-02
Types of Routing Protocol
Static
Distance vector
- RIP

Link state
- OSPF
- ISIS

Path Vector
- BGP

‘Hybrid’
- EIGRP
Distance Vector Routing Protocols

Distance vector protocols count the number of


routers in a path

The metric is known as “hops”

These protocols cannot take into account


speed or congestion

Distance vector protocols are “route by rumor”

“Split horizon” is used to prevent routing loops

Distance vector protocols do not scale very


well
Distance Vector Routing Protocols
= 2
= 3
10Mb 1.5Mb
10.1.1.2 172.16.1.2

1Gb 1Gb

10Gb
Distance vector routing
protocols can cause routing
loops. In order to prevent this,
they can use a mechanism called
“split horizon”
Split Horizon
Prevents a router from advertising learned routes out of the
same interface it received the route advertisement on.
In other words, one router will say to another “do not tell me
what I’ve just told you”.
Distance Vector Protocol Default Behavior

I have access
2 to network
10.1.1.0/24

172.16.1.0/24

3
1

10.1.1.0/24
Distance Vector Protocol Default Behavior

I still have access


2 to network
10.1.1.0/24 via R3

172.16.1.0/24

3
1
I have access
to network
10.1.1.0/24
10.1.1.0/24
Distance Vector Protocol Default Behavior

I have access
2 to network
10.1.1.0/24

172.16.1.0/24

3
1
I have access
to network
10.1.1.0/24 I have some
10.1.1.0/24
data for 10.1.1.2
Link State Routing Protocols
Link state protocols use link speeds to find
the best path
The metric is known as “cost”
These protocols cannot take into account
congestion
Routers share their database with a
‘master’ router
Use of a database prevents routing loops
Link state protocols are able to scale well
Link State Routing Protocols
= 1100
= 21
100 1000
10Mb 1.5Mb
10.1.1.2 172.16.1.20

1Gb 1Gb
10 10
10Gb
1
Path Vector Routing Protocols

Path vector protocols tend to be used on


large networks
- The internet

The BGP metric is “MED”


BGP can use up to 13 criteria to determine
best path
eBGP typically uses the shortest number of
“AS_PATHs” for the best path
Path vector protocols are infinitely scalable
Autonomous Systems
Are a group of routers under a single administrative
domain, for example, a service provider may have all of
their routers under a single AS.
Path Vector Routing Protocols
= 2
= 3

198.51.100.10 203.0.113.2
“Hybrid” Routing Protocols

Hybrid protocols use a variety of criteria


- Delay, bandwidth, reliability, load, MTU

The metric is known as “composite metric”


Only EIGRP is considered a hybrid protocol
- Cisco proprietary routing protocol
Introducing OSPF
OSPF was originally defined in RFC 1131
- Published in 1989
- OSPF version 1
- Replaced by RFC 1247

RFC 1247 became OSPFv2


- Draft written in 1991
- Updated in RFC 1349
- Replaced by RFC 1583, then RFC 2178
- Now defined in RFC 2328

OSPFv3 was introduced in RFC 2740


- Superceded by RFC 5340
OSPF Version 1

OSPF version 1 laid most of the framework


in use today
Version 1 was briefly used in live network
environments
It soon became apparent there were a few
‘issues’
Version 1 was quite quickly replaced with
OSPFv2
OSPF Framework
Neighbors
- Same subnet OSPF enabled routers
- Adjacency formed using ‘hello’ packets

LSAs
- Link state advertisements
- Contains reachable subnet information

LSDB
- Link state database
- Used to store subnet information

Areas
- Segmentation of the OSPF domain
Basic OSPF Operation

A B E

D
Routers running OSPF will
usually use the destination IP
addresses 224.0.0.5 and
224.0.0.6 to send hello packets
and LSA’s onto the network
segment
Multicast
Is a way of sending the same packet to specific nodes on
a network segment without sending a broadcast to all
nodes. Switches can copy the packet and send it to
subscribers of the multicast stream.
Basic OSPF Operation

A B E

D
OSPF Version 2 – RFC 1247

Introduced after comments were received


on RFC 1131
This added additional features:
- Stub areas
- Extra hop prevention
- Optional TOS support

RFC 1247 also made numerous corrections


OSPFv2 is not backwards compatible with
version 1
OSPF Version 2 – Later RFCs

Support for classless IP addressing


MOSPF added to enable multicast routing
Encrypted authentication allowed between
neighbors
Point to multipoint interface support added
- Frame relay, DMVPN
OSPF Version 3 – RFC 2740

OSPFv3 was introduced for IPv6


Replaced by RFC 5340
- Some OSPFv2 related features removed
- MOSPF disabled

OSPFv3 can still advertise IPv4 subnets


We’re Going on a Road Trip
D
B
G
1 hour

1 hour E 1 hour

Martinsville 2 hours

C H

F
Thank you for the road trip, I needed a
vacation, but weren’t we supposed to be
talking about networking?
Yes we were, absolutely
So, what has driving between cities have to
do with a dynamic routing protocol?
Believe it or not, quite a bit
Calculating the Best Path
Edsger Dijkstra developed an algorithm
which calculated shortest paths
This became known as the SPF or Dijkstra
algorithm
Routing protocols prefer to use the best
network path
OSPF uses the SPF algorithm to find the
lowest cost network path
The SPF algorithm was first tested on road
maps
Network Maps Instead of Road Maps
B D
G
1 hour

1 hour E 1 hour

Martinsville 2 hours

C H
F
Network Maps Instead of Road Maps
B D
G
1Gb

1Gb E 1Gb

A 1Gb

C H
F
SPF Algorithm

O(|E|+|V|log|V|)
OSPF Databases

The LSDB contains subnet information


Information within the LSDB is raw data
and must be processed
The SPF algorithm is run against the LSDB
This eventually is moved into the routing
table
Populating the LSDB
D
B
G
10.5.5.0/24

10.2.2.0/24 E
172.16.11.0/24

A 10.8.8.0/24

C H

F
Populating the LSDB
D
B
G
10.5.5.0/24

10.2.2.0/24 E
172.16.11.0/24

A 10.8.8.0/24

C H

F
Populating the LSDB
D
B
G
10.5.5.0/24

10.2.2.0/24 E
172.16.11.0/24

A 10.8.8.0/24

C H

F
LSDB Raw Data

A
OSPF has 3 databases; LSDB,
candidate database and the SPF
database
Candidate Database

A
SPF Database

A
Types of routing protocol
Summary
Versions of OSPF
OSPF framework
SPF algorithm
OSPF link-state, candidate and SPF
databases

Você também pode gostar