|
+------------------------------------+ | TLDP | | | | | +--v---+ +-------+ +-----v-+ | R1 | | R2 | | R2 | | +---------+ +--------+ | +------+ +-------+ +-------+ 1.1.1.1 2.2.2.2 3.3.3.3 |
Не устанавливается L2VC, т.к у нас нет меток от удаленной стороны («no outgoing label»):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
root@R1> show l2circuit connections Layer-2 Circuit Connections: Legend for connection status (St) EI -- encapsulation invalid NP -- interface h/w not present MM -- mtu mismatch Dn -- down EM -- encapsulation mismatch VC-Dn -- Virtual circuit Down CM -- control-word mismatch Up -- operational VM -- vlan id mismatch CF -- Call admission control failure OL -- no outgoing label IB -- TDM incompatible bitrate NC -- intf encaps not CCC/TCC TM -- TDM misconfiguration BK -- Backup Connection ST -- Standby Connection CB -- rcvd cell-bundle size bad SP -- Static Pseudowire LD -- local site signaled down RS -- remote site standby RD -- remote site signaled down HS -- Hot-standby Connection XX -- unknown Legend for interface status Up -- operational Dn -- down Neighbor: 3.3.3.3 Interface Type St Time last up # Up trans ge-0/0/0.0(vc 1001) rmt OL |
|
root@R3> show l2circuit connections | find nei Neighbor: 1.1.1.1 Interface Type St Time last up # Up trans ge-0/0/0.0(vc 1001) rmt OL |
Это классическая ситуация, при отсутствии TLDP сессии:
|
root@R1> show ldp session 3.3.3.3 root@R1> |
Со связностью все ОК:
|
root@R1> ping 3.3.3.3 source 1.1.1.1 count 1 PING 3.3.3.3 (3.3.3.3): 56 data bytes 64 bytes from 3.3.3.3: icmp_seq=0 ttl=63 time=2.306 ms --- 3.3.3.3 ping statistics --- 1 packets transmitted, 1 packets received, 0% packet loss round-trip min/avg/max/stddev = 2.306/2.306/2.306/0.000 ms |
Попробуем выполнить telnet (хотя можно было с этого и начинать) на порт 646 на удаленной стороны, все ОК:
|
root@R1> telnet 3.3.3.3 source 1.1.1.1 port 646 Trying 3.3.3.3... Connected to 3.3.3.3. Escape character is '^]'. ^] telnet> quit Connection closed. |
Но почему-то коробка не генерирует UDP LDP Hello. Находим интерфейс через который коробка будет отправлять трафик на соседа:
|
root@R1> show route 3.3.3.3/32 exact inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 3.3.3.3/32 *[OSPF/10] 03:45:33, metric 11 > to 10.0.0.2 via ge-0/0/1.0 inet.3: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 3.3.3.3/32 *[LDP/9] 03:45:24, metric 1 > to 10.0.0.2 via ge-0/0/1.0, Push 16 |
|
root@R1> set cli timestamp Jun 23 14:53:27 CLI timestamp set to: %b %d %T |
Снимаем дамп, по умолчанию TLDP Hello ходят каждые 15сек. В дампе пусто:
|
root@R1> monitor traffic interface ge-0/0/1.0 no-resolve matching "port 646 and host 3.3.3.3" Jun 23 14:54:25 verbose output suppressed, use <detail> or <extensive> for full protocol decode Address resolution is OFF. Listening on ge-0/0/1.0, capture size 96 bytes ^C 25 packets received by filter 0 packets dropped by kernel root@R1> Jun 23 14:54:48 root@R1> set cli timestamp disable Jun 23 14:57:34 CLI timestamp disabled |
Происходит это потому-то Juniper рассматривает lo0.0 как «стандартный» интерфейс, где приземляются TLDP Hello (работает протокол LDP и создаются соседства aka LDP Discovery). Т.е чтобы коробке отправить TLDP Hello discovery пакет, нужет src адрес («transport address»), который по умолчанию равен
LDP_RID и берется с адреса lo0, нужно чтобы на этом интерфейсе был включен LDP. А использовать transport adress с lo0 для создания уже TCP TLDP сессии можно можно и без этого, например TCP сессия к R2:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
root@R1> show ldp session 2.2.2.2 detail Address: 2.2.2.2, State: Operational, Connection: Open, Hold time: 24 Session ID: 1.1.1.1:0--2.2.2.2:0 Next keepalive in 3 seconds Passive, Maximum PDU: 4096, Hold time: 30, Neighbor count: 1 Neighbor types: discovered Keepalive interval: 10, Connect retry interval: 1 Local address: 1.1.1.1, Remote address: 2.2.2.2 Up for 06:10:13 Capabilities advertised: none Capabilities received: none Protection: disabled Session flags: none Local - Restart: disabled, Helper mode: enabled Remote - Restart: disabled, Helper mode: disabled Local maximum neighbor reconnect time: 120000 msec Local maximum neighbor recovery time: 240000 msec Local Label Advertisement mode: Downstream unsolicited Remote Label Advertisement mode: Downstream unsolicited Negotiated Label Advertisement mode: Downstream unsolicited MTU discovery: disabled Nonstop routing state: Not in sync Next-hop addresses received: 10.0.0.2 2.2.2.2 10.0.1.2 |
Продолжим, LDP сейчас включен только на соседнюю коробку:
|
root@R1> show ldp interface Interface Label space ID Nbr count Next hello ge-0/0/1.0 1.1.1.1:0 1 1 |
|
root@R1> show configuration protocols ldp interface ge-0/0/1.0; |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
root@R1> show ldp overview Instance: master Reference count: 2 Router ID: 1.1.1.1 Message id: 5 Configuration sequence: 2 Deaggregate: disabled Explicit null: disabled IPv6 tunneling: disabled Strict targeted hellos: disabled Loopback if added: no Route preference: 9 Unicast transit LSP chaining: disabled P2MP transit LSP chaining: disabled Transit LSP statistics based on route statistics: disabled LDP route acknowledgement: enabled LDP mtu discovery: disabled Capabilities enabled: none Egress FEC capabilities enabled: none Downstream unsolicited Sessions: Operational: 1 Retention: liberal Control: ordered Timers: Keepalive interval: 10, Keepalive timeout: 30 Link hello interval: 5, Link hello hold time: 15 Targeted hello interval: 15, Targeted hello hold time: 45 Label withdraw delay: 60, Make before break timeout: 30 Make before break switchover delay: 3 Link protection timeout: 120 Graceful restart: Restart: disabled, Helper: enabled, Restart in process: false Reconnect time: 60000, Max neighbor reconnect time: 120000 Recovery time: 160000, Max neighbor recovery time: 240000 Traffic Engineering: Bgp igp: disabled Both ribs: disabled Mpls forwarding: disabled IGP: Tracking igp metric: disabled Sync session up delay: 10 Session protection: Session protection: disabled Session protecton timeout: 0 Interface addresses advertising: 10.0.0.1 |
Включаем LDP на интерфейсе lo0.0:
|
[edit] root@R1# set protocols ldp interface lo0.0 [edit] root@R1# commit and-quit commit complete |
Интерфейс появился в списке:
|
root@R1> show ldp interface Interface Label space ID Nbr count Next hello ge-0/0/1.0 1.1.1.1:0 1 3 lo0.0 1.1.1.1:0 1 0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
root@R1> show ldp overview Instance: master Reference count: 2 Router ID: 1.1.1.1 Message id: 8 Configuration sequence: 3 Deaggregate: disabled Explicit null: disabled IPv6 tunneling: disabled Strict targeted hellos: disabled Loopback if added: yes Route preference: 9 Unicast transit LSP chaining: disabled P2MP transit LSP chaining: disabled Transit LSP statistics based on route statistics: disabled LDP route acknowledgement: enabled LDP mtu discovery: disabled Capabilities enabled: none Egress FEC capabilities enabled: none Downstream unsolicited Sessions: Operational: 1 Retention: liberal Control: ordered Timers: Keepalive interval: 10, Keepalive timeout: 30 Link hello interval: 5, Link hello hold time: 15 Targeted hello interval: 15, Targeted hello hold time: 45 Label withdraw delay: 60, Make before break timeout: 30 Make before break switchover delay: 3 Link protection timeout: 120 Graceful restart: Restart: disabled, Helper: enabled, Restart in process: false Reconnect time: 60000, Max neighbor reconnect time: 120000 Recovery time: 160000, Max neighbor recovery time: 240000 Traffic Engineering: Bgp igp: disabled Both ribs: disabled Mpls forwarding: disabled IGP: Tracking igp metric: disabled Sync session up delay: 10 Session protection: Session protection: disabled Session protecton timeout: 0 Interface addresses advertising: 10.0.0.1 1.1.1.1 |
Также можно заметить, что колличество соседств на интерфейсе lo0 равно 1. Это происходит потому-что мы начали отправлять TLDP Hello (у нас есть L2VC к одному из соседей), а Juniper автоматически пытается установить TLDP сессию к удаленному пиру, проверим. Запускаем дамп или traceoptions для LDP:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
root@R1> monitor traffic interface ge-0/0/1.0 no-resolve detail matching "port 646 and host 3.3.3.3" Address resolution is OFF. Listening on ge-0/0/1.0, capture size 1514 bytes 15:08:52.720814 Out IP (tos 0xc0, ttl 64, id 18034, offset 0, flags [none], proto: UDP (17), length: 70) 1.1.1.1.646 > 3.3.3.3.646: LDP, Label-Space-ID: 1.1.1.1:0, pdu-length: 38 Hello Message (0x0100), length: 28, Message ID: 0x00000015, Flags: [ignore if unknown] Common Hello Parameters TLV (0x0400), length: 4, Flags: [ignore and don't forward if unknown] Hold Time: 45s, Flags: [Targeted Hello, Request for targeted Hellos] IPv4 Transport Address TLV (0x0401), length: 4, Flags: [ignore and don't forward if unknown] IPv4 Transport Address: 1.1.1.1 Configuration Sequence Number TLV (0x0402), length: 4, Flags: [ignore and don't forward if unknown] Sequence Number: 5 15:09:05.787830 Out IP (tos 0xc0, ttl 64, id 18042, offset 0, flags [none], proto: UDP (17), length: 70) 1.1.1.1.646 > 3.3.3.3.646: LDP, Label-Space-ID: 1.1.1.1:0, pdu-length: 38 Hello Message (0x0100), length: 28, Message ID: 0x00000016, Flags: [ignore if unknown] Common Hello Parameters TLV (0x0400), length: 4, Flags: [ignore and don't forward if unknown] Hold Time: 45s, Flags: [Targeted Hello, Request for targeted Hellos] IPv4 Transport Address TLV (0x0401), length: 4, Flags: [ignore and don't forward if unknown] IPv4 Transport Address: 1.1.1.1 Configuration Sequence Number TLV (0x0402), length: 4, Flags: [ignore and don't forward if unknown] Sequence Number: 5 15:09:20.159891 Out IP (tos 0xc0, ttl 64, id 18066, offset 0, flags [none], proto: UDP (17), length: 70) 1.1.1.1.646 > 3.3.3.3.646: LDP, Label-Space-ID: 1.1.1.1:0, pdu-length: 38 Hello Message (0x0100), length: 28, Message ID: 0x00000017, Flags: [ignore if unknown] Common Hello Parameters TLV (0x0400), length: 4, Flags: [ignore and don't forward if unknown] Hold Time: 45s, Flags: [Targeted Hello, Request for targeted Hellos] IPv4 Transport Address TLV (0x0401), length: 4, Flags: [ignore and don't forward if unknown] IPv4 Transport Address: 1.1.1.1 Configuration Sequence Number TLV (0x0402), length: 4, Flags: [ignore and don't forward if unknown] Sequence Number: 5 ^C 47 packets received by filter 0 packets dropped by kernel |
LDP трафик генерируется каждые 15сек +/- рандомное число, чтобы избежать коллизий/всплеска нагрузки на CPU в широковещательных средах.
|
root@R1> show ldp interface lo0.0 extensive Interface Label space ID Nbr count Next hello lo0.0 1.1.1.1:0 1 0 Hello interval: 15, Hold time: 45, Transport address: 1.1.1.1 Local hello interval: 15, Index: 325 Hello Sent: 39, Received: 0 Link Protection: Off |
Попробуем временно отключить L2VC:
|
root@R1# deactivate protocols l2circuit neighbor 3.3.3.3 [edit] root@R1# commit and-quit commit complete |
Колличество соседств рано 0:
|
root@R1> show ldp interface Interface Label space ID Nbr count Next hello ge-0/0/1.0 1.1.1.1:0 1 1 lo0.0 1.1.1.1:0 0 0 root@R1> show ldp neighbor Address Interface Label space ID Hold time 10.0.0.2 ge-0/0/1.0 2.2.2.2:0 13 |
Откатываемся:
|
root@R1# rollback 1 load complete [edit] root@R1# commit and-quit commit complete |
|
root@R1> show ldp interface Interface Label space ID Nbr count Next hello ge-0/0/1.0 1.1.1.1:0 1 4 lo0.0 1.1.1.1:0 1 0 |
Т.к не получено TLDP Hello от удаленной стороны «Label space ID» = «0.0.0.0:0»:
|
root@R1> show ldp neighbor Address Interface Label space ID Hold time 10.0.0.2 ge-0/0/1.0 2.2.2.2:0 11 3.3.3.3 lo0.0 0.0.0.0:0 0 |
Несмотря на что что удаленная сторона слушает порт, но т.к. интерфейс не включен в LDP система отбрасывает трафик:
|
root@R3> show system connections | match 646 tcp4 0 0 3.3.3.3.61496 2.2.2.2.646 ESTABLISHED tcp4 0 0 *.646 *.* LISTEN udp4 0 0 *.646 |
|
root@R3> monitor traffic interface ge-0/0/1 no-resolve matching "host 1.1.1.1" count 1 verbose output suppressed, use <detail> or <extensive> for full protocol decode Address resolution is OFF. Listening on ge-0/0/1, capture size 96 bytes 15:25:11.648522 In IP 1.1.1.1.646 > 3.3.3.3.646: LDP, Label-Space-ID: 1.1.1.1:0, pdu-length: 38 root@R3> |
|
root@R3> show ldp neighbor Address Interface Label space ID Hold time 10.0.1.2 ge-0/0/1.0 2.2.2.2:0 10 |
Добавим lo0.0 в LDP также на R3:
|
root@R3# set protocols ldp interface lo0.0 root@R3# commit and-quit commit complete |
Соседство установилось:
|
root@R1> show ldp neighbor Address Interface Label space ID Hold time 10.0.0.2 ge-0/0/1.0 2.2.2.2:0 14 3.3.3.3 lo0.0 3.3.3.3:0 42 |
TLDP сессия ОК
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
root@R1> show ldp session 3.3.3.3 detail Address: 3.3.3.3, State: Operational, Connection: Open, Hold time: 21 Session ID: 1.1.1.1:0--3.3.3.3:0 Next keepalive in 1 seconds Passive, Maximum PDU: 4096, Hold time: 30, Neighbor count: 1 Neighbor types: configured-layer2 Keepalive interval: 10, Connect retry interval: 1 Local address: 1.1.1.1, Remote address: 3.3.3.3 Up for 00:00:39 Capabilities advertised: none Capabilities received: none Protection: disabled Session flags: none Local - Restart: disabled, Helper mode: enabled Remote - Restart: disabled, Helper mode: enabled Local maximum neighbor reconnect time: 120000 msec Local maximum neighbor recovery time: 240000 msec Local Label Advertisement mode: Downstream unsolicited Remote Label Advertisement mode: Downstream unsolicited Negotiated Label Advertisement mode: Downstream unsolicited MTU discovery: disabled Nonstop routing state: Not in sync Next-hop addresses received: 3.3.3.3 10.0.1.1 |
L2VC UP:
|
root@R1> show l2circuit connections | find nei Neighbor: 3.3.3.3 Interface Type St Time last up # Up trans ge-0/0/0.0(vc 1001) rmt Up Jun 23 15:49:11 2019 1 Remote PE: 3.3.3.3, Negotiated control-word: Yes (Null) Incoming label: 299872, Outgoing label: 299776 Negotiated PW status TLV: No Local interface: ge-0/0/0.0, Status: Up, Encapsulation: VLAN Flow Label Transmit: No, Flow Label Receive: No |
IOS, XR ведут себя «попроще»:
|
R1# show mpls interfaces Interface IP Tunnel BGP Static Operational Ethernet0/0 Yes (ldp) No No No Yes Ethernet0/1 Yes (ldp) No No No Yes |
|
RP/0/RSP0/CPU0:R1# show mpls ldp interface loopback 0 Sun Jun 23 20:05:07.654 MSK Interface 'Loopback0' not found |