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

bgpd: EVPN fix per rd specific type-2 json output #16913

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

chiragshah6
Copy link
Member

@chiragshah6 chiragshah6 commented Sep 25, 2024

Current Issue:

paths key is not there for 'show bgp l2vpn evpn route rd mac json' uses evpn prefix as key for each path.
Replace the evpn prefix with "paths".
This aligned with overall EVPN RIB json output like 'show bgp l2vpn evpn route json'
'show bgp l2vpn evpn route rd <> type 2 json'

Testing:

Before fix:

leaf22# show bgp l2vpn evpn route rd 6.0.0.17:2 mac 00:02:00:00:00:12 json {
  "prefix":"[2]:[0]:[48]:[00:02:00:00:00:12]",
  "prefixLen":352,
  "rd":"6.0.0.17:2",
  "routeType":2,
  "ethTag":0,
  "macLen":48,
  "mac":"00:02:00:00:00:12",
  "advertisedTo":{
    "220.20.0.33":{
      "hostname":"spine21"
    },
    "220.21.0.33":{
      "hostname":"spine22"
    }
  },
  "[2]:[0]:[48]:[00:02:00:00:00:12]":[ <=====  Prefix info instead of "paths" key
    [
      {
        "vni":"101101",
        "aspath":{
          "string":"65202 65024",
          "segments":[
            {
              "type":"as-sequence",
              "list":[
                65202,
                65024
              ]
            }
          ],
          "length":2
        },
        "esi":"03:00:00:00:77:02:04:00:00:18",
        "es_info":{
          "localEs":true
        },
        "origin":"IGP",
        "valid":true,
        "version":5,
        "bestpath":{
          "bestpathFromAs":65202,
          "overall":true,
          "selectionReason":"Older Path"
        },
        "extendedCommunity":{
          "string":"RT:65024:101101 ET:8"
        },
        "lastUpdate":{
          "epoch":1726803218,
          "string":"Fri Sep 20 03:33:38 2024\n"
        },
        "nexthops":[
          {
            "ip":"6.0.0.17",
            "hostname":"spine21",
            "afi":"ipv4",
            "metric":0,
            "accessible":true,
            "used":true
          }
        ],
        "peer":{
          "peerId":"220.20.0.33",
          "routerId":"6.0.0.20",
          "hostname":"spine21",
          "type":"external"
        }
      }
    ],
    [
      {
        "vni":"101101",
        "aspath":{
          "string":"65202 65024",
          "segments":[
            {
              "type":"as-sequence",
              "list":[
                65202,
                65024
              ]
            }
          ],
          "length":2
        },
        "esi":"03:00:00:00:77:02:04:00:00:18",
        "es_info":{
          "localEs":true
        },
        "origin":"IGP",
        "valid":true,
        "version":5,
        "extendedCommunity":{
          "string":"RT:65024:101101 ET:8"
        },
        "lastUpdate":{
          "epoch":1726803218,
          "string":"Fri Sep 20 03:33:38 2024\n"
        },
        "nexthops":[
          {
            "ip":"6.0.0.17",
            "hostname":"spine22",
            "afi":"ipv4",
            "metric":0,
            "accessible":true,
            "used":true
          }
        ],
        "peer":{
          "peerId":"220.21.0.33",
          "routerId":"6.0.0.21",
          "hostname":"spine22",
          "type":"external"
        }
      }
    ]
  ],
  "numPaths":2
}

After fix:

