openconfig/public

Support to fetch multiple link information from a single OSPF Router-LSA is missing.

Opened this issue · 6 comments

One OSPF Router LSA can have multiple link informations in it.
But the openconfig does not have an option to print multiple link info.
Openconfig supports fetching of single link info only.

OSPF Router LSA structure as per RFC 2328 section A.4.2 Router-LSAs is as below.

    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                             |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                              ...                              |

Openconfig definition of Router LSA is as below.
https://openconfig.net/projects/models/schemadocs/yangdoc/openconfig-network-instance.html#network-instances-network-instance-protocols-protocol-ospfv2-areas-area-lsdb-lsa-types-lsa-type-lsas-lsa-router-lsa

I think attributes as such as type, link-id, link-data, metric, number-tos-metrics, and types-of-service should be inside a list, so that multiple link information from a single Router LSA can be fetched.

Please look into this.

Please find below a sample router-lsa with 5 links as an example.

show ospf database router lsa-id 11.1.1.1 extensive

OSPF database, Area 0.0.0.0

Type ID Adv Rtr Seq Age Opt Cksum Len
Router *11.1.1.1 11.1.1.1 0x80000004 1320 0x22 0x91a5 84
bits 0x0, link count 5
id 10.1.1.1, data 10.11.3.2, Type PointToPoint (1)
Topology count: 0, Default metric: 1
id 10.11.3.0, data 255.255.255.0, Type Stub (3)
Topology count: 0, Default metric: 1
id 17.1.1.1, data 11.17.1.1, Type PointToPoint (1)
Topology count: 0, Default metric: 1
id 11.17.1.0, data 255.255.255.0, Type Stub (3)
Topology count: 0, Default metric: 1
id 11.1.1.1, data 255.255.255.255, Type Stub (3)
Topology count: 0, Default metric: 0

Agreed, this looks like a bug in the ospf lsdb model. Here's a proposed tree, inserting a list of lsa-ids into the router-lsa container. Let me know if this looks correct and I'll make the changes to the yang

  +--rw network-instances
     +--rw network-instance* [name]
        +--rw protocols
        |  +--rw protocol* [identifier name]
        |     +--rw ospfv2
        |     |  +--rw areas
        |     |     +--rw area* [identifier]
        |     |        +--ro lsdb
        |     |        |  +--ro state
        |     |        |  |  +--ro identifier?   oc-ospf-types:ospf-area-identifier
        |     |        |  +--ro lsa-types
        |     |        |     +--ro lsa-type* [type]
        |     |        |        +--ro type     -> ../state/type
        |     |        |        +--ro state
        |     |        |        |  +--ro type?   identityref
        |     |        |        +--ro lsas
        |     |        |           +--ro lsa* [link-state-id]
        |     |        |              +--ro link-state-id        -> ../state/link-state-id
        |     |        |              +--ro state
        |     |        |              |  +--ro link-state-id?        yang:dotted-quad
        |     |        |              |  +--ro advertising-router?   yang:dotted-quad
        |     |        |              |  +--ro sequence-number?      int32
        |     |        |              |  +--ro checksum?             uint16
        |     |        |              |  +--ro age?                  uint16
        |     |        |              +--ro router-lsa
        |     |        |              |  +--ro state
        |     |        |              |  |  +--ro type?                 identityref

        |     |        |              |  |  +--ro link-ids*             [link-id]             <--- new list
        |     |        |              |  |    +--ro link-id?              yang:dotted-quad
        |     |        |              |  |    +--ro link-data?            union
        |     |        |              |  |    +--ro metric?               oc-ospf-types:ospf-metric
        |     |        |              |  |    +--ro number-links?         uint16
        |     |        |              |  |    +--ro number-tos-metrics?   uint16


        |     |        |              |  +--ro types-of-service
        |     |        |              |     +--ro type-of-service* [tos]
        |     |        |              |        +--ro tos      -> ../state/tos
        |     |        |              |        +--ro state
        |     |        |              |           +--ro tos?      uint8
        |     |        |              |           +--ro metric?   oc-ospf-types:ospf-metric

Please find some suggestions below.

  1. Can link-ids be renamed as link-infos? link-id is only one piece of information of one router link.
  2. number-links should be outside of link-ids(link-infos).
  3. types-of-service should be within link-ids(link-infos). Multiple TOS could be present in single router link.

I think I understand what you are saying regarding link-id just being one piece of information amongst several. I've suggested using just links/link for the container/list combination below. (Note that the OpenConfig style guide requires that lists have a container named with the plural form of the list. ie: links/link.

Here is the proposed tree with number-links in the router-lsa container and tos within the link list:
(still before writing the yang to see if this looks right)

        |     |        |        +--ro lsas
        |     |        |           +--ro lsa* [link-state-id]
        |     |        |              +--ro router-lsa
        |     |        |              |  +--ro state
        |     |        |              |  |  +--ro type?                 identityref
        |     |        |              |  |  +--ro number-links?         uint16
        |     |        |              |  |  +--ro links
        |     |        |              |  |   |  +--ro link*           [id]             <--- new list   
        |     |        |              |  |   |    +--ro id?            yang:dotted-quad
        |     |        |              |  |   |    +--ro link-data?            union
        |     |        |              |  |   |    +--ro metric?               oc-ospf-types:ospf-metric
        |     |        |              |  |   |    +--ro number-tos-metrics?   uint16
        |     |        |              |  |   |    +--ro types-of-service
        |     |        |              |  |   |        +--ro type-of-service* [tos]
        |     |        |              |  |   |           +--ro tos      -> ../state/tos
        |     |        |              |  |   |           +--ro state
        |     |        |              |  |   |              +--ro tos?      uint8
        |     |        |              |  |   |              +--ro metric?   oc-ospf-types:ospf-metric

Sorry, missed to mention this before.

type should be inside link(new list).

    |     |        |              |  |  +--ro type?                 identityref