Greetings,

Thanks Ondrej!

With the help from a little IEEE754 converter, it works!

Filter becomes:
---------------------------------
    export filter {
        # Bandwidth in IEEE floating point format
        # http://www.h-schmidt.net/FloatConverter/IEEE754.html
        # 10000 0x461c4000
        #  9000 0x460ca000
        #  8000 0x45fa0000
        #  7000 0x45dac000
        #  6000 0x45bb8000
        #  5000 0x459c4000
        #  4000 0x457a0000
        #  3000 0x453b8000
        #  2000 0x44fa0000
        #  1000 0x447a0000
        #bgp_ext_community.add((unknown 0x4004, 65300, 0x461c4000));
        if net ~ [22.0.0.0/24] then {
            bgp_ext_community.add((unknown 0x4004, 65300, 0x461c4000));#10000
        }
        if net ~ [22.0.1.0/24] then {
            bgp_ext_community.add((unknown 0x4004, 65300, 0x460ca000));#9000
        }
        if net ~ [22.0.2.0/24] then {
            bgp_ext_community.add((unknown 0x4004, 65300, 0x45fa0000));#8000
        }
        if net ~ [22.0.3.0/24] then {
            bgp_ext_community.add((unknown 0x4004, 65300, 0x447a0000));#1000
        }
---------------------------------

Community is correctly interpreted by a Juniper MX:
---------------------------------
root@cache-router> show route 22.0.0.0 detail                    

inet.0: 605 destinations, 1120 routes (604 active, 0 holddown, 1 hidden)
22.0.0.0/24 (2 entries, 1 announced)
        *BGP    Preference: 170/-101
                Next hop type: Indirect
                Address: 0x290c1c0
                Next-hop reference count: 514
                Source: 10.1.0.2
                Next hop type: Router, Next hop index: 635
                Next hop: 10.0.0.2 via xe-1/0/0.10, selected
                Session Id: 0x1
                Next hop type: Router, Next hop index: 724
                Next hop: 10.0.1.2 via xe-1/2/0.10
                Session Id: 0x5
                Protocol next hop: 10.0.0.2
                Indirect next hop: 0x2930514 1048577 INH Session ID: 0xc1b
                Protocol next hop: 10.0.1.2
                Indirect next hop: 0x2930c30 1048578 INH Session ID: 0x96
                State: <Active Int Ext>
                Peer AS: 65300
                Age: 3:56       Metric2: 0
                Validation State: unverified
                Task: BGP_65300_65300.10.1.0.2+57790
                Announcement bits (3): 0-KRT 4-Resolve tree 2 6-RT
                AS path: 65301 I
                AS path: Recorded
                Communities: bandwidth:65300:10000                                               <--------------- Yay!
                Accepted Multipath
                Localpref: 100
                Router ID: 10.1.0.2
         BGP    Preference: 170/-101
                Next hop type: Indirect
                Address: 0x28a58b4     
                Next-hop reference count: 385
                Source: 10.1.0.6
                Next hop type: Router, Next hop index: 724
                Next hop: 10.0.1.2 via xe-1/2/0.10, selected
                Session Id: 0x5
                Protocol next hop: 10.0.1.2
                Indirect next hop: 0x2930c30 1048578 INH Session ID: 0x96
                State: <NotBest Int Ext>
                Inactive reason: Not Best in its group - Router ID
                Peer AS: 65300
                Age: 2d 22:58:54        Metric2: 0
                Validation State: unverified
                Task: BGP_65300_65300.10.1.0.6+36217
                AS path: 65301 I
                AS path: Recorded
                Accepted MultipathContrib
                Localpref: 100
                Router ID: 10.1.0.6
---------------------------------
root@cache-router> show route 22.0.0.0 detail | grep bandwidth
                Communities: bandwidth:65300:10000

root@cache-router> show route 22.0.1.0 detail | grep bandwidth   
                Communities: bandwidth:65300:9000

root@cache-router> show route 22.0.2.0 detail | grep bandwidth   
                Communities: bandwidth:65300:8000

root@cache-router> show route 22.0.3.0 detail | grep bandwidth   
                Communities: bandwidth:65300:1000
---------------------------------

From an operational perspective, what's the best way make changes to these Bandwidth values without restarting the BGP sessions?  I'd like to be able to make changes, and then push a new update message, like doing a 'clear ip bgp x.x.x.x soft clear out'.  I've tried just updating the configurations file and then restarting the reloading the protocol, but that doesn't do it.
---------------------------------
bird> reload core
core: reloading
---------------------------------

Kind regards,
Dave


On Sun, Jan 11, 2015 at 3:43 PM, Ondrej Zajicek <santiago@crfreenet.org> wrote:
On Sun, Jan 11, 2015 at 02:16:18PM -0800, dave seddon wrote:
> Greetings Ondrej,
>
> Thanks for your reply regarding this extended community.
>
> I have tried the following two (2) configurations:
> -------------------------------------------------
>         bgp_ext_community.add((unknown 0x4004, 65300, 10000));
>         bgp_ext_community.add((unknown 0x4004, 65300, 0x03E8));
> -------------------------------------------------
>
> In both cases, the neighbour Juniper router see the bandwidth as zero.

According to https://tools.ietf.org/html/draft-ietf-idr-link-bandwidth-06,
the bandwidth have to be encoded as floating point, while the 'unknown'
format defines a raw value of local field of the community.

You could try to set the value from the tcpdump of Juniper (1176255488)
instead of 10000.

Well, to be practical, we would have to add explicit support for this
community instead of using universal format.

--
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."