leaf22# show bgp l2vpn evpn route rd 6.0.0.17:2 mac 00:02:00:00:00:12 json {
  "prefix":"[2]:[0]:[48]:[00:02:00:00:00:12]",
  "prefixLen":352,
  "rd":"6.0.0.17:2",
  "routeType":2,
  "ethTag":0,
  "macLen":48,
  "mac":"00:02:00:00:00:12",
  "advertisedTo":{
    "220.20.0.33":{
      "hostname":"spine21"
    },
    "220.21.0.33":{
      "hostname":"spine22"
    }
  },
  "paths":[
    [
      {
        "vni":"101101",
        "aspath":{
          "string":"65202 65024",
          "segments":[
            {
              "type":"as-sequence",
              "list":[
                65202,
                65024
              ]
            }
          ],
          "length":2
        },
        "esi":"03:00:00:00:77:02:04:00:00:18",
        "es_info":{
          "localEs":true
        },
        "origin":"IGP",
        "valid":true,
        "version":3,
        "bestpath":{
          "bestpathFromAs":65202,
          "overall":true,
          "selectionReason":"Router ID"
        },
        "extendedCommunity":{
          "string":"RT:65024:101101 ET:8"
        },
        "lastUpdate":{
          "epoch":1727175046,
          "string":"Tue Sep 24 10:50:46 2024\n"
        },
        "nexthops":[
          {
            "ip":"6.0.0.17",
            "hostname":"spine21",
            "afi":"ipv4",
            "metric":0,
            "accessible":true,
            "used":true
          }
        ],
        "peer":{
          "peerId":"220.20.0.33",
          "routerId":"6.0.0.20",
          "hostname":"spine21",
          "type":"external"
        }
      }
    ],
    [
      {
        "vni":"101101",
        "aspath":{
          "string":"65202 65024",
          "segments":[
            {
              "type":"as-sequence",
              "list":[
                65202,
                65024
              ]
            }
          ],
          "length":2
        },
        "esi":"03:00:00:00:77:02:04:00:00:18",
        "es_info":{
          "localEs":true
        },
        "origin":"IGP",
        "valid":true,
        "version":3,
        "extendedCommunity":{
          "string":"RT:65024:101101 ET:8"
        },
        "lastUpdate":{
          "epoch":1727175046,
          "string":"Tue Sep 24 10:50:46 2024\n"
        },
        "nexthops":[
          {
            "ip":"6.0.0.17",
            "hostname":"spine22",
            "afi":"ipv4",
            "metric":0,
            "accessible":true,
            "used":true
          }
        ],
        "peer":{
          "peerId":"220.21.0.33",
          "routerId":"6.0.0.21",
          "hostname":"spine22",
          "type":"external"
        }
      }
    ]
  ],
  "numPaths":2
}

Signed-off-by: Sindhu Parvathi Gopinathan's [email protected]

Current Issue:

paths key is not there for
'show bgp l2vpn evpn route rd <rd-id> mac <mac> json' uses
evpn prefix as key for each path.
Replace the evpn prefix with "paths".
This aligned with overall EVPN RIB json output like
'show bgp l2vpn evpn route json'
'show bgp l2vpn evpn route rd <> type 2 json'

Fix:

paths key is added instead of prefix info.

Ticket:#4087461

Issue:4087461

Testing:

Before fix:

leaf22# show bgp l2vpn evpn route rd 6.0.0.17:2 mac 00:02:00:00:00:12 json
{
  "prefix":"[2]:[0]:[48]:[00:02:00:00:00:12]",
  "prefixLen":352,
  "rd":"6.0.0.17:2",
  "routeType":2,
  "ethTag":0,
  "macLen":48,
  "mac":"00:02:00:00:00:12",
  "advertisedTo":{
    "220.20.0.33":{
      "hostname":"spine21"
    },
    "220.21.0.33":{
      "hostname":"spine22"
    }
  },
  "[2]:[0]:[48]:[00:02:00:00:00:12]":[ <=====  Prefix info instead of "paths" key
    [
      {
        "vni":"101101",
        "aspath":{
          "string":"65202 65024",
          "segments":[
            {
              "type":"as-sequence",
              "list":[
                65202,
                65024
              ]
            }
          ],
          "length":2
        },
        "esi":"03:00:00:00:77:02:04:00:00:18",
        "es_info":{
          "localEs":true
        },
        "origin":"IGP",
        "valid":true,
        "version":5,
        "bestpath":{
          "bestpathFromAs":65202,
          "overall":true,
          "selectionReason":"Older Path"
        },
        "extendedCommunity":{
          "string":"RT:65024:101101 ET:8"
        },
        "lastUpdate":{
          "epoch":1726803218,
          "string":"Fri Sep 20 03:33:38 2024\n"
        },
        "nexthops":[
          {
            "ip":"6.0.0.17",
            "hostname":"spine21",
            "afi":"ipv4",
            "metric":0,
            "accessible":true,
            "used":true
          }
        ],
        "peer":{
          "peerId":"220.20.0.33",
          "routerId":"6.0.0.20",
          "hostname":"spine21",
          "type":"external"
        }
      }
    ],
    [
      {
        "vni":"101101",
        "aspath":{
          "string":"65202 65024",
          "segments":[
            {
              "type":"as-sequence",
              "list":[
                65202,
                65024
              ]
            }
          ],
          "length":2
        },
        "esi":"03:00:00:00:77:02:04:00:00:18",
        "es_info":{
          "localEs":true
        },
        "origin":"IGP",
        "valid":true,
        "version":5,
        "extendedCommunity":{
          "string":"RT:65024:101101 ET:8"
        },
        "lastUpdate":{
          "epoch":1726803218,
          "string":"Fri Sep 20 03:33:38 2024\n"
        },
        "nexthops":[
          {
            "ip":"6.0.0.17",
            "hostname":"spine22",
            "afi":"ipv4",
            "metric":0,
            "accessible":true,
            "used":true
          }
        ],
        "peer":{
          "peerId":"220.21.0.33",
          "routerId":"6.0.0.21",
          "hostname":"spine22",
          "type":"external"
        }
      }
    ]
  ],
  "numPaths":2
}

