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

srv6: better json format for seg6_segs #15905

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dmytroshytyi-6WIND
Copy link
Contributor

Previous Json output contained lists of srv6 segments in the "segs" field. Now we do the "json struct in the json struct", i.e. "seg6->segs"

Before...
When we had 1 segment :

      "seg6local":{
        "action":"unspec"
      },
      "seg6":{
        "segs":"2001:db8:1:1:1::2"
      }

When we had multiple segments :

      "seg6local":{
        "action":"unspec"
      },
      "seg6":[
        "2001:db8:aaaa::7",
        "2002::2",
        "2003::3",
        "2004::4"
      ]

Now...
When we have multiple segments:

      seg6":{"segs":["fc00:0:3::","fc00:0:5::","fc00:0:6::"]}}]}

Previous Json output contained lists of srv6 segments in the "segs"
field. Now we do the "json struct in the json struct", i.e. "seg6->segs"

Before...
When we had 1 segment :
          "seg6local":{
            "action":"unspec"
          },
          "seg6":{
            "segs":"2001:db8:1:1:1::2"
          }

When we had multiple segments :

          "seg6local":{
            "action":"unspec"
          },
          "seg6":[
            "2001:db8:aaaa::7",
            "2002::2",
            "2003::3",
            "2004::4"
          ]

Now...
When we have multiple segments:

          seg6":{"segs":["fc00:0:3::","fc00:0:5::","fc00:0:6::"]}}]}

Signed-off-by: Dmytro Shytyi <[email protected]>
Copy link
Member

@ton31337 ton31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this a breaking change?

@dmytroshytyi-6WIND
Copy link
Contributor Author

ci:rerun

@dmytroshytyi-6WIND
Copy link
Contributor Author

Isn't this a breaking change?

Hi @ton31337 , This changes only json for seg6 segs. No cli configuration impact. Is it considered as breaking change? As iproute has:

ENCAP_SEG6 := seg6 mode [ encap | encap.red | inline | l2encap | l2encap.red ] segs SEGMENTS [ hmac KEYID ]

In future new parameters might be added, like described above.
For example:
seg6":{"mode": inline, "segs":["fc00:0:3::","fc00:0:5::","fc00:0:6::"]}}]}

This change will prepare for future extensions.

Copy link
Member

@riw777 riw777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@donaldsharp donaldsharp self-requested a review May 7, 2024 15:33
@ton31337
Copy link
Member

ton31337 commented May 9, 2024

I meant that JSON breaking change. If it had a structure the people used for automation, and now it's different, then it's not good.

choppsv1

This comment was marked as resolved.

Copy link
Contributor

@choppsv1 choppsv1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an exisitng IETF yang model that we should be taking direction from? Also is the structure changing based on there being 1 vs N? This seems wrong, or are we switching to only use an array (which seems good)?

@dmytroshytyi-6WIND
Copy link
Contributor Author

dmytroshytyi-6WIND commented May 15, 2024

Is there an exisitng IETF yang model that we should be taking direction from? Also is the structure changing based on there being 1 vs N? This seems wrong, or are we switching to only use an array (which seems good)?

Hello, Thank you for your review.

I'm not aware of IETF RFC standardized YANG model for this behavior.

Let me give one more example.
Before

"seg6local":{
"action":"unspec"
},
"seg6":[
"2001:db8:aaaa::7",
"2002::2",
"2003::3",
"2004::4"
]

After

"seg6local":{
"action":"unspec"
},
"segs": { <<< this is added.
"seg6":[
"2001:db8:aaaa::7",
"2002::2",
"2003::3",
"2004::4"
],
"mode": "inline", <<<<< the above added section allows to set more parameters like this
}

Does this explain what this PR is intented to do better?

@pguibert6WIND
Copy link
Member

The array is moved into a segs json entry.
maybe we can keep the original array, and copy it in the new segs json entry.
We run deprecation on the original array for one year. At this date, we will remove it.

@choppsv1
Copy link
Contributor

choppsv1 commented May 16, 2024

Is there an exisitng IETF yang model that we should be taking direction from? Also is the structure changing based on there being 1 vs N? This seems wrong, or are we switching to only use an array (which seems good)?

Hello, Thank you for your review.

I'm not aware of IETF RFC standardized YANG model for this behavior.

Is this data represented in https://datatracker.ietf.org/doc/html/draft-ietf-spring-srv6-yang-03

?

That's still a draft but it would be good to know we compared what we are doing to what is on the path to being standardized.

Thanks,
Chris.

@choppsv1
Copy link
Contributor

Let me give one more example. Before

"seg6local":{ "action":"unspec" }, "seg6":[ "2001:db8:aaaa::7", "2002::2", "2003::3", "2004::4" ]

After

"seg6local":{ "action":"unspec" }, "segs": { <<< this is added. "seg6":[ "2001:db8:aaaa::7", "2002::2", "2003::3", "2004::4" ], "mode": "inline", <<<<< the above added section allows to set more parameters like this }

Does this explain what this PR is intented to do better?

Given the structure is completely changing are you also getting rid of the union of singleton vs array of SIDs? Are theese really "seg6"s or are they "SID"s?

Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

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

Successfully merging this pull request may close these issues.

None yet

5 participants