Log of the as4 patch project in 2006

This is the AS4 patch log for the year 2006, which covers the beginning of the development, the first successes, some quagga outputs from pre-version-01 code, first announcements, etc.

09.12.2006
Paul mentioned this patch when he released 0.99.6 in his blog.
07.12.2006
Received no feedback at all as of now, and January is getting nearer. Thus, announced this page on quagga-users in order to get more testers. In the meantime, rebased the patch to the current quagga without any modifications in the basic functions.
Patch got listed under 'Additional Resources' in wiki.quagga.net after a few hours.
17.11.2006
Did a general clean up
Cleaned up comments, made them shorter, chucked anything not worth staying in a comment. Browsed through patch and got rid of things like white space differences to the base version (caused by editing forwards and backwards and getting indentation wrong). Set up a script to get the patch out of my subversion automagically (skip files where my own manangement causes diffs which do not belong to asn32).
Realized confederation identifier and peers were always in asplain because I overlooked them. Now I use the configured format, as everywhere else.
Enter Review and Tests non-public.
Released current Patch for code review and testing to Paul and Hank, but not on quagga-users. Actually, put the patch on this website - just in case there are more people who got informed in the meantime ;-).
16.11.2006
Oups, found out I forgot to deal with 'set aggregator as ASNUM IP' inside of route-maps. Did and tested that.
Dealt with extended communities.
Had done nothing about extended communities yet. Actually I have not used them in real life either ;-).
We have draft-rekhter-as4octet-ext-community-01.txt to deal with, basically some additions to the files bgp_ecommunity.[ch]. Seems to me we have to deal with this too if we want to say we grok 4 Byte as numbers. So hacked that in.
Caveat: if you have a string at the left side of a colon (:) which has one dot (.) in it, this is now recognized as a 4 byte as number. More dots in it and it will be an ip address. If you supply a number smaller than 65536, this will be handled as before. A number greater than 65535 will be taken as a 4 byte as number. The correct types in the ecommunity will be set in all these cases.
If you supply an ipaddress with one dot in a ecommunity command and rely on automagical expansion to a complete ip address this will now fail - that will be taken as a 4 byte as number now.
If you are crazy and use asip asnum output format, you'll not be able to put in a 4 byte as number in an extended community. And you yourself will not be able to distinguish ip address and 4 byte as number in any output then. So don't use asip! The one who implemented that output format for as numbers must have been really crazy... ;-)
15.11.2006
Tested around with as_sets. Had not done that before. Found another attribute length error, this time entirely my own one - counted ASSEGMENT_SIZE when gobbling up an as16 path segment; has to be ASSEGMENT16_SIZE in that case, oups.
Good thing I tested around a bit, this one could have discouraged people a lot.

Thought about AS_CONFED_SEQUENCE and AS_CONFED_SET:
Wrote a new routine to chuck any AS_CONFED_SEQUENCE and AS_CONFED_SET in an aspath. Actually this may be unnecessary - we can only have these at the beginning of an aspath anyway (I think), and there is already a function which gets rid of AS_CONFED_SEQUENCE and AS_CONFED_SET at the beginning of an aspath.
Hm... what about "nice guys" playing with 'set as-path prepend' big way sending paths with AS_CONFED_ in the middle of it!? Should we care? Or not? Make no assumptions, keep to the letter and chuck all AS_CONFED_*, I think. Lets see what happens.
Though I explicitly did what the draft-ietf-idr-as4bytes-12.txt says, this look a bit funny. Guess that's what happens if you stick non-real asnumbers onto your as path. Look at this:

2006/11/15 09:18:05 BGP: 10.1.28.2 have AS_PATH
  65531 65530 23456 23456 23456 {1,2,23456} 23456 (45 46 23456) 23456 23456 6 65003
and NEW_AS_PATH
 65535.65535 9188.9188 9188.9188 {1,2,3.7} 4.4 10.11 12.13 6 65003
... merging
2006/11/15 09:18:05 BGP: 10.1.28.2 rcvd UPDATE w/ attr: nexthop 10.1.28.2, origin i, path 65531 65530 65535.65535 9188.9188 9188.9188 {1,2,3.7} 4.4 10.11 12.13 6 65003
On the sending side, we removed the (45 46 23456) for NEW_AS_PATH in the middle as AS_CONFED_SEQUENCE. We did not for AS_PATH, because, well, nothing was changed in the handling of that one, and there AS_CONFED_things are only removed at the beginning of the path. On the receiving side, AS_PATH is longer than NEW_AS_PATH, so the aspath to be used will be synthesized. The merged path is the wanted result, the 23456 are replaced correctly. This is more a theoretical thing, IMHO, because nobody in her right mind should advertise a path with an AS_CONFED_* segment in the middle anyway... So I could very well use the same routine as AS_PATH for removing AS_CONFED_* at the beginning. As it is, the synthesized as-path is shorter than the one we got as AS_PATH, and that is surely not supposed to happen.
At the moment, I'll leave it as-is though, and wait for feedback. Guess quagga can do what it wants in this situation, it is a case of "if you get garbage-in, you may give garbage-out".
And we see this as:
Checkpoint 11 reached:
Handling of AS_CONFED_SEQUENCE and AS_CONFED_SET implemented and checked.

Provided debug commands for asn32 issues:
Up to now the asn32 related debug outputs were non-conditional and at many places very extensive. I cut them down to a reasonable level, and made that configurable with "debug bgp asn32" and "debug bgp asn32 segment" so that everybody can look into asn32 handling if specific bugs turn up.
The "segment" debugging gives extensive information when aspath segments are parsed; while that is not directly asn32 related (because it also happens when parsing an asn16 path) it is useful when you stumble upon an attribute length error for an ASPATH or NEW_ASPATH attribute. You get potentially many lines for one aspath being parsed, so you probably do not want to activate this if you feed a DFZ bgp table into quagga, that may fill up your log in seconds.

14.11.2006
Moved asn32 string format routines into bgp_aspath.c. IMHO asn32 format is as number handling, ases are mostly handled in aspaths, so these should be there and not distributed all over the place. Consolidated this further, now there is only one routine for each direction, the old code had two places. Cleaned out some comments, some debug loggings, some typos, etc.

Checkpoint 12 done (before 11, well, you know....):
Valgrind is quiet.

13.11.2006
We are slowly creeping up on the "enter review and tests non public" date, and I still think I'll be able to hold onto that. If no other big bugs like this one turn up... Gee, have not been that deep into code, state-machine, extensive log files etc, for *years* - but it is still fun ;-).

Making progress. Got rid of the bug which caused one of the asn32 peers to get stuck in "Clearing" (see the bugs page). Was a sleeping beauty of a bug, entirely non-asn32 related, and triggered by the setup of my test environment.

10.11.2006
Nobody wants it this way, but... it is there now. Nobody *should* change the output format every now and then, so I have not provided re-printing all aspaths in memory thus people changing the format at run time have to clear their bgp sessions if they want consistent aspaths on their system.

When saving the config, the command is positioned above 'router bgp ...', so a saved output format will result in consistent aspaths on startup.

Henk said that asdot is being used by the RIRs, and Cisco uses this, too. So whatever you think, asdot has a user base. OTOH, there are strong supporters of asplain, e.g. Paul, and there are good reasons to use that, too.

So I chicken here. Format asdot is the default now (because of the user base and sticking to cisco-likeness), meaning that if nothing is configured, it will be used. The formats asdot+ (that is asdot with a mandatory number for the higher bits, i.e. the format causing many 0.<something> to appear), asip (for crazy people) and asplain (the other reasonable format) are run-time configurable, but need a bgp hard reset to get all aspaths right if used in a runnning system.

!**** we have asdot at the moment
raasay# conf term
raasay(config)# bgp as
raasay(config)# bgp asnum 
raasay(config)# bgp asnum format 
  asdot
  asdot+
  asip
  asplain
raasay(config)# bgp asnum format asplain
% WARNING: Change of asnumber format.
% Newly learned aspaths will now be formatted in asplain
% You have to *reset* your bgp sessions to get a consistent aspaths format
%  on this system.  Only that way you also ensure re-evaluation of all bgp
%  aspath access-lists you may have in use.
raasay(config)#exit
raasay# sh ip bgp neighbors 
BGP neighbor is 10.1.1.197, remote AS 4294967295, local AS 602153956, external link
!**** cut for brevity ****
raasay# sh ip bgp summary 
BGP router identifier 10.1.1.199, local AS number 602153956
RIB entries 12, using 768 bytes of memory
Peers 3, using 7548 bytes of memory

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.1.1.197      4 
             4294967295      23      39        0    0    0 00:07:44        4
10.1.28.2       4 65531      31      34        0    0    0 00:07:49        2
172.16.2.2      4 65003      30      36        0    0    0 00:07:46        3

Total number of neighbors 3
raasay# sh ip bgp paths 
Address Refcnt Path
[0x822c6f8:0] (9) 
[0x824f1a0:1] (3) 65535.65535
[0x824e448:130534] (1) 65003 65535.65535 65530
[0x824ee48:65004] (1) 65535.65535 65003
[0x824ea90:65004] (1) 65003 65535.65535
[0x824eb00:65005] (3) 65003
[0x824fe38:131062] (1) 65535.65535 65530 65531
[0x824dc48:131063] (3) 65531 65530
[0x824ff88:65531] (1) 65535.65535 65530
[0x824e5e0:65533] (3) 65531
!**** yield the warning ****
raasay# clear ip bgp *
!**** wait a while, then again: ****
raasay# sh ip bgp paths 
Address Refcnt Path
[0x822c6f8:0] (9) 
[0x824f248:1] (3) 4294967295
[0x824e658:130534] (1) 65003 4294967295 65530
[0x824dc18:65004] (1) 4294967295 65003
[0x824d770:65004] (1) 65003 4294967295
[0x824ee48:65005] (3) 65003
[0x8250610:131062] (1) 4294967295 65530 65531
[0x824f110:131063] (3) 65531 65530
[0x8250a28:65531] (1) 4294967295 65530
[0x82500f0:65533] (3) 65531
09.11.2006
Spent some time bug hunting. Found it. See the bugs page. Still have to think about which way to solve this.
07.11.2006
I think I am through even with Checkpoint 11, at least with implementing. Have not done that much with confederations yet (and what I've done once is years past), so testing will be a bit like shooting in the dark, but I'll try.
The other thing I'm doing right now is going over my code and cleaning up some rough edges, add or delete comments, and write some documentation. Final test here will be a valgrind in order to see if I lost some memory on the way.
At some places there may be shortcuts and/or optimizations which could be done - but that is something for (much) later; right now we need something which simply works, even if it burns some cpu cycles more than necessary.
Another thing has arisen. Paul mentionend that the output of asn32s should just be a number, i.e. <1-4294967295> (lets call that asplain), and not <1-65535>.<0-65535> (lets call that asdot). Then that fighted-over asdot draft draft-michaelson-4byte-as-representation-02.txt tells me that "later" it should be <0-65535>.<0-65535> (asdot+), i.e. the "leading zero" should become mandatory at one point.
If I read correctly, one vendor is supposed to have implemented asdot already, and asdot is the only thing (disregarding ascolon, which is definitely history) I have seen presented at RIPE meetings as of yet. Hmpfft. Would be easier if all people had the same opinion ;-). Actually, the output is just sugar and has nothing to do with the real functionality - but has a lot of influence if you think of regular expressions because they have to match what you are using, and a dot is not in [0-9] which I remember seeing in lots and lots of regular expressions...
Even if I go into featuritis with this I think I'll make the output format configurable - at least nothing (or only the default) will have to be changed if a definite decision is finally there. Taking any input (even asip or ashex, *yuck*) is easy, and making the output configurable does not sound too complicated either. Default will have to be asplain - simply because asplain is what Paul is shooting for.
02.11.2006
If it proceeds like this, I'll finish early! I defined an aggregate-address, and it simply works. Guess I did not do any big goofs when programming that. Interaction with ciscos (asn16) worked directly like a charm, too. So basically I am now stuck with as_sets and confederations issues (i.e. everything which is not a basic as-path); I'll first have to define test cases and wanted outputs, then also hack the relevant things (which I did not do yet), and then we'll see.
Lets take a look, this is exciting (I think so ;-)! We have a test setup:
           +------ lab2 [cisco3620](as65531) - lab3 [cisco2610](as65530)
           |                                   /   
raasay(as9188.9188) - eileantigh(as65535.65535)
               \            |
            multihop     multihop
                |           |
              sambesi(as65003)[ed-zebra-pj, quite old]

** raasay **
router bgp 9188.9188
 bgp router-id 10.1.1.199
 network 1.1.1.1/32
 network 1.1.1.11/32
 aggregate-address 1.1.1.8/30 summary-only
 neighbor 10.1.1.197 remote-as 65535.65535
 neighbor 10.1.28.2 remote-as 65531
 neighbor 172.16.2.2 remote-as 65003
 neighbor 172.16.2.2 ebgp-multihop 255
************

raasay# sh ip bgp 
BGP table version is 0, local router ID is 10.1.1.199
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, R Removed
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.1/32       0.0.0.0                  0         32768  i
*  1.1.1.2/32       172.16.2.2                             0 65003 65535.65535 i
*>                  10.1.1.197               0             0 65535.65535 i
*  1.1.1.3/32       10.1.1.197                             0 65535.65535 65003 i
*>                  172.16.2.2               0             0 65003 i
*> 1.1.1.8/30       0.0.0.0                            32768  i
s> 1.1.1.11/32      0.0.0.0                  0         32768  i
*> 10.20.2.2/32     10.1.28.2                0             0 65531 i
*  10.20.20.20/32   172.16.2.2                             0 65003 65535.65535 65530 i
*                   10.1.28.3                              0 65535.65535 65530 i
*>                  10.1.28.2                              0 65531 65530 i

Total number of prefixes 7
raasay# sh ip bgp summary 
BGP router identifier 10.1.1.199, local AS number 9188.9188
RIB entries 12, using 768 bytes of memory
Peers 3, using 7548 bytes of memory

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.1.1.197      4 
            65535.65535     199     322        0    0    0 05:12:40        3
10.1.28.2       4 65531      27      29        0    0    0 00:23:00        2
172.16.2.2      4 65003     321     324        0    0    0 05:14:33        3

Total number of neighbors 3
raasay# sh ip bgp neighbors 
BGP neighbor is 10.1.1.197, remote AS 65535.65535, local AS 9188.9188, external link
  BGP version 4, remote router ID 10.1.1.197
  BGP state = Established, up for 05:13:23
  Last read 00:01:07, hold time is 180, keepalive interval is 60 seconds
  Neighbor capabilities:
    4 Byte AS: advertised and received
    Route refresh: advertised and received(old & new)
    Address family IPv4 Unicast: advertised and received
  Message statistics:
    Inq depth is 0
    Outq depth is 0
                         Sent       Rcvd
    Opens:                  1          0
    Notifications:          0          0
    Updates:                7          3
    Keepalives:           315        196
    Route Refresh:          0          0
    Capability:             0          0
    Total:                323        199
  Minimum time between advertisement runs is 30 seconds

 For address family: IPv4 Unicast
  Community attribute sent to this neighbor(both)
  3 accepted prefixes

  Connections established 1; dropped 0
  Last reset never
Local host: 10.1.1.199, Local port: 179
Foreign host: 10.1.1.197, Foreign port: 3096
Nexthop: 10.1.1.199
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
Read thread: on  Write thread: off

BGP neighbor is 10.1.28.2, remote AS 65531, local AS 9188.9188, external link
  BGP version 4, remote router ID 10.254.255.2
  BGP state = Established, up for 00:23:43
  Last read 00:00:43, hold time is 180, keepalive interval is 60 seconds
  Neighbor capabilities:
    4 Byte AS: advertised
    Route refresh: advertised
    Address family IPv4 Unicast: advertised
  Message statistics:
    Inq depth is 0
    Outq depth is 0
                         Sent       Rcvd
    Opens:                  1          1
    Notifications:          0          0
    Updates:                4          2
    Keepalives:            25         24
    Route Refresh:          0          0
    Capability:             0          0
    Total:                 30         27
  Minimum time between advertisement runs is 30 seconds

 For address family: IPv4 Unicast
  Community attribute sent to this neighbor(both)
  2 accepted prefixes

  Connections established 1; dropped 0
  Last reset never
Local host: 10.1.1.199, Local port: 38441
Foreign host: 10.1.28.2, Foreign port: 179
Nexthop: 10.1.1.199
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
Read thread: on  Write thread: off

BGP neighbor is 172.16.2.2, remote AS 65003, local AS 9188.9188, external link
  BGP version 4, remote router ID 212.89.130.219
  BGP state = Established, up for 05:15:16
  Last read 00:00:16, hold time is 180, keepalive interval is 60 seconds
  Neighbor capabilities:
    4 Byte AS: advertised
    Route refresh: advertised and received(old & new)
    Address family IPv4 Unicast: advertised and received
  Message statistics:
    Inq depth is 0
    Outq depth is 0
                         Sent       Rcvd
    Opens:                  1          1
    Notifications:          0          0
    Updates:                7          5
    Keepalives:           317        316
    Route Refresh:          0          0
    Capability:             0          0
    Total:                325        322
  Minimum time between advertisement runs is 30 seconds

 For address family: IPv4 Unicast
  Community attribute sent to this neighbor(both)
  3 accepted prefixes

  Connections established 1; dropped 0
  Last reset never
  External BGP neighbor may be up to 255 hops away.
Local host: 10.1.1.199, Local port: 40668
Foreign host: 172.16.2.2, Foreign port: 179
Nexthop: 10.1.1.199
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
Read thread: on  Write thread: off

*eileantigh*
router bgp 65535.65535
 bgp router-id 10.1.1.197
 network 1.1.1.2/32
 neighbor 10.1.1.199 remote-as 9188.9188
 neighbor 10.1.28.3 remote-as 65530
 neighbor 172.16.2.2 remote-as 65003
 neighbor 172.16.2.2 ebgp-multihop 255
************

eileantigh# show ip bgp summary 
BGP router identifier 10.1.1.197, local AS number 65535.65535
RIB entries 11, using 704 bytes of memory
Peers 3, using 7548 bytes of memory

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.1.1.199      4 
              9188.9188     328     205        0    0    0 03:19:53        5
10.1.28.3       4 65530      37      26        0    0    0 00:18:09        4
172.16.2.2      4 65003     330     210        0    0    0 03:19:57        4

