Itroductio to OSPF ISP Workshops These materials are licesed uder the Creative Commos Attributio-NoCommercial 4.0 Iteratioal licese (http://creativecommos.org/liceses/by-c/4.0/) Last updated 3 rd October 2017 1
Ackowledgemets p This material origiated from the Cisco ISP/IXP Workshop Programme developed by Philip Smith & Barry Greee p Use of these materials is ecouraged as log as the source is fully ackowledged ad this otice remais i place p Bug fixes ad improvemets are welcomed Please email workshop (at) bgp4all.com Philip Smith 2
OSPF p Ope Shortest Path First p Ope: Meaig a Ope Stadard Developed by IETF (OSPF Workig Group) for IP RFC1247 Curret stadard is OSPFv2 (RFC2328) p Shortest Path First: Edsger Dijkstra s algorithm for producig shortest path tree through a graph p Dijkstra, E. W. (1959). A ote o two problems i coexio with graphs. Numerische Mathematik 1: 269 271 3
OSPF p Kow as a Lik State Routig Protocol The other lik state routig protocol is ISIS Each ode i the etwork computes the map of coectivity through the etwork p The other type of Routig Protocol is Distace Vector Like EIGRP or RIP Each ode shares its view of the routig table with other odes 4
OSPF p Routers with OSPF eabled o them look for eighbourig routers also ruig OSPF Usig the Hello protocol The Hello packet icludes the subet mask, list of kow eighbours, ad details such as hello iterval ad router dead iterval p Hello iterval how ofte the router will sed Hellos p Router dead iterval how log to wait before decidig router has disappeared p The values of hello iterval, router dead iterval ad subet mask must match o both eighbours Whe a eighbourig router respods with matchig details, a eighbour relatioship is formed 5
OSPF Neighbour Relatioships p A relatioship is formed betwee selected eighbourig routers for the purpose of exchagig routig iformatio This is called a ADJACENCY p Not every pair of eighbourig routers become adjacet O multi-access etworks (e.g. etheret), oly selected routers form adjacecies 6
OSPF Adjacecies p Oce a adjacecy is formed, eighbours share their lik state iformatio Iformatio goes i a Lik State Packet (LSP) LSPs set to a eighbour are kow as Lik State Aoucemets (LSA) p New iformatio received from eighbours is used to compute a ew view of the etwork p O a lik failure New LSPs are flooded The routers recompute the routig table 7
OSPF across a etwork p All routers across the etwork form eighbour relatioships with their directly attached eighbours p Each router computes the routig table p Oce each router has the same view of the etwork, the etwork has coverged p The IGP desig for a etwork is crucially importat to esure scalability ad rapid covergece p Geerally: the fewer the prefixes, the faster the covergece 8
OSPF Areas p OSPF has the cocept of areas All etworks must have a area 0, the default area Areas are used to scale OSPF for large etworks There are may types of areas, to suit may differet types of ifrastructure ad topologies Most small to medium etworks (up to ~300 routers) ca happily use a sigle area 9
OSPF p OSPFv2 is for IPv4 For carryig IPv4 prefixes oly p OSPFv3 is for IPv6 For carryig IPv6 prefixes oly Based o OSPFv2 but is specifically for IPv6 Documeted i RFC5340 Is totally idepedet of OSPFv2 p Cofiguratio cocepts ad sytax are very similar (There are subtle differeces/improvemets) 10
Liks i OSPF p Two types of liks i OSPF: Poit-to-poit lik p Oly oe other router o the lik, formig a poit-to-poit adjacecy Multi-access etwork (e.g. etheret) p Potetial for may other routers o the etwork, with several other adjacecies p OSPF i multi-access etworks has optimisatios to aid scalig Two routers are elected to origiate the LSAs for the whole multi-access etwork Called Desigated Router ad Backup Desigated Router Other routers o the multi-access etwork form adjacecies with the DR ad BDR 11
Desigated Router p There is ONE desigated router per multi-access etwork Geerates etwork lik advertisemets Assists i database sychroizatio Scales OSPF for multi-access (etheret) etworks Desigated Router Backup Desigated Router Desigated Router Backup Desigated Router 12
Selectig the Desigated Router p Cofigured priority (per iterface) Cofigure high priority o the routers to be the DR/BDR p Else priority determied by highest router ID Router ID is 32 bit iteger Set maually, otherwise derived from the loopback iterface IPv4 address, otherwise the highest IPv4 address o the router 131.108.3.2 131.108.3.3 R1 DR R2 R1 Router ID = 144.254.3.5 R2 Router ID = 131.108.3.3 144.254.3.5 13
Adjacecies o multi-access etworks p DR ad BDR form FULL adjacecies: With each other With all other routers o the multi-access etwork Databases are sychroised LSAs propagate alog adjacecies Full DR BDR 14
Adjacecies o multi-access etworks p Neighbour relatioships betwee routers which are ot DR or BDR are called 2WAY They see each other i HELLO packets but do ot exchage topology iformatio The eighbours the are ot adjacet 2WAY DR BDR 15
Adjacecies: Examples p To fid adjacecy state, use: show ip[v6] ospf eighbor Poit-to-Poit lik Neighbor ID Pri State Dead Time Address Iterface 10.10.15.236 0 FULL/ - 00:00:35 10.10.15.16 Serial1/0 FULL: other router to DR/BDR Neighbor ID Pri State Dead Time Address Iterface 10.10.15.225 1 FULL/BDR 00:00:35 10.10.15.2 FastEth0/0 10.10.15.226 1 FULL/DR 00:00:35 10.10.15.3 FastEth0/0 2WAY: other router to other router Neighbor ID Pri State Dead Time Address Iterface 10.10.15.227 1 2WAY/DROTHER 00:00:35 10.10.15.4 FastEth0/0 16
OSPF o Cisco IOS p Startig OSPFv2 (IPv4) i Cisco s IOS Where 42 is the process ID p Startig OSPFv3 (IPv6) i Cisco s IOS Where 42 is the process ID p OSPF process ID is uique to the router router ospf 42 ipv6 router ospf 42 Gives possibility of ruig multiple istaces of OSPF o oe router Process ID is ot passed betwee routers i a AS Some ISPs cofigure the process ID to be the same as their BGP Autoomous System Number 17
Addig iterfaces to OSPF p OSPF iterface cofiguratio: Whe OSPF is cofigured for a subet or o a iterface, the router will automatically attempt to fid eighbours o that subet or iterface router ospf 42 passive-iterface default ISP Best Practice is to disable this behaviour: Ad the explicitly eable the iterface to allow OSPF to search for eighbours as required: router ospf 42 o passive-iterface Gigabit 4/0 18
OSPF o Cisco IOS p Eablig OSPF o a iterface does two thigs: 1. Eables the Hello protocol for formig eighbour relatioships ad adjacecies with other routers coected to that iterface 2. Aouces the iterface subet(s) ito OSPF p Care eeded Must avoid eablig the Hello protocol o utrusted etworks p (e.g. those outside your Autoomous System) 19
OSPFv2 o Cisco IOS p Formig eighbour relatioships OSPFv2 eeds to be activated o the iterface the eighbour relatioship is desired o: iterface Gigabit 4/0 ip address 192.168.1.1 255.255.255.252 ip ospf 42 area 0! router ospf 42 passive-iterface default o passive-iterface Gigabit 4/0! 20
OSPFv3 o Cisco IOS p Formig eighbour relatioships OSPFv3 eeds to be activated o the iterface the eighbour relatioship is desired o: iterface Gigabit 4/0 ipv6 address 2001:DB8:10:FE::4/64 ipv6 ospf 42 area 0! ipv6 router ospf 42 passive-iterface default o passive-iterface Gigabit 4/0! 21
OSPF iterface costs p Cisco IOS sets the iterface cost automatically Formula used: cost = 10 8 /iterface badwidth p Which is fie for iterfaces up to 100Mbps p May operators develop their ow iterface cost strategy Sets iterface cost to 100 ip ospf cost 100 Care eeded as the sum of costs determies the best path through the etwork p OSPF chooses lowest cost path through a etwork p OSPF will load balace over paths with equal cost to the same destiatio 22
OSPF Metric Calculatio p Best path/lowest cost = 60 5Mbps 2Mbps 20 50 50 10 2Mbps 10Mbps 23
OSPF Metric Calculatio p Best path/lowest cost = 60 p Equal cost paths = 70 5Mbps 2Mbps 20 50 50 10 2Mbps 10Mbps 5Mbps 2Mbps 20 50 60 10 1.3Mbps 10Mbps 24
OSPF Neighbour Autheticatio p Neighbour autheticatio is highly recommeded Prevets uauthorised routers from formig eighbour relatioships ad potetially compromisig the etwork p OSPFv2 Autheticatio is built-i There are two types: p Plai text password p MD5 hash p OSPFv3 uses stadard IP security header There are two types: p MD5 hash p SHA1 25
OSPFv2 Neighbour Autheticatio p Cofigurig autheticatio for area 0 Iterfaces still eed the autheticatio key, e.g. POS4/0 router ospf 42 area 0 autheticatio message-digest! iterface Gigabit 4/0 ip ospf message-digest-key <key-o> md5 <passwd>! p Cofigurig autheticatio per iterface: iterface Gigabit 4/0 ip ospf autheticatio message-digest ip ospf message-digest-key <key-o> md5 <passwd>! 26
OSPFv3 Neighbour Autheticatio p Cofigurig autheticatio for all iterfaces i area 0 The key is icluded i the commad turig o autheticatio for area 0: ipv6 router ospf 42 area 0 autheticatio ipsec spi 256 md5 <passwd>! p Cofigurig autheticatio per iterface: iterface Gigabit 4/0 ipv6 ospf autheticatio ipsec spi 256 md5 <passwd>! 27
Origiatig a Default Route p Origiatig a default route ito OSPF: router ospf 42 default-iformatio origiate Which will origiate a default route ito OSPF oly if a default route exists i the RIB router ospf 42 default-iformatio origiate always Which will always origiate a default route ito OSPF eve if o default is i the RIB p There are equivalet commads for OSPFv3 28
OSPF o Poit-to-Poit Etheret p OSPF o poit-to-poit etheret: DR ad BDR electio is ot eeded o a poit to poit lik so it is disabled, which is more efficiet iterface gigabit 2/0 ip ospf etwork poit-to-poit p There are equivalet commads for OSPFv3 29
Coclusio p OSPF is a Lik State Routig Protocol p Quick ad simple to get started But has a myriad of optios ad features to cover almost all types of etwork topology ISPs keep their OSPF desig SIMPLE >400 routers i a sigle area is etirely feasible 30
Itroductio to OSPF ISP Workshops 31