Skip to content

How to add new vendor support

Vadim edited this page Sep 12, 2021 · 3 revisions

This tutorial is aimed at showing how to add new vendor support in Topolograph.
In order to visualize OSPF network there are two important LSAs - Router LSA and Network LSA. All others are optional. Router LSA is divided to four subtypes and not all types are needed for visualization of OSPF. These types are mentioned bellow:

LINK ID definitions for different network types (p2p, stub, transit) in Router LSA
                   Link type   Description       Link ID
                   __________________________________________________
                   1           Point-to-point    Neighbor Router ID
                               link
                   2           Link to transit   Interface address of
                               network           Designated Router
                   3           Link to stub      IP network number
                               network
                   4           Virtual link      Neighbor Router ID

For us we need to take Link Type 1, 2 (it's mandatory) and highly desirable to know about all terminated networks in OSPF. That's why we take into account Link type 3 too. All in all, for adding new vendor to Topolograph we need to build five (5) textfsm templates. They are:

No TextFSM name LSA name Purpose Is Mandatory
1 <vendor_name>_<os_name>__router_p2p.tpl Router LSA type 1 LSA describes adjacency through p2p links Yes
2 <vendor_name>_<os_name>__router_transit.tpl Router LSA type 2 LSA describes adjacency through broadcast media Yes
3 <vendor_name>_<os_name>__router_stub.tpl Router LSA type 3 LSA describes included in OSPF subnets No
4 <vendor_name>_<os_name>__router_network.tpl Network LSA For describing adjacency in broadcast media Yes
5 <vendor_name>_<os_name>__router_external.tpl External LSA LSA describes external subnets No

TextFSM templates

LSA Router Type p2p

Example of Router LSA
Next RT3's router-LSA for the backbone is shown.  It
indicates that RT3 has a single attachment to the
backbone.  This attachment is via an unnumbered
point-to-point link to Router RT6.  RT3 has again
indicated that it is an area border router.

        ; RT3's router-LSA for the backbone for Area 1 **<--AREA**

        LS age = 0                     ;always true on origination
        Options = (E-bit)              ;
        LS type = 1                    ;indicates router-LSA
        Link State ID = 192.1.1.3      ;RT3's router ID
        Advertising Router = 192.1.1.3 ;RT3's router ID            **<--ADV_ROUTER_ID**
        bit E = 0                      ;not an AS boundary router
        bit B = 1                      ;area border router
        #links = 1
               Link ID = 18.10.0.6     ;Neighbor's Router ID       **<--NEIGHBORING_ROUTER_ID**
               Link Data = 0.0.0.3     ;MIB-II ifIndex of P-P link
               Type = 1                ;connects to router
               # TOS metrics = 0
               metric = 8                                          **<--METRIC**
Variable TextFSM Value option Example Values Is Mandatory
ROUTER_ID Filldown 192.1.1.3 No
AREA Filldown No
ADV_ROUTER_ID Filldown 192.1.1.3 from Advertising Router Yes
NEIGHBORING_ROUTER_ID Required 18.10.0.6 from Link ID Yes
METRIC Required 8 Yes

cisco_ios_show_ip_ospf_database_router_p2p.tpl

LSA Router Type transit

Example of Router LSA Type transit
; RT3's router-LSA for Area 1

        LS age = 0                     ;always true on origination
        Options = (E-bit)              ;
        LS type = 1                    ;indicates router-LSA
        Link State ID = 192.1.1.3      ;RT3's Router ID
        Advertising Router = 192.1.1.3 ;RT3's Router ID           **<--ADV_ROUTER_ID**
        bit E = 0                      ;not an AS boundary router
bit B = 1                      ;area border router
        #links = 2
               Link ID = 192.1.1.4     ;IP address of Desig. Rtr. **<--DR_IP_Addr**
               Link Data = 192.1.1.3   ;RT3's IP interface to net 
               Type = 2                ;connects to transit network
               # TOS metrics = 0
               metric = 1                                         **<--METRIC**
Variable TextFSM Value option Example Values Is Mandatory
ROUTER_ID No
AREA Filldown No
ADV_ROUTER_ID Filldown 192.1.1.3 from Advertising Router Yes
DR_IP_Addr Required 192.1.1.4 from Link ID Yes
METRIC Required 1 Yes

cisco_ios_show_ip_ospf_database_router_transit.textfsm

LSA Router Type stub

Example of Router LSA Type stub
; RT3's router-LSA for Area 1

        LS age = 0                     ;always true on origination
        Options = (E-bit)              ;
        LS type = 1                    ;indicates router-LSA
        Link State ID = 192.1.1.3      ;RT3's Router ID
        Advertising Router = 192.1.1.3 ;RT3's Router ID             **<--ADV_ROUTER_ID**
        bit E = 0                      ;not an AS boundary router
bit B = 1                      ;area border router
        #links = 2

               Link ID = 192.1.4.0     ;IP Network number           **<--SUBNET**
               Link Data = 0xffffff00  ;Network mask                **<--SUBNET_MASK**
               Type = 3                ;connects to stub network
               # TOS metrics = 0
               metric = 2                                           **<--METRIC**
Variable TextFSM Value option Example Values Is Mandatory
ROUTER_ID No
AREA No
ADV_ROUTER_ID 192.1.1.3 from Advertising Router Yes
SUBNET Required 192.1.4.0 from Link ID Yes
SUBNET_MASK Required 0xffffff00 from Link Data but generally it's in DEC format. Both variants are acceptable /24 and 255.255.255.0 Yes
METRIC Required 2 Yes

cisco_ios_show_ip_ospf_database_router_stub.textfsm

Network LSA

Example of Network LSA
 LS age = 0                     ;always true on origination
        Options = (E-bit)              ;
        LS type = 2                    ;indicates network-LSA
        Link State ID = 192.1.1.4      ;IP address of Desig. Rtr.
        Advertising Router = 192.1.1.4 ;RT4's Router ID           **<--ADV_ROUTER_ID**
        Network Mask = 0xffffff00
               Attached Router = 192.1.1.4    ;Router ID          **<--NEIGHBORING_ROUTER_ID**
               Attached Router = 192.1.1.1    ;Router ID          **<--NEIGHBORING_ROUTER_ID**
               Attached Router = 192.1.1.2    ;Router ID          **<--NEIGHBORING_ROUTER_ID**
               Attached Router = 192.1.1.3    ;Router ID          **<--NEIGHBORING_ROUTER_ID**
Variable TextFSM Value option Example Values Is Mandatory
AREA No
DR_IP_Add Required 192.1.1.4 from Link State ID Yes
NEIGHBORING_ROUTER_ID List [192.1.1.4, 192.1.1.1, 192.1.1.2, 192.1.1.3] DR also includes itself in this list! Yes

cisco_ios_show_ip_ospf_database_network.textfsm

External LSA

Example of External LSA
        LS age = 0                  ;always true on origination
        Options = (E-bit)           ;
        LS type = 5                 ;AS-external-LSA
        Link State ID = N12's IP network number           **<--SUBNET** **<--SUBNET_MASK**
        Advertising Router = Router RT7's ID              **<--ADV_ROUTER_ID**
        bit E = 1                   ;Type 2 metric        **<--METRIC_TYPE**
        metric = 2                                        **<--METRIC**
        Forwarding address = 0.0.0.0                      **<--FORWARDING_IP_ADDR**
Variable TextFSM Value option Example Values Is Mandatory
ADV_ROUTER_ID Router RT7's ID Yes
SUBNET Required N12's IP network number Yes
SUBNET_MASK Required Yes
METRIC_TYPE Required 1 Yes
METRIC Required 2 Yes
FORWARDING_IP_ADDR Required 0.0.0.0 No

cisco_ios_show_ip_ospf_database_external.textfsm