Questions on handling bytestring attributes and using them in preference logic

yazan slaila yazan.slaila at hotmail.com
Fri Aug 29 01:10:10 CEST 2025


Dear BIRD Developers,
I am currently experimenting with custom BGP attributes using bytestring type within a topology that consists of 8 routers. My goal is to display and handle the newly added custom attributes and be able to see the value for each router in all other routers, like the AS_path idea:

router1: 50
router2: 50 35

router2: 50 35 70

Because I want to reach a point where I can decide the lowest value for this cutom attribute and choose the best path based on that lowest value, but the problem is that I can't perform operations on attribute type bytestings due to implementation limitations. Now I have two main questions:

  1.
Working with bytestring values to be able to decide the best path based on the lowest total path cost we have:
     *
Is there a recommended way to parse, compare, or extract numbers from a bytestring attribute within a BIRD filter? And how?
     *
Currently, the raw output prints hexadecimal sequences (e.g., 31:30). How should these be decoded/processed for comparisons?
     *
How can I apply this idea using the bytestring type to add a value to each router and then advertise it to every other router (in the topology of 8 routers) to decide what is the best path to take based on the lowest cost value we have?
  2.
Preference logic example:
     *
How can a bytestring attribute be integrated into preference calculation in a filter?
     *
The documentation shows how to set preference based on integers or communities, but I couldn’t find a concrete example for bytestring. Could you provide a minimal example filter to illustrate this in order to prefere the path that has the lowest values?

Any guidance or best practices on working with bytestring attributes for routing decisions would be greatly appreciated.
Best regards,
Yazan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20250828/9dfe5d3c/attachment.htm>


More information about the Bird-users mailing list