Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DonaMaria2024 opened this issue Mar 18, 2024 · 8 comments
Assignees

Comments

@DonaMaria2024
Copy link

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.

@DonaMaria2024
Copy link
Author

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

@dplore dplore self-assigned this Mar 18, 2024
@dplore
Copy link
Member

dplore commented Mar 18, 2024

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

@DonaMaria2024
Copy link
Author

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.

@dplore
Copy link
Member

dplore commented Mar 20, 2024

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

@DonaMaria2024
Copy link
Author

Sorry, missed to mention this before.

type should be inside link(new list).

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

@dplore
Copy link
Member

dplore commented Mar 21, 2024

@DonaMaria2024 see PR at #1080

Copy link

This issue is stale because it has been open 180 days with no activity. If you wish to keep this issue active, please remove the stale label or add a comment, otherwise will be closed in 14 days.

@github-actions github-actions bot added the Stale label Sep 18, 2024
@dplore dplore removed the Stale label Sep 18, 2024
@dplore
Copy link
Member

dplore commented Sep 18, 2024

I have an update pending on #1080, but I do still intend to fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants