Re: Decode BGP Shutdown Communication messages (RFC 8203)
Hi, 1) You also implemented enable bgp2 "enable message" This message currently seen only at local side and doesn't seen at remote peer. Scenario: You made maintenance work with the shutdown message "Session will be down from 13:00 till 14:00". Later session was established again. Days after at remote peer side still printed the same message. That's confusing. Suggestion: (May be) To show two different messages? Tx and Rx. To clear Rx message every time when BGP session state changed to established. 2) Is it possible to log such messages and see via syslog? P.S. For russian UTF8 text 128 bytes restriction (RFC) probably not always enough. Ondrej Zajicek пишет 19.09.2017 21:53:
On Thu, Jul 27, 2017 at 05:55:40PM +0200, Job Snijders wrote:
Hi all,
Here is a patch to decode received BGP shutdown communication messages as specified in RFC 8203. In the following example scenario I'm sending a shutdown communication with openbgpd:
$ bgpctl neighbor 94.142.241.204 down "TICKET-2331 we are upgrading, back in 30 min" request processed Hi
Merged with some significant changes, with support for both RX and TX of shutdown communication:
https://gitlab.labs.nic.cz/labs/bird/commit/cd1d99611e445c9fe2452d05627ccfc6...
I generalized it a bit, so the message is not specific to BGP, but can be attached to any protocol, so it makes sense that it can be changed by general commands like disable, restart. That means it also changed the output a bit:
bird> show protocols all bgp2 name proto table state since info bgp2 BGP master down 19:39:00 Description: My BGP session Message: Planned shutdown, back in 30 min Preference: 100 Input filter: ACCEPT Output filter: (unnamed) BGP state: Down Neighbor address: 10.0.1.1 Neighbor AS: 10
Conceptually, it is one-item mailbox, which can be set by either the core (using enable/disable/restart commands) or the protocol (received BGP Notification with the RFC 8203 message). I am not sure if it would not be better to have two separate mailboxes for both directions, but it probably does not matter.
The message can be send from BIRD shell:
birdc> disable bgp1 "hi, we will upgrade to bird 1.6.4"
Unfortunately, that means that from Unix shell you have to do double qouting:
birdc disable bgp1 '"hi, we will upgrade to bird 1.6.4"'
Currently no support for message associated with 'disabled' in bird.conf or for message associated with BIRD global shutdown.
Otherwise, there are some minor changes w.r.t. your patch:
1) Your patch requires that RFC 8203 message fills the entire space of BGP notification (i.e. msg_len + 1 == remaining_len). I do not see any such requirement in RFC 8203, so i accept if (msg_len + 1 <= remaining_len)
2) I reset the message not with any RX notification, but only with administrative shutdown/reset notification. That prevents message reset with subsequent errors unrelated to administrative notification.
3) Proper handling of zero-length messages (should be handled equally like no message at all according to RFC 8203).
4) Some basic sanitization of received strings to avoid escape-attacks and newlines in logs.
Any comments, suggestions, opposition?
Hi, hope you well. I also interested in this question. Can someone from the developers say something about it ? Thanks. With best regards, Dmitry S. Nikolaev Moscow, Russia SIP URI: dn@sip.mega-net.ru On 26.10.2017 16:40, Mikhail Grishin wrote:
Hi,
1) You also implemented enable bgp2 "enable message" This message currently seen only at local side and doesn't seen at remote peer.
Scenario: You made maintenance work with the shutdown message "Session will be down from 13:00 till 14:00". Later session was established again. Days after at remote peer side still printed the same message. That's confusing.
Suggestion: (May be) To show two different messages? Tx and Rx. To clear Rx message every time when BGP session state changed to established.
2) Is it possible to log such messages and see via syslog?
P.S. For russian UTF8 text 128 bytes restriction (RFC) probably not always enough.
Hi. So, can we expect an answer ? Thanks. With best regards, Dmitry S. Nikolaev Moscow, Russia phone: +7 (499) 678 8007 [ext. 6003] fax: +7 (499) 678 8007 [ext. 7777] www: http://www.mega-net.ru mail: dnikolaev@mega-net.ru SIP URI: dnikolaev@sip.mega-net.ru || dn@sip.mega-net.ru On 31.10.2017 13:39, Dmitry S. Nikolaev wrote:
Hi, hope you well.
I also interested in this question. Can someone from the developers say something about it ?
Thanks.
With best regards, Dmitry S. Nikolaev Moscow, Russia SIP URI: dn@sip.mega-net.ru
On 26.10.2017 16:40, Mikhail Grishin wrote:
Hi,
1) You also implemented enable bgp2 "enable message" This message currently seen only at local side and doesn't seen at remote peer.
Scenario: You made maintenance work with the shutdown message "Session will be down from 13:00 till 14:00". Later session was established again. Days after at remote peer side still printed the same message. That's confusing.
Suggestion: (May be) To show two different messages? Tx and Rx. To clear Rx message every time when BGP session state changed to established.
2) Is it possible to log such messages and see via syslog?
P.S. For russian UTF8 text 128 bytes restriction (RFC) probably not always enough.
On Mon, Nov 13, 2017 at 07:56:47AM +0300, Dmitry S. Nikolaev wrote:
Hi.
So, can we expect an answer ?
Hi I hope that i answered: http://trubka.network.cz/pipermail/bird-users/2017-October/011623.html -- 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."
On Thu, Oct 26, 2017 at 04:40:45PM +0300, Mikhail Grishin wrote:
Hi,
1) You also implemented enable bgp2 "enable message" This message currently seen only at local side and doesn't seen at remote peer.
Scenario: You made maintenance work with the shutdown message "Session will be down from 13:00 till 14:00". Later session was established again. Days after at remote peer side still printed the same message. That's confusing.
Suggestion: (May be) To show two different messages? Tx and Rx. To clear Rx message every time when BGP session state changed to established.
Hi You are right, clearing the RX message when state changed to established makes sense. Independent handling (or at least distinguishing) of RX and TX messages was already suggested by Job Snijders, this is another argument for that.
2) Is it possible to log such messages and see via syslog?
Yes, received messages are logged. Sent ones are not.
P.S. For russian UTF8 text 128 bytes restriction (RFC) probably not always enough.
Well, that is specified by RFC 8203. I wonder why the limit is not 255, as the length field is byte anyways. -- 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."
participants (3)
-
Dmitry S. Nikolaev -
Mikhail Grishin -
Ondrej Zajicek