OSPF summary
Background
OSPF uses IP protocol 89 to communicate.
OSPF also uses two multicast groups: AllSPFRouters = 224.0.0.5, and ALLDRouters = 224.0.0.6
An OSPF internetwork can be divided into up to 2^32 OSPF areas
. A network with one area will have only area 0, which is mandatory. Areas are used to limit the scope of LSAs; when an LSA is sent it floods its entire area but, depending on what it is, need not also flood other areas. Areas also help conserve router memory and improve performance by limiting the size of the OSPF link state database.
When there is more than one area, the rule is that area 0 is the hub area: no two other areas can communicate without doing so via area 0.
LSA types
OSPF routers originate link state advertisements
(LSAs) to describe the local environment. LSAs are flooded within the area using multicast. Any topology change in the area will trigger a new flood of LSAs. All LSAs, taken together, form the link state database. Every router in an area will have the exact same link state database.
Type 1: Router-LSA
- Reports router's active interfaces, IP addresses, and neighbors.
- One such LSA per router.
- Distributed using reliable flooding: if a new, different LSA is received, the router acks it, then sends it out all of its other interfaces.
Type 2: Network-LSA
- On broadcast subnets, for all routers to form adjacencies with all other routers would require n*(n-1) links.
- Instead, each router has a link to the subnet's Network-LSA (and vice versa).
- The designated router (DR) originates the network-LSA on behalf of the subnet.
- This LSA has a list of all of the attached routers.
- On NBMA networks, all routers need to know (by configuration?) the
DR and BDR, not the others. They must be able to reach the others (full
mesh).
- (On point-to-multipoint networks, a full mesh is not required.
There is no DR, and hence no Type 2 LSAs; only Type 1 LSAs are used.)
Type 3: Summary-LSA
- Generated by ABR to leak one area's summary address info into another area
- ABR will generate more than one summary-LSA for an area if that
area's addresses cannot be properly aggregated by only one prefix.
- Reduces the size of the link state database
- Constrains flooding to an area
- Makes areas somewhat insensitive to link or router failures in another area.
- Since OSPF prefers intra-area paths, duplicate routes in another area won't affect this one.
Type 5: AS-external-LSA
- Unlike all other LSAs, these have
AS flooding scope
, not area
flooding scope
. In other works, they are flooded unmodified across
area boundaries.
- Originated by ASBRs
- Advertises a single prefix, learned from another routing protocol.
- Coming from another internal protocol, usually use Type 1 metrics.
- Coming from an external source, usually use Type 2 metrics.
- Flooded across area boundaries, instead of being re-originated by ABRs.
Type 4: ASBR-summary-LSA
- Originated by ABRs when an ASBR is present to let other areas know where the ASBR is.
- Handled just like summary-LSAs.
Type 7: Type-7-LSA
- Used only by NSSAs, which are stub areas that contain one or more ASBRs.
- Type 7s are originated by ASBRs (only if area is configured to be a NSSA).
- ABRs hear the Type 7s, then change them into Type 5s before forwarding them.
- Identical in format to type 5s, except that they have only area flooding scope.
- Can have a N/P (do not propagate) bit set.
Type 8: external-attributes-LSA
- Never been implemented or deployed.
- Used when BGP info is carried across OSPF AS.
- Only needed when the BGP AS-path does not fit into the available 4 bytes in the AS-external-LSA
Tag
field.
- If used, the associated Type 5's tag field is set equal to the link state ID of the Type 8.
- Allows OSPF to be used instead of IBGP, and still preserves the AS-path attribute. Advantages of OSPF over IBGP:
- IBGP requires n2 mesh
- With OSPF, each BGP route traverses a subnet only once, using the OSPF flooding mechanism
- Some OSPF routers would be required to store BGP info in the form of Type 8s, requiring more memory.
Special area types
Stub area
- Design goal: allow the use of routers with limited memory and processor.
- Shielded from external routes (gets there via default route) but knows of all the other OSPF areas.
- No AS-external-LSAs (5).
- Cisco:
area 1 stub
Totally stubby area
- Shielded from external routes and routes in other areas (gets there via default route).
- No AS-external-LSAs (5).
- No summary LSAs (3,4) except default summary route.
- Cisco:
area 1 stub no-summary
NSSA (not-so-stubby-area)
- Like a stub area, but allowed to import external routes for some destinations, still using default routes to get to others.
- Allows stub area to provide transit for small sub routing domains that are not OSPF (such as a small RIP network.
- No summary LSAs (3,4) except default summary route.
- No AS-external-LSAs (5), but uses type-7 LSAs to transmit type 5 info to ABRs within the area that need this info.
- Still protects internal routers from other area's external-LSAs.
- All routers in an area must agree that it is an NSSA, so that there
are no AS-external-LSAs. Therefore, N/P bit is also part of the Hello
packet.
- Cisco:
area 1 nssa
NSSA totally stubby area
- Cisco:
area 1 nssa no-summary