After fix:

eaf22# show bgp l2vpn evpn route rd 6.0.0.17:2 mac 00:02:00:00:00:12 json
{
  "prefix":"[2]:[0]:[48]:[00:02:00:00:00:12]",
  "prefixLen":352,
  "rd":"6.0.0.17:2",
  "routeType":2,
  "ethTag":0,
  "macLen":48,
  "mac":"00:02:00:00:00:12",
  "advertisedTo":{
    "220.20.0.33":{
      "hostname":"spine21"
    },
    "220.21.0.33":{
      "hostname":"spine22"
    }
  },
  "paths":[
    [
      {
        "vni":"101101",
        "aspath":{
          "string":"65202 65024",
          "segments":[
            {
              "type":"as-sequence",
              "list":[
                65202,
                65024
              ]
            }
          ],
          "length":2
        },
        "esi":"03:00:00:00:77:02:04:00:00:18",
        "es_info":{
          "localEs":true
        },
        "origin":"IGP",
        "valid":true,
        "version":3,
        "bestpath":{
          "bestpathFromAs":65202,
          "overall":true,
          "selectionReason":"Router ID"
        },
        "extendedCommunity":{
          "string":"RT:65024:101101 ET:8"
        },
        "lastUpdate":{
          "epoch":1727175046,
          "string":"Tue Sep 24 10:50:46 2024\n"
        },
        "nexthops":[
          {
            "ip":"6.0.0.17",
            "hostname":"spine21",
            "afi":"ipv4",
            "metric":0,
            "accessible":true,
            "used":true
          }
        ],
        "peer":{
          "peerId":"220.20.0.33",
          "routerId":"6.0.0.20",
          "hostname":"spine21",
          "type":"external"
        }
      }
    ],
    [
      {
        "vni":"101101",
        "aspath":{
          "string":"65202 65024",
          "segments":[
            {
              "type":"as-sequence",
              "list":[
                65202,
                65024
              ]
            }
          ],
          "length":2
        },
        "esi":"03:00:00:00:77:02:04:00:00:18",
        "es_info":{
          "localEs":true
        },
        "origin":"IGP",
        "valid":true,
        "version":3,
        "extendedCommunity":{
          "string":"RT:65024:101101 ET:8"
        },
        "lastUpdate":{
          "epoch":1727175046,
          "string":"Tue Sep 24 10:50:46 2024\n"
        },
        "nexthops":[
          {
            "ip":"6.0.0.17",
            "hostname":"spine22",
            "afi":"ipv4",
            "metric":0,
            "accessible":true,
            "used":true
          }
        ],
        "peer":{
          "peerId":"220.21.0.33",
          "routerId":"6.0.0.21",
          "hostname":"spine22",
          "type":"external"
        }
      }
    ]
  ],
  "numPaths":2
}

Signed-off-by: Sindhu Parvathi Gopinathan's <[email protected]>
@ton31337
Copy link
Member

@Mergifyio backport stable/10.1 stable/10.0 stable/9.1 stable/9.0

Copy link

mergify bot commented Sep 25, 2024

backport stable/10.1 stable/10.0 stable/9.1 stable/9.0

✅ Backports have been created

@ton31337 ton31337 merged commit 51b19f9 into FRRouting:master Sep 25, 2024
16 checks passed
donaldsharp added a commit that referenced this pull request Sep 25, 2024
bgpd: EVPN fix per rd specific type-2 json output (backport #16913)
donaldsharp added a commit that referenced this pull request Sep 25, 2024
bgpd: EVPN fix per rd specific type-2 json output (backport #16913)
ton31337 added a commit that referenced this pull request Oct 14, 2024
bgpd: EVPN fix per rd specific type-2 json output (backport #16913)
ton31337 added a commit that referenced this pull request Oct 14, 2024
bgpd: EVPN fix per rd specific type-2 json output (backport #16913)
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.

2 participants