Understanding OSPF Link-state Advertisement

LSA Overview

Routers generate different types of LSAs depending on the router's role within the OSPF Autonomous System.
  1. All OSPF  routers create Router LSAs (Type-1)
  2. Designated routers create Network LSAs (Type-2)
  3. Area-Border routers create Summary LSAs (Type-3)
  4. Area Border routers create ASBR-Summary LSAs (Type-4) when an ASBR is known.
  5. Autonomous-System Boundary routers create External LSAs (Type-5 and Type-7)

OSPF (LSA Header and Body)


• LS Age: By default an LSA has a maximum age of 3600 seconds. which means if that LSA is put into the database and it reaches one hour (3600 seconds) in age and not been refreshed, it will be aged out and removed from the database and any corresponding route will also be removed from the IP routing table. Therefore when a router generates a Router LSA, that router has a responsibility of periodically refreshing that LSA to make sure that it doesn't age out in other routers. Cisco routers regenerates all Router LSAs at every half the time interval of LS Age timer i.e. ever 30 minutes (1800 seconds).
Options: (E-bit) --Indicates that this area allows external LSAs, this is a normal area and it is not a stub area.
LS Type: Type of LSA
• Link State ID: Varies depending on the kind of LSA.
• Advertising Router: Router that is advertising this LSA. This is a 32 bit number.
• LS Sequence number: Initial Sequence number of an LSA. Everytime this number is incremented. When an OSPF router originates an LSA for the first time, it will choose the sequence number 0×80000001.
• LS Checksum
• Length



Router LSA (Type-1)

  • Describes the state and cost of the router's links to the area (The kind of interfaces or connections router have, stub, transit, or point-to-point)
  • Sends layer-3 reachability information about directly-connected neighbors and networks.
  • All of the router's link in an area must be described in a single LSA
  • Flooded throughout the particular area and no more.
  • Router indicates whether it is an ASBR, ABR. or end-point of virtual link. (by setting the flags)


Router LSAs basically serves 2 high level functions:

  1. It assists all the other routers in the area in building a topology-map, so they know who is connected to who and what kind of interfaces they are connected to.
  2. It also assist all those routers in determining routes, layer-3 prefixes and IP addresses

OSPF specification treat point-to-point link a little bit strangely. According to the specification, Point-to-point links technically doesn't even need IP addresses. So, if a point-to-point interface does have an IP address and a subnet mask, then the OSPF state must be described in two different ways. Then one interface will be described as point-to-point interface, and then it has to re-describe it as a stub link with a network and subnet mask on that interface. See image1.1 to find what the link ID and Link States will be on those LSAs

