OSPF-From JNCIS Study guide

  • Prefix advertised in the form of Link State Advertisement (LSA)
  • Each LSA has common LSA Header. 20-octet format.
    • Link state age: – 2 octet
      • Time since LSA was originated.
      • After MaxAge time is reached (3600 sec), the LSA becomes invalid.
      • The originating router should flood the LSA before it expires. On Juniper, it is done at 3000 sec (50 mins), by default
    • Options: 1 Octet
      • Displayed as “Opt” in the show command. Capabilities are advertised via this option field.
      • Bit-7: DN bit. Down bit. Used in VPN to avoid loop
      • Bit-6: Indicates local router supports opaque LSA.
      • Bit-3: N/P. To handle NSSA LSAs
      • Bit-1: E bit. Indicate support for type-5 external LSAs
      • When opt = 0x02. It indicates it supports Type-5 LSA. When Opt=0x08, implies router is part of NSSA.
    • Link-state Type: 1 octet
      • 1- Router LSA. 2-Network LSA. 3- Network Summary LSA. 4- ASBR summary LSA. 5- AS External LSA. 7- NSSA External LSA.9-Opaque LSA (link-local). 10-Opaque LSA (area-local)
    • Link-state ID: 4 octet
      • Indicates the network portion being advertised in LSA. Differs according to link-state type.
    • Advertising Router (4 octet)
      • Router ID of router which originates the LSA.
    • Link state Sequence Number (4 octet)
      • To make router have recent version of LSAs. Starts from 0x80000001 to 0x7fffffff
    • Link state checksum (2 octet)
      • IP checksum for entire LSA except age field
    • Length (2 octet)
      • Length of entire LSA packet including the header.
  • Router LSA: ( area-scope)
    • To advertise its own networks. The fields available in router LSA are;
    • V/E/B bits- 00000VEB (1 octet)
      • ‘v’ bit is set when local router is end point of a virtual link.
      • ‘E’ bit is set when local router is ASBR
      • ‘B’ bit is set when local router is ABR.
      • When this octet is 0x01 : ABR, 0x02: ASBR, 0x03: ABR as well ASBR. When 0x05, it means it is ABR and has Virtual link.
    • Reserved (1 octet)
      • Set to 0x00
    • Number of links; (1 octet)
      • Implies how many links are advertised in this router LSA. Following fields are repeated for each links.
    • Link ID and Link data (each 4 octet)
      • Depends on type of interface advertised. (Link type)
      • Point-point:
        • OSPF router form adjacency over point-point link
        • Link ID: router ID of adjacent Peer
        • Link data: IP address of local routers’ interface
      • Transit:
        • Transit links are interfaces connected to broadcast domain. Eg: Ethernet.
        • Link ID: Interface address of DR router.
        • Link data: IP address of local router’s interface
      • Stub:
        • Each operational OSPF interface that doesn’t contain adjacency is stub network.
        • Loopback IP, passive interface, subnet on P2P interface
        • Link ID: has network number
        • Link data: has subnet mask
      • Virtual Link:
        • Same as in point-point link type.
    • Link Type ( 1 octet)
      • 1- point-point. 2-Transist. 3- Stub. 4- Virtual Link.
    • Number of TOS metric ( 1 octet)
      • Set to 0x00
    • Metric (2 octets)
      • Displays cost/metric
    • Command to see router LSA in database: “show ospf database router area 0 extensive”
    • LSA originated by local router are denoted by “*”
  • Network LSA (area wide)
    • Originated by DR. Link state ID field in LSA header is filled with IP interface address of the DR.
    • It has 2 fields. Network Mask (4 octet)
      • Contains network mask of broadcast segment.
    • Attached Router: (multiples of 4 octet)
      • List all attached routers in the broadcast segment
    • “show ospf database network area 0 extensive”
  • Network Summary LSA ( area wide)
    • ABR generates a single summary LSA for each router and network LSA in an area to another area.
    • Link state ID field in LSA header represents network being advertised.
    • It has following fields. Network Mask (4 octet)
      • Contains network mask
    • Reserved (1 octet)
      • 0x00
    • Metric ( 3 octets)
      • ABR uses its local total cost for the route as the metric. When summarized, it uses largest metric of summarized routes.
    • “show ospf database netsummary area 0 extensive”
  • ASBR Summary LSA (local area wide)
    • Before using external routes, routers check its reachability to ASBR.
    • In same area, routers know about ASBR by router LSA’s V/E/B bits.
    • To allow routers in other areas to use external routes, the ABR generates ASBR summary LSA  when below 2 conditions met;
      • When ABR receives ASBR summary LSA from backbone.
      • When ABR see a router with its router LSA set to ASBR
    • Same format as Network summary LSA. Key difference is “link state ID” in the header will have router ID of ASBR and the “network mask” filed in summary LSA has 0.0.0.0
    • “show ospf database asbrsummary area 0 extensive”
  • AS External LSA ( domain wide)
    • External routes are advertised as type-5 LSA by ASBR. The ‘link state ID’ filed in header has network portion being advertised.
    • It has following fields;
      • Network mask (4 octet)
        • Contains mask of the network being advertised.
      • E-bit ( 1 octet): “E0000000”
        • When “E” bit is set to 1 (default), it is consider as type-2 and all ospf routers uses the metric advertised as total cost for the external route.
      • Metric (  3 octet)
        • Metric set by ASBR for external routes
      • Forwarding address ( 4 octet)
        • Displays IP address to which each OSPF router should forward the packets to reach external route. Set to 0000
      • External Route Tag (4 octet)
        • For use by other routing protocols. By default to 0.0.0.0
    • “show ospf database extern extensive”
  • NSSA External LSA ( area wide)
    • Generated by ASBR in NSSA. Same format as AS external LSA. ABR translates type-7 to type-5 LSA.
    • “show ospf database nssa extensive”
  • Opaque LSA
    • Link-local:
      • LSAs are flooded only in a single link between 2 routers.
      • Used for graceful restart feature.
    • Area-local:
      • LSAs are flooded throughout an area.
      • Used for TE in MPLS network
    • AS-wide scope:
      • LSAs are flooded throughout OSPF domain
      • Currently not implemented in any vendor
    • ‘Link state ID’ of LSA header is divided into 2 portions;
      • First 8 bits represent “Opaque type” and remaining 3 octet represent “opaque ID”
  • Tie break rules to select an OSPF route; in order of preference
    • Intra-area route;
    • Inter-area route;
    • External route marked as type-1;
    • External route marked as type-2.
  • SPF algorithm:
    • Juniper router have 3 database for SPF calculation
    • Link-state database:
      • Different than “show ospf database” but have same info.
      • (router ID, neighbor ID, cost) format
    • Candidate database;
      • Same tuple format as above, but the cost field implies cost from root of the SFP tree(local router).
      • Shortest path to each node is calculated in this table.
    • Tree database;
      • Result of SPF calculation. Passes this info to routing table.
  • Graceful restart feature;
    • Ability to restart routing process without causing network instability.
    • Each graceful restart capable router can be in  any of three modes;
    • Restart candidate: When the local router is attempting to restart, it will be ‘restart candidate mode’. Router sends notification msg and stores its local protocol state and restarts.
    • Possible helper: Default mode. It can assist a neighbor router undergoing restart operation or the local router itself can go restart.
    • Helper mode: When a restart-capable router receives a notification message from neighbor, it goes into ‘helper mode’. It maintains the adjacency as ‘Full’ and will not trigger topology change.
  • Grace LSA:
    • The opaque type is set to 3 and opaque ID is set to 0.
    • It has following fields; TLV format
      • Type (2 octets) : 1- Grace period. 2- Hitless restart reason. 3- IP interface address.
      • Length (2 octets) : 4 when ‘type’ is grace period or IP interface address. 1 when type is restart reason.
      • Value (variable)
        • Grace period: time period in seconds for restart even to complete. Should be in all grace LSAs.
        • Hitless restart reason: the possible reasons are unknown(0), software restart(1), software upgrade(2) or RPM failover(3)
        • IP interface address: Used in broadcast network.
    • “show ospf database link-local extensive”
    • Configured inside “protocol ospf” mode with “graceful-restart options”
  • Authentication:
    • 2 configuration steps. Configure “authentication –type” inside “ospf area” mode. And then “authentication-key xxxx” inside “ospf area interface” mode. Only later part makes authentication to be enabled.
    • Default : no authentication
    • Simple password:
      • “authentication-type simple” in [edit protocol ospf area]
      • “authentication-key xxxx” in [edit protocol ospf area interface]
    • MD5 authentication:
      • “authentication-type md5” in [edit protocol ospf area]
      • “authentication-key xxxx key-id yyyy” in [ospf area interface]
  • Interface metric is calculated as “Ref. BW/ BW of the interface in bits/sec” where ‘Ref. BW” is 10^8, by default.
  • We can manually configure metric for an interface using “metric xxxx” in [edit protocol ospf area interface] mode.
  • We can change the default reference-bandwidth using “reference-bandwidth 1g” inside [edit protocol ospf] mode.
  • Virtual link;
    • To connect an area to backbone area via non-backbone area, so that all networks can be reachable.
    • Configuration requires 2 information: router ID of remote router and transit area the 2 routers have in common.
    • Inside area 0 configuration mode, “virtual-link neighbor-id x.x.x.x transit-area y.y.y.y”
  • To reduce the number of LSAs in database, we have two methods;
    • For non-backbone areas, we can configure stub,nssa, totally stub.
    • For backbone areas, we need route summarization to reduce LSAs
  • Stub:
    • ABR does not flood the AS-external LSA into stub area. Also, ABR does not generate ASBR-summary LSA.
    • Configure ‘stub’ inside [protocol ospf area] to make that area stub.
    • Check “show ospf interface detail” command to check stub config.
    • The reachability of external LSAs is replaced by default route originated by ABR. In JUNOS, this is by manual configuration.
    • [stub default-metric xx] to generate default-route with metric xx
  • Totally stub:
    • Network summary LSAs are not allowed inside totally-stubby area.
    • [stub default-metric xx no-summaries] inside area configuration.
  • NSSA:
    • ASBR present inside stub area. NSSA allows external routes as type-7
    • E bit is cleared and N/P bit is set in option field of OSPF header.
    • Inside area configuration mode, set the area as nssa with ‘nssa’ CLI
    • “N” bit is significant in OSPF hello packet to indicate support of NSSA
    • “P” bit is significant in NSSA packet to indicate ABR with highest router ID to perform type-7 to type-5 conversion.
    • By default, inside NSSA area, default route is injected as type-7 LSA by ABR with [default-lsa default-metric] command inside [area nssa].
  • Totally stubby NSSA:
    • Inside [edit protocol ospf area nssa] mode, configure “no-summaries
    • Type-3 default route is generated by ABR. If we need this default route to be generated as type-7 configure “type-7” inside [edit protocol ospf area nssa default-lsa] mode.
  • Address Summarization:
    • Area route summarization: configure “area-range xxxx/y” command inside a non-backbone area configuration mode in ABR. The ABR locates any router/network LSA in that area that falls within the configured range and does not advertise them into backbone.
    • NSSA route summarization: configure above command inside [edit protocol ospf area nssa] mode to summarize AS external routes.

Source: JNCIS-M series Study guide.

Advertisements
This entry was posted in jncis, Junos, ospf and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s