open-traffic-generator/models

BGP Extended Community revamp.

Closed this issue · 0 comments

The current model for Extended Community has type / subtype and a 6 byte hex data field .
This means for value , user has to create valid hex pattern in the test program .
For most of the cases it works more or less fine but for bandwidth ( to be encoded as 2 byte AS + 4 byte IEEE float ) , it is difficult and language specific to be able to do this .
e.g.

extCommunities := rr.ExtCommunities().Add()
            extCommunities.SetType(gosnappi.BgpExtCommunityType.ADMINISTRATOR_AS_2OCTET_LINK_BANDWIDTH)
            extCommunities.SetSubtype(gosnappi.BgpExtCommunitySubtype.EXTENDED_BANDWIDTH)
            /* AS : 65000 , B/W: 60,000,000 */
            twoByteAs := 65000**
            bandwidth := float32(60000000)
            extCommValue:= fmt.Sprintf("%04x%08x", twoByteAs, **math.Float32bits**(bandwidth))
            extCommunities.SetValue(extCommValue)   

Hence, logging this issue to deprecate current model and add a new variant with following advantages:
a) Strict data format per type/subtype and conversion to 6 byte value handled by implementation.
b) Support of custom extended community for type/subtype combinations not covered in a) .