Information contained inside a Router LSA.
• LS Age
• Options
• LS type: Router Links (type 1)
• Link State ID:  RID of router that originates this LSA.       
• Advertising Router: RID of router that originates this LSA
• LS Seq Number: Initial Sequence number of an LSA
• Checksum
• Length
Number of Links: Number of links that the Router LSA contains.
For a Stub Link:
• (Lind ID Network/subnet number: IP network number (route or prefix that the router is advertising)
• (Link Data) Network Mask: Network prefix used by subnet number.
For a Transit Link:
• (Lind ID) Designated Router address: Interface IP address of the designated router.
• (Link Data) Router Interface address: Interface IP address of the advertising router.



Network LSA (Type-2)

  • Generated for Every transit broadcast and NBMA network.
  • Describes:
             -- The layer-3 network and subnet mask
             -- All the routers attached to the network
  • Only the designated router originates this LSA.
  • Flooded throughout the area and no more.

Every router in an area have to receive LSA-1 and LSA-2.

Information contained inside a Network LSA
• LS Age
• Options
• LS Type: Network Links (type 2)
• Link State ID:Interface IP address of the designated router.
• Advertising Router: RID of router that originates this LSA
• LS Seq Number
• Checksum
• Length
• Network Mask: Network prefix used by the router interface.
• Attached Routers: RID of routers to which this router is adjacent with.



Summary LSA (Type-3)

  • Describes destinations outside the area but still in the AS.
  • Summary is created for one area, which is flooded out in all other areas.
  • Originated by an ABR.
ABR will take the set of router and network LSA that is learned from one area and summarize them down into a summary LSA and inject that into the adjacent areas.

Information contained inside an ABR-Summary LSA
• LS Age
• Options
• LS type: Summary Links(network) (type 3)
• Link State ID: IP network number (route or prefix that the router is advertising) 
• Advertising router: RID of ABR
• LS Seq Number
• Checksum
• Length
• Network Mask: Network prefix used by Link State ID.
• metric




ASBR-Summary LSA (Type-4)

  • Originated by an ABR when it receives a Type-1 router LSA from an ASBR.
  • Injected into adjacent areas to give information about the ASBR.

For a router in OSPF to be considered an ASBR, it must have a redistribute statement with this OSPF process, even if the router has nothing to redistribute at the moment.

Information contained inside an ASBR-Summary LSA
• LS Age
• Options
• LS type: Summary Links (AS Boundry Router) (type 4)
• Link State ID: RID of ASBR
• Advertising router: RID of ABR
• LS Seq Number
• Checksum
• Length
• Network Mask: 0.0.0.0
• metric




External LSA (Type-5)

  • Defines routers to destinations external to AS.
  • Autonomous System default route is also sent as external.
  • Two types of external LSAs:
           -- E1: consider the total cost up to the external destination. (Increments the cost as it passes through routers.)
           -- E2: Considers the cost at the point of redistribution. (This cost remains the same throughout the OSPF network). Default cost for both types of External LSAs is 20(configurable).


Purpose of External LSA is to take a route or prefix that was learned in some non-OSPF way and inject to an OSPF autonomous system. Any time we redistribute anything into OSPF, it automatically defaults to using an external type-5 LSA type. Now LSA type-5 are the only type of LSAs that ones it injected in an autonomous system, it's flooded to all routers in that autonomous system except the routers in a Stub area.

Information contained inside an External LSA
• LS Age
• Options
• LS type: AS External Link (Type 5)
• Link State ID: IP network number
• Advertising router: Router ID of the redistributing router. (RID of ASBR)
• LS Seq Number
• Checksum
• Length
• Network Mask: Network prefix used by IP network/subnet number.
• Metric Type: 2
• Metric: 20
• Forwarding address: 0.0.0.0 (Traffic should be forwarded to the ASBR)
• External Route Tag







Comments

  1. Good explanation but I have two points till now to comment on:
    1- Stub information is sent in the hello msgs not in the LSA Type-1.
    2- LSA Type-4 is not as what you mentioned, I suggest to check this explanation about this Type-4 LSA: http://blog.networkrise.com/2013/08/01/ospf-type-4-lsa/

    waiting for more articles

    ReplyDelete
  2. Dear Saeed,

    The stub information, that the hello messages carry is about Stub area flag. All routers in an area must agree to this flab to form neighbor relationship.

    But what I have mentioned here is the kind of LINK/CONNECTION that a router has. A router can look at it's interface and describe it as either a Stub link, Virtual Link, Point-to-Point Link or a Transit Link.

    If an interface is running OSPF, however that interface has not learned of any other OSPF neighbors, It has sent out hello packets but hasn't got any hello packets back from anyone else. So the router will classify that connecion or interface as a stub interface.

    In OSPF even if a Point-to-Point interface has an IP address, then that interface will be described in two different ways. Firstly it will be described as a point-to-point interface, and then it has to re-describe it as a stub link with a network and subnet mask on that interface.

    ReplyDelete
  3. Can you show us what fields in the LSA are responsible for STUB/P2P/Transit descriptions?

    Regarding to the 2nd point of LSA Type-4 is sent when the ABR received LSA Type-5 from the ASBR not the Type-1 and this LSA shows other areas how to reach this ASBR RID which is mentioned in the Type-5 LSA in the filed of "Advertisement Router"...

    ReplyDelete
  4. I guess this Presentation will solve all your queries.
    https://learningnetwork.cisco.com/docs/DOC-7224

    ReplyDelete
  5. it seems you don't have anything to say about the second point which you're ignoring in every comment, and regarding to the presentation I think it is worthless to show because I just asked you what fields in LSA Type-1 describe the link type... but I am not expecting an answer on both points so thanks for the nice article.
    bye bye

    ReplyDelete

Post a Comment

Popular posts from this blog

Specifying SSH port in Ansible Inventory

Ansible-Playbook to display output of multiple show commands (using stdout_lines with Loop)

Filtering Routes in BGP using Route-maps and Prefix-list

Ansible Playbook for Network OS Upgrade with pre and post checks

Bypassing Proxy Server in Google Chrome

VMware NSX Traffic Flow — East-West & North-South

Ansible-playbook for backing up running config of Cisco IOS

Export or Backup Azure Network Security Groups into CSV using PowerShell