[Xorp-hackers] BGP peers output

Kristian Larsson kristian@juniks.net
Wed, 5 Apr 2006 14:26:35 +0200


Long time ago I submitted a patch for a nicer
output of the show bgp peers commands.
Atanu had thoughts about recoding the bgp show
tool so the patches were never commited. Now I
looked them over and thought that the output could
be improved further... 

Cisco output:
Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
85.195.4.148    4 39525    2096   86561  1027248    0    0 14:07:57        0
217.10.127.18   4 35706  100426    1423  1027248    0    0 22:18:57   182206

Cisco has MsgRcvd and MsgSent, which I've really doesn't understand the purpose 
of. Foundrys approach is much better with receied/filtered/sent/tosend prefixes.
I think version can be ommited today, anyone using anything else than v4?

Foundry output:
  Neighbor Address  AS#   State   Time     Rt:Accepted Filtered Sent   ToSend
  1.3.3.7           3246  CONN   23h15m50s    0        0        0      30
  85.195.63.7       35706 ESTAB   2d11h44m    182145   0        181463 0
  85.195.63.14      35706 ESTAB  19d 3h18m    640      0        181463 0
  213.50.153.237    3246  ESTAB  22d 8h20m    182115   0        30     0
  217.10.127.2      31642 ESTAB  22d 8h20m    2        0        4      0
  217.10.127.10     39525 ESTAB  19d16h47m    1        0        1      0
  217.10.127.14     39525 CONN    6d16h 6m    0        0        0      182208
  217.10.127.17     39525 ESTAB  22h19m43s    2        0        182208 0


I would like to combine the best of this.
What do we need to see?

Peer IP address
Peer remote AS
State of the session
How long it has been in this state
Number of flaps is nice
Number of received prefixes
number of filtered prefixes
number of sent prefixes
number of prefixes to send (really great when writing route-maps)

I had something like this in mind..
XORP output - Next Generation:
me@mybox> show bgp peers
F:Flaps   PA:Accepted prefixes   PF: Filtered prefixes   PS:Sent prefixes
TS:Prefixes to send

Peer             ASN    F      Time            PA        PF    PS    TS
53.123.53.25     34853  0   0w,1d,03:45:23     Active, attempt in 67 secs.
87.13.214.1      4834   0   0w,4d,06:23:57     Administratively down
123.123.123.123  12345  0   1w,5d,12:23:54     183521    0     0     0
217.10.127.17    39525  0   00:12:43           182145    0     23    0

We never explicitly tell the user that a session is established, but if you
have received prefixes from a neighbor I think you can safely presume it is
in a established state. What do you think of this output?
Should we sort by IP address or AS number? Perhaps descriptions for BGP 
neighbors should be included?

Now I'm just talking about the short output. The detailed output should 
ofcourse contain just about every information we have about the session.
I will try and propose something for detailed output as well.

What do you all think?

Regards,
Kristian