Understanding OSPF Routing (part 2)
Smart Tinkering and Unnecessary Tinkering
People have a tendency to tinker with traffic, even when they aren’t suffering from under-provisioned bandwidth. In OSPF, you cannot really influence the way traffic is routed, aside from adjusting a path’s metric. Some routers support making changes to weights, but this isn’t usually necessary. OSPF generally takes care of assigning weights, based on the speed of the interfaces on a router. You can also use ECMP (equal cost multipath) with OSPF, if you have two links to the same place and wish to load balance in a round-robin fashion. Don’t try tinkering with OSPF parameters; more likely than not, if you think you have a problem it’s a network design issue, and fixing that will accomplish your goals.
The LSA and Packets
Pivotal to understanding the impact OSPF will have on your network is realizing there are multiple types of LSAs. Updates are sent every few seconds, which result in updates to the LSA database, and possibly the routing table. “New” LSAs will cause every single router to ditch its routing table and start over with the SPF (shortest path first) calculation.
Finding the shortest path on a weighted, directed graph is computationally hard, and takes considerable time, even on today’s routers. Thankfully Edsger W. Dijkstra made this better with his SPF algorithm, but it’s still tough. This is the main reason OSPF can’t be used on the Internet, and you don’t want to squirt your full BGP Internet routing table into OSPF. Every time a network is deleted or added, an SPF recalculation happens.
Try not to be confused by another “type.” OSPF has many, so be sure to pay attention to the “type” you’re referring to. LSAs can be either an update packet, or a request packet. These are the different types of LSAs that can be sent, and these are either Type 3 or 4 OSPF packets:
- Type 1: router LSA. A router sends this to describe neighbors and its own interfaces.
- Type 2: network LSA. For broadcast networks only; this LSA is flooded by the DR and lists OSPF-speaking routers on the network.
- Type 3: network summary LSA. Sent by an ASBR to advertise networks reachable through it. A stub area router will also use this for the default route.
- Type 4: ASBR-summary LSA. Sent by ASBR, but only internally. This describes to the others how to get to the ASBR itself, and uses only internal metrics.
- Type 5: AS-external LSA. Used to describe external routes to internal areas. Can be used to advertise “this is the way to the Internet” (or some subset of).
- Type 6: Group summary. Used in multicast (MOSPF). Ignore this.
- Type 7: NSSA area import.
Notice that we have both a router and a network LSA. The reason a router LSA exists is because in the absence of a DR, there is no network LSA sent. The router LSA would include a list of all links to the other routers on a network. So OSPF can work in the absence of a DR or BDR, albeit with increased complexity due to the fact that the DR is no longer providing nice summaries.