advanced ipv4 bgp troubleshooting - cisco · advanced ipv4 bgp troubleshooting глазами tac...
TRANSCRIPT
Advanced IPv4 BGP troubleshooting
глазами TAC
Василий Михайловский
(инженер TAC, команда Routing Protocols)
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.
Основные правила troubleshooting
• Не следует поддаваться панике;
• Четко определите что является симптомом проблемы;
• Если проблема затрагивает большое количество маршрутов, выберитеодин и сфокусируйтесь на нем;
• Если проблема имеет эпизодический характер, постарайтесь найтикорреляцию с другими событиями в сети;
• Если Вы знакомы с сетью – постарайтесь сравнить наблюдаемоеповедение с baseline;
• Не зацикливайтесь на одной версии причины – старайтесьсформулировать несколько версий и, по ходу, отсеивайте неверные;
• Если обнаружилась возможность workaround – используйте ее, в этомслучае поиск и устранение root cause можно будет перенести за пределыбизнес-часов;
• Keep calm and call TAC
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.2
СОДЕРЖАНИЕ
• Классификация проблемных ситуаций
• Детали конкретных случаев
• Рекомендации: как [не] следует делать
• Q&A
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.3
Классификация проблемных ситуаций
Проблемы конфигурации (настроили, а не работает);
Проблемы транспортного уровня (TCP 179);
Проблемы этапа обмена данными (updates);
Проблемы выбора best-path;
Проблемы быстрой сходимости и установки маршрутов в RIB/FIB
Общесистемные проблемы
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.4
Классификация проблемных ситуаций
R1# show runn | section r.bgp|Loopback
Interface Loopback0
ip address 1.1.1.1 255.255.255.255
router bgp 100
neighbor 3.3.3.3 remote-as 300
neighbor 3.3.3.3 update-source Loopback0
neighbor 3.3.3.3 ebgp-multihop 3
R1# show tcp brief all
R1# show ip route 3.3.3.3
R1# show ip cef 3.3.3.3
Проблемы конфигурации
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.5
R3# show runn | section r.bgp|Loopback
Interface Loopback0
ip address 3.3.3.3 255.255.255.255
router bgp 300
neighbor 1.1.1.1 remote-as 100
neighbor 1.1.1.1 update-source Loopback0
neighbor 1.1.1.1 ebgp-multihop 3
R3# show tcp brief all
R3# show ip route 1.1.1.1
R3# show ip cef 1.1.1.1
Классификация проблемных ситуаций
Проблемы конфигурации;
Проблемы транспортного уровня (TCP 179);
Проблемы этапа обмена данными (updates);
Проблемы выбора best-path;
Проблемы быстрой сходимости и установки маршрутов в RIB/FIB
Общесистемные проблемы
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.6
Классификация проблемных ситуаций
Т.к. протокол BGP является, по сути, TCP/IP приложением, то ему присущи
все проблемы транспорта:
1) Полная потеря пакетов (отсутствие маршрута, 100%-packet loss);
2) Частичная потеря пакетов (при перегрузке канала);
3) Проблемы MTU (включая pMTU discovery);
4) Проблемы BGP аутентификации (MD5)
Проблемы транспортного уровня
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.7
Команды:
- show ip bgp sum
- show ip tcp
- show ip bgp nei <peer ip-address>
- show ip cef/route <peer ip-address>
- ping <peer ip-address> df-bit [size 1500]
- show runn | section router bgp
Классификация проблемных ситуаций
- Пакеты не доходят от 10.0.1.254:
%BGP-3-NOTIFICATION: sent to neighbor 10.0.1.254 4/0 (hold time expired) 0 bytes
%BGP-5-NBR_RESET: Neighbor 10.0.1.254 reset (BGP Notification sent)
%BGP-5-ADJCHANGE: neighbor 10.0.1.254 Down BGP Notification sent
- Пакеты не доходят до 10.0.1.254:
%BGP-3-NOTIFICATION: received from neighbor 10.0.1.254 4/0 (hold time expired) 0 bytes
%BGP-5-NBR_RESET: Neighbor 10.0.1.254 reset (BGP Notification received)
%BGP-5-ADJCHANGE: neighbor 10.0.1.254 Down BGP Notification received
- Проблема конфигурации (remote-as):
%BGP-3-NOTIFICATION: sent to neighbor 10.0.1.254 passive 2/2 (peer in wrong AS) 2 bytes
0001
%BGP-3-NOTIFICATION: received from neighbor 10.0.1.254 passive 2/2 (peer in wrong AS) 2
bytes 0001
-Проблема конфигурации (VRF, src/dst ip-address):
%TCP-6-BADAUTH: No MD5 digest from 3.3.3.3(179) to 1.1.1.1(28866) (RST)
- Проблема конфигурации (пароль) или firewall на пути:
%TCP-6-BADAUTH: Invalid MD5 digest from 3.3.3.3(36840) to 1.1.1.1(179)
%TCP-6-BADAUTH: No MD5 digest from 3.3.3.3(24249) to 1.1.1.1(179)
Проблемы транспортного уровня / сообщения из show logg
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.8
Классификация проблемных ситуацийПроблемы транспортного уровня / аутентификация
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Source Port | Destination Port |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Acknowledgment Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Data | |U|A|P|R|S|F| |
| Offset| Reserved |R|C|S|S|Y|I| Window |
| | |G|K|H|T|N|N| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum | Urgent Pointer |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Options | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| data |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Firewall между BGP пирами может:
- вырезать TCP опции;
- выполнять “sequence number randomization”;
Что приводит к невозможности установить сессию – проблема аутентификации!
“neighbor 3.3.3.3 password CISCO”
MD5 – TCP option 19
Sequence number – включен в расчет MD5
MD5 включен в каждый TCP пакет
(включая SYN и RST)
Классификация проблемных ситуацийПроблемы транспортного уровня / аутентификация
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.10
R1#
Interface E0/0
ip address 10.1.3.1 255.255.255.0
router bgp 100
neighbor 10.1.3.3 remote-as 300
neighbor 10.1.3.3 password CISCO
R3#
Interface E0/0
vrf forwarding INET
ip address 10.1.3.3 255.255.255.0
router bgp 300
neighbor 10.1.3.1 remote-as 100
neighbor 10.1.3.1 password CISCO
%TCP-6-BADAUTH: No MD5 digest from 10.1.3.3 (179) to
10.1.3.1(31262) (RST)
Классификация проблемных ситуаций
R1#sh ip bgp nei 3.3.3.3 | i Last read|retran
Last read 00:00:15, last write 00:00:13, hold time is 180, keepalive interval is 60 seconds
Enqueued packets for retransmit: 1, input: 0 mis-ordered: 0 (0 bytes)
Sent: 6285 (retransmit: 14 fastretransmit: 0),with data: 6275, total data bytes: 5039815
R3#sh ip bgp nei 1.1.1.1 | i Last r|retra
Last read 00:02:02, last write 00:00:13, hold time is 180, keepalive interval is 60 seconds
Enqueued packets for retransmit: 2, input: 0 mis-ordered: 0 (0 bytes)
Status Flags: passive open, retransmission timeout, gen tcbs
Sent: 2993 (retransmit: 5 fastretransmit: 0),with data: 7, total data bytes: 175
Проблемы транспортного уровня / диагностика packet-loss
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.11
Потери пакетов можно диагностировать командой ping:
- ping 1.1.1.1 source 3.3.3.3 tos 192
- ping 1.1.1.1 source 3.3.3.3 tos 192 size <MTU> df-bit
#show ip bgp summ
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
R1# 3.3.3.3 4 100 6 40006 2612561 0 0 00:02:10 0
R3# 1.1.1.1 4 100 40004 6 0 0 0 00:02:16 400000
Классификация проблемных ситуацийПроблемы транспортного уровня / MTU
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.12
Проблема MTU будет рассмотрена в разделе «ситуаций»
Классификация проблемных ситуаций
Проблемы транспортного уровня (TCP 179);
Проблемы этапа обмена данными (updates);
Проблемы выбора best-path;
Проблемы установки маршрутов в RIB/ программирование HW
Общесистемные проблемы
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.13
Классификация проблемных ситуаций
После установки TCP сессии, протокол начинает обмен данными (application
level):
1) Встроенный loop-prevention механизм BGP;
2) Проблемы «тиражирования» updates на большое количество сессий;
Проблемы этапа обмена данными (updates)
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.14
Команды:
- show ip bgp <prefix>/<lenth>
- show ip bgp sum
- show ip bgp nei <peer ip-address>
- show ip bgp update-group
- show runn | section router bgp
Классификация проблемных ситуаций
Основные механизмы loop-prevention включают в себя:
• *Next-hop должен быть валиден (существует в RIB и не блокирован);
• По умолчанию, BGP анонсирует только best-path;
• AS-path (своя AS от eBGP пира);
• “Connected check” (eBGP на физических интерфейсах);
• По умолчанию, updates от iBGP не тиражируются другим iBGP пирам;
• Если же тиражируются (route-reflector), то используется BGP router-id и
cluster-list.
Проблемы этапа обмена данными (updates) – loop prevention
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.15
Команды:
- debug ip bgp updates
- show ip bgp sum
- show ip bgp update-group
- show runn | section router bgp
- show ip bgp version recent …
Классификация проблемных ситуаций
show ip bgp [prefix/length]
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
r>i 1.1.1.1/32 10.0.13.1 11 100 0 I
i 10.0.4.0/24 99.99.99.99 0 100 0 i
BGP routing table entry for 10.0.4.0/24, version 0
Paths: (1 available, no best path)
Not advertised to any peer
99.99.99.99 (inaccessible) from 4.4.4.4 (4.4.4.4)
BGP routing table entry for 1.1.1.1/32, version 7
Paths: (1 available, best #1, table default, RIB-failure(17))
Local
10.0.13.1 (metric 1020) from 4.4.4.4 (4.4.4.4)
Origin IGP, metric 11, localpref 100, valid, internal, best
Проблемы этапа обмена данными (updates) – show ip bgp
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.16
Классификация проблемных ситуаций
debug ip bgp updates [ACL] [neighbor address] [in | out]:
• BGP(0): 10.0.34.4 rcv UPDATE about 4.4.4.4/32 -- DENIED due to: NEXTHOP is our own address;
• BGP: 10.0.34.4 Advertised Nexthop 99.99.99.99: Non-local or Nexthop and peer Not on same interface
BGP(0): 10.0.34.4 rcv UPDATE about -- DENIED due to: non-connected NEXTHOP;
• BGP(0): 10.0.34.4 rcv UPDATE about 4.4.4.4/32 -- DENIED due to: AS-PATH contains our own AS
• BGP(0): 4.4.4.4 rcv UPDATE about 1.1.1.1/32 -- DENIED due to: ORIGINATOR is us
• BGP(0): 4.4.4.4 rcv UPDATE about 1.1.1.1/32 -- DENIED due to: reflected from the same cluster;
• BGP(0): 4.4.4.4 rcvd 10.0.0.0/22 -- DENIED due to: route-map;
Проблемы этапа обмена данными (updates) – debug
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.17
Классификация проблемных ситуацийПроблемы этапа обмена данными (updates) – тиражирование updates
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.18
R1#sh ip bgp neighbors 3.3.3.3 advertised-routes
Network Next Hop Metric LocPrf Weight Path
*> 11.11.11.0/24 0.0.0.0 0 32768 i
R1#sh ip bgp 11.11.11.0/24
BGP routing table entry for 11.11.11.0/24, version 6
Paths: (1 available, best #1, table default)
Advertised to update-groups:
2 3
Refresh Epoch 1
Local
0.0.0.0 from 0.0.0.0 (1.1.1.1)
Origin IGP, metric 0, localpref 100, weight 32768, valid, sourced, local, best
rx pathid: 0, tx pathid: 0x0
Классификация проблемных ситуацийПроблемы этапа обмена данными (updates) – тиражирование updates
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.19
R1#sh ip bgp update-group 2
BGP version 4 update-group 2, external, Address Family: IPv4 Unicast
BGP Update version : 6/0, messages 0
Route map for outgoing advertisements is SET_NH
Topology: global, highest version: 6, tail marker: 6
Format state: Current working (OK, last minimum advertisement interval)
Refresh blocked (not in list, last not in list)
Update messages formatted 3, replicated 3, current 0, refresh 0, limit 1000
Number of NLRIs in the update sent: max 1, min 0
Minimum time between advertisement runs is 30 seconds
Has 1 member:
3.3.3.3
R1#sh ip bgp update-group 3
BGP version 4 update-group 3, internal, Address Family: IPv4 Unicast
BGP Update version : 6/0, messages 0
Topology: global, highest version: 6, tail marker: 6
Format state: Current working (OK, last not in list)
Refresh blocked (not in list, last not in list)
Update messages formatted 2, replicated 2, current 0, refresh 0, limit 1000
Number of NLRIs in the update sent: max 1, min 0
Minimum time between advertisement runs is 0 seconds
Has 2 members:
2.2.2.2 6.6.6.6
Классификация проблемных ситуацийПроблемы этапа обмена данными (updates) – множество RR кластеров
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.20
https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-
bgp/200153-BGP-Route-Reflection-and-Multiple-Cluste.html
Классификация проблемных ситуацийПроблемы этапа обмена данными (updates) / prefix flapping
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.21
R1#sh ip bgp summ
BGP router identifier 1.1.1.1, local AS number 100
BGP table version is 402735, main routing table version 402735
399996 network entries using 55999440 bytes of memory
399996 path entries using 30399696 bytes of memory
40000/40000 BGP path/bestpath attribute entries using 5440000 bytes of memory
40000 BGP AS-PATH entries using 1616904 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 93456040 total bytes of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
3.3.3.3 4 100 4 41109 402735 0 0 00:00:43 0
10.0.1.254 4 99 82956 7 402471 0 0 00:04:35 399996
R1#sh ip bgp summ
BGP router identifier 1.1.1.1, local AS number 100
BGP table version is 402928, main routing table version 402928
...
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
3.3.3.3 4 100 4 41311 402938 0 0 00:00:52 0
10.0.1.254 4 99 83149 7 402471 0 0 00:04:44 399995
Классификация проблемных ситуацийПроблемы этапа обмена данными (updates) / prefix flapping
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.22
R1#sh ip route | i 00:00:0
B 128.136.139.32[20/17968] via 10.0.1.254, 00:00:01
B 128.1.169.160 [20/16430] via 10.0.1.254, 00:00:04
...
R1#sh ip bgp version recent <n>
Network Next Hop Metric LocPrf Weight Path
*> 128.136.139.32/27
10.0.1.254 17968 0 99 8124 4520 {19806} e
*> 128.170.223.192/27
10.0.1.254 9866 0 99 23700 5437 e
R1#sh ip bgp 128.136.139.32/27
BGP routing table entry for 128.136.139.32/27, version 412867
Paths: (1 available, best #1, table default)
Not advertised to any peer
Refresh Epoch 1
99 8124 4520 {19806}
10.0.1.254 from 10.0.1.254 (10.0.1.254)
Origin EGP, metric 17968, localpref 100, valid, external, best
rx pathid: 0, tx pathid: 0x0
Классификация проблемных ситуацийПроблемы этапа обмена данными (updates) – тиражирование updates
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.23
Дополнительно проблема тиражирования будет рассмотрена в
разделе «ситуаций»
Классификация проблемных ситуаций
Проблемы транспортного уровня (TCP 179);
Проблемы этапа обмена данными (updates);
Проблемы выбора best-path;
Проблемы установки маршрутов в RIB/ программирование HW
Общесистемные проблемы
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.24
Классификация проблемных ситуаций
Из расчета best-path исключаются:
1. Неверный (отсутствует или рекурсивный конфликт RIB), либо
блокированный next-hop;
2. Префикс от iBGP «не синхронизирован» (команда “sync”);
3. “Receive-only” (могут присутствовать в таблице BGP, когда настроен “soft-
reconfiguration inbound”)
Выбор best-path
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.25
Классификация проблемных ситуаций
1. WEIGHT (не передается в updates);
2. Local preference (default –eq 100, распространяется только в рамках AS);
3. Locally originated (“network”, “aggregate”) – weight 32768;
4. AS-path;
5. Origin type (IGP/EGP/INCOMPLETE);
6. MED (ряд условий и настроек);
7. eBGP over iBGP;
8. IGP metric to next-hop;
9. *Multipath (требует настройки);
10.eBGP – наиболее старый маршрут (настройки)
11.Router-id (originator-id);
12.Cluster length
13.Lowest IP-address
Алгоритм best-path
http://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13753-25.html
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.26
Классификация проблемных ситуаций
Проблемы расчет Best-path для каждого префикса:
1) Next-hop недоступен;
2) Next-hop рекурсивно указывает на BGP peer;
3) Next-hop указывает в неверном направлении;
4) Несогласованность настроек внутри одной AS (перманентная
нестабильность);
5) Более одного стабильного состояния
Алгоритм best-path
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.27
Команды:
- show ip bgp <prefix>/<mask>
- show ip cef/route <prefix>/<mask>
- show runn | section router bgp
Классификация проблемных ситуаций
iBGP может передать next-hop, который нам не известен:
BGP(0): 1.1.1.1 rcvd UPDATE w/ attr: nexthop 99.99.99.99, origin i, localpref 100, metric 0
BGP(0): 1.1.1.1 rcvd 10.0.1.0/24
BGP(0): no valid path for 10.0.1.0/24
R3#sh ip bgp 10.0.1.0/24
BGP routing table entry for 10.0.1.0/24, version 5
Paths: (1 available, no best path)
Not advertised to any peer
Local
99.99.99.99 (inaccessible) from 1.1.1.1 (1.1.1.1)
Алгоритм best-path / проблемы Next-hop - недоступен
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.28
Классификация проблемных ситуаций
BGP может передать next-hop, рекурсивно указывающий на себя:
R3# sh ip bgp
Network Next Hop Metric LocPrf Weight Path
* 1.1.1.1/32 10.0.1.253 0 0 100 i
*> 10.0.1.0/24 10.0.1.253 0 0 100 I
R3#sh ip bgp 10.0.1.0/24
10.0.1.253 from 10.0.13.1 (1.1.1.1)
Origin IGP, metric 0, localpref 100, valid, external, best
R3#sh ip bgp 1.1.1.1/32
Paths: (1 available, no best path)
Not advertised to any peer
10.0.1.253 (inaccessible) from 10.0.13.1 (1.1.1.1)
Origin IGP, metric 0, localpref 100, valid, external
rx pathid: 0, tx pathid: 0
R3#sh ip cef 10.0.1.253 det
10.0.1.253/32, epoch 0
1 RR source [active source]
Dependent covered prefix type rr, cover 10.0.1.0/24
recursive via 10.0.1.0/24, unresolved
Алгоритм best-path / проблемы Next-hop – проблема рекурсии
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.29
Классификация проблемных ситуаций
Либо next-hop может вести не туда, куда мы ожидаем:
R3#sh ip route 10.0.1.0
Routing entry for 10.0.1.0/24
Known via "bgp 100", distance 200, metric 0, type internal
Last update from 99.99.99.99 00:03:08 ago
Routing Descriptor Blocks:
* 99.99.99.99, from 1.1.1.1, 00:03:08 ago
R3#sh ip cef 10.0.1.0 detail
10.0.1.0/24, epoch 0, flags rib only nolabel, rib defined all labels
recursive via 99.99.99.99
recursive via 99.0.0.0/8
nexthop 10.0.3.253 Ethernet0/0
nexthop 10.0.3.254 Ethernet0/0
Алгоритм best-path / проблемы Next-hop
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.30
Классификация проблемных ситуацийАлгоритм best-path / нестабильные состояния
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.31
Несогласованность настроек MED может вести к постоянным пересчетам
BGP:
• “bgp always-compare-med”;
• “bgp deterministic-med”:
• IOS – выключен;
• IOS-XR – включен;
http://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-
bgp/13759-37.html
Классификация проблемных ситуаций
Проблема: существование более одного потенциального стабильного
состояния существенно усложняет troubleshooting и делает
практически невозможным “baseline-анализ”.
• Проблема стабильных состояний BGP
хорошо (и с примерами) описана в RFC 4264 “BGP Wedgies”
• Проблема стабильных состояний сети (проблема дизайна)
как правило, возникает в случаях явного и неявного redistribute
Алгоритм best-path / более одного стабильного состояния
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.32
Классификация проблемных ситуацийАлгоритм best-path / проблема дизайна
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.33
Сценарий EIGRP:
Префикс 10.0.1.0/24 получен по eBGP (от R3).
Префикс 10.0.1.0/24 получен по IGP (от R1).
На R2 команда BGP “network 10.0.1.0 mask 255.255.255.0”
Сценарий OSPF:
Префикс 10.0.0.0/8 получен по eBGP (от R3)
На R2 OSPF : “area 0 range 10.0.0.0 255.0.0.0”
На R2 команда BGP “network 10.0.0.0 mask 255.0.0.0”
Классификация проблемных ситуаций
BGP first:
R2#
Network Next Hop Metric LocPrf Weight Path
*> 10.0.1.0/24 10.0.23.3 0 0 33 i
R2#sh ip route 10.0.1.0
Routing entry for 10.0.1.0/24
Known via "bgp 22", distance 20, metric 0
Tag 33, type external
Алгоритм best-path / проблема дизайна
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.34
EIGRP first:
R2#
Network Next Hop Metric LocPrf Weight Path
* 10.0.1.0/24 10.0.23.3 0 0 33 i
*> 10.0.12.1 156160 32768 I
R2#sh ip route 10.0.1.0
Routing entry for 10.0.1.0/24
Known via "eigrp 1", distance 170, metric 156160, type external
Redistributing via eigrp 1
Advertised by bgp 22
Классификация проблемных ситуаций
Проблемы транспортного уровня (TCP 179);
Проблемы этапа обмена данными (updates);
Проблемы выбора best-path;
Проблемы быстрой сходимости и установки маршрутов в
RIB/FIB
Общесистемные проблемы
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.35
Классификация проблемных ситуаций
1) Большое время “failure detection”;
2) Большое время control plane convergence;
3) Большое время установки маршрутов в FIB
Рекомендации по теме:
BRKIPM-2265 – Deploying BGP Fast Convergence
Проблемы быстрой сходимости и установки маршрутов в RIB/FIB
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.36
Классификация проблемных ситуаций
Проблемы транспортного уровня (TCP 179);
Проблемы этапа обмена данными (updates);
Проблемы выбора best-path;
Проблемы быстрой сходимости и установки маршрутов в RIB/FIB
Общесистемные проблемы
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.37
Классификация проблемных ситуаций
1) High CPU “BGP Router“
2) High CPU “BGP Scanner“
3) Высокая загрузка памяти
Рекомендации по теме:
http://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-
bgp/107615-highcpu-bgp.html
http://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-
bgp/12512-41.html
Общесистемный проблемы
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.38
Классификация проблемных ситуаций
#show proc cpu sort | I BGP
Общесистемный проблемы / процессы BGP
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.39
Процесс Описание Интервал
BGP Router Расчет best path, контроль
получения\отправки updates, обновления
RIB
По факту
события
BGP Scanner Проверка BGP table на предмет
доступности next-hop; проверка условного
анонса префиксов,route dampening,
1 раз в
минуту
BGP I/O Обработка пакетов BGP (update/keepalive) По факту
события
Классификация проблемных ситуаций
Дополнительные ссылки по теме:
https://tools.ietf.org/html/rfc4271
http://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/22166-bgp-trouble-main.html
http://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/19345-bgp-noad.html
http://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/19167-bgp-rec-routing.html
https://supportforums.cisco.com/discussion/12576981/ask-expert-configuring-and-troubleshooting-border-gateway-protocol-bgp
Резюме
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.40
Agenda
• Классификация проблемных ситуаций
• Детали конкретных случаев
• Рекомендации: как [не] следует делать
• Q&A
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.41
Детали случаевПример 1 – BGP flapping
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.42
13:38:46.588: %BGP-5-ADJCHANGE: neighbor 6.6.6.6 Up
13:39:22.231: %BGP-5-NBR_RESET: Neighbor 6.6.6.6 reset (Peer closed the session)
13:39:22.231: %BGP-3-NOTIFICATION: received from neighbor 6.6.6.6 4/0 (hold time expired) 0 bytes
13:39:22.232: %BGP-5-ADJCHANGE: neighbor 6.6.6.6 Down Peer closed the session
13:39:22.232: %BGP_SESSION-5-ADJCHANGE: neighbor 6.6.6.6 IPv4 Unicast topology base removed from session
Peer closed the session
13:39:35.750: %BGP-5-ADJCHANGE: neighbor 6.6.6.6 Up
13:40:11.361: %BGP-3-NOTIFICATION: received from neighbor 6.6.6.6 4/0 (hold time expired) 0 bytes
13:40:11.361: %BGP-5-NBR_RESET: Neighbor 6.6.6.6 reset (BGP Notification received)
13:40:11.362: %BGP-5-ADJCHANGE: neighbor 6.6.6.6 Down BGP Notification received
13:40:11.362: %BGP_SESSION-5-ADJCHANGE: neighbor 6.6.6.6 IPv4 Unicast topology base removed from session
BGP Notification received
13:40:20.726: %BGP-5-ADJCHANGE: neighbor 6.6.6.6 Up
Timers 10/35
Детали случаевПример 1 – BGP flapping
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.43
R1# sh ip bgp summ
BGP router identifier 1.1.1.1, local AS number 100
BGP table version is 2000001, main routing table version 2000001
400000 network entries using 56000000 bytes of memory
400000 path entries using 30400000 bytes of memory
40000/40000 BGP path/bestpath attribute entries using 5440000 bytes of memory
40000 BGP AS-PATH entries using 1616904 bytes of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
3.3.3.3 4 100 41 81734 2000001 0 0 00:35:22 0
6.6.6.6 4 100 4 14 1 0 999 00:00:05 0
10.0.1.254 4 99 40020 24 2000001 0 0 00:18:23 400000
R1#ping 6.6.6.6 so 1.1.1.1 si 1500 df
Sending 5, 1500-byte ICMP Echos to 6.6.6.6, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
Packet sent with the DF bit set
.....
Success rate is 0 percent (0/5)
http://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/116377-troubleshoot-bgp-mtu.html
Детали случаевПример 2 – несоответствие количества маршрутов на BGP соседях
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.44
R3#sh ip bgp summ
BGP table version is 1, main routing table version 1
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
1.1.1.1 4 100 93595 59 1 0 0 00:51:30 113500
R6#sh ip bgp summ
BGP table version is 1, main routing table version 1
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
1.1.1.1 4 100 50810 50 1 0 0 00:07:25 113500
R1#sh ip bgp summ
BGP table version is 2800001, main routing table version 2800001
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
3.3.3.3 4 100 59 93547 2405131 0 0 00:51:29 0
6.6.6.6 4 100 50 50808 2405131 0 1000 00:07:24 0
10.0.1.254 4 99 40006 9 2800001 0 0 00:04:35 400000
Детали случаевПример 2 – несоответствие маршрутов
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.45
R1#sh ip bgp summ | b Nei
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
3.3.3.3 4 100 62 108719 2405131 0 0 00:54:13 0
6.6.6.6 4 100 67 65980 2405131 0 1000 00:10:08 0
10.0.1.254 4 99 40008 11 2800001 0 0 00:07:19 400000
R1#
R1#sh ip bgp summ | b Nei
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
3.3.3.3 4 100 63 110385 2405131 0 0 00:54:30 0
6.6.6.6 4 100 69 67646 2405131 0 1000 00:10:25 0
10.0.1.254 4 99 40009 12 2800001 0 0 00:07:37 400000
R1#sh ip bgp update-group
BGP version 4 update-group 1, internal, Address Family: IPv4 Unicast
BGP Update version : 2405131/2800001, messages 1000
Topology: global, highest version: 2800001, tail marker: 2800001
Format state: Current blocked (no message space, last no message space)
Refresh blocked (not in list, last not in list)
Update messages formatted 208363, replicated 259705, current 1000, refresh 0, limit 1000
Number of NLRIs in the update sent: max 812, min 0
Minimum time between advertisement runs is 0 seconds
Has 2 members:
3.3.3.3 6.6.6.6
Детали случаевПример 2 – несоответствие маршрутов
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.46
R1#sh ip bgp summ
BGP router identifier 1.1.1.1, local AS number 100
BGP table version is 2800001, main routing table version 2800001
400000 network entries using 56000000 bytes of memory
400000 path entries using 30400000 bytes of memory
40000/40000 BGP path/bestpath attribute entries using 5440000 bytes of memory
40000 BGP AS-PATH entries using 1616904 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 93456904 total bytes of memory
BGP activity 834910/434910 prefixes, 1600000/1200000 paths, scan interval 60 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
3.3.3.3 4 100 74 122254 2800001 0 0 01:04:54 0
6.6.6.6 4 100 136 80551 2800001 0 0 00:20:49 0
10.0.1.254 4 99 40019 23 2800001 0 0 00:18:01 400000
http://www.cisco.com/c/en/us/td/docs/ios/ios_xe/iproute_bgp/configuration/guide/2_xe/irg_xe_book/irg_slow_peer_
xe.html
Детали случаевПример 3 – полная потеря маршрутов / проблема
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.47
R4#sh ip bgp 10.0.67.0/24
BGP routing table entry for 10.0.67.0/24, version 4
Paths: (2 available, best #2, table default)
Advertised to update-groups:
2
Refresh Epoch 1
Local, (Received from a RR-client)
7.7.7.7 (metric 21) from 7.7.7.7 (7.7.7.7)
Origin IGP, metric 0, localpref 100, valid, internal
rx pathid: 0, tx pathid: 0
Refresh Epoch 1
Local, (Received from a RR-client)
6.6.6.6 (metric 21) from 6.6.6.6 (6.6.6.6)
Origin IGP, metric 0, localpref 100, valid, internal, best
rx pathid: 0, tx pathid: 0x0
10.0.67.0/24
Детали случаевПример 3 – полная потеря маршрутов / проблема
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.48
10.0.67.0/24R4#sh ip bgp 10.0.67.0/24
BGP routing table entry for 10.0.67.0/24, version 5
Paths: (2 available, best #1, table default)
Advertised to update-groups:
2
Refresh Epoch 1
Local, (Received from a RR-client)
7.7.7.7 from 7.7.7.7 (7.7.7.7)
Origin IGP, metric 0, localpref 100, valid, internal, best
rx pathid: 0, tx pathid: 0x0
Refresh Epoch 1
Local, (Received from a RR-client)
6.6.6.6 (metric 21) from 6.6.6.6 (6.6.6.6)
Origin IGP, metric 0, localpref 100, valid, internal
rx pathid: 0, tx pathid: 0
Детали случаевПример 3 – полная потеря маршрутов / причина
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.49
R4#sh ip route 7.7.7.7
% Network not in table
R4#sh ip cef 7.7.7.7
7.7.7.7/32
nexthop 10.0.4.254 Ethernet0/3
R4#sh ip route 0.0.0.0
Routing entry for 0.0.0.0/0, supernet
Known via "static", distance 1, metric 0, candidate
default path
Routing Descriptor Blocks:
* 10.0.4.254
Route metric is 0, traffic share count is 1
Детали случаевПример 3 – полная потеря маршрутов / два варианта решения
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.50
router bgp 12345
template peer-session RRC
remote-as 12345
update-source Loopback0
exit-peer-session
!
neighbor 6.6.6.6 inherit peer-session RRC
neighbor 7.7.7.7 inherit peer-session RRC
fall-over route-map NO_DEF_GW
bgp nexthop route-map NO_DEF_GW
route-map NO_DEF_GW deny 10
match ip address prefix-list DEF_GW
route-map NO_DEF_GW permit 20
ip prefix-list DEF_GW seq 10 permit 0.0.0.0/0
Содержание
• Классификация проблемных ситуаций
• Детали конкретных случаев
• Рекомендации: как [не] следует делать
• Q&A
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.51
Рекомендации
• “Keep it simple, stupid” – избегайте излишней сложности дизайна;
• Тщательное планирование топологии (масштабируемость, надежность);
• Избегайте конфигураций со множеством стабильных состояний сети;
• Используйте community для маркировки префиксов;
• Используйте частные номера AS для private сетей;
• Быстрая сходимость за счет настройки IGP (timer 1/3 – не лучший вариант для iBGP сессии);
• Используйте BFD для быстрой сходимости eBGP или floating static;
• Избегайте присутствия 0.0.0.0/0 на iBGP роутерах, либо примите меры;
• Следите за идентичностью настроек по всей AS (deterministic-med);
• RR: используйте template peer-policy/peer-session;
• RR: используйте slow-peer detection;
• Избегайте ненужных iBGP сессий.
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.52
Основные правила troubleshooting
• Не следует поддаваться панике;
• Четко определите что является симптомом проблемы;
• Если проблема затрагивает большое количество маршрутов, выберитеодин и сфокусируйтесь на нем;
• Если проблема имеет эпизодический характер, постарайтесь найтикорреляцию с другими событиями в сети;
• Если Вы знакомы с сетью – постарайтесь сравнить наблюдаемоеповедение с baseline;
• Не зацикливайтесь на одной версии причины – старайтесьсформулировать несколько версий и, по ходу, отсеивайте неверные;
• Если обнаружилась возможность workaround – используйте ее, в этомслучае поиск и устранение root cause можно будет перенести за пределыбизнес-часов;
• Keep calm and call TAC
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.53
Q&A
Вопросы?
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.54
Video
Russian Cisco Support Community
Data CenterVoiceSecurity
Routing and Switching
Contact Center
Unified Communications
Воспользуйтесь возможностью и задайте вопросы на форуме Технической
Поддержки Cisco - http://russiansupportforum.cisco.com
Голосовая связь
Системы унифицированных коммуникаций Маршрутизация и коммутация
ВидеоКонтакт центры
Центры Обработки данных
БезопасностьCUCMCUBE
UCCX
UCCE
Telepresence
ASA VPN IPS
ISR44xx/43xx
Nexus 7000 Cat 4900
4500 76006500
VSSПротоколы маршрутизации
IOS XEIOS IOS XR
ISR ISR G2
ASR1000
FWSM
ASR90x
ASR9000
GSR12000 CRS
Ждем ваших сообщений с хештегом
#CiscoConnectRu
CiscoRu Cisco CiscoRussia CiscoRu
22.11.2015 © 2015 Cisco and/or its affiliates. All rights reserved.