]> git.proxmox.com Git - mirror_frr.git/commit
bgpd: Add `neighbor <neigh> shutdown rtt` command
authorDonatas Abraitis <donatas.abraitis@gmail.com>
Sat, 25 Jul 2020 06:10:56 +0000 (09:10 +0300)
committerDonatas Abraitis <donatas.abraitis@gmail.com>
Mon, 7 Sep 2020 19:30:19 +0000 (22:30 +0300)
commit8336c896fdcc993ee6dbf428f75231e1b0453ed9
treeda6723510b8903190247358dcfbcb752a6493afd
parente410d563072d7319e6cc9803e8aee05cbee339f5
bgpd: Add `neighbor <neigh> shutdown rtt` command

This would be useful in cases with lots of peers and shutdown them
automatically if RTT goes above the specified limit.

A host with 512 or more IPv6 addresses has a higher latency due to
ipv6_addr_label(). This method tries to pick the best candidate address
fo outgoing connection and literally increases processing latency.

```
Samples: 28  of event 'cycles', Event count (approx.): 22131542
  Children      Self  Command  Shared Object      Symbol
  +  100.00%     0.00%  ping6    [kernel.kallsyms]  [k] entry_SYSCALL_64_fastpath
  +  100.00%     0.00%  ping6    [unknown]          [.] 0x0df0ad0b8047022a
  +  100.00%     0.00%  ping6    libc-2.17.so       [.] __sendto_nocancel
  +  100.00%     0.00%  ping6    [kernel.kallsyms]  [k] sys_sendto
  +  100.00%     0.00%  ping6    [kernel.kallsyms]  [k] SYSC_sendto
  +  100.00%     0.00%  ping6    [kernel.kallsyms]  [k] sock_sendmsg
  +  100.00%     0.00%  ping6    [kernel.kallsyms]  [k] inet_sendmsg
  +  100.00%     0.00%  ping6    [kernel.kallsyms]  [k] rawv6_sendmsg
  +  100.00%     0.00%  ping6    [kernel.kallsyms]  [k] ip6_dst_lookup_flow
  +  100.00%     0.00%  ping6    [kernel.kallsyms]  [k] ip6_dst_lookup_tail
  +  100.00%     0.00%  ping6    [kernel.kallsyms]  [k] ip6_route_get_saddr
  +  100.00%     0.00%  ping6    [kernel.kallsyms]  [k] ipv6_dev_get_saddr
  +  100.00%     0.00%  ping6    [kernel.kallsyms]  [k] __ipv6_dev_get_saddr
  +  100.00%     0.00%  ping6    [kernel.kallsyms]  [k] ipv6_get_saddr_eval
  +  100.00%     0.00%  ping6    [kernel.kallsyms]  [k] ipv6_addr_label
  +  100.00%   100.00%  ping6    [kernel.kallsyms]  [k] __ipv6_addr_label
  +    0.00%     0.00%  ping6    [kernel.kallsyms]  [k] schedule
```

This is how it works:

```
~# vtysh -c 'show bgp neigh 192.168.0.2 json' | jq '."192.168.0.2".estimatedRttInMsecs'
9
~# tc qdisc add dev eth1 root netem delay 120ms
~# vtysh -c 'show bgp neigh 192.168.0.2 json' | jq '."192.168.0.2".estimatedRttInMsecs'
89
~# vtysh -c 'show bgp neigh 192.168.0.2 json' | jq '."192.168.0.2".estimatedRttInMsecs'
null
~# vtysh -c 'show bgp neigh 192.168.0.2 json' | jq '."192.168.0.2".lastResetDueTo'
"Admin. shutdown"
```

Warning message:
bgpd[14807]: 192.168.0.2 shutdown due to high round-trip-time (200ms > 150ms)

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
bgpd/bgp_fsm.c
bgpd/bgp_packet.c
bgpd/bgp_vty.c
bgpd/bgpd.c
bgpd/bgpd.h