Total number of neighbors 3
eileantigh# sh ip bgp
BGP table version is 0, local router ID is 10.1.1.197
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, R Removed
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*  1.1.1.1/32       10.1.28.3                              0 65530 65531 9188.9188 i
*>                  10.1.1.199               0             0 9188.9188 i
*                   172.16.2.2                             0 65003 9188.9188 i
*> 1.1.1.2/32       0.0.0.0                  0         32768  i
*  1.1.1.3/32       10.1.1.199                             0 9188.9188 65003 i
*>                  172.16.2.2               0             0 65003 i
*  1.1.1.8/30       10.1.28.3                              0 65530 65531 9188.9188 i
*                   172.16.2.2                             0 65003 9188.9188 i
*>                  10.1.1.199                             0 9188.9188 i
*  10.20.2.2/32     10.1.28.3                              0 65530 65531 i
*                   172.16.2.2                             0 65003 9188.9188 65531 i
*>                  10.1.28.2                              0 9188.9188 65531 i
*> 10.20.20.20/32   10.1.28.3                0             0 65530 i
*                   10.1.28.2                              0 9188.9188 65531 65530 i

Total number of prefixes 6
eileantigh# sh ip bgp 1.1.1.8
BGP routing table entry for 1.1.1.8/30
Paths: (3 available, best #3, table Default-IP-Routing-Table)
  Advertised to non peer-group peers:
  10.1.28.3 172.16.2.2
  65530 65531 9188.9188, (aggregated by 9188.9188 10.1.1.199)
    10.1.28.3 from 10.1.28.3 (10.254.255.3)
      Origin IGP, localpref 100, valid, external, atomic-aggregate
      Last update: Tue Oct 31 05:47:14 2006

  65003 9188.9188, (aggregated by 9188.9188 10.1.1.199)
    172.16.2.2 from 172.16.2.2 (212.89.130.219)
      Origin IGP, localpref 100, valid, external, atomic-aggregate
      Last update: Tue Oct 31 02:50:09 2006

  9188.9188, (aggregated by 9188.9188 10.1.1.199)
    10.1.1.199 from 10.1.1.199 (10.1.1.199)
      Origin IGP, localpref 100, valid, external, atomic-aggregate, best
      Last update: Tue Oct 31 02:49:55 2006

eileantigh# sh ip bgp 1.1.1.1
BGP routing table entry for 1.1.1.1/32
Paths: (3 available, best #2, table Default-IP-Routing-Table)
  Advertised to non peer-group peers:
  10.1.28.3 172.16.2.2
  65530 65531 9188.9188
    10.1.28.3 from 10.1.28.3 (10.254.255.3)
      Origin IGP, localpref 100, valid, external
      Last update: Tue Oct 31 05:47:14 2006

  9188.9188
    10.1.1.199 from 10.1.1.199 (10.1.1.199)
      Origin IGP, metric 0, localpref 100, valid, external, best
      Last update: Tue Oct 31 02:45:30 2006

  65003 9188.9188
    172.16.2.2 from 172.16.2.2 (212.89.130.219)
      Origin IGP, localpref 100, valid, external
      Last update: Tue Oct 31 02:45:26 2006

eileantigh# sh ip bgp neighbors 
BGP neighbor is 10.1.1.199, remote AS 9188.9188, local AS 65535.65535, external link
  BGP version 4, remote router ID 10.1.1.199
  BGP state = Established, up for 03:20:35
  Last read 00:00:38, hold time is 180, keepalive interval is 60 seconds
  Neighbor capabilities:
    4 Byte AS: advertised and received
    Route refresh: advertised and received(old & new)
    Address family IPv4 Unicast: advertised and received
  Message statistics:
    Inq depth is 0
    Outq depth is 0
                         Sent       Rcvd
    Opens:                  1          1
    Notifications:          0          0
    Updates:                3          7
    Keepalives:           202        321
    Route Refresh:          0          0
    Capability:             0          0
    Total:                206        329
  Minimum time between advertisement runs is 30 seconds

 For address family: IPv4 Unicast
  Community attribute sent to this neighbor(both)
  5 accepted prefixes

  Connections established 1; dropped 0
  Last reset never
Local host: 10.1.1.197, Local port: 3096
Foreign host: 10.1.1.199, Foreign port: 179
Nexthop: 10.1.1.197
Nexthop global: fe80::20c:29ff:fe34:1f86
Nexthop local: ::
BGP connection: non shared network
Read thread: on  Write thread: off

BGP neighbor is 10.1.28.3, remote AS 65530, local AS 65535.65535, external link
  BGP version 4, remote router ID 10.254.255.3
  BGP state = Established, up for 00:18:51
  Last read 00:00:17, hold time is 180, keepalive interval is 60 seconds
  Neighbor capabilities:
    4 Byte AS: advertised
    Route refresh: advertised
    Address family IPv4 Unicast: advertised
  Message statistics:
    Inq depth is 0
    Outq depth is 0
                         Sent       Rcvd
    Opens:                  1          1
    Notifications:          0          0
    Updates:                5          7
    Keepalives:            20         30
    Route Refresh:          0          0
    Capability:             0          0
    Total:                 26         38
  Minimum time between advertisement runs is 30 seconds

 For address family: IPv4 Unicast
  Community attribute sent to this neighbor(both)
  4 accepted prefixes

  Connections established 1; dropped 0
  Last reset never
Local host: 10.1.1.197, Local port: 3762
Foreign host: 10.1.28.3, Foreign port: 179
Nexthop: 10.1.1.197
Nexthop global: fe80::20c:29ff:fe34:1f86
Nexthop local: ::
BGP connection: non shared network
Read thread: on  Write thread: off

BGP neighbor is 172.16.2.2, remote AS 65003, local AS 65535.65535, external link
  BGP version 4, remote router ID 212.89.130.219
  BGP state = Established, up for 03:20:39
  Last read 00:00:04, hold time is 180, keepalive interval is 60 seconds
  Neighbor capabilities:
    4 Byte AS: advertised
    Route refresh: advertised and received(old & new)
    Address family IPv4 Unicast: advertised and received
  Message statistics:
    Inq depth is 0
    Outq depth is 0
                         Sent       Rcvd
    Opens:                  1          1
    Notifications:          0          0
    Updates:                8          8
    Keepalives:           202        322
    Route Refresh:          0          0
    Capability:             0          0
    Total:                211        331
  Minimum time between advertisement runs is 30 seconds

 For address family: IPv4 Unicast
  Community attribute sent to this neighbor(both)
  4 accepted prefixes

  Connections established 1; dropped 0
  Last reset never
  External BGP neighbor may be up to 255 hops away.
Local host: 10.1.1.197, Local port: 2079
Foreign host: 172.16.2.2, Foreign port: 179
Nexthop: 10.1.1.197
Nexthop global: fe80::20c:29ff:fe34:1f86
Nexthop local: ::
BGP connection: non shared network
Read thread: on  Write thread: off

**** lab3 ****
router bgp 65530
 no synchronization
 network 10.20.20.20 mask 255.255.255.255
 neighbor 10.1.1.197 remote-as 23456
 neighbor 10.254.2.2 remote-as 65531
 no auto-summary
**************
lab3#sh ip bgp summary 
BGP router identifier 10.254.255.3, local AS number 65530
BGP table version is 9, main routing table version 9
6 network entries and 11 paths using 886 bytes of memory
11 BGP path attribute entries using 1320 bytes of memory
BGP activity 6/0 prefixes, 11/0 paths

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.1.1.197      4 23456      29      46        9    0    0 00:32:54        5
10.254.2.2      4 65531      46      44        9    0    0 00:38:06        5
lab3#sh ip bgp
BGP table version is 9, local router ID is 10.254.255.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*  1.1.1.1/32       10.1.1.199                             0 23456 23456 i
*>                  10.254.2.2                             0 65531 23456 i
*> 1.1.1.2/32       10.1.1.197               0             0 23456 i
*                   10.254.2.2                             0 65531 23456 23456 i
*> 1.1.1.3/32       10.1.1.197                             0 23456 65003 i
*                   10.254.2.2                             0 65531 23456 65003 i
*  1.1.1.8/30       10.1.1.199                             0 23456 23456 i
*>                  10.254.2.2                             0 65531 23456 i
*  10.20.2.2/32     10.1.28.2                              0 23456 23456 65531 i
*>                  10.254.2.2               0             0 65531 i
*> 10.20.20.20/32   0.0.0.0                  0         32768 i
lab3#sh ip bgp 1.1.1.8
BGP routing table entry for 1.1.1.8/30, version 6
Paths: (2 available, best #2)
  Advertised to non peer-group peers:
    10.1.1.197 
  23456 23456, (aggregated by 23456 10.1.1.199)
    10.1.1.199 from 10.1.1.197 (10.1.1.197)
      Origin IGP, localpref 100, valid, external, atomic-aggregate, ref 2
  65531 23456, (aggregated by 23456 10.1.1.199)
    10.254.2.2 from 10.254.2.2 (10.254.255.2)
      Origin IGP, localpref 100, valid, external, atomic-aggregate, best, ref 2
lab3#sh ip bgp 1.1.1.1
BGP routing table entry for 1.1.1.1/32, version 4
Paths: (2 available, best #2)
  Advertised to non peer-group peers:
    10.1.1.197 
  23456 23456
    10.1.1.199 from 10.1.1.197 (10.1.1.197)
      Origin IGP, localpref 100, valid, external, ref 2
  65531 23456
    10.254.2.2 from 10.254.2.2 (10.254.255.2)
      Origin IGP, localpref 100, valid, external, best, ref 2
lab3#sh ip bgp neighbors 
BGP neighbor is 10.1.1.197,  remote AS 23456, external link
 Index 2, Offset 0, Mask 0x4
  BGP version 4, remote router ID 10.1.1.197
  BGP state = Established, table version = 9, up for 00:33:48
  Last read 00:00:59, hold time is 180, keepalive interval is 60 seconds
  Minimum time between advertisement runs is 30 seconds
  Received 29 messages, 0 notifications, 0 in queue
  Sent 47 messages, 0 notifications, 0 in queue
  Prefix advertised 6, suppressed 0, withdrawn 2
  Connections established 1; dropped 0
  Last reset 00:34:11, due to Peer closed the session
  5 accepted prefixes consume 160 bytes
  0 history paths consume 0 bytes
Connection state is ESTAB, I/O status: 1, unread input bytes: 0
Local host: 10.1.28.3, Local port: 179
Foreign host: 10.1.1.197, Foreign port: 3762

Enqueued packets for retransmit: 0, input: 0  mis-ordered: 0 (0 bytes)

Event Timers (current time is 0x245C76):
Timer          Starts    Wakeups            Next
Retrans            39          0             0x0
TimeWait            0          0             0x0
AckHold            26         25             0x0
SendWnd             0          0             0x0
KeepAlive           0          0             0x0
GiveUp              0          0             0x0
PmtuAger            0          0             0x0
DeadWait            0          0             0x0

iss: 1356169154  snduna: 1356170254  sndnxt: 1356170254     sndwnd:   6432
irs: 1076346065  rcvnxt: 1076346891  rcvwnd:      15559  delrcvwnd:    825

SRTT: 304 ms, RTTO: 672 ms, RTV: 32 ms, KRTT: 0 ms
minRTT: 0 ms, maxRTT: 300 ms, ACK hold: 200 ms
Flags: passive open, nagle, gen tcbs

Datagrams (max data segment is 1460 bytes):
Rcvd: 66 (out of order: 0), with data: 26, total data bytes: 825
Sent: 64 (retransmit: 0), with data: 38, total data bytes: 1099
          
BGP neighbor is 10.254.2.2,  remote AS 65531, external link
 Index 1, Offset 0, Mask 0x2
  BGP version 4, remote router ID 10.254.255.2
  BGP state = Established, table version = 9, up for 00:39:11
  Last read 00:00:12, hold time is 180, keepalive interval is 60 seconds
  Minimum time between advertisement runs is 30 seconds
  Received 47 messages, 0 notifications, 0 in queue
  Sent 45 messages, 0 notifications, 0 in queue
  Prefix advertised 3, suppressed 0, withdrawn 0
  Connections established 1; dropped 0
  Last reset never
  5 accepted prefixes consume 160 bytes
  0 history paths consume 0 bytes
Connection state is ESTAB, I/O status: 1, unread input bytes: 0
Local host: 10.254.2.3, Local port: 179
Foreign host: 10.254.2.2, Foreign port: 11026

Enqueued packets for retransmit: 0, input: 0  mis-ordered: 0 (0 bytes)

Event Timers (current time is 0x249134):
Timer          Starts    Wakeups            Next
Retrans            46          0             0x0
TimeWait            0          0             0x0
AckHold            46         43             0x0
SendWnd             0          0             0x0
KeepAlive           0          0             0x0
GiveUp              0          0             0x0
PmtuAger            0          0             0x0
DeadWait            0          0             0x0

iss: 1044247913  snduna: 1044248895  sndnxt: 1044248895     sndwnd:  15403
irs:  649573614  rcvnxt:  649574739  rcvwnd:      15260  delrcvwnd:   1124

SRTT: 302 ms, RTTO: 630 ms, RTV: 13 ms, KRTT: 0 ms
minRTT: 0 ms, maxRTT: 304 ms, ACK hold: 200 ms
Flags: passive open, nagle, gen tcbs

Datagrams (max data segment is 1460 bytes):
Rcvd: 90 (out of order: 0), with data: 46, total data bytes: 1124
Sent: 89 (retransmit: 0), with data: 45, total data bytes: 981
Checkpoint 10 reached:
Basic operation of AGGREGATOR in the setups of checkpoints 7 to 9 looks good.
Checkpoint 9 reached:
Checkpoints 7 and 8 run with ciscos as ASN16 speaker.
Checkpoint 8 reached:
(ETA was: 05.11.2006 [set on 31.10.])
Aspath and ASN handling runs in a setup ASN16 <-> ASN32(>1.0) <-> ASN16.
Checkpoint 7 reached:
(ETA: 05.11.2006) [set on 31.10.]
Aspath and ASN handling runs in a setup ASN32(>1.0) <-> ASN16 <-> ASN32(>1.0). Actually, the test setup also completed the ring by a peering between the two ASN32.
Had to fight in the aspath-muddling, this intern/unintern hashing stuff got me on the wrong foot in the beginning. But never mind, it runs now and looks good.
31.10.2006
Checkpoint 6 reached:
(ETA was: 05.11.2006 [set on 30.10.])
Aspath and ASN handling runs between ASN32 speaker (ASN >= 1.0) and ASN16 speaker.
Checkpoint 5 reached:
(ETA was: 05.11.2006 [set on 30.10.])
Aspath and ASN handling runs between ASN32 speaker (ASN < 1.0) and ASN16 speaker.
Checkpoint 4 reached:
(ETA was: 31.10.2006 [set on 30.10.])
Session between ASN32 and ASN16 establishes.
Checkpoint 3 reached:
(ETA was: 31.10.2006 [set on 30.10.])
Two ASN32 speakers understand each other in three situations:
  1. One asn32 speaker with ASN < 1.0, one asn32 speaker with ASN >= 1.0.
  2. Both asn32 speaker with ASN < 1.0.
  3. Both asn32 speaker with ASN >= 1.0.
29.10.2006
Set up this webpage for interested parties.
Checkpoint 2 reached: Session between 2 ASN32 speakers is capable of advertising paths, and correct paths appears at the other end.
Time for a preview, here a live cut & paste:
raasay# sh ip bgp summary 
BGP router identifier 10.1.1.199, local AS number 9188
RIB entries 3, using 192 bytes of memory
Peers 1, using 2516 bytes of memory

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.1.1.197      4 
                 145.15       8      14        0    0    0 00:10:40        1

Total number of neighbors 1
raasay# sh ip bgp
BGP table version is 0, local router ID is 10.1.1.199
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, R Removed
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.1/32       0.0.0.0                  0         32768  i
*> 1.1.1.2/32       10.1.1.197               0             0 145.15 45.45 6.7 8.8 5555 i
raasay# sh ip bgp neighbors 
BGP neighbor is 10.1.1.197, remote AS 145.15, local AS 9188, external link
  BGP version 4, remote router ID 10.1.1.197
  BGP state = Established, up for 00:16:01
  Last read 00:00:22, hold time is 180, keepalive interval is 60 seconds
  Neighbor capabilities:
    Route refresh: advertised and received(old & new)
    Address family IPv4 Unicast: advertised and received
  Message statistics:
    Inq depth is 0
    Outq depth is 0
(... omitted for brevity...)

"show ip bgp summary": as long as the neigbor's ASN fits into the traditional 5 chars, output will be one line. Otherwise it will be broken into two with the ASN adjusted to the right of the AS column (as seen above).
Some Bugs in aspath lengths (memory calculations). I'm using the same routines for as16 and as32 path parsing/writing. It is not always only the difference between 2 and 4.
Checkpoint 1 reached: Established Session between 2 ASN32 quaggas
Had to readjust the source heftily again. Problem is with a ASN32 partner, we potentially get its as-number in the options. Old code gets options after doing a whole lot of tests with just the "open" packet, without looking at the options. First try was to take the options directly, then proceed in the test -- but this broke capablity handling alltogether. This capability stuff is a bit convoluted, the program flow not easily deciphered. So backed up, took the easy way out: put the capability parsing where it was, and peek into capabilities at the beginning and grep just the 4BYTEAS capability.

28.10.2006
Finally: I think I've persuaded the vty routines to digest ASN32 syntax. There may still be some "<0-65535> AS numbers" left somewhere, but most should be working now.
27.10.2006
Henk wants to know whats up, what I intend to do, what has been done, etc. Gave ETA 1-2 weeks for something suitable for very early testing, and told about need to test extensively, which I have not the environment to do.
26.10.2006
Decision by Paul: this will be an unconditional patch, no configure or run-time option. If neccessary we'll provide a per-peer override capability.

Paul asked whether Henk Uijterwaal of RIPE NCC should know about this, because RIPE NCC is busy putting ASN32 support in all their ASN-using tools and they depend on quagga. Gave a go-ahead.

25.10.2006
Told Paul Jakma about this, in order to avoid double effords. But also keep this under the carpet until something more than hot air has materialized.
18.10.2006
Begun hacking on quagga bgpd in order to support asn32. Took draft-ietf-idr-as4bytes-12.txt, read it, and began.