OSPF Network Types

Posted by Bradley | OSPF | Wednesday 11 November 2009 17:13

Quick bit of a refresh on OSPF network types, these are specified on a per link basis and it changes the way OSPF behaves on that link specifying the wrong type can cause bad things to happen such as if you mix DR & Non DR types adjacencies wont form correctly.

There are 5 network types,

  1. Point to Point – Should be used as the name implies on P2P links which support broadcast, nearly all OSPF traffic is sent to the ALLSPFRouters address which is 224.0.0.5, although retransmitted LSAs are sent to the unicast address as such these links should support broadcasting.
  2. Broadcast – This is the default network type for Ethernet networks, as this network type is capable of having adjacencies with multiple routers. To prevent unnecessary meshing DR & BDR elections take place. Communications from the DR & BDR take place on the ALLDRRouters address 224.0.0.6 whilst all other communications on 224.0.0.5. As the name implies the layer 2 network must support broadcasting.
  3. Non Broadcast Multiple Access (NBMA) – This is the default configuration on a serial interface, and is classified as a link which is able to send to multiple other routers via the single link but with no broadcasting, therefore neighbour statements must be manually set. A DR & BDR will still be elected but all communication is unicast, the hello and dead timers change from the defaults to 30 and 120 seconds.
  4. Point to Multipoint networks – All communication is unicast and no DR or BDR election takes place an ideal placement for this would be in the hub in a hub and spoke topology.
  5. Virtual Links – Packets sent over Virtual Links are unicast and perceived as unnumbered point to point connections

Its pretty simple to change the network type its all done under the interface like so.

Router(config-if)#ip ospf network ?
  broadcast            Specify OSPF broadcast multi-access network
  non-broadcast        Specify OSPF NBMA network
  point-to-multipoint  Specify OSPF point-to-multipoint network
  point-to-point       Specify OSPF point-to-point network

OSPF E1 and E2 Routes

Posted by Bradley | OSPF | Thursday 2 July 2009 15:20

External routes are propagated through an OSPF area as a type 5 from an ASBR,  or type 7 LSA from an ASBR in an NSSA. These routes from outside the OSPF domain are can either be E1 or E2 routes and they are treated in slightly different ways.

E1 or External Type Routes - The cost of E1 routes is the cost of the external metric with the additional of the internal cost within OSPF to reach that network.

E2 or External Type2 Routes – The cost of E2 routes will always be the external metric, the metric will takes no notice of the internal cost to reach that network.

If 2 external type 2 routes exist with the same metric to the same destination the route with the lowest metric to the ASBR will be used. Also if an E1 and and E2 route exist to the same destination the E1 route will always be preferred irrespective of the metric.

Cisco’s excellent reference on the topic is http://www.cisco.com/en/US/tech/tk365/technologies_white_paper09186a0080094e9e.shtml#t33

Off Topic – The weather in the UK for some reason is always exceptional as its an island nation. For the last 5 or so days we have had an exception heatwave and it has been 30°C+ which were just not used to, and I have been surprised how much it has affected my ability to study, I just haven’t been able to concentrate for anywhere near as long as I can in the cold.

OSPF LSA Types

Posted by Bradley | OSPF | Tuesday 22 July 2008 22:23

Understanding all the OSPF LSA types is one of the keys to understanding OSPF, so its definatly worth me making a few notes on them

LSA type 1 – Router LSAs are sent from a router to other routers in the same area. It contains information regarding the routers interfaces in the same area, relevant interfaces IPs, its adjacent routers on those interfaces and sub networks

LSA type 2 – Network LSAs are generated by the DR on a multi access segment, and provides similar information to an LSA type 1 for the multi access segment and subnet which it belongs

LSA type 3 – Network Summary LSAs are generated by ABRs and contain the subnets & costs but omit the topological data from all subnets in one area and sent to another area via the ABR

LSA type 4 -ASBR summary LSAs are from ASBRs and are identical in structure to a type 3 LSA and sent when crossing an AS boundary

LSA type 5 -Are AS external LSAs which are originated by ASBRs and describe external networks

LSA type 6 – Is defined as a Group Membership LSA but not used in Cisco devices

LSA type 7 -NSSA External LSAs are generated by the ASBR in an NSSA area

LSA type 8 – Is defined as a External Attribute LSA but not used in Cisco devices

LSA types 9 to 11 – Defined as Opaque LSAs and are reserved for future expansion

OSPF area types

Posted by Bradley | OSPF | Monday 21 July 2008 16:23

OSPF uses a variety of area types to divide the network which results in smaller and therefore more efficient LSDBs due to summarization at ABRs & ASBRs, also failures are limited to a single area so OSPF does not need to run a full SPF calculation across the entire network and the reduced size of the LSDB uses less memory and therefore results in quicker SPF calculations.

The Backbone Area or Area 0

