LSA
LSA types
LSA type | Common Name | Description |
1 | Router | Each router creates its own Type1 LSA to represent itself for each area to which it connects. The LSDB for one area contains one type 1 LSA per router per area, listing the RID and all interface IP addresses on that router that are in that area. REpresents stub networks as well. |
2 | Network | One per transit network. Created by the DR on the subnet, and represents the subnet and the router interfaces connected to the subnet. |
3 | Net summary | Created by ABRs to represent subnets listed in one area’s Type 1 and 2 LSAs when being advertised into another area. Defines the links ( subnets ) in the origin area, and cost, but no topology data. |
4 | ASBR summary | Like a type 3 LSA. Except it advertises a host route used to reach an ASBR. |
5 | AS external | Created by ASBRs for external routers injected into OSPF. |
6 | Group membership | Defined for MOSPF, not supported by cisco IOS |
7 | NSSA external | Created by ASBRs inside an NSSA area, instead of a Type 5 LSA |
8 | Link LSAs | Only exist on a local link, where they are used by a router to advertise the router’s link-local address to all other routers on the same link, additionally, the Type 8 LSA provides to routers on that link a listing of all IPv6 addresses associated with the link. |
9 | Intra-Area Prefix LSAs | Can send information about IPv6 networks ( including stub networks) attached to a router ( similar to the Type 1 LSA for IPv4 networks). Additionally, a Type 9 LSA can send information about transit IPv6 network segments within an area ( similar to Type 2 LSA for IPv4 networks) |
10, 11 | Opaque | Used as generic LSAs to allow easy future extension of OSPF. For example, type 10 has been adapted for MPLS traffic engineering. |
Internal LSA types
LSA type 1: router SLA
Every router generates router link advertisements for each area to which it belongs. Router link advertisements describe the state of the router links to the area and are flooded only within that particular area. The link-state ID of the type 1 LSA is the originating router ID.
- Type 1 LSAs are generated by every router and flooded within the area.
- They describe the state of the router links in that area.
- When generating a type 1 LSA, the router uses its own router ID as the value of LSID (32-bit). As with all OSPF LSAs, OSPF identifies a Type 1 LSA using LSID.
Type 1 LSA lists:
- RID of the router.
- For each interface on which no designated router has been elected, it lists the router’s interface subnet number/mask and interface OSPF cost.
- For each interface on which a designated router has been elected, it lists the IP address of the DR and a notation that the link attaches to a transit network.
- For each interface with no DR, but for which a neighbor is reachable, it lists the neighbor’s RID.
ABRs create multiple Type 1 LSAs for themselves: one per area. Type 1 LSA in one area will list only interfaces in that area and only neighbors in that area. However, the router still has only one RID, so all its type 1 LSAs for a single router list the same RID. The ABR then floods each of its type 1 LSAs into the appropriate area.
Example we will use, first two octets are 10.10:
Related reading: http://www.getnetworking.net/ospf/router-lsa
LSA type2: Network LSA
OSPF routers actually choose whether to use a Type 2 LSA for a multiaccess network based on whether a DR has or has not been elected on an interface.
OSPF uses a DR in particular subnet for two main purposes:
- To create and flood a Type 2 Network LSA for that subnet.
- To aid in the detailed process of database exchange over that subnet.
OSPF can not represent the idea of more than 2 routers connected through a single subnet by using a link connecte to all routers. Instead, OSPF defines the Type 2 network LSA, used as a pseudonode. Each router’s Type 1 Router LSA lists a connection to this pseudonode, often called a transit network, which is then modeled by a Type 2 network LSA. This type 2 Network LSA itself then lists references back to each Type 1 router LSA connected to it.
The elected DR in the subnet creates the Type 2 LSA for that subnet. The DR identifies the LSA by assigning an LSID of the DR’s interface’s IP address in that subnet.
Example in the topology above:
R3 and R4 are connected to the same LAN 10.10.34.0/24, if both R3 and R4 default to use priority value and R4’s RID 4.4.4.4, R3’s RID 3.3.3.3. So R4 will be the DR and create the Type 2 LSA for that subnet and flood the LSA.
If we use show command on R3, then we need to check the following areas:
R3# show ip ospf database
--------
Net Link States (Area 34)
Link ID ADV Router Age Seq# Checksum
10.10.34.4 4.4.4.4 1104 0x8000001 0x00AB28
———-
Because we got the advertising router is 4.4.4.4, then we use command:
R3# show ip ospf database router 4.4.4.4
Link connected to: a Transit Network
(Link ID) Designated Router Address: 10.10.34.4
(Link Data) Router Interface address : 10.10.34.4
number of TOS metrics: 0
TOS 0 Metrics: 1
Then we go further:
R3# show ip ospf database network 10.10.34.4
Routing Bit Set on this LSA
LS age: 1161
Options: (No TOS-capability, DC)
LS type: Network Links
Link State ID: 10.10.34.4 (address of Designated Router)
Advertising Router: 4.4.4.4
—–
Network mask: /24
Attached Router: 4.4.4.4
Attached Router: 3.3.3.3
———
LSA type 3: summary LSA
OSPF advertises the interarea routes using the Type 3 summary LSA. ABRs generate a Type 3 LSA for each subnet in one area, and advertise each Type 3 LSA into the other areas.
An ABR connected to area 3 will not forward the Type1 and Type 2 LSAs into other areas, instead creating a Type 3 LSA for each subnet. The routers inside the other areas can then calculate a route for the subnets that exist inside another area. The Type 3 summary LSAs do not contain all the detailed topology information.
Note, The Type 3 summary LSA is not the purpose of route summarization. The summary reflects the idea that the information is sparse compared to the detail inside Type1 and type2 LSAs.
Limit the nuber of LSAs
To protect router memory and ensure fast converge time, we can limit the number of LSAs learned from other routers.
Syntax:
router(config-router)# max-lsa number_of LSAs ignore-time minutes ignore-count times_can_be_suppressed
The first reaction is to issue log messages.
- number _of_LSAs : 1-4294967294, maximum number of non self-generated LSAs.
- Ignore-time: The router ignores the event for a time period, after which the router repeats the warning message.
- Ignore-count: How many times adjacencies can be suppressed.
Related reading: http://www.getnetworking.net/ospf/summary-lsa-type-3
LSA type number | LSA Type Name | This Type represents | Display using show ip ospf database keyword | LSID is equal to | Created by |
1 | Router | A router | Router | RID of router | Each router creates its own |
2 | Network | A subnet in which a DR exists | network | DR’s IP address in the subnet | DR in that subnet |
3 | Summary | A subnet in another area | summary | subnet number | An ABR |
OSPF database exchange process
Basic knowledge is here: http://frankfu.click/networking/networking-fundamental/single-area-ospf/2/
Database description exchange in 2-way:
When a router has reached the 2-way state with a neighbor, the router then decides whether it should exchange its LSDB entries.
When no DR exists, the answer is always “yes”, each router will follow the process:
Exchange without a DR:
Step 1. Discover the LSAs known to the neighbor but unknown to me.
Step 2. Discover the LSAs know by both routers, but the neighbor’s LSA is more up to date.
Step 3. Ask the neighbor for a copy of all the LSAs identified in the first two steps.
Discover a description of the neighbor’s LSDB
After 2-way state, the next step requires both routers to tell each other the LSIDs of all their known LSAs in that area, but the primary goal for each neighbor is to realize which LSAs it does not know, so it can then ask for those LSAs to be sent.
To learn the list of the LSAs known by a neighbor, the neighboring routers follow these steps:
Step1. Multicast database description packets (DD and DBD) to 224.0.0.5, which is the all-SPF-router multicast.
Step2. When sending the first DD message, transition to the ExState state until one router, the one with the higher RID, become the master.
Step3. After electing a master, transition the neighbor to the Exchange state.
Step4. Continue multicasting DD messages to each other until both routers have the same shared view of the LSIDs known collectively by both routers.
Note that the DD messages don’t list the entire LSAs, but rather just the LSA headers. These headers include the LSIDs of the LSAs and sequence number.
The sequence number begins at 0x80000001 (hex). The router increments the sequence number and refloods the LSA whenever the LSA changes.
The slave responds by placing LSA headers in its DD messages, some of the LSA headers simply repeat what the slave hear from the master to acknowledging to the master. Additionally, the slave includes the LSA headers for any LSAs that the master did not list.
This exchange of DD messages ends when each router has known a list of LSAs that it did not have in its LSDB. Additionally, each router also ends this process with a list of LSAs that the local router already knows, but for which the other router has a more recent copy ( based on sequence number).
Exchange the LSAs
Router start to exchange the LSAs in following steps:
Step 1. Transition the neighbor state to loading.
Step 2. For any missing LSAs, send a Link-state request (LSR)message, listing the LSID of the requested LSA.
Step 3. Respond to any LSR messages with a link-state update (LSU), listing one or more LSs in each message.
Step 4. Acknowledge receipt by either sending a link-state acknowledgement (LSAck) message (called explicite acknowledgement) or by sending the same LSA that was received back to the other router in an LSU message (implicit acknowledgement)
Step 5. When all LSAs have been sent , received, and acknowledged, transition the neighborship to the FULL state.
Exchange with a DR
The big difference to exchange without a DR is with whom each router chooses to perform database exchange.
In this situation, each DROther router exchanges their database with the DR/BDR only, not with any DROther routers. Then the DR exchanges any new/ changed LSs with the rest of the OSPF routers in the subnet.
The message differs slightly:
- Non-DR sends message to the 224.0.0.6 all-DR-routers multicast address.
- The DR sends the messages to the 224.0.0.5 all-SPF-routers multicast address.
Periodic flooding
Although OSPF does not send routing updates on a periodic interval, it does reflood each LSA every 30 minutes based on each LSA’s age variable.
The router that creates the LSA sets this age to 0 (second). Each router then increments the age of its copy of each LSA over time.
If 30 minutes pass with no change to an LSA, the owner router increments the sequence number, reset the timer to 0, and refloods the LSA.
Because the owner router increments the sequence number every 1800 seconds (30 minutes), the output of various show ip ospf database
command always show an age less than 1800 seconds.
Note that, when a router realizes it needs to flush an LSA from the LSDB for an area, it actually sets the age of the LSA to the MaxAge setting (3600) and reflood the LSA.
OSPF cost
Check it out here: http://frankfu.click/networking/cisco/single-area-ospf-configuration/2/