notes taken to help study for CCIE...used Enabling IP Routing with Cisco Routers by R. Das & K.Chakrabarty, CCIE Routing and Switching by A. Anthony Bruno, as well as lots of Internet resources. A lot of this stuff is plagarized from the 2 stated sources, and should be re-worked if ever put into an official publication. A few things were taken from Pearson's CCNA Routing and Switching 200-101 Complete Video Course.
Table of Contents

OSPF(v2 (ipv4))


Definitions

Hello - protocol used to discover OSPF neighbors and confirm reachabilty to those neighbors (also used in election of DR)
Link State Advertisement (LSA) - info rtr snds/recs about net reachability (used to construct rtr's Link State Database)
Link State Update (LSU) - pkt that carries LSAs
Link State Request (LSR) - Used by rtr to req spec LSA info fr neighbor
Link State Acknowledgement (LSAck) - Used by rtr to conf it rec'ed an LSU
DR – (Designated Router) BDR – (Backup Designated Router) – Takes over for DR if DR fails.
DRothers – non DR/BDR routers. Multicast packets to DR & BDR using multicast address 224.0.0.6 (AllDRouters).
ABR - (Area Border Router) - Connect 2 areas within AS.
ASBR - (Autonomous System Boundary Router) - connects to at least one external routing process (i.e. not in the OSPF AS)

Neighbors are routers on same link - (known via Hello msgs - to be a neighbor area hs to be the same, hello and dead timers have to be the same, mtu has to be the same, have to be on same network/subnet)
Adjacencies area - collection of interfaces that are running OSPF
Flooding – Periodic updating of topology and routing table info with LSAs being sent out.

Stub Area - configured with default external route (0.0.0.0). Doesn't accept external summary routes (LSA Type 4 or LSA Type 5). A stub area has no routers or areas beyond it.
Totally Stubby Area - Cisco proprietary. Doesn't accept LSA Types 3, 4, 5. Accepts default external route (0.0.0.0). Will not accept external summary LSAs.
Not So Stubby Area - Allows for redistribution of routing info. ASBR sends LSA Type 7 through area. ABR converts to Type 5 LSA.

External type 1 route - metric is sum of redistribution cost plus cost of path to reach ASBR.
External type 2 route - metric of route at the point of redistribution into OSPF network.
Virtual Link - Area that is not connected directly to area 0 can be connected through another area. This should be temporary only (redo areas).

Network Types

Network Type Elects DR/BDR Default Hello Interval Uses neighbor command
Broadcast Yes 10 seconds No
P-to-P No 10 seconds No
NBMA Yes 30 seconds Yes
P-to-Multipoint No 30 seconds No

Timer Comparison

 Hello(RIP-Invalid)
(OSPF-Suspicious)
Dead
(RIP-Flush)
Holddown
RIP30180 (6x)240 (8x)180
OSPF10 BMA
30 NBMA
90 (3x)120 (4x)5 second delay +
10 seconds Hold
EIGRP5
60 WAN < 1.544Mbps
15 (3x)
STP220 blocking
15 listening
15 learning
forwarding

Packets

Type   Description  
1 Hello establishes and maintains neighbor relationships, DR, BR.. Hello timer-
  • Every 10 seconds on BMA and P-to-P.  
  • 30 seconds on NBMA.  
  • Suspicious neighbor relationship at 3 times hello timer.  
  • Dead timer 4 times hello timer.
2 Database Description describe the contents of the link-state database (overview)
3 Link State Request send if rtr finds that parts link-state db are out-of-date
4 Link State Update implements flooding of LSAs. Each packet carries collection of LSAs one hop further from their origin.  LSU can contain multiple LSAs.
5 Link State Acknowledgment Acks the flooded LSAs. Makes the flooding process reliable.

LSAs

– (Link State Advertisement) – OSPF packetcontaining src, dst, routing info.
LSA Type   Description  
1 Router-LSAs I am an OSPF rtr and these are my links to the area - 1 for eac subnet
2 Network-LSAs DR sends this LSA to all fully adjacent rtrs. Lists DR rtr ID and rtr IDs fully adjacent to the DR
3 Summary-LSAs (IP network)   ABRs send summary routes into area for other areas in AS
4 Summary-LSAs (ASBR) ASBRs send summary routes into area for other areas not in AS (i.e. using a diff routing protocol
5 AS-external-LSAs External routes injected into OSPF area
6   Group membership link entry generated by multicast OSPF routers
7 NSSA External LSA here's another area not in our AS


Sample OSPF Map


Router ID

higher is better - Priority looked at before Router ID
  1. router-id command (under router OSPF <pid>)
  2. loopback
  3. highest active IP addr
priority then router id (highest) determines DR and BDR

States (Cisco?)

Forming an Adjacency

         R1             R2
      (r1 boots, r2 already up)
state init     ------------Hello----------> state init (r2 not in r1's hello neighbor list)
state 2way     <-----------Hello----------- state init (r2 includes r1 as neighbor to r2 in packet)
state 2way     ------------Hello----------> state 2way (r1 includes r2 as neighbor to r1 in packet)
state 2way     <-dr/bdr elect (if needed)-> state 2way
state ExStart  <--prim/sec rtrs selected--> state ExStart
state Exchange <-db desc packs Exchanged--> state Exchange
state Loading  <-rtrs query for missing entries-> state Loading
state full     <--adjacency fully formed--> state full

Flapping

causes area to recalc SPF.  minimize by

Configuring Neighbor Authentication

Plain text

int s1/0
  ip ospf authentication-key DaSecret
router ospf 1
  area 1 authentication

show ip ospf int s 1/0
clear ip ospf process (reset OSPF processes)
show ip ospf neighbor

MD5 hash

int fa 0/0
  ip ospf message-digest-key 1 md5 DaSecret2
router ospf 1 
  area 0 authentication message-digest

show ip ospf int fa 0/0
clear ip ospf process (reset OSPF processes)
show ip ospf neighbor

Metric

OSPF Metric/ref bw - (10^8)/bps or 10mbps
cost (integer) = ref bw/interface bw
don't forget to all all links including final egress link
Fast Ethernet and faster1
Ethernet10
E148
T164
128 kbps781
64 kbps1562
56 kbps1785
can set manually on interface with
    ip ospf cost <cost>
        or
    bandwidth <kbps>

show ip ospf interface 

can modify ref bw using
  auto-cost reference-bandwidth <value>
where <value> = highest bw in network - can only be 16 bit value...be careful of low end values
shows calc'ed cost not specified?

Djikstra's Algorithm

considers topology and calculates Shortest Path to Destination taken from Cisco CCNA Routing and Switching 200-120 Complete Video Course until I can redraw it differently
From Node A's perspective how do I get everywhere...
From Node To Node
B C D E
A 20 via A 10 via A Infinite Infinite
C not connected
20 via A
already there
10 via A
20 + 10 (A-C)
30 via C
50 + 10 (A-C)
60 via C
B already there
20 via A
not connected
10 via A
30 + 20 (A-C)
30 via C
not connected
60 via C
D 30 + 30 (A-C-D)
20 via A
20 + 30 (A-C-D)
10 via A
already there
30 via C
40 + 30 (A-C-D)
60 via C
E not connected 50 + 60 (A-C-E)
10 via A
40 + 60 (A-C-E)
30 via C
already there
60 via C

Shortest Path Tree (from A perspective)
A--B
|
C--D
|
E

Commands and config - ipv4 (Cisco)

!
interface Loopback0
 ip address 192.168.5.3 255.255.255.255
 ip ospf priority 101  (highest prio wins, default is 1, 0 - don't participate,
                        bounce int to relearn DR)
interface FastEthernet0/0
 ip address 192.168.4.3 255.255.255.0
 ip ospf message-digest-key 1 md5 cisco (key for authentication)
!
...
!
router ospf 1  (1 is process id)
 log-adjacency-changes
 area 0 authentication message-digest
 network 192.168.0.0 0.0.7.255 area 0  (wildcard mask)
   OR
 network 0.0.0.0 255.255.255.255 area 0 (all networks/interfaces)
 default-information originate
 passive-interface fa0/0 (don't send Hellos/LSAs out this interface)
 auto-cost reference-bandwidth 10000 (mbps - default is 10mbps)
 router-id x.y.z.a (leaving it off will take highest loopback)

int s 1/0
 ip ospf network non-broadcast (or broadcast or point-to-multipoint 
                                or point-to-point (changes timers))
 ip ospf hello-interval 30 (manually set timers to force match-up)
                           (routes won't be learned unless network type is same)

sh ip protocols
sh ip ospf 
sh ip ospf int brief
sh ip ospf interfaces (sh interface ospf detail incl timers - need to match neighbor)
sh ip ospf int <interface> (shows DR/BDR status)
sh ip ospf neighbor (includes if ospf neighbor rtr is DR or BDR, also HELLO/DEAD timers)
                    (has adjacency been formed)
sh ip ospf rib (rtr info base - entries w/ > are injected into rtr ip rting tbl (global rib))
sh ip route     shows [AdminDistance/Cost(or FD for EIGRP)]
                               (OI means interarea)
sh ip route ospf (only shows routes learned vi ospf)
debug ip ospf hello
clear ip ospf process (resets ospf)
show ip protocols (shows all routing protocols running and some details)

Commands and config - ipv6/ospfv3 (Cisco)

ipv6 unicast-routing
ipv6 cef (make efficient fwd decisions based on fib and adj table)

int fa 0/0
 ipv6 ospf 1 area 0
int fa0/1
 ipv6 ospf 1 area 0
int lo0
 ipv6 ospf 1 area 0

ipv6 router ospf 1
 router-id 1.1.1.1 (can be ipv4)
  
router ospfv3 1 (1 is process id)
 auto-cost reference-bandwidth 10000
 passive-interface fa0/0
 
sh ipv6 route
sh ipv6 int brief
ping 2000:11::1111
traceroute 2000:11::1111
sh ipv6 ospf neighbor
sh ipv6 protocol (rtr id is ipv4 addr)
sh ipv6 ospf int brief
sh ipv6 ospf <interface> (see cost, router id, timers, net type, adjacency
sh ipv6 cef

Packet details

Header
	0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Version # | Type | Packet length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Router ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Area ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum | AuType |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Authentication |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Authentication |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Hello Packet
	0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Version # | 1 | Packet length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Router ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Area ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum | AuType |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Authentication |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Authentication |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Network Mask |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| HelloInterval | Options | Rtr Pri |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| RouterDeadInterval |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Designated Router |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Backup Designated Router |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Neighbor |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... |
Database description packet
	0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Version # | 2 | Packet length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Router ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Area ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum | AuType |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Authentication |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Authentication |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Interface MTU | Options |0|0|0|0|0|I|M|MS
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| DD sequence number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+- -+
| |
+- An LSA Header -+
| |
+- -+
| |
+- -+
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... |

Link State Request
	0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Version # | 3 | Packet length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Router ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Area ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum | AuType |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Authentication |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Authentication |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS type |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Link State ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Advertising Router |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... |
Link State Update
"...carries a collection of LSAs one hop further from their origin..."
	0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Version # | 4 | Packet length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Router ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Area ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum | AuType |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Authentication |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Authentication |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| # LSAs |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+- +-+
| LSAs |
+- +-+
| ... |
Link State Ack
	0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Version # | 5 | Packet length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Router ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Area ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum | AuType |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Authentication |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Authentication |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+- -+
| |
+- An LSA Header -+
| |
+- -+
| |
+- -+
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... |

LSA formats

"...Each LSA describes a piece of the OSPF routing domain. Every router originates a router-LSA. In addition, whenever the router is elected Designated Router, it originates a network-LSA. Other types of LSAs may also be originated (see Section 12.4). All LSAs are then flooded throughout the OSPF routing domain...collection of LSAs is called the link-state database.

From the link state database, each router constructs a shortest path tree with itself as root. This yields a routing table...."

LSA header
	0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS age | Options | LS type |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Link State ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Advertising Router |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS sequence number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS checksum | length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Router-LSAs
"Each router in an area originates a router-LSA. The LSA describes the state and cost of the router's links (i.e., interfaces) to the area. All of the router's links to the area must be described in a single router-LSA. For details concerning the construction of router-LSAs, see Section 12.4.1."
	0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS age | Options | 1 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Link State ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Advertising Router |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS sequence number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS checksum | length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 |V|E|B| 0 | # links |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Link ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Link Data |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | # TOS | metric |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| TOS | 0 | TOS metric |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Link ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Link Data |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... |
Network-LSAs (type 2 LSAs)
originated by the network's DR - lists all router IDs attached to the network, including the DR itself. Generally sent by the DR.
	0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS age | Options | 2 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Link State ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Advertising Router |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS sequence number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS checksum | length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Network Mask |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Attached Router |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... |
Summary-LSAs
Type 3 LSAs are originated by ABRs to describe inter-area IP destinations (within AS but outside of particular area). Type 4 LSAs are originated by ASBRs to describe routes to IP destinations outside of AS.
	0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS age | Options | 3 or 4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Link State ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Advertising Router |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS sequence number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS checksum | length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Network Mask |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 | metric |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| TOS | TOS metric |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... |
AS-external-LSAs
	0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS age | Options | 5 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Link State ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Advertising Router |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS sequence number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS checksum | length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Network Mask |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|E| 0 | metric |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Forwarding address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| External Route Tag |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|E| TOS | TOS metric |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Forwarding address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+