The backbone area which is also configured as area 0, which is the area number which is used in the configuration. Area 0 which must be directly connected (except for a few very rare circumstances) to every other area. Area 0 must be continuous and is used for inter area routing between the OSPF areas.

Standard Area

This is the default area type which accepts link updates, route summaries and external routes.

Stub Areas

A stub area (sometimes referred to as a stubby area), is an area which does not receive type 4 or 5 LSA’s which are external routes from ASBRs. But a stubby area will receive type 3 LSAs which are summary routes from ABRs. If there are multiple ABRs in a stub area the route will be chosen which has the shortest path to the destination.

Totally Stubby Areas

Totally Stubby Areas, is a non standard area type used in Ciscos implementation of multi area OSPF. Totally Stubby Areas do not accept type 3, 4 or 5 LSAs, the ABRs only injects a single default route into the area. If there are multiple ABRs in the Totally Stubby Area each router routes to the closest (lowest metric) ABR in its area.

Not So Stubby Area (NSSA)

A Not So Stubby Area (NSSA) is a stub area which contains an an ASBR. It operates in the same way as a stub area but originates type 7 LSAs which are external routes from a ASBR in a NSSA area.

Not So Stubby Totally Stubby Area

This area name has got to be one of the craziest names I have come across, and I thought a Not So Stubby Area was bad. Its another non standard area type used by Cisco which is a Totally Stubby Area which has an ASBR which originates type 7 LSAs.

OSPF Designated Routers

Posted by Bradley | OSPF | Thursday 17 July 2008 19:02

On an multiaccess network OSPF prevents every router on the segment from becoming fully adjacent neighbors with each other through the use of OSPF Designated Routers (DR).

If OSPF did not use the concept of having a DR then each router on the multiaccess segment would directly share its LSDB with each other, we can calculate the number of instances of  LSDB flooding that would occur if there wasn’t a DR on a multiaccess segment with the full mesh formula which is N(N-1)/2.

So without OSPF DRs if we had 10 routers then where would be 45 LSDBs flooded between the adjacent OSPF routers (N(N1-1)/2 = 10(10-1)/2 = 45). This could potentially cause a serious amount of overhead due to the massive amount of redundant LSAs that would be propagating the network. This is the main reason why OSPF DRs are used, another good point about OSPF DRs is that they originate type 2 LSAs which represent a subnet. I will make a post on all of the LSA types soon.

OSPF will start to perform a DR election when it starts 2-way state on the first neighbor it sees on an interface if the hello received from the neighbor has a DR of 0.0.0.0 (0.0.0.0 as the DR in a hello packet means a DR has not yet been elected). OSPF will then wait the period specified in the Dead Timer, where it is waiting for other routers to communicate and come online. This timer is called the wait time and is used to allow other routers to come online and be active for the DR elections after a failure, if this did not occur then one of the first routers to be online would always be the DR.

If the received OSPF hello has a DR of anything else apart from 0.0.0.0 that indicates that DR elections have already taken place and OSPF will use the DR specified in the hello.

In each OSPF hello it sends the current DR and its Priority, if the DR priority of a received hello is higher than the current DR it recognises that as the current DR. The router priority is a value between 0 and 255 with the higher being better, the default is 1 and if it is set to 0 then the router will never become a DR. If there is a tie between OSPF priorities then the highest Router ID wins the tie breaker. The second most preferable DR becomes the Backup DR (BDR) and is used as a failover. Routers which are not the DR or BDR assume the DROther state. Once the DR election is complete the router will move into ExStart and start exchange Database Descriptors (DD).

All OSPF routers send their DDs to the multicast address of 224.0.0.6, this gets acknowledged by the DR sending the same packet back to the source as unicast. The DR then sends the DD it has received to all OSPF routers on the multi access segment via the multicast address of 224.0.0.5. This means that all routers on a multi access network to not need to constantly keep updating one another, they only have to update a central source and this is then sent to the segment.

OSPF Router IDs

Posted by Bradley | OSPF | Wednesday 16 July 2008 22:44

I have blitzed through EIGRP in the last few days and am starting on OSPF, here is the first of a few posts I will make on it in the next few days.

For a router to send OSPF messages it has to define its OSPF Router Identifier (RID). This is a 32bit dotted decimal number which uniquely identifies the router.

Its a simple 3 steps for the router to choose what the RID will be

  1. If the router-id id command is configured under router ospf then that that will always be used as the RID
  2. If there is no router-id configured it uses the numerically highest up loopback interface
  3. Finally if there is no router-id command set or no loopback interfaces up then it uses the highest interface IP address which is up.

It should be noted that the RID is only used to uniquely identify the OSPF router and does not need to be reachable or exist in the routing table. If the RID is changed then all OSPF routers in the area will have to recalculate SPF as its unique identifier has changed.

The final point is that the RID will only change when the router-id command is entered, or OSPF is restarted.