Skip to content

Conversation

@apratimmukherjee
Copy link
Contributor

@apratimmukherjee apratimmukherjee commented Jan 28, 2026

Feature Overview

  • Related Issue: Fixes #456
  • Brief Description:
  • Supports advertisement of Transitive Extended Community with Link Bandwidth for IPv4 and IPv6 routes sent from BGP/BGP+ peers.
  • Supports structured format of retrieval of Transitive Extended Community with Link Bandwidth in get_state for received IPv4 and IPv6 routes from BGP/BGP+ peers.

Feature Details

  1. config/devices/bgp/ipv[4|6]_interfaces/peers/v[4|6]_routes/extended_communities.
  2. monitor/get_state/responses/200/bgp_prefixes/ipv[4|6]_unicast_prefixes/extended_communities
  • Dev-Snappi branch reference
  • Example command to fetch the dev-snappi branch:
    go get github.com/open-traffic-generator/snappi/gosnappi@bgp_ext_comm_trans_bw
    

Code snippets

ext1.Transitive2OctetAsType().LinkBandwidthSubtype().
	SetGlobal2ByteAs(65000).
	SetBandwidth(1000)
	
...

req := gosnappi.NewStatesRequest()
 req.BgpPrefixes().SetBgpPeerNames(peerNames)
 res, err := client.GetStates(req)
 if err != nil {
 	return nil, err
 }
 
 learnedRoutes := res.BgpPrefixes()
 liFirstPeer := actualBGPv4Prefix.Items()[0]
 route := liFirstPeer.Ipv4UnicastPrefixes().Items()[0]
 extComm := route.ExtendedCommunities().Items()[0]
 if extComm.Structured() == nil ||
    extComm.Structured().Transitive2OctetAsType()== nil  ||
    extComm.Structured().Transitive2OctetAsType().LinkBandwidthSubtype() == nil {
       t.Fatal("Structured member expected and missing for Transitive Link Bandwidth Extended Community.")
 }
 if ( extComm.Structured().Transitive2OctetAsType().LinkBandwidthSubtype().Bandwidth()!= 1000.0 ||
        extComm.Structured().Transitive2OctetAsType().LinkBandwidthSubtype().Global2ByteAs() != 65000){
        t.Fatal("Bandwidth value / AS value not as expected.")
 }



Test Specification (Optional)

  • Example test scenario:
    • Configuration details: Port1- DUT - Port2 with BGP routes on Port1 configured to send Transitive B/W Extended Community to DUT which should be configured to accept and forward the same to Port2.
    • GetStates can be used for presence of and exact check of Transitive2OctetAsType().LinkBandwidthSubtype().Bandwidth() in addition to DUT telemetry that DUT accepts and forwards the attribute as expected.

apratimmukherjee and others added 7 commits January 28, 2026 18:03
…in both route range attributes as well as learned information.
…ible in generated yaml/redocli for get_states. This occurs due to yaml generation depending on unique names of objects from /components path and BMP and BGP learned info structures have become duplicate if hirerarchy is ignored. build.py is unable to detect this error today and undesired yaml gets generated without this being done. Logically this is okay since technically BMP should also be able to show this new subtype in recieved BGP prefixes.
Copy link
Contributor

@SouravSinhaRoy SouravSinhaRoy 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 for merge

@apratimmukherjee apratimmukherjee merged commit 2bb6a48 into master Jan 30, 2026
@apratimmukherjee apratimmukherjee deleted the bgp_ext_comm_trans_bw branch January 30, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support of BGP Extended Community Transitive Link Bandwidth attribute in BGP advertised routes and learned information

5 participants