在本页
LDP 配置
最低 LDP 配置
启用和禁用 LDP
配置 Hello 消息的 LDP 计时器
LDP hello 消息使 LDP 节点能够相互发现,并检测邻接方或邻接方链路的故障。所有启用 LDP 的接口上都会定期发送 Hello 消息。
LDP hello 消息有两种类型:
链路 hello 消息 — 通过 LDP 接口作为寻址至 LDP 发现端口的 UDP 数据包发送。收到接口上的 LDP 链路 hello 消息会识别与 LDP 对等路由器的邻接。
定向 hello 消息 — 作为 UDP 数据包发送到特定地址的 LDP 发现端口。定向的 hello 消息用于支持非直接连接的路由器之间的 LDP 会话。目标路由器可确定是响应还是忽略有针对性的 Hello 消息。选择响应的目标路由器会定期将有针对性的 hello 消息发送回发起路由器,从而实现此目的。
默认情况下,LDP 每 5 秒发送一次链路 hello 消息,每 15 秒发送一次目标 hello 消息。您可以配置 LDP 计时器来更改这两种类型的 hello 消息的发送频率。但是,您无法为 LDP 计时器配置大于 LDP 保持时间的时间。有关更多信息,请参阅 在考虑 LDP 邻接方之前配置延迟。
为链路 Hello 消息配置 LDP 计时器
要修改 LDP 发送链路 hello 消息的频率,请使用 hello-interval
语句为 LDP 计时器指定新的链路发送消息间隔:
hello-interval seconds;
有关可包含此语句的层次结构级别列表,请参阅此语句的语句摘要部分。
为目标 Hello 消息配置 LDP 计时器
要修改 LDP 发送有目标的 hello 消息的频率,请通过将语句配置为 hello-interval
语句的选项 targeted-hello
,为 LDP 计时器指定新的目标 hello 消息间隔:
targeted-hello { hello-interval seconds; }
有关可包括这些语句的层次结构级别列表,请参阅这些语句的语句摘要部分。
在 LDP 邻接方被视为已关闭之前配置延迟
保留时间决定了 LDP 节点在声明邻接方关闭之前应等待发送 hello 消息的时间。此值作为 hello 消息的一部分发送,这样每个 LDP 节点都会告诉其邻接方等待多久。每个邻接方发送的值不必匹配。
保留时间通常应至少是发送间隔的三倍。默认情况下,链路 hello 消息为 15 秒,目标 hello 消息为 45 秒。但是,可以配置接近 hello 间隔的 LDP 保留时间。
通过将 LDP 保持时间配置为接近 hello 间隔(小于 hello 间隔的三倍),可能会更快地检测到 LDP 邻接方故障。但是,这也增加了路由器可能会声明一个 LDP 邻接方,该邻接方仍然运行正常的可能性。有关更多信息,请参阅 配置 Hello 消息的 LDP 计时器。
LDP 保持时间也会在 LDP 对等方之间自动协商。当两个 LDP 对等方相互播发不同的 LDP 保留时间时,将使用较小的值。如果 LDP 对等路由器播发的保留时间比您配置的值短,则使用对等路由器播发的暂侯时间。此协商也会影响 LDP 保持间隔。
如果在 LDP 对等方协商期间本地 LDP 保留时间未缩短,则用户配置的保持间隔不变。但是,如果在对等方协商期间缩短本地保留时间,将重新计算保持间隔。如果在对等方协商期间缩短 LDP 保留时间,则保留间隔将缩减为新保留时间值三分之一。例如,如果新的暂侯时间值是 45 秒,则保持间隔设置为 15 秒。
这种自动激活间隔计算会导致在每台对等路由器上配置不同的激活间隔。这使得路由器能够灵活地发送持续消息,因为 LDP 对等协商可确保发送频率高于 LDP 保留时间。
重新配置保留间隔时,更改直到重置会话后才会生效。当 LDP 对等会话启动时,将协商保留时间,只要会话启动,就不能重新协商(RFC 5036, LDP 规格要求)。要手动强制重置 LDP 会话,请发出 clear ldp session
命令。
配置链路 Hello 消息的 LDP 保留时间
要修改 LDP 节点在声明邻接方之前应等待链路 hello 消息的时间,请使用 hold-time
语句指定新时间(以秒为单位):
hold-time seconds;
有关可包含此语句的层次结构级别列表,请参阅此语句的语句摘要部分。
配置目标 Hello 消息的 LDP 保留时间
要修改 LDP 节点在声明邻接方之前应等待目标 hello 消息的时间,请使用语句 hold-time
作为语句的选项指定新时间(以秒为单位 targeted-hello
):
targeted-hello { hold-time seconds; }
有关可包括这些语句的层次结构级别列表,请参阅这些语句的语句摘要部分。
为 LDP 启用严格定向的 Hello 消息
使用严格的目标 hello 消息,以防止与尚未特别配置的远程邻接方建立 LDP 会话。如果配置语句 strict-targeted-hellos
,LDP 对等方不会响应来自不是其配置远程邻接方之一的来源的目标 hello 消息。配置的远程邻接方可能包括:
配置 LDP 隧道的 RSVP 隧道端点
第 2 层电路邻接方
如果未配置的邻接方发送了 hello 消息,LDP 对等方将忽略此消息并记录一个错误(带有 error
跟踪标志),指示源。例如,如果 LDP 对等方从互联网地址 10.0.0.1 收到目标问候,并且未特别配置此地址的邻接方,则向 LDP 日志文件打印以下消息:
LDP: Ignoring targeted hello from 10.0.0.1
要启用严格定向的 hello 消息,请包括以下 strict-targeted-hellos
语句:
strict-targeted-hellos;
有关可包含此语句的层次结构级别列表,请参阅此语句的语句摘要部分。
配置 LDP 激活消息的间隔
keepalive 间隔决定了在会话中发送消息的频率,以确保不会超过激活超时。如果在此期间没有通过会话发送其他 LDP 流量,则会发送一条激活消息。默认为 10 秒。最小为 1 秒。
如果为对等路由器上的 LDP 保持时间配置的值低于本地配置的值,则为 keepalive 间隔配置的值可以在 LDP 会话协商期间更改。有关更多信息,请参阅 在考虑 LDP 邻接方之前配置延迟。
要修改 keepalive 间隔,请包括以下 keepalive-interval
语句:
keepalive-interval seconds;
有关可包含此语句的层次结构级别列表,请参阅此语句的语句摘要部分。
配置 LDP 保持超时
建立 LDP 会话后,必须定期交换消息,以确保会话仍然工作。保持超时用于定义邻接方 LDP 节点在确定会话失败之前等待的时间量。此值通常设置为至少保持间隔的三倍。默认为 30 秒。
要修改 keepalive 间隔,请包括以下 keepalive-timeout
语句:
keepalive-timeout seconds;
有关可包含此语句的层次结构级别列表,请参阅此语句的语句摘要部分。
为 keepalive-timeout
语句配置的值显示为发出 show ldp session detail
命令时的保留时间。
为 LDP 配置最长匹配
为了让 LDP 能够学习跨 OSPF 区域或跨域间 ISIS 级别的聚合或汇总的路由,Junos OS 允许您基于 RFC5283 为 LDP 配置最长匹配。
为 LDP 配置最长匹配之前,必须请执行以下操作:
配置设备接口。
配置 MPLS 协议。
配置 OSPF 协议。
要为 LDP 配置最长匹配项,必须请执行以下操作:
示例:为 LDP 配置最长匹配
此示例说明如何基于 RFC5283 为 LDP 配置最长匹配项。这允许 LDP 了解跨 OSPF 区域或域间 ISIS 级别的聚合或汇总的路由。每个前缀的精细度提供最长的匹配策略。
要求
此示例使用以下硬件和软件组件:
6 台具有 OSPF 协议的 MX 系列路由器,并在连接的接口上启用 LDP。
在所有设备上运行的 Junos OS 16.1 或更高版本。
开始之前:
配置设备接口。
配置 OSPF。
概述
LDP 通常用于使用 OSPF 或 IS-IS 等 IGP 在整个网络域中建立 MPLS 标签交换路径 (LSP)。在这样的网络中,域中的所有链路都有 IGP 邻接和 LDP 邻接。LDP 在 IP 转发确定的目标最短路径上建立 LSP。在 Junos OS 中,LDP 实施对 RIB 或 IGP 路由中 FEC 的 IP 地址执行精确匹配查找,以便进行标签映射。这种确切映射要求在所有 LE 中配置 MPLS 端到端 LDP 端点 IP 地址。这会破坏接入设备中的 IP 分层设计或默认路由的目的。配置 longest-match
通过抑制确切的匹配行为并基于每个前缀最长的匹配路由设置 LSP,有助于克服这一难题。
配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到层级的 [edit] CLI 中,然后从配置模式进入 commit
。
R0
set interfaces ge-0/0/0 unit 0 family inet address 22.22.22.1/24 set interfaces ge-0/0/1 unit 0 family inet address 15.15.15.1/24 set interfaces ge-0/0/2 unit 0 family inet address 11.11.11.1/24 set interfaces ge-0/0/2 unit 0 family iso set interfaces ge-0/0/2 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.112.1/32 primary set interfaces lo0 unit 0 family inet address 10.255.112.1/32 preferred set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0001.00 set routing-options router-id 10.255.112.1 set protocols mpls interface ge-0/0/2.0 set protocols ospf area 0.0.0.1 interface ge-0/0/2.0 set protocols ospf area 0.0.0.1 interface lo0.0 passive set protocols ldp longest-match set protocols ldp interface ge-0/0/2.0 set protocols ldp interface lo0.0
R1
set interfaces ge-0/0/0 unit 0 family inet address 11.11.11.2/24 set interfaces ge-0/0/0 unit 0 family iso set interfaces ge-0/0/0 unit 0 family mpls set interfaces ge-0/0/1 unit 0 family inet address 12.12.12.1/24 set interfaces ge-0/0/1 unit 0 family iso set interfaces ge-0/0/1 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.112.2/32 primary set interfaces lo0 unit 0 family inet address 10.255.112.2/32 preferred set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0002.00 set routing-options router-id 10.255.112.2 set protocols mpls interface ge-0/0/0.0 set protocols mpls interface ge-0/0/1.0 set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ospf area 0.0.0.1 interface ge-0/0/0.0 set protocols ldp longest-match set protocols ldp interface ge-0/0/0.0 set protocols ldp interface ge-0/0/1.0 set protocols ldp interface lo0.0
R2
set interfaces ge-0/0/0 unit 0 family inet address 24.24.24.1/24 set interfaces ge-0/0/0 unit 0 family iso set interfaces ge-0/0/0 unit 0 family mpls set interfaces ge-0/0/1 unit 0 family inet address 12.12.12.2/24 set interfaces ge-0/0/1 unit 0 family iso set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 23.23.23.1/24 set interfaces ge-0/0/2 unit 0 family iso set interfaces ge-0/0/2 unit 0 family mpls set interfaces ge-0/0/3 unit 0 family inet address 22.22.22.2/24 set interfaces ge-0/0/4 unit 0 family inet address 25.25.25.1/24 set interfaces ge-0/0/4 unit 0 family iso set interfaces ge-0/0/4 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.111.4/32 primary set interfaces lo0 unit 0 family inet address 10.255.111.4/32 preferred set interfaces lo0 unit 0 family iso address 49.0003.0192.0168.0003.00 set routing-options router-id 10.255.111.4 set protocols mpls interface ge-0/0/1.0 set protocols mpls interface ge-0/0/2.0 set protocols mpls interface ge-0/0/0.0 set protocols mpls interface ge-0/0/4.0 set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ospf area 0.0.0.2 area-range 10.255.111.0/24 set protocols ospf area 0.0.0.2 interface ge-0/0/2.0 set protocols ospf area 0.0.0.2 interface ge-0/0/0.0 set protocols ospf area 0.0.0.2 interface ge-0/0/4.0 set protocols ldp interface ge-0/0/0.0 set protocols ldp interface ge-0/0/1.0 set protocols ldp interface ge-0/0/2.0 set protocols ldp interface ge-0/0/4.0 set protocols ldp interface lo0.0
R3
set interfaces ge-0/0/0 unit 0 family inet address 35.35.35.1/24 set interfaces ge-0/0/0 unit 0 family iso set interfaces ge-0/0/0 unit 0 family mpls set interfaces ge-0/0/1 unit 0 family inet address 23.23.23.2/24 set interfaces ge-0/0/1 unit 0 family iso set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 34.34.34.1/24 set interfaces ge-0/0/2 unit 0 family iso set interfaces ge-0/0/2 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.111.1/32 primary set interfaces lo0 unit 0 family inet address 10.255.111.1/32 preferred set interfaces lo0 unit 0 family iso address 49.0003.0192.0168.0004.00 set routing-options router-id 10.255.111.1 set protocols mpls interface ge-0/0/1.0 set protocols ospf area 0.0.0.2 interface ge-0/0/1.0 set protocols ospf area 0.0.0.2 interface fxp0.0 disable set protocols ospf area 0.0.0.2 interface lo0.0 passive set protocols ldp interface ge-0/0/1.0 set protocols ldp interface lo0.0
R4
set interfaces ge-0/0/0 unit 0 family inet address 45.45.45.1/24 set interfaces ge-0/0/0 unit 0 family iso set interfaces ge-0/0/0 unit 0 family mpls set interfaces ge-0/0/1 unit 0 family inet address 24.24.24.2/24 set interfaces ge-0/0/1 unit 0 family iso set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 34.34.34.2/24 set interfaces ge-0/0/2 unit 0 family iso set interfaces ge-0/0/2 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.111.2/32 primary set interfaces lo0 unit 0 family inet address 10.255.111.2/32 preferred set interfaces lo0 unit 0 family iso address 49.0003.0192.0168.0005.00 set routing-options router-id 10.255.111.2 set protocols mpls interface ge-0/0/1.0 set protocols ospf area 0.0.0.2 interface ge-0/0/1.0 set protocols ospf area 0.0.0.2 interface fxp0.0 disable set protocols ospf area 0.0.0.2 interface lo0.0 passive set protocols ldp interface ge-0/0/1.0 set protocols ldp interface lo0.0
R5
set interfaces ge-0/0/0 unit 0 family inet address 25.25.25.2/24 set interfaces ge-0/0/0 unit 0 family iso set interfaces ge-0/0/0 unit 0 family mpls set interfaces ge-0/0/1 unit 0 family inet address 15.15.15.2/24 set interfaces ge-0/0/2 unit 0 family inet address 35.35.35.2/24 set interfaces ge-0/0/3 unit 0 family inet address 45.45.45.2/24 set interfaces ge-0/0/3 unit 0 family iso set interfaces ge-0/0/3 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.111.3/32 primary set interfaces lo0 unit 0 family inet address 10.255.111.3/32 preferred set interfaces lo0 unit 0 family iso address 49.0003.0192.0168.0006.00 set routing-options router-id 10.255.111.3 set protocols mpls interface ge-0/0/0.0 set protocols ospf area 0.0.0.2 interface ge-0/0/0.0 set protocols ospf area 0.0.0.2 interface fxp0.0 disable set protocols ospf area 0.0.0.2 interface lo0.0 passive set protocols ldp interface ge-0/0/0.0 set protocols ldp interface lo0.0
配置设备 R0
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用CLI 编辑器。
要配置设备 R0:
配置接口。
[edit interfaces] set ge-0/0/0 unit 0 family inet address 22.22.22.1/24 set ge-0/0/1 unit 0 family inet address 15.15.15.1/24 set ge-0/0/2 unit 0 family inet address 11.11.11.1/24 set ge-0/0/2 unit 0 family iso set ge-0/0/2 unit 0 family mpls
为设备分配环路地址。
[edit interfaces lo0 unit 0 family] set inet address 10.255.112.1/32 primary set inet address 10.255.112.1/32 preferred set iso address 49.0002.0192.0168.0001.00
配置路由器 ID。
[edit routing-options] set router-id 10.255.112.1
在接口上配置 MPLS 协议。
[edit protocols mpls] set interface ge-0/0/2.0
在接口上配置 OSPF 协议。
[edit protocols ospf] set area 0.0.0.1 interface ge-0/0/2.0 set area 0.0.0.1 interface lo0.0 passive
为 LDP 协议配置最长匹配。
[edit protocols ldp] set longest-match
在接口上配置 LDP 协议。
[edit protocols ldp] set interface ge-0/0/2.0 set interface lo0.0
结果
在配置模式下,输入 、 show protocols和show routing-options命令,show interfaces以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@R0# show interfaces ge-0/0/0 { unit 0 { family inet { address 22.22.22.1/24; } } } ge-0/0/1 { unit 0 { family inet { address 15.15.15.1/24; } } } ge-0/0/2 { unit 0 { family inet { address 11.11.11.1/24; } family iso; family mpls; } } lo0 { unit 0 { family inet { address 10.255.112.1/32 { primary; preferred; } } family iso { address 49.0002.0192.0168.0001.00; } } }
user@R0# show protocols mpls { interface ge-0/0/2.0; } ospf { area 0.0.0.1 { interface ge-0/0/2.0; interface lo0.0 { passive; } } } ldp { longest-match; interface ge-0/0/2.0; interface lo0.0; }
user@R0# show routing-options router-id 10.255.112.1;
完成设备配置后,请从配置模式进入 commit
。
验证
确认配置工作正常。
验证路由
目的
验证是否已学习到预期的路由。
行动
在设备 R0 上,从操作模式运行 show route
命令以显示路由表中的路由。
user@R0> show route
inet.0: 62 destinations, 62 routes (62 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
10.4.0.0/16 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.5.0.0/16 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.6.128.0/17 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.9.0.0/16 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.10.0.0/16 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.13.4.0/23 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.13.10.0/23 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.82.0.0/15 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.84.0.0/16 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.85.12.0/22 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.92.0.0/16 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.92.16.0/20 *[Direct/0] 10:08:01
> via fxp0.0
10.92.20.175/32 *[Local/0] 10:08:01
Local via fxp0.0
10.94.0.0/16 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.99.0.0/16 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.102.0.0/16 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.150.0.0/16 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.155.0.0/16 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.157.64.0/19 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.160.0.0/16 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.204.0.0/16 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.205.0.0/16 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.206.0.0/16 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.207.0.0/16 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.209.0.0/16 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.212.0.0/16 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.213.0.0/16 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.214.0.0/16 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.215.0.0/16 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.216.0.0/16 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.218.13.0/24 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.218.14.0/24 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.218.16.0/20 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.218.32.0/20 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.227.0.0/16 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
10.255.111.0/24 *[OSPF/10] 09:52:14, metric 3
> to 11.11.11.2 via ge-0/0/2.0
10.255.111.4/32 *[OSPF/10] 09:54:10, metric 2
> to 11.11.11.2 via ge-0/0/2.0
10.255.112.1/32 *[Direct/0] 09:55:05
> via lo0.0
10.255.112.2/32 *[OSPF/10] 09:54:18, metric 1
> to 11.11.11.2 via ge-0/0/2.0
11.11.11.0/24 *[Direct/0] 09:55:05
> via ge-0/0/2.0
11.11.11.1/32 *[Local/0] 09:55:05
Local via ge-0/0/2.0
12.12.12.0/24 *[OSPF/10] 09:54:18, metric 2
> to 11.11.11.2 via ge-0/0/2.0
15.15.15.0/24 *[Direct/0] 09:55:05
> via ge-0/0/1.0
15.15.15.1/32 *[Local/0] 09:55:05
Local via ge-0/0/1.0
22.22.22.0/24 *[Direct/0] 09:55:05
> via ge-0/0/0.0
22.22.22.1/32 *[Local/0] 09:55:05
Local via ge-0/0/0.0
23.23.23.0/24 *[OSPF/10] 09:54:10, metric 3
> to 11.11.11.2 via ge-0/0/2.0
24.24.24.0/24 *[OSPF/10] 09:54:10, metric 3
> to 11.11.11.2 via ge-0/0/2.0
25.25.25.0/24 *[OSPF/10] 09:54:10, metric 3
> to 11.11.11.2 via ge-0/0/2.0
128.92.17.45/32 *[OSPF/10] 09:54:05, metric 3
> to 11.11.11.2 via ge-0/0/2.0
128.92.20.175/32 *[Direct/0] 10:08:01
> via lo0.0
128.92.21.186/32 *[OSPF/10] 09:54:10, metric 3
> to 11.11.11.2 via ge-0/0/2.0
128.92.25.135/32 *[OSPF/10] 09:54:10, metric 3
> to 11.11.11.2 via ge-0/0/2.0
128.92.27.91/32 *[OSPF/10] 09:54:18, metric 1
> to 11.11.11.2 via ge-0/0/2.0
128.92.28.70/32 *[OSPF/10] 09:54:10, metric 2
> to 11.11.11.2 via ge-0/0/2.0
172.16.0.0/12 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
192.168.0.0/16 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
192.168.102.0/23 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
207.17.136.0/24 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
207.17.136.192/32 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
207.17.137.0/24 *[Static/5] 10:08:01
> to 10.92.31.254 via fxp0.0
224.0.0.5/32 *[OSPF/10] 09:55:05, metric 1
MultiRecv
inet.3: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
10.255.111.1/32 *[LDP/9] 09:41:03, metric 3
> to 11.11.11.2 via ge-0/0/2.0, Push 300128
10.255.111.2/32 *[LDP/9] 09:41:03, metric 3
> to 11.11.11.2 via ge-0/0/2.0, Push 300144
10.255.111.3/32 *[LDP/9] 09:41:03, metric 3
> to 11.11.11.2 via ge-0/0/2.0, Push 300160
10.255.111.4/32 *[LDP/9] 09:54:10, metric 2, tag 0
> to 11.11.11.2 via ge-0/0/2.0, Push 300000
10.255.112.2/32 *[LDP/9] 09:54:48, metric 1, tag 0
> to 11.11.11.2 via ge-0/0/2.0
iso.0: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
47.0005.80ff.f800.0000.0108.0001.1280.9202.0175/152
*[Direct/0] 10:08:01
> via lo0.0
49.0002.0192.0168.0001/72
*[Direct/0] 09:55:05
> via lo0.0
mpls.0: 10 destinations, 10 routes (10 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
0 *[MPLS/0] 09:55:05, metric 1
Receive
1 *[MPLS/0] 09:55:05, metric 1
Receive
2 *[MPLS/0] 09:55:05, metric 1
Receive
13 *[MPLS/0] 09:55:05, metric 1
Receive
300064 *[LDP/9] 09:54:48, metric 1
> to 11.11.11.2 via ge-0/0/2.0, Pop
300064(S=0) *[LDP/9] 09:54:48, metric 1
> to 11.11.11.2 via ge-0/0/2.0, Pop
300112 *[LDP/9] 09:54:10, metric 2, tag 0
> to 11.11.11.2 via ge-0/0/2.0, Swap 300000
300192 *[LDP/9] 09:41:03, metric 3
> to 11.11.11.2 via ge-0/0/2.0, Swap 300128
300208 *[LDP/9] 09:41:03, metric 3
> to 11.11.11.2 via ge-0/0/2.0, Swap 300144
300224 *[LDP/9] 09:41:03, metric 3
> to 11.11.11.2 via ge-0/0/2.0, Swap 300160
inet6.0: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
abcd::128:92:20:175/128
*[Direct/0] 10:08:01
> via lo0.0
fe80::5668:a50f:fcc1:1f9c/128
*[Direct/0] 10:08:01
> via lo0.0
含义
输出显示设备 R0 路由表中的所有路由。
验证 LDP 概述信息
目的
显示 LDP 概述信息。
行动
在设备 R0 上,从操作模式运行 show ldp overview
命令以显示 LDP 的概述。
user@R0> show ldp overview
Instance: master
Reference count: 2
Router ID: 10.255.112.1
Message id: 8
Configuration sequence: 6
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
Longest Match: enabled
Capabilities enabled: none
Egress FEC capabilities enabled: entropy-label-capability
Downstream unsolicited Sessions:
Operational: 1
Retention: liberal
Control: ordered
Auto targeted sessions:
Auto targeted: disabled
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 protection timeout: 0
Interface addresses advertising:
11.11.11.1
10.255.112.1
128.92.20.175
Label allocation:
Current number of LDP labels allocated: 5
Total number of LDP labels allocated: 11
Total number of LDP labels freed: 6
Total number of LDP label allocation failure: 0
Current number of labels allocated by all protocols: 5
含义
输出显示设备 R0 的 LDP 概述信息
验证内部拓扑表中的 LDP 条目
目的
显示标签分发协议 (LDP) 内部拓扑表中的路由条目。
行动
在设备 R0 上,从操作模式运行 show ldp route
命令以显示 LDP 的内部拓扑表。
user@R0> show ldp route
Destination Next-hop intf/lsp/table Next-hop address
10.4.0.0/16 fxp0.0 10.92.31.254
10.5.0.0/16 fxp0.0 10.92.31.254
10.6.128.0/17 fxp0.0 10.92.31.254
10.9.0.0/16 fxp0.0 10.92.31.254
10.10.0.0/16 fxp0.0 10.92.31.254
10.13.4.0/23 fxp0.0 10.92.31.254
10.13.10.0/23 fxp0.0 10.92.31.254
10.82.0.0/15 fxp0.0 10.92.31.254
10.84.0.0/16 fxp0.0 10.92.31.254
10.85.12.0/22 fxp0.0 10.92.31.254
10.92.0.0/16 fxp0.0 10.92.31.254
10.92.16.0/20 fxp0.0
10.92.20.175/32
10.94.0.0/16 fxp0.0 10.92.31.254
10.99.0.0/16 fxp0.0 10.92.31.254
10.102.0.0/16 fxp0.0 10.92.31.254
10.150.0.0/16 fxp0.0 10.92.31.254
10.155.0.0/16 fxp0.0 10.92.31.254
10.157.64.0/19 fxp0.0 10.92.31.254
10.160.0.0/16 fxp0.0 10.92.31.254
10.204.0.0/16 fxp0.0 10.92.31.254
10.205.0.0/16 fxp0.0 10.92.31.254
10.206.0.0/16 fxp0.0 10.92.31.254
10.207.0.0/16 fxp0.0 10.92.31.254
10.209.0.0/16 fxp0.0 10.92.31.254
10.212.0.0/16 fxp0.0 10.92.31.254
10.213.0.0/16 fxp0.0 10.92.31.254
10.214.0.0/16 fxp0.0 10.92.31.254
10.215.0.0/16 fxp0.0 10.92.31.254
10.216.0.0/16 fxp0.0 10.92.31.254
10.218.13.0/24 fxp0.0 10.92.31.254
10.218.14.0/24 fxp0.0 10.92.31.254
10.218.16.0/20 fxp0.0 10.92.31.254
10.218.32.0/20 fxp0.0 10.92.31.254
10.227.0.0/16 fxp0.0 10.92.31.254
10.255.111.0/24 ge-0/0/2.0 11.11.11.2
10.255.111.4/32 ge-0/0/2.0 11.11.11.2
10.255.112.1/32 lo0.0
10.255.112.2/32 ge-0/0/2.0 11.11.11.2
11.11.11.0/24 ge-0/0/2.0
11.11.11.1/32
12.12.12.0/24 ge-0/0/2.0 11.11.11.2
15.15.15.0/24 ge-0/0/1.0
15.15.15.1/32
22.22.22.0/24 ge-0/0/0.0
22.22.22.1/32
23.23.23.0/24 ge-0/0/2.0 11.11.11.2
24.24.24.0/24 ge-0/0/2.0 11.11.11.2
25.25.25.0/24 ge-0/0/2.0 11.11.11.2
128.92.17.45/32 ge-0/0/2.0 11.11.11.2
128.92.20.175/32 lo0.0
128.92.21.186/32 ge-0/0/2.0 11.11.11.2
128.92.25.135/32 ge-0/0/2.0 11.11.11.2
128.92.27.91/32 ge-0/0/2.0 11.11.11.2
128.92.28.70/32 ge-0/0/2.0 11.11.11.2
172.16.0.0/12 fxp0.0 10.92.31.254
192.168.0.0/16 fxp0.0 10.92.31.254
192.168.102.0/23 fxp0.0 10.92.31.254
207.17.136.0/24 fxp0.0 10.92.31.254
207.17.136.192/32 fxp0.0 10.92.31.254
207.17.137.0/24 fxp0.0 10.92.31.254
224.0.0.5/32
含义
输出显示设备 R0 的标签分配协议 (LDP) 内部拓扑表中的路由条目。
仅验证 LDP 路由的 FEC 信息
目的
仅显示 LDP 路由的 FEC 信息。
行动
在设备 R0 上,从操作模式运行 show ldp route fec-only
命令以显示路由表中的路由。
user@R0> show ldp route fec-only
Destination Next-hop intf/lsp/table Next-hop address
10.255.111.1/32 ge-0/0/2.0 11.11.11.2
10.255.111.2/32 ge-0/0/2.0 11.11.11.2
10.255.111.3/32 ge-0/0/2.0 11.11.11.2
10.255.111.4/32 ge-0/0/2.0 11.11.11.2
10.255.112.1/32 lo0.0
10.255.112.2/32 ge-0/0/2.0 11.11.11.2
含义
输出仅显示可用于设备 R0 的 LDP 协议的 FEC 路由。
验证 LDP 的 FEC 和影子路由
目的
显示路由表中的 FEC 和影子路由。
行动
在设备 R0 上,从操作模式运行 show ldp route fec-and-route
命令以显示路由表中的 FEC 和影子路由。
user@R0> show ldp route fec-and-route
Destination Next-hop intf/lsp/table Next-hop address
10.4.0.0/16 fxp0.0 10.92.31.254
10.5.0.0/16 fxp0.0 10.92.31.254
10.6.128.0/17 fxp0.0 10.92.31.254
10.9.0.0/16 fxp0.0 10.92.31.254
10.10.0.0/16 fxp0.0 10.92.31.254
10.13.4.0/23 fxp0.0 10.92.31.254
10.13.10.0/23 fxp0.0 10.92.31.254
10.82.0.0/15 fxp0.0 10.92.31.254
10.84.0.0/16 fxp0.0 10.92.31.254
10.85.12.0/22 fxp0.0 10.92.31.254
10.92.0.0/16 fxp0.0 10.92.31.254
10.92.16.0/20 fxp0.0
10.92.20.175/32
10.94.0.0/16 fxp0.0 10.92.31.254
10.99.0.0/16 fxp0.0 10.92.31.254
10.102.0.0/16 fxp0.0 10.92.31.254
10.150.0.0/16 fxp0.0 10.92.31.254
10.155.0.0/16 fxp0.0 10.92.31.254
10.157.64.0/19 fxp0.0 10.92.31.254
10.160.0.0/16 fxp0.0 10.92.31.254
10.204.0.0/16 fxp0.0 10.92.31.254
10.205.0.0/16 fxp0.0 10.92.31.254
10.206.0.0/16 fxp0.0 10.92.31.254
10.207.0.0/16 fxp0.0 10.92.31.254
10.209.0.0/16 fxp0.0 10.92.31.254
10.212.0.0/16 fxp0.0 10.92.31.254
10.213.0.0/16 fxp0.0 10.92.31.254
10.214.0.0/16 fxp0.0 10.92.31.254
10.215.0.0/16 fxp0.0 10.92.31.254
10.216.0.0/16 fxp0.0 10.92.31.254
10.218.13.0/24 fxp0.0 10.92.31.254
10.218.14.0/24 fxp0.0 10.92.31.254
10.218.16.0/20 fxp0.0 10.92.31.254
10.218.32.0/20 fxp0.0 10.92.31.254
10.227.0.0/16 fxp0.0 10.92.31.254
10.255.111.0/24 ge-0/0/2.0 11.11.11.2
10.255.111.1/32 ge-0/0/2.0 11.11.11.2
10.255.111.2/32 ge-0/0/2.0 11.11.11.2
10.255.111.3/32 ge-0/0/2.0 11.11.11.2
10.255.111.4/32 ge-0/0/2.0 11.11.11.2
10.255.111.4/32 ge-0/0/2.0 11.11.11.2
10.255.112.1/32 lo0.0
10.255.112.1/32 lo0.0
10.255.112.2/32 ge-0/0/2.0 11.11.11.2
10.255.112.2/32 ge-0/0/2.0 11.11.11.2
11.11.11.0/24 ge-0/0/2.0
11.11.11.1/32
12.12.12.0/24 ge-0/0/2.0 11.11.11.2
15.15.15.0/24 ge-0/0/1.0
15.15.15.1/32
22.22.22.0/24 ge-0/0/0.0
22.22.22.1/32
23.23.23.0/24 ge-0/0/2.0 11.11.11.2
24.24.24.0/24 ge-0/0/2.0 11.11.11.2
25.25.25.0/24 ge-0/0/2.0 11.11.11.2
128.92.17.45/32 ge-0/0/2.0 11.11.11.2
128.92.20.175/32 lo0.0
128.92.21.186/32 ge-0/0/2.0 11.11.11.2
128.92.25.135/32 ge-0/0/2.0 11.11.11.2
128.92.27.91/32 ge-0/0/2.0 11.11.11.2
128.92.28.70/32 ge-0/0/2.0 11.11.11.2
172.16.0.0/12 fxp0.0 10.92.31.254
192.168.0.0/16 fxp0.0 10.92.31.254
192.168.102.0/23 fxp0.0 10.92.31.254
207.17.136.0/24 fxp0.0 10.92.31.254
207.17.136.192/32 fxp0.0 10.92.31.254
207.17.137.0/24 fxp0.0 10.92.31.254
224.0.0.5/32
含义
输出显示设备 R0 的 FEC 和影子路由
配置 LDP 路由首选项
当多个协议计算到同一目标的路由时,将使用路由首选项来选择在转发表表中安装哪个路由。优先选项值最低的路由被选中。优先级值可以是 0 到 255 范围内的数字。默认情况下,LDP 路由的优先级值为 9。
要修改路由优先级,请包括以下 preference
语句:
preference preference;
有关可包含此语句的层次结构级别列表,请参阅此语句的语句摘要部分。
LDP 平滑重启
LDP 平滑重启使 LDP 控制平面正在重新启动的路由器能够继续转发流量,同时从相邻路由器恢复其状态。它还支持启用帮助器模式的路由器,以协助试图重新启动 LDP 的相邻路由器。
在会话初始化期间,路由器会播发其执行 LDP 平稳重启的能力,或者通过发送平稳重启TLV来利用执行 LDP 平滑重启的邻接方的优势。此TLV包含两个与 LDP 平滑重启相关的字段:重新连接时间和恢复时间。重新连接和恢复时间的值表示路由器支持的平滑重启功能。
当路由器发现相邻路由器正在重新启动时,它会等到恢复时间结束后再尝试重新连接。恢复时间是指路由器等待 LDP 正常重新启动的时间长度。当发送或接收初始化消息时,恢复时间段就开始了。此时间段通常也是相邻路由器维护有关重新启动路由器信息的时间长度,以便其继续转发流量。
您可以在 LDP 协议的主实例和特定路由实例中配置 LDP 平滑重启。您可以在全局级别为所有协议禁用平滑重启,在协议级别仅限 LDP,并在特定路由实例上禁用平滑重启。LDP 平滑重启默认处于禁用状态,因为在全局级别,平滑重启默认处于禁用状态。但是,默认情况下,帮助器模式(协助相邻路由器尝试平稳重启的能力)处于启用状态。
以下是与 LDP 平滑重启相关的一些行为:
重新启动时不会维护传出标签。将分配新的传出标签。
路由器重新启动时,不会向支持正常重启的邻接方发送标签映射消息,直到重新启动路由器稳定下来(标签映射消息会立即发送至不支持正常重启的邻接方)。但是,所有其他消息(keepalive、地址消息、通知和发布)都会照常发送。分发这些其他消息可防止路由器分发不完整的信息。
助手模式和平稳重启是独立的。您可以在配置中禁用平滑重启,但仍允许路由器与试图正常重新启动的邻接方合作。
配置 LDP 平滑重启
在层级或[edit protocols ldp graceful-restart]
层级更改平滑重启配置[edit routing-options graceful-restart]
时,系统会自动重新启动任何正在运行的 LDP 会话,以应用平滑重启配置。当您更改 BGP 的平滑重启配置时,此行为会反映 BGP 的行为。
默认情况下,正常重启助手模式已启用,但已禁用平滑重启。因此,路由器的默认行为是协助相邻路由器尝试平稳重新启动,但不尝试自行正常重新启动。
要配置 LDP 平滑重启,请参阅以下部分:
实现平稳重启
要启用 LDP 平稳重启,还需要在路由器上启用平滑重启。要实现平稳重启,请包括以下 graceful-restart
语句:
graceful-restart;
您可以在以下层级包含此语句:
[edit routing-options]
[edit logical-systems logical-system-name routing-options]
ACX 系列路由器不支持 [edit logical-systems logical-system-name routing-options
] 层次结构级别。
该 graceful-restart
语句允许路由器上支持此功能的所有协议正常重新启动。有关平稳重启的更多信息,请参阅 路由设备的 Junos OS 路由协议库。
默认情况下,当您在 LDP 协议级别和所有路由实例上启用平滑重启时,LDP 平滑重启处于启用状态。但是,您可以禁用 LDP 平滑重启和 LDP 平滑重启助手模式。
禁用 LDP 平滑重启或助手模式
要禁用 LDP 平稳重启和恢复,请包括以下 disable
语句:
ldp { graceful-restart { disable; } }
有关可包含此语句的层次结构级别列表,请参阅此语句的语句摘要部分。
您只能在 LDP 协议级别禁用帮助器模式。您不能为特定路由实例禁用帮助器模式。要禁用 LDP 帮助器模式,请包括以下 helper-disable
语句:
ldp { graceful-restart { helper-disable; } }
有关可包含此语句的层次结构级别列表,请参阅此语句的语句摘要部分。
可以采用以下 LDP 平滑重启配置:
LDP 平滑重启和助手模式均已启用。
LDP 平滑重启已禁用,但已启用助手模式。以这种方式配置的路由器无法正常重新启动,但可以帮助正在重新启动的邻接方。
LDP 平滑重启和助手模式均已禁用。路由器不使用初始化消息中发送的 LDP 平滑重启类型、长度和值 (TLV)。路由器无法支持 LDP 正常重启。
如果尝试启用平滑重启并禁用助手模式,将发出配置错误。
配置重新连接时间
邻接方之间的 LDP 连接失败后,邻接方会等待一定时间,以便正常重新启动的路由器继续发送 LDP 消息。等待期过后,可以重新建立 LDP 会话。您可以配置等待期(以秒为单位)。此值包含在启用 LDP 正常重启时的容错会话中,TLV在 LDP 初始化消息中发送。
假设路由器 A 和路由器 B 是 LDP 邻接方。路由器 A 是重新启动的路由器。重新连接时间是指路由器 B 检测到路由器 A 重新启动后,路由器 A 告诉路由器 B 等待的时间。
要配置重新连接时间,请 reconnect-time
添加语句:
graceful-restart { reconnect-time seconds; }
您可以将重新连接时间设置为 30 到 300 秒范围内的值。默认为 60 秒。
有关可配置这些语句的层次结构级别列表,请参阅这些语句的语句摘要部分。
配置恢复时间和最大恢复时间
恢复时间是指路由器等待 LDP 正常重新启动的时间量。当发送或接收初始化消息时,恢复时间段就开始了。此时间段通常也是相邻路由器维护有关重新启动路由器信息的时间量,从而允许其继续转发流量。
为了防止相邻路由器从重新启动路由器收到恢复时间误值时受到不利影响,您可以在相邻路由器上配置最大恢复时间。相邻路由器保持其状态的两次较短。例如,路由器 A 正在执行 LDP 平滑重启。它已向相邻路由器 B 发送了 900 秒的恢复时间。但是,路由器 B 配置的最大恢复时间为 400 秒。路由器 B 只会等待 400 秒,然后才能从路由器 A 清除其 LDP 信息。
要配置恢复时间,请添加语句 recovery-time
和 maximum-neighbor-recovery-time
语句:
graceful-restart { maximum-neighbor-recovery-time seconds; recovery-time seconds; }
有关可配置这些语句的层次结构级别列表,请参阅这些语句的语句摘要部分。
过滤入站 LDP 标签绑定
您可以过滤收到的 LDP 标签绑定,应用策略以接受或拒绝相邻路由器播发的绑定。要配置接收的标签过滤,请 import
添加语句:
import [ policy-names ];
有关可包含此语句的层次结构级别列表,请参阅此语句的语句摘要部分。
命名策略(在 [edit policy-options]
层次结构级别配置)将应用于从所有 LDP 邻接方接收的所有标签绑定。所有过滤均使用 from
语句完成。 表 1 仅 from
列出了应用于 LDP 接收标签过滤的运算符。
from 算子 |
说明 |
---|---|
|
匹配从指定接口上相邻的邻接方收到的绑定 |
|
与从指定 LDP 路由器 ID 接收的绑定匹配 |
|
匹配从邻居接收并传播指定接口地址的绑定 |
|
匹配具有指定前缀的绑定 |
如果对绑定进行筛选,则它仍然显示在 LDP 数据库中,但不会考虑作为标签交换路径 (LSP) 的一部分进行安装。
通常,在 LDP 中应用策略只能用于阻止 LSP 的建立,而不能控制其路由。这是因为 LSP 遵循的路径由单播路由决定,而不是由 LDP 决定。但是,当通过不同的邻接方到达目标有多个等价路径时,您可以使用 LDP 过滤将部分可能的下一跃点排除在考虑范围之外。(否则,LDP 会随机选择一个可能的下一跃点。)
LDP 会话不绑定到接口或接口地址。LDP 仅播发每个路由器(而非每个接口)标签;因此,如果两个路由器之间存在多个并行链路,则只会建立一个 LDP 会话,并且不绑定到单个接口。当路由器与同一邻接方具有多个邻接时,请小心确保过滤器按预期运行。(一般来说,使用 next-hop
, interface
在这种情况下不适合。)
如果某个标签已过滤(这意味着该标签被策略拒绝,未用于构建 LSP),则该标签在数据库中被标记为已过滤:
user@host> show ldp database Input label database, 10.10.255.1:0-10.10.255.6:0 Label Prefix 3 10.10.255.6/32 (Filtered) Output label database, 10.10.255.1:0-10.10.255.6:0 Label Prefix 3 10.10.255.1/32 (Filtered)
有关如何为 LDP 配置策略的更多信息,请参阅 路由策略、防火墙过滤器和流量监管器用户指南。
例子:过滤入站 LDP 标签绑定
仅接受所有邻居的 /32 前缀:
[edit] protocols { ldp { import only-32; ... } } policy-options { policy-statement only-32 { term first { from { route-filter 0.0.0.0/0 upto /31; } then reject; } then accept; } }
接受 131.108/16
或更长的路由器 ID 10.10.255.2
,并接受来自所有其他邻接方的所有前缀:
[edit] protocols { ldp { import nosy-neighbor; ... } } policy-options { policy-statement nosy-neighbor { term first { from { neighbor 10.10.255.2; route-filter 131.108.0.0/16 orlonger accept; route-filter 0.0.0.0/0 orlonger reject; } } then accept; } }
过滤出站 LDP 标签绑定
您可以配置导出策略来过滤 LDP 出站标签。您可以通过应用路由策略来过滤出站标签绑定,以阻止向相邻路由器播发绑定。要配置出站标签过滤,请 export
添加以下语句:
export [policy-name];
有关可包含此语句的层次结构级别列表,请参阅此语句的语句摘要部分。
命名的导出策略(在 [edit policy-options]
层次结构级别配置)应用于传输至所有 LDP 邻接方的所有标签绑定。唯 from
一适用于 LDP 出站标签过滤的运算符是 route-filter
,它匹配具有指定前缀的绑定。应用于出站标签过滤的唯 to
一运营商是中的 表 2操作人员。
到运营商 |
说明 |
---|---|
|
与发送至指定接口邻接邻接方上的绑定匹配 |
|
发送至指定 LDP 路由器 ID 的绑定匹配 |
|
匹配发送至邻接方以宣传指定接口地址的绑定 |
如果对绑定进行了过滤,则绑定不会播发到相邻路由器,但可将该绑定安装为本地路由器上 LSP 的一部分。您可以在 LDP 中应用策略来阻止 LSP 的建立,但不能控制 LSP 的路由。LSP 遵循的路径由单播路由决定,而不是由 LDP 决定。
LDP 会话不绑定到接口或接口地址。LDP 仅播发每个路由器(而非每个接口)标签。如果两个路由器之间存在多个并行链路,则仅建立一个 LDP 会话,并且不绑定到单个接口。
当路由器与 next-hop
同一邻接方有多个邻接方邻接时,请勿使用和 interface
运算符。
经过过滤的标签在数据库中标记:
user@host> show ldp database Input label database, 10.10.255.1:0-10.10.255.3:0 Label Prefix 100007 10.10.255.2/32 3 10.10.255.3/32 Output label database, 10.10.255.1:0-10.10.255.3:0 Label Prefix 3 10.10.255.1/32 100001 10.10.255.6/32 (Filtered)
有关如何为 LDP 配置策略的更多信息,请参阅 路由策略、防火墙过滤器和流量监管器用户指南。
例子:过滤出站 LDP 标签绑定
路由的块传输给 10.10.255.6/32
任何邻接方:
[edit protocols] ldp { export block-one; } policy-options { policy-statement block-one { term first { from { route-filter 10.10.255.6/32 exact; } then reject; } then accept; } }
仅 131.108/16
向路由器 ID 10.10.255.2
发送更长的地址,并将所有前缀发送至所有其他路由器:
[edit protocols] ldp { export limit-lsps; } policy-options { policy-statement limit-lsps { term allow-one { from { route-filter 131.108.0.0/16 orlonger; } to { neighbor 10.10.255.2; } then accept; } term block-the-rest { to { neighbor 10.10.255.2; } then reject; } then accept; } }
指定 LDP 使用的传输地址
路由器必须先在彼此之间建立 TCP 会话,然后才能建立 LDP 会话。TCP 会话使路由器能够交换 LDP 会话所需的标签通告。要建立 TCP 会话,每个路由器都必须学习另一个路由器的传输地址。传输地址是用于识别运行 LDP 会话的 TCP 会话的 IP 地址。
要配置 LDP 传输地址,请添加传输地址语句:
transport-address (router-id | interface);
有关可包含此语句的层次结构级别列表,请参阅此语句的语句摘要部分。
如果指定了 router-id
选项,则路由器标识符的地址将用作传输地址(除非另有配置,路由器标识符通常与环路地址相同)。如果指定选项 interface
,则接口地址将用作可通过该接口访问的邻接方的任何 LDP 会话的传输地址。请注意,路由器标识符默认用作传输地址。
为了正确操作,必须可访问 LDP 传输地址。路由器 ID 是一个标识符,而非可路由的 IP 地址。因此,建议将路由器 ID 设置为与环路地址匹配,并且环路地址由 IGP 播发。
当与同一 LDP 邻接方存在多个并行链路时,您无法指定 interface
选项,因为 LDP 规格要求在所有接口上将相同的传输地址播发至同一邻接方。如果 LDP 检测到与同一邻接方存在多个并行链路,则它通过断开接口上的邻接方连接或指定 router-id
选项,逐个禁用该邻接方接口,直到该条件被清除。
用于目标 LDP 会话的控制传输地址
要在两台设备之间建立 TCP 会话,每个设备都必须学习另一台设备的传输地址。传输地址是用于标识 LDP 会话所通过的 TCP 会话的 IP 地址。之前,此传输地址只能是路由器 ID 或接口地址。借助 LDP 传输地址功能,您可以将任何 IP 地址显式配置为第 2 层电路、MPLS 和 VPLS 邻接方的目标 LDP 邻接的传输地址。这使您能够使用传输地址配置来控制目标 LDP 会话。
控制用于目标 LDP 会话的传输地址的优势
配置传输地址以建立目标 LDP 会话具有以下优势:
Flexible interface configurations-提供为一个环路接口配置多个 IP 地址的灵活性,而无需中断目标-LDP 邻接方之间的 LDP 会话创建。
Ease of operation—在接口级别配置的传输地址允许您在 IGP 主干中为 LDP 使用多个协议。这样就能轻松顺畅地进行运维。
目标 LDP 传输地址概述
在 Junos OS 19.1R1 版之前,LDP 仅支持路由器 ID 或接口地址作为任何 LDP 接口上的传输地址。该接口上形成的邻接使用分配给接口的 IP 地址之一或路由器 ID。对于目标邻接,接口为环路接口。在设备上配置多个环路地址时,无法为接口派生传输地址,因此无法建立 LDP 会话。
从 Junos OS 19.1R1 版开始,除了用于传输目标 LDP 会话地址的默认 IP 地址外,您还可以将任何其他 IP 地址配置为 , session
session-group
和interface
配置语句下的传输地址。传输地址配置仅适用于配置的邻接方,包括第 2 层电路、MPLS 和 VPLS 邻接。此配置不适用于发现的邻接(目标或非)。
传输地址优先级
您可以在会话、会话组和接口级别为目标 LDP 会话配置传输地址。
配置传输地址后,将根据 LDP 的传输地址优先级建立目标-LDP 会话。
目标邻接方传输地址的优先级(通过第 2 层电路、MPLS、VPLS 和 LDP 配置配置)如下所示:
在层次结构下
[edit protocols ldp session]
。在层次结构下
[edit protocols ldp session-group]
。在层次结构下
[edit protocols ldp interfcae lo0]
。在层次结构下
[edit protocols ldp]
。默认地址。
发现的邻接方传输地址的优先级顺序如下:
在层次结构下
[edit protocols ldp interfcae]
。在层次结构下
[edit protocols ldp]
。默认地址。
将 LDP 配置为接受 hello 数据包的自动目标邻接方传输地址的优先级顺序如下:
在层次结构下
[edit protocols ldp interfcae lo0]
。在层次结构下
[edit protocols ldp]
。默认地址。
传输地址配置故障排除
您可以使用以下命令 show 命令输出对目标 LDP 会话进行故障排除:
show ldp session
show ldp neighbor
detail
命令的输出show ldp neighbor
级别显示以 hello 消息中发送至目标邻接方中的传输地址。如果邻接方无法访问此地址,则不会启动 LDP 会话。show configuration protocols ldp
您还可以启用 LDP 追踪选项,以便进一步排除故障。
如果配置从使用无效(不可访问)的传输地址更改为有效的传输地址,则可以看到以下痕迹:
May 29 10:47:11.569722 Incoming connect from 10.55.1.4 May 29 10:47:11.570064 Connection 10.55.1.4 state Closed -> Open May 29 10:47:11.570727 Session 10.55.1.4 state Nonexistent -> Initialized May 29 10:47:11.570768 Session 10.55.1.4 state Initialized -> OpenRec May 29 10:47:11.570799 LDP: Session param Max PDU length 4096 from 10.55.1.4, negotiated 4096 May 29 10:47:11.570823 Session 10.55.1.4 GR state Nonexistent -> Operational May 29 10:47:11.669295 Session 10.55.1.4 state OpenRec -> Operational May 29 10:47:11.669387 RPD_LDP_SESSIONUP: LDP session 10.55.1.4 is up
如果配置从使用有效的传输地址更改为无效(无法访问)的传输地址,则可以看到以下痕迹:
May 29 10:42:36.317942 Session 10.55.1.4 GR state Operational -> Nonexistent May 29 10:42:36.318171 Session 10.55.1.4 state Operational -> Closing May 29 10:42:36.318208 LDP session 10.55.1.4 is down, reason: received notification from peer May 29 10:42:36.318236 RPD_LDP_SESSIONDOWN: LDP session 10.55.1.4 is down, reason: received notification from peer May 29 10:42:36.320081 Connection 10.55.1.4 state Open -> Closed May 29 10:42:36.322411 Session 10.55.1.4 state Closing -> Nonexistent
如果配置错误,请执行以下故障排除任务:
检查
address family
。在语句下session
配置的传输地址必须与邻接方或会话属于同一地址族。在或
session
语句下配置为传输地址的neighbor
地址必须位于路由器的本地,才能启动目标 hello 消息。您可以检查地址是否已配置。如果未在任何接口下配置地址,则配置将被拒绝。
配置从路由表播发到 LDP 的前缀
您可以控制播发到 LDP 的前缀集,使路由器成为这些前缀的出口路由器。默认情况下,只有环路地址播发到 LDP 中。要配置路由表中要播发到 LDP 的前缀集,请添加以下 egress-policy
语句:
egress-policy policy-name;
有关可包含此语句的层次结构级别列表,请参阅此语句的语句摘要部分。
如果为不包含环路地址的 LDP 配置出口策略,则不会再在 LDP 中播发。要继续播发环路地址,您需要将其显式配置为 LDP 出口策略的一部分。
命名策略(在 [edit policy-options]
或 [edit logical-systems logical-system-name policy-options]
层次结构级别配置)应用于路由表中的所有路由。与策略匹配的路由将播发到 LDP 中。您可以使用语句控制这些前缀播 export
发到的邻接方集。仅 from 考虑运营商;您可以使用任何有效的 from 操作员。有关更多信息,请参阅 适用于路由设备的 Junos OS 路由协议库。
ACX 系列路由器不支持 [edit logical-systems
] 层次结构级别。
示例:配置播发至 LDP 的前缀
将所有连接的路由播发到 LDP 中:
[edit protocols] ldp { egress-policy connected-only; } policy-options { policy-statement connected-only { from { protocol direct; } then accept; } }
配置 FEC 分解
当 LDP 出口路由器播发多个前缀时,这些前缀绑定到单个标签,并聚合为单个转发等价类 (FEC)。默认情况下,LDP 在播发遍网络时会保留此聚合。
通常,由于 LSP 不会拆分为多个下一跃点,并且前缀绑定到单个 LSP 中,因此不会跨等价路径进行负载平衡。但是,如果您配置负载平衡策略并解聚 FEC,则可以跨等价路径实现负载均衡。
解聚 FEC 会使每个前缀绑定到一个单独的标签,并成为一个单独的 LSP。
要配置解聚合的 FEC,请添加 deaggregate
以下语句:
deaggregate;
有关可包含此语句的层次结构级别列表,请参阅此语句的语句摘要部分。
对于所有 LDP 会话,只能全局配置解聚合 FEC。
解聚 FEC 允许将生成的多个 LSP 分布到多个等价路径上,并跨出口分段上的多个下一跃点分配 LSP,但每个 LSP 仅安装一个下一跃点。
要聚合 FEC,请包括以下 no-deaggregate
语句:
no-deaggregate;
有关可包含此语句的层次结构级别列表,请参阅此语句的语句摘要部分。
对于所有 LDP 会话,您只能全局配置聚合 FEC。
为 LDP FEC 配置监管器
您可以将 Junos OS 配置为跟踪和监管 LDP FEC 的流量。LDP FEC 监管器可用于执行以下任一操作:
跟踪或监管 LDP FEC 的入口流量。
跟踪或监管 LDP FEC 的传输流量。
跟踪或监管源自特定转发类的 LDP FEC 流量。
跟踪或监管来自特定虚拟路由和转发 (VRF) 站点的 LDP FEC 流量。
丢弃绑定到特定 LDP FEC 的错误流量。
要为 LDP FEC 监管流量,必须先配置过滤器。具体来说,您需要在[edit firewall family protocol-family filter filter-name term term-name from]
层次结构级别配置interface
语句或interface-set
语句。您可以通过语句 interface
将过滤器匹配到单个接口。该 interface-set
语句允许您将过滤器与多个接口进行匹配。
有关如何为 LDP FEC 配置 interface
语句、 interface-set
语句和监管程序的更多信息,请参阅 路由策略、防火墙过滤器和流量监管器用户指南。
配置过滤器后,您需要将它们包含在 LDP 的语句配置中 policing
。要为 LDP FEC 配置监管器,请添加以下 policing
语句:
policing { fec fec-address { ingress-traffic filter-name; transit-traffic filter-name; } }
有关可包含此语句的层次结构级别列表,请参阅此语句的语句摘要部分。
语句 policing
包含以下选项:
fec
- 指定要监管的 LDP FEC 的 FEC 地址。ingress-filter
- 指定入口流量过滤器的名称。transit-traffic
- 指定传输流量过滤器的名称。
配置 LDP IPv4 FEC 过滤
默认情况下,当建立目标 LDP 会话时,Junos OS 始终通过目标 LDP 会话交换 IPv4 转发等价类 (FEC) 和第 2 层电路 FEC。对于间接连接的邻接方之间的 LDP 会话,您可能只想将第 2 层电路 FEC 导出到邻接方,前提是该会话被专门配置为支持第 2 层电路或 VPLS。
在将所有非 BGP 前缀播发到 LDP 的混合供应商网络中,LDP 数据库可能会变得庞大。对于此类环境,防止由于第 2 层电路或 LDP VPLS 配置而形成的 LDP 会话上 IPv4 FEC 会很有用。同样,过滤在这种环境中接收的任何 IPv4 FE 也很有用。
如果与 LDP 会话关联的所有 LDP 邻接方仅属于第 2 层,则可以通过 l2-smart-policy
配置语句将 Junos OS 配置为仅播发第 2 层电路 FEC。此功能还会自动过滤掉此会话上收到的 IPv4 FEC。配置为 l2-smart-policy
禁用此功能而激活的显式导出或导入策略。
如果形成一个 LDP 会话邻接方是因为发现邻接,或者由于一个或多个 RSVP LSP 上的 LDP 隧道配置而形成邻接,则 IPv4 FEC 将使用默认行为播发和接收。
要防止 LDP 仅通过 LDP 与第 2 层邻接方会话导出 IPv4 FEC,并过滤掉通过此类会话接收的 IPv4 FEC,请填写以下 l2-smart-policy
语句:
l2-smart-policy;
有关可配置此语句的层次结构级别列表,请参阅此语句的语句摘要。
为 LDP LSP 配置 BFD
您可以为 LDP LSP 配置双向转发检测 (BFD)。BFD 协议是一种简单的发送机制,用于检测网络故障。Hello 数据包将按指定的定期发送间隔发送。当路由器在指定间隔后停止接收回复时,将检测到邻接方故障。BFD 适用于各种网络环境和拓扑结构。与静态路由的故障检测机制相比,BFD 的故障检测计时器具有更短的时间限制,因此检测速度更快。
只要路径的 BFD 会话失败,就会记录错误。下面展示了 LDP LSP 日志消息的 BFD 显示方式:
RPD_LDP_BFD_UP: LDP BFD session for FEC 10.255.16.14/32 is up RPD_LDP_BFD_DOWN: LDP BFD session for FEC 10.255.16.14/32 is down
您还可以为 RSVP LSP 配置 BFD,如为 RSVP 信号 LSP 配置 BFD 中所述。
BFD 故障检测计时器是自适应的,可以调整为或多或少主动。例如,如果邻接失败,计时器可以适应更高的值,或者邻接方可以协商计时器比配置的值更高的值。当 BFD 会话翻动在 15 秒内发生三次以上时,计时器会适应更高的值。如果本地 BFD 实例是会话翻动的原因,则回退算法将接收 (Rx) 间隔增加 2。如果远程 BFD 实例是会话翻动的原因,则传输 (Tx) 间隔将增加 2。您可以使用 clear bfd adaptation
命令将 BFD 间隔计时器返回到其配置的值。命令 clear bfd adaptation
是无中断的,这意味着命令不会影响路由设备上的流量。
要为 LDP LSP 启用 BFD,请 oam
包括和 bfd-liveness-detection
语句:
oam { bfd-liveness-detection { detection-time threshold milliseconds; ecmp; failure-action { remove-nexthop; remove-route; } holddown-interval seconds; ingress-policy ingress-policy-name; minimum-interval milliseconds; minimum-receive-interval milliseconds; minimum-transmit-interval milliseconds; multiplier detection-time-multiplier; no-adaptation; transmit-interval { minimum-interval milliseconds; threshold milliseconds; } version (0 | 1 | automatic); } fec fec-address { bfd-liveness-detection { detection-time threshold milliseconds; ecmp; failure-action { remove-nexthop; remove-route; } holddown-interval milliseconds; ingress-policy ingress-policy-name; minimum-interval milliseconds; minimum-receive-interval milliseconds; minimum-transmit-interval milliseconds; multiplier detection-time-multiplier; no-adaptation; transmit-interval { minimum-interval milliseconds; threshold milliseconds; } version (0 | 1 | automatic); } no-bfd-liveness-detection; periodic-traceroute { disable; exp exp-value; fanout fanout-value; frequency minutes; paths number-of-paths; retries retry-attempts; source address; ttl ttl-value; wait seconds; } } lsp-ping-interval seconds; periodic-traceroute { disable; exp exp-value; fanout fanout-value; frequency minutes; paths number-of-paths; retries retry-attempts; source address; ttl ttl-value; wait seconds; } }
通过使用层次结构级别的选项[edit protocols ldp]
配置 FEC 地址fec
,可以为与特定转发同等类 (FEC) 关联的 LDP LSP 启用 BFD。或者,您也可以配置操作管理 (OAM) 入口策略,以在一系列 FEC 地址上启用 BFD。有关更多信息,请参阅 为 LDP 配置 OAM 入口策略。
除非使用 OAM 入口策略在 FEC 上显式配置其等效 FEC 地址或启用 OAM,否则您无法启用 BFD LDP LSP。如果未为任何 FEC 地址启用 BFD,则 BFD 会话不会出现。
您可以在以下层级配置 oam
语句:
[edit protocols ldp]
[edit logical-systems logical-system-name protocols ldp]
ACX 系列路由器不支持 [edit logical-systems
] 层次结构级别。
语句 oam
包含以下选项:
fec
- 指定 FEC 地址。您必须指定 FEC 地址或配置 OAM 入口策略,以确保启动 BFD 会话。lsp-ping-interval
- 指定 LSP ping 间隔的持续时间(以秒为单位)。要对 LDP 信号的 LSP 发出 ping,请使用ping mpls ldp
命令。有关更多信息,请参阅 CLI 浏览器。
语句 bfd-liveness-detection
包含以下选项:
ecmp
- 使 LDP 为为指定 FEC 配置的所有 ECMP 路径建立 BFD 会话。如果配置选项ecmp
,还必须为指定的 FEC 配置periodic-traceroute
语句。如果不这样做,提交操作将失败。您可以在全局层次结构级别 ([edit protocols ldp oam]
) 上配置periodic-traceroute
语句,ecmp
同时仅配置特定 FEC ([edit protocols ldp oam fec address bfd-liveness-detection]
) 的选项。暂侯间隔 — 指定在添加路由或下一跃点之前 BFD 会话应保持运行状态的持续时间。如果指定 0 秒的时间,则 BFD 会话一旦恢复,就会添加路由或下一跃点。
minimum-interval
- 指定最小传输和接收间隔。如果配置了minimum-interval
选项,则无需配置选项minimum-receive-interval
minimum-transmit-interval
。minimum-receive-interval
- 指定最小接收间隔。范围为 1 到 255,000 毫秒。minimum-transmit-interval
- 指定最小传输间隔。范围为 1 到 255,000 毫秒。multiplier
- 指定检测时间倍增器。范围从 1 到 255。版本 — 指定 BFD 版本。选项为 BFD 版本 0 或 BFD 版本 1。默认情况下,Junos OS 软件会尝试自动确定 BFD 版本。
为 LDP LSP 配置 ECMP 感知 BFD
为 FEC 配置 BFD 时,只会为路由器的一个活动本地下一跃点建立 BFD 会话。但是,您可以配置多个 BFD 会话,每个与特定等价多路径 (ECMP) 路径关联的 FEC 一个。要让此功能正常运行,还需要配置 LDP LSP 定期追踪路由。(请参阅 配置 LDP LSP Traceroute。)LDP LSP 追踪路由用于发现 ECMP 路径。对于发现的每个 ECMP 路径,都会启动一个 BFD 会话。每当其中一个 ECMP 路径的 BFD 会话失败时,都会记录错误。
定期运行 LDP LSP traceroute,以检查 ECMP 路径的完整性。发现问题时,可能会发生以下情况:
如果 FEC 的最新 LDP LSP 追踪路由与之前的跟踪路由不同,则会关闭与该 FEC 关联的 BFD 会话(与上一次运行中更改的地址范围相关的 BFD 会话),并为已更改范围内的目标地址启动新的 BFD 会话。
如果 LDP LSP 追踪路由返回错误(例如超时),则与该 FEC 关联的所有 BFD 会话都会被拆除。
要配置 LDP 为为指定 FEC 配置的所有 ECMP 路径建立 BFD 会话,请包含该 ecmp
语句。
ecmp;
有关可包含此语句的层次结构级别列表,请参阅此语句的语句摘要部分。
除了语句, ecmp
您还必须将语句 periodic-traceroute
包含在全局 LDP OAM 配置中(在 [edit protocols ldp oam]
或 [edit logical-systems logical-system-name protocols ldp oam]
层次结构级别)或指定 FEC 的配置中(在 [edit protocols ldp oam fec address]
或 [edit logical-systems logical-system-name protocols ldp oam fec address]
层次结构级别)。否则,提交操作将失败。
ACX 系列路由器不支持 [edit logical-systems
] 层次结构级别。
为 LDP LSP 上的 BFD 会话配置故障操作
如果 LDP LSP 上出现 BFD 会话故障事件,您可以配置路由和下一跃点属性。故障事件可能是已关闭的现有 BFD 会话,也可能是从未出现过的 BFD 会话。当相关 BFD 会话再次出现时,LDP 会返回路由或下一跃点。
如果 LDP LSP 上的 BFD 会话失败,可以为语句配置以下故障操作选项 failure-action
之一:
remove-nexthop
-当检测到 BFD 会话故障事件时,删除与入口节点 LSP 路由下一跃点对应的路由。remove-route
-当检测到 BFD 会话故障事件时,从相应的路由表中删除与 LSP 对应的路由。如果用 ECMP 配置了 LSP,并且与任何路径对应的 BFD 会话中断,则路由将被移除。
要配置 LDP LSP 上的 BFD 会话失败时发生的故障操作,请 remove-nexthop
添加语句的选项或 remove-route
选项 failure-action
:
failure-action { remove-nexthop; remove-route; }
有关可包含此语句的层次结构级别列表,请参阅此语句的语句摘要部分。
配置 BFD 会话的暂侯间隔
通过在层次结构级别或层级[edit protocols ldp oam fec address bfd-livenesss-detection]
配置holddown-interval
语句[edit protocols ldp oam bfd-livenesss-detection]
,可以指定在添加路由或下一跃点之前应启动的 BFD 会话持续时间。如果指定 0 秒的时间,则 BFD 会话一旦恢复,就会添加路由或下一跃点。
holddown-interval seconds;
有关可包含此语句的层次结构级别列表,请参阅此语句的语句摘要部分。
配置 LDP 链路保护
您可以为单播和组播 LDP 标签交换路径 (LSP) 配置标签分配协议 (LDP) 链路保护,从而在链路或节点故障期间提供弹性。
开始之前:
配置设备接口。
配置设备的路由器 ID 和自治系统编号。
配置以下协议:
RSVP
具有流量工程功能的 MPLS。
OSPF,具有流量工程功能。
注:要通过无环路替代 (LFA) 实现组播 LDP 链路保护,启用链路保护。
[edit protocols] user@R0# set ospf area 0 interface all link-protection
要配置 LDP 链路保护:
示例:配置 LDP 链路保护
LDP 链路保护概述
- LDP 简介
- Junos OS LDP 协议实施
- 了解 LDP 的多点扩展
- 在目标 LDP 会话上使用 LDP 的多点扩展
- LDP 链路保护的当前限制
- 使用 RSVP LSP 作为解决方案
- 了解组播 LDP 链路保护
- 用于提供 LDP 链路保护的不同模式
- 用于 LDP 链路保护的标签操作
- 组播 LDP 链路保护配置示例
- 先决后决
- 警告和限制
LDP 简介
标签分发协议 (LDP) 是在非流量设计的应用程序中分发标签的协议。LDP 允许路由器通过将网络层路由信息直接映射到数据链路 LSP,通过网络建立标签交换路径 (LSP)。
这些 LSP 的端点可能位于直连邻接方(类似于 IP 逐跳转发)或网络出口节点上,从而支持通过所有中间节点进行交换。由 LDP 建立的 LSP 还可以遍历由 RSVP 创建的流量工程 LSP。
LDP 将一个转发等效类 (FEC) 与它创建的每个 LSP 相关联。与 LSP 关联的 FEC 指定将哪些数据包映射到该 LSP。当每个路由器选择 FEC 下一跃点播发的标签并将其拼接到播发至所有其他路由器的标签时,LSP 会通过网络进行扩展。此过程会形成一个在出口路由器上融合的 LSP 树。
Junos OS LDP 协议实施
LDP 的 Junos OS 实施支持 LDP 版本 1。Junos OS 支持在内部网关协议 (IGP) 中的路由器之间建立隧道的简单机制,以消除核心内外部路由的所需分布。Junos OS 允许将下一跃点 MPLS 隧道发送至网络中的所有出口路由器,只有核心中运行的 IGP 才能将路由分发到出口路由器。边缘路由器运行 BGP,但不将外部路由分发到核心。相反,边缘的递归路由查找解析为切换到出口路由器的 LSP。传输 LDP 路由器上无需外部路由。
了解 LDP 的多点扩展
LDP 定义了在网络中设置点到点、多点到点、点到多点和多点到多点 LSP 的机制。点到多点和多点到多点 LSP 统称为多点 LSP,其中流量分别从单一来源流向多个目标,从多个源流向多个目标。目标路由器或出口路由器称为叶节点,来自源的流量在到达叶节点之前遍历一个或多个中继节点。
Junos OS 不支持多点到多点 LSP。
通过利用网络的 MPLS 数据包复制功能,多点 LSP 可避免入口路由器上不必要的数据包复制。只有当数据包转发到需要不同网络路径的两个或多个不同目标时,数据包才会发生复制。
在目标 LDP 会话上使用 LDP 的多点扩展
LDP 的多点扩展规范要求 LDP 会话的两个端点通过第 2 层介质直接连接,或被网络的 IGP 视为邻接点。这称为 LDP 链路会话。如果 LDP 会话的两个端点没有直接连接,则此会话称为目标 LDP 会话。
过去的 Junos OS 实施仅支持链路会话的组播 LDP。随着 LDP 链路保护功能的引入,组播 LDP 功能扩展到了目标 LDP 会话。 图 2 显示了一个示例拓扑。

路由器 R7 和 R8 分别是上游 (LSR-U) 和下游 (LSR-D) 标签交换路由器 (LSR),并部署组播 LDP。核心路由器 R5 已启用 RSVP-TE。
当 LSR-D 使用根和 LSP ID 属性设置点到多点 LSP 时,它将确定上游 LSR-U 作为到根路径上的下一跃点(目前,下一跃点假定为 IGP 下一跃点)。
借助目标 LDP 会话上的组播 LDP 支持,您可以确定 LSR-U 的下一跃点是否存在 LSP 下一跃点,该跃点位于 LSR-D 的根路径上,其中 LSR-D 和 LSR-you 不是直接连接的邻接方,而是目标 LDP 对等方。除非 LSR-D 和 LSR-U 之间存在 LSP,否则不会使用在 LSR-D 和 LSR-U 之间的目标 LDP 会话上播发的点到多点标签。因此,需要从 LSR-you 到 LSR-D 相反的方向使用相应的 LSP。
数据通过数据包的单播复制在点对多点 LSP 上传输,其中 LSR-U 向点对多点 LSP 的每个下游 LSR 发送一个副本。
数据传输以以下方式实现:
将协商目标 LDP 会话上的点对多点功能。
选择上游 LSR 的算法将发生变化,如果 IGP 下一跃点不可用,或者换句话说,LSR-D 和 LSR-U 之间没有 LDP 链路会话,则 RSVP LSP 用作到达 LSR-U 的下一跃点。
通过目标 LDP 会话收到的传入标签将安装为此点到多点 FEC 路由的分支下一跃点,其中 LDP 标签作为内部标签,将 RSVP 标签安装为外部标签。
LDP 链路保护的当前限制
当 LDP 网络部署中出现链路或节点故障时,应提供快速流量恢复,以便为任务关键型服务恢复受影响的流量。对于多点 LSP,当点到多点树的一个链路发生故障时,子树可能会分离,直到 IGP 重新融合,并使用从下游路由器到新的上游路由器的最佳路径建立多点 LSP。
在使用 LDP 流量本地修复进行快速重新路由时,数据包转发引擎中预安装了备份路径(修复路径)。当主路径发生故障时,流量会快速移动到备份路径,而无需等待路由协议融合。无环路备用 (LFA) 是在核心和服务提供商网络中提供 IP 快速重新路由功能的方法之一。
如果没有 LFA,当链路或路由器出现故障或返回到服务中时,分布式路由算法将根据网络中的更改计算新路由。计算新路由的时间称为路由转换。在路由过渡完成之前,网络连接将中断,因为故障旁边的路由器会继续通过故障组件转发数据包,直到识别出备用路径。
但是,由于 IGP 指标,LFA 无法在所有网络部署中实现全面覆盖。因此,这是当前 LDP 链路保护方案的限制。
图 3 展示了 LFA 覆盖不完全的示例网络,其中流量从源路由器 (S) 通过路由器 R1 流向目标路由器 (D)。假设网络中的每个链路具有相同的指标,如果路由器 S 和路由器 R1 之间的链路发生故障,路由器 R4 不是保护 S-R1 链路的 LFA,因此流量弹性将丢失。因此,使用普通 LFA 无法实现全覆盖。在典型的网络中,LFA 覆盖范围始终与普通 LFA 存在一定比例的差距。

使用 RSVP LSP 作为解决方案
要保护通过 LDP LSP 的流量,关键是要有一个显式隧道,以便在发生链路或节点故障时重新路由流量。显式路径必须在下一个下一个下游路由器上终止,而该显式路径需要接受流量,而该显式路径应通过 RPF 检查。
RSVP LSP 通过通过以下方式扩展 LFA 覆盖范围,帮助克服了目前对于点对点和点对多点 LDP LSP 的无环路替代 (LFA) 限制:
手动配置的 RSVP LSP
考虑到中 图 3所使用的示例,当 S-R1 链路发生故障且路由器 R4 不是该特定链路的 LFA 时,手动创建的 RSVP LSP 将用作补丁,以提供完整的 LFA 覆盖范围。RSVP LSP 已预发信号并预安装在路由器 S 的数据包转发引擎中,因此一旦路由器 S 检测到链路出现故障,即可使用。

在这种情况下,在路由器 S、R4 和 R3 之间会创建一个 RSVP LSP,如中 图 4所示。路由器 S 和路由器 R3 之间会创建一个目标 LDP 会话,因此,当 S-R1 链路发生故障时,流量会到达路由器 R3。路由器 R3 会将流量转发到路由器 R2,因为路由器 R2 是到达目标的最短路径,即路由器 D。
动态配置的 RSVP LSP
此方法会自动创建并预安装在系统中的 RSVP LSP,以便在出现链路故障时立即使用。在这里,出口是受保护链路另一端的节点,从而改善 LFA 覆盖范围。
Benefits of Enabling Dynamic RSVP LSPs
易于配置。
只要有替代路径到受保护的链路远端,就针对链路故障提供 100% 的保障。
设置和关闭 RSVP 旁路 LSP 是自动的。
当受保护的链路开启时,RSVP LSP 仅用于链路保护,不用于转发流量。
减少系统上所需的 RSVP LSP 总数。
考虑到中 图 3所使用的示例,为了防止流量出现 S-R1 链路的潜在故障,路由器 R4 不是该特定链路的 LFA,因此会自动向路由器 R1 创建 RSVP 旁路 LSP,路由器 R1 是受保护链路远端的节点,如图所示 图 5。流量从路由器 R1 转发到其原始目标路由器 D。
RSVP LSP 已预发信号并预安装在路由器 S 的数据包转发引擎中,以便在路由器 S 检测到链路故障后立即使用。

另一种操作模式是根本不使用 LFA,始终创建 RSVP LSP,以涵盖所有链路故障。
要启用动态 RSVP LSP, dynamic-rsvp-lsp
除了在 [edit protocols ldp interface interface-name link-protection]
相应的接口上启用 RSVP 协议外,还包括在层次结构级别上添加语句。
了解组播 LDP 链路保护
点对多点 LDP 标签交换路径 (LSP) 是一种点对点到多点的 LDP 信号 LSP,称为组播 LDP。
组播 LDP LSP 可用于从单个根节点或入口节点向遍历一个或多个中继节点的多个叶节点或出口节点发送流量。组播 LDP 链路保护可在链路发生故障时快速重新路由通过点到多点 LDP LSP 传输的流量。当点到多点树的一个链路发生故障时,子树可能会分离,直到 IGP 重新融合并且使用从下游路由器到新的上游路由器的最佳路径建立多点 LSP。
要保护通过组播 LDP LSP 的流量,您可以配置一个显式隧道,以便在发生链路故障时重新路由流量。显式路径必须在下一个下游路由器上终止。流量的反向路径转发应成功。
组播 LDP 链路保护引入了以下特性和功能:
使用动态 RSVP LSP 作为旁路隧道
RSVP LSP 的显式路由对象 (ERO) 使用约束最短路径优先 (CSPF) 计算,并使用该约束作为要避免的链路。只要需要链路保护,LSP 会发出信号并动态关闭。
先创后断
先行先断功能可确保在尝试向新 LSP 路径发出信号时,在撕毁组播 LDP LSP 的旧 LSP 路径时,丢包最少。
目标 LDP 会话
创建与下游标签交换路由器 (LSR) 的目标邻接有两个原因:
在链路故障后保持会话正常运行。
要使用从会话接收的点到多点标签将流量发送到 RSVP LSP 旁路隧道上的下行 LSR。
当下游 LSR 使用根节点和 LSP ID 设置组播 LDP LSP 时,它会使用上游 LSR,这是通往根的最佳路径。
当与下游 LSR 存在多个链路邻接(并行链路)时,不需要组播 LDP 链路保护。
用于提供 LDP 链路保护的不同模式
以下是用于单播和组播 LDP 链路保护的三种不同操作模式:
Case A: LFA only
在这种操作模式下,使用现有可行的无环路替代 (LFA) 提供组播 LDP 链路保护。在没有可行的 LFA 的情况下,组播 LDP LSP 不提供链路保护。
Case B: LFA and Dynamic RSVP LSP
在这种操作模式下,使用现有可行的 LFA 提供组播 LDP 链路保护。如果没有可行的 LFA,系统会自动创建 RSVP 旁路 LSP,为组播 LDP LSP 提供链路保护。
Case C: Dynamic RSVP LSP only
在此操作模式下,LFA 不用于链路保护。通过使用自动创建的 RSVP 旁路 LSP 提供组播 LDP 链路保护。
图 6 是一个示例拓扑,展示了组播 LDP 链路保护的不同操作模式。路由器 R5 是连接到两个叶节点(路由器 R3 和 R4)的根节点。路由器 R0 和路由器 R1 分别是上游和下游标签交换路由器 (LSR)。组播 LDP LSP 在根节点和叶节点之间运行。

考虑到路由器 R0 在 R0-R1 链路发生故障时需要保护组播 LDP LSP,因此不同的链路保护模式将按以下方式运行:
Case A: LFA only
路由器 R0 检查是否存在可以避开 R0-R1 链路以到达路由器 R1 的可行 LFA 路径。根据指标,路由器 R2 是 R0-R1 链路的有效 LFA 路径,用于转发单播 LDP 流量。如果多个组播 LDP LSP 使用 R0-R1 链路,则使用相同的 LFA(路由器 R2)进行组播 LDP 链路保护。
当 R0-R1 链路发生故障时,组播 LDP LSP 流量会通过路由器 R0 移动到 LFA 路径上,并将要到达路由器 R1 (L100) 的单播 LDP 标签推送到组播 LDP 标签 (L21) 之上。
Case B: LFA and Dynamic RSVP LSP
路由器 R0 检查是否存在可以避开 R0-R1 链路以到达路由器 R1 的可行 LFA 路径。根据指标,路由器 R2 是 R0-R1 链路的有效 LFA 路径,用于转发单播 LDP 流量。如果多个组播 LDP LSP 使用 R0-R1 链路,则使用相同的 LFA(路由器 R2)进行组播 LDP 链路保护。当 R0-R1 链路发生故障时,组播 LDP LSP 流量会通过路由器 R0 移动到 LFA 路径上。
但是,如果 R2-R1 链路上的指标为 50 而不是 10,则路由器 2 不是 R0-R1 链路的有效 LFA。在这种情况下,系统会自动创建一个 RSVP LSP,以保护在路由器 R0 和 R1 之间传输的组播 LDP 流量。
Case C: Dynamic RSVP LSP only
从路由器 R0 到路由器 R1,再到路由器 R2 自动发出 RSVP LSP 信号,避免出现接口 ge-1/1/0。如果多个组播 LDP LSP 使用 R0-R1 链路,则同一 RSVP LSP 用于组播 LDP 链路保护。
当 R0-R1 链路发生故障时,组播 LDP LSP 流量会通过路由器 R0 移动到 RSVP LSP 上,并将要到达路由器 R1 (L100) 的 RSVP 标签推送到组播 LDP 标签 (L21) 之上。
用于 LDP 链路保护的标签操作
使用与图 5 相同的网络拓扑, 图 7 展示了单播和组播 LDP 链路保护的标签操作。

路由器 R5 是连接到两个叶节点(路由器 R3 和 R4)的根节点。路由器 R0 和路由器 R1 分别是上游和下游标签交换路由器 (LSR)。组播 LDP LSP 在根节点和叶节点之间运行。单播 LDP 路径将路由器 R1 连接到路由器 R5。
在以下 LDP 链路保护模式下,标签操作的执行方式不同:
案例 A:仅 LFA
show route detail
使用路由器 R0 上的命令输出,可以导出单播 LDP 流量和组播 LDP 流量。
user@R0> show route detail 299840 (1 entry, 1 announced) *LDP Preference: 9 Next hop type: Router Address: 0x93bc22c Next-hop reference count: 1 Next hop: 11.0.0.6 via ge-0/0/1.0 weight 0x1, selected Label operation: Swap 299824 Session Id: 0x1 Next hop: 11.0.0.10 via ge-0/0/2.0 weight 0xf000 Label operation: Swap 299808 Session Id: 0x3 State: <Active Int> Age: 3:16 Metric: 1 Validation State: unverified Task: LDP Announcement bits (1): 0-KRT AS path: I Prefixes bound to route: 192.168.0.4/32 299856 (1 entry, 1 announced) *LDP Preference: 9 Next hop type: Flood Address: 0x9340e04 Next-hop reference count: 3 Next hop type: Router, Next hop index: 262143 Address: 0x93bc3dc Next-hop reference count: 2 Next hop: 11.0.0.6 via ge-0/0/1.0 weight 0x1 Label operation: Swap 299888 Next hop: 11.0.0.10 via ge-0/0/2.0 weight 0xf000 Label operation: Swap 299888, Push 299776(top) Label TTL action: prop-ttl, prop-ttl(top) State: <Active Int AckRequest> Age: 3:16 Metric: 1 Validation State: unverified Task: LDP Announcement bits (1): 0-KRT AS path: I FECs bound to route: P2MP root-addr 192.168.0.5, lsp-id 99
标签 299840 是到达路由器 R0 的流量,与到路由器 R1 的单播 LDP 流量相对应。标签299856是到达路由器 0 的流量,与从根节点 R5 到叶出口节点 R3 和 R4 的组播 LDP 流量相对应。
单播和组播 LDP LSP 的主路径都是通过接口 ge-0/0/1(连接到路由器 R1 的链路),而 LFA 路径通过接口 ge-0/0/2(到路由器 R2 的链路)。除非 ge-0/0/1 接口关闭,否则 LFA 路径不会使用。
在案例 A 的标签操作中,对于单播和组播 LDP 流量,仅 LFA 操作模式不同:
单播标签操作
对于单播 LDP 流量,将在其启用 LDP 的网络中的所有链路上播发 FEC 和相关标签。这意味着,为了为向路由器 R4 的单播 LDP 流量提供 LFA 操作,路由器 R0 只需将传入标签交换为路由器 R1 播发的标签299824用于 FEC R4,而是将传入标签交换为路由器 R2 播发的标签299808 FEC R4。这是单播 LDP 流量的标准 Junos OS LFA 操作。
图 8 展示了 R0-R1 链路发生故障时单播流量的标签操作。灰色框在正常情况下显示单播 LDP 流量的标签操作,当 R0-R1 链路出现故障时,虚线框则显示单播 LDP 流量的标签操作。
图 8: 单播 LDP 标签操作组播标签操作
组播 LDP 流量的标签操作与单播 LDP 标签操作不同,因为多点 LSP 标签只会沿着从叶节点到入口节点的最佳路径播发。因此,路由器 R2 不知道组播 LDP。为了克服这种情况,组播 LDP LSP 流量只需在单播 LDP LSP 路径内部隧道,通过路由器 R2(在路由器 R1 终止)。
为了实现这一目标,路由器 R0 首先将传入的组播 LDP LSP 标签299856交换为路由器 R1 播发的299888标签。然后,标签299776被推送到顶部,即路由器 R2 为 FEC R1 播发的 LDP 标签。当数据包到达路由器 R2 时,由于倒数第二跳跃弹出,顶部标签会弹出。这意味着数据包到达路由器 R1 时,其组播 LDP 标签299888路由器 R1 最初播发至路由器 R0。
图 9 展示了 R0-R1 链路发生故障时的组播 LDP 流量的标签操作。蓝色框显示正常情况下组播 LDP 流量的标签操作,而虚线框则显示 R0-R1 链路发生故障时组播 LDP 流量的标签操作。
图 9: 组播 LDP 标签操作
当 R2-R1 链路上的指标设置为 1000 而非 1 时,路由器 R2 不是路由器 R0 的有效 LFA。在这种情况下,如果路由器 R2 在 IGP 融合之前收到发往路由器 R1、R3 或 R4 的数据包,则数据包将发回路由器 R0,从而产生环路数据包。
由于路由器 R0 没有可行的 LFA,因此数据包转发引擎中没有安装备份路径。如果 R0-R1 链路发生故障,流量将中断,直到 IGP 和 LDP 融合,并且受影响的路由器上安装了新条目。
当无 LFA 可用于链路保护时,命令 show route detail
将显示状态。
user@host> show route detail 299840 (1 entry, 1 announced) *LDP Preference: 9 Next hop type: Router, Next hop index: 578 Address: 0x9340d20 Next-hop reference count: 2 Next hop: 11.0.0.6 via ge-0/0/1.0, selected Label operation: Swap 299824 Session Id: 0x1 State: <Active Int> Age: 5:38 Metric: 1 Validation State: unverified Task: LDP Announcement bits (1): 0-KRT AS path: I Prefixes bound to route: 192.168.0.4/32 299856 (1 entry, 1 announced) *LDP Preference: 9 Next hop type: Flood Address: 0x9340e04 Next-hop reference count: 3 Next hop type: Router, Next hop index: 579 Address: 0x93407c8 Next-hop reference count: 2 Next hop: 11.0.0.6 via ge-0/0/1.0 Label operation: Swap 299888 State: <Active Int AckRequest> Age: 5:38 Metric: 1 Validation State: unverified Task: LDP Announcement bits (1): 0-KRT AS path: I FECs bound to route: P2MP root-addr 192.168.0.5, lsp-id 99
案例 B:LFA 和动态 RSVP LSP
在此操作模式下,如果有可行的 LFA 邻接方,则标签操作行为与仅 LFA 模式类似。但是,如果没有可行的 LFA 邻接方,系统会自动创建一个 RSVP 旁路隧道。
如果链路 R2-R1 上的指标设置为 1000 而不是 1,则路由器 R2 不是路由器 R0 的 LFA。在得知没有 LFA 路径来保护 R0-R1 链路故障时,会自动创建一个 RSVP 旁路隧道,其中路由器 R1 作为出口节点,并遵循可避开 R0-R1 链路的路径(例如 R0-R2-R1)。
如果 R0-R1 链路发生故障,则单播 LDP 和组播 LDP 流量将通过 RSVP 旁路隧道进行隧道传输。RSVP 旁路隧道不用于正常转发,仅在 R0-R1 链路故障的情况下为 LDP 流量提供链路保护。
show route detail
使用命令,可以派生单播和组播 LDP 流量。
user@host> show route detail 299840 (1 entry, 1 announced) *LDP Preference: 9 Next hop type: Router Address: 0x940c3dc Next-hop reference count: 1 Next hop: 11.0.0.6 via ge-0/0/1.0 weight 0x1, selected Label operation: Swap 299824 Session Id: 0x1 Next hop: 11.0.0.10 via ge-0/0/2.0 weight 0x8001 Label-switched-path ge-0/0/1.0:BypassLSP->192.168.0.1 Label operation: Swap 299824, Push 299872(top) Label TTL action: prop-ttl, prop-ttl(top) Session Id: 0x3 State: <Active Int NhAckRequest> Age: 19 Metric: 1 Validation State: unverified Task: LDP Announcement bits (1): 0-KRT AS path: I Prefixes bound to route: 192.168.0.4/32 299856 (1 entry, 1 announced) *LDP Preference: 9 Next hop type: Flood Address: 0x9340e04 Next-hop reference count: 3 Next hop type: Router, Next hop index: 262143 Address: 0x940c154 Next-hop reference count: 2 Next hop: 11.0.0.6 via ge-0/0/1.0 weight 0x1 Label operation: Swap 299888 Next hop: 11.0.0.10 via ge-0/0/2.0 weight 0x8001 Label-switched-path ge-0/0/1.0:BypassLSP->192.168.0.1 Label operation: Swap 299888, Push 299872(top) Label TTL action: prop-ttl, prop-ttl(top) State: < Active Int AckRequest> Age: 20 Metric: 1 Validation State: unverified Task: LDP Announcement bits (1): 0-KRT AS path: I FECs bound to route: P2MP root-addr 192.168.0.5, lsp-id 99
单播和组播 LDP LSP 的主路径都是通过接口 ge-0/0/1(连接到路由器 R1 的链路),而 LFA 路径通过接口 ge-0/0/2(连接到路由器 R2 的链路)。除非 ge-0/0/1 接口关闭,否则 LFA 路径不会使用。
标签 299840 是到达路由器 R0 的流量,与到路由器 R4 的单播 LDP 流量相对应。标签299856是到达路由器 0 的流量,与从根节点 R5 到叶出口节点 R3 和 R4 的组播 LDP 流量相对应。
如命令输出所示 show route detail
,对于单播 LDP 和组播 LDP 流量,保护路径的标签操作相同。路由器 R0 上的传入 LDP 标签将交换至路由器 R1 播发至路由器 R0 的 LDP 标签。然后,用于旁路隧道的 RSVP 标签299872被推送到数据包上。在旁路隧道上使用倒数第二跳跃弹出,导致路由器 R2 弹出该标签。这样,数据包将带有最初播发至路由器 R0 的 LDP 标签到达路由器 R1。
图 10 展示了受 RSVP 旁路隧道保护的单播 LDP 和组播 LDP 流量的标签操作。灰色和蓝色框分别表示在正常条件下单播和组播 LDP 流量使用的标签值。虚线框表示 R0-R1 链路发生故障时使用的标签值。

案例 C:仅动态 RSVP LSP
在此操作模式中,完全不使用 LFA。系统会自动创建动态 RSVP 旁路 LSP,以提供链路保护。命令和标签操作的 show route detail
输出类似于案例 B、LFA 和动态 RSVP LSP 模式。
组播 LDP 链路保护配置示例
要启用组播 LDP 链路保护,需要在路由器 R0 上进行以下配置:
在此示例中,在连接到路由器 R1 的路由器 R0 的 ge-1/0/0 接口上启用了组播 LDP 链路保护,尽管通常需要对所有接口进行配置以实现链路保护。
路由器 R0
protocols { rsvp { interface all; interface ge-0/0/0.0 { disable; } } mpls { interface all; interface ge-0/0/0.0 { disable; } } ospf { traffic-engineering; area 0.0.0.0 { interface lo0.0; interface ge-0/0/1.0 { link-protection; } interface ge-0/0/2.0; interface ge-0/0/3.0; } } ldp { make-before-break { timeout seconds; switchover-delay seconds; } interface ge-1/1/0.0 { link-protection { disable; dynamic-rsvp-lsp; } } } }
以下配置语句适用于不同组播 LDP 保护模式,如下所示:
link-protection
语句位于[edit protocols ospf interface ge-0/0/1.0]
此配置仅适用于组播 LDP 链路保护案例 A(仅限 LFA)和案例 B(LFA 和动态 RSVP LSP)模式。案例 C 不需要在 IGP 下配置链路保护(仅限动态 RSVP LSP)。
link-protection
语句位于[edit protocols ldp interface ge-0/0/1.0]
所有组播 LDP 保护模式都需要此配置。但是,如果唯一存在的 LDP 流量是单播流量,并且不需要动态 RSVP 旁路,则不需要此配置,因为层级的
link-protection
[edit protocols ospf interface ge-0/0/1.0]
语句会导致 LDP 单播流量的 LFA 操作。dynamic-rsvp-lsp
语句位于[edit protocols ldp interface ge-0/0/1.0 link-protection]
此配置仅适用于案例 B(LFA 和动态 RSVP LSP)和案例 C(仅限动态 RSVP LSP)LDP 链路保护模式。动态 RSVP LSP 配置不适用于案例 A(仅限 LFA)。
先决后决
Junos OS 上默认启用先发制功能,可为点对多点 LSP 提供一些优势。
对于点对多点 LSP,标签交换路由器 (LSR) 选择作为 LSP 根部下一跃点的 LSR 作为其上游 LSR。当到达根路径的最佳路径发生变化时,LSR 会选择新的上游 LSR。在此期间,LSP 可能会暂时中断,导致数据包丢失,直到 LSP 重新融合到新的上游 LSR。在这种情况下,先发制人的目标是将丢包量降至最低。如果从 LSR 到根路径的最佳路径发生变化,但 LSP 继续将流量转发到上一个下一跃点到根跃点,应在撤回旧 LSP 之前建立新的 LSP,以最大程度地减少数据包丢失的持续时间。
例如,在链路故障后,下游 LSR(例如,LSR-D)仍在接收和/或将数据包转发给其他下游 LSR,因为它继续接收来自单跳 RSVP LSP 的数据包。路由融合后,LSR-D 会为此点到多点 LSP 的 FEC (FEC-A) 选择新的上游 LSR (LSR-U)。新的 LSR 可能已经将用于 FEC-A 的数据包转发到 LSR-D 以外的下行 LSR。从 LSR-D 收到 FEC-A 标签后,当 LSR-U 得知 FEC-A 的 LSP 已从根到自身时,通知 LSR-D。当 LSR-D 收到此类通知时,它会将其 LSP 根的下一跃点更改为 LSR-U。这是对 LSR-D 执行路由删除和添加操作。此时,LSR-D 会进行 LSP 切换,丢弃通过 RSVP LSP 或 LFA 隧道传输的流量,并接受来自 LSR-U 的流量。增加了 LSR-U 的新传输路由。RPF 检查已更改为接受来自 LSR-you 的流量并丢弃来自旧上游 LSR 的流量,或者删除旧路由并添加新路由。
假设 LSR-U 已从其上游路由器收到 FEC-A 点到多点 LSP 的“先发后断”通知,并已安装 LSP 的转发状态。此时,它应该通过先断通知向 LSR-D 发出信号,表明它已成为 FEC-A 标识的树的一部分,LSR-D 应开始向 LSP 切换。否则,LSR-U 应记住,当收到来自上游 LSR 的 FEC-A 先发通知并安装此 LSP 的转发状态时,它需要向 LSR-D 发送通知。LSR-D 使用一跳 RSVP LSP 或 LFA 路径继续接收来自旧下一跃点到根节点的流量,直到它切换到新的点对多点 LSP 到 LSR-U。
具有组播 LDP 链路保护的先断功能包括以下功能:
先断后断功能
LSR 播发它能够通过功能播发来处理“先成后断”LSP。如果对等方不支持“先试后断”,则不会将“先发后断”参数发送至此对等方。如果 LSR 从下游 LSR (LSR-D) 收到先行先断参数,但上游 LSR (LSR-U) 不支持“先断后断”,则 LSR 会立即向 LSR-D 发送先发通知,且未建立支持先发先断的 LSP。相反,建立了正常的 LSP。
先断后断状态代码
先行先断的状态代码包括:
1 — 先成后断请求
2 — 先确认
当下游 LSR 为点到多点 LSP 发送标签映射消息时,它将先行后中断状态代码作为 1(请求)包含。当上游 LSR 更新点到多点 LSP 的转发状态时,它会通知下行 LSR 一条通知消息,其中包含先发后断状态代码为 2(确认)。此时,下游 LSR 会进行 LSP 切换。
警告和限制
LDP 链路保护功能的 Junos OS 实施有以下警告和限制:
出口 LSR 上的以下点到多点 LSP 不支持先行先断:
带有虚拟路由和转发 (VRF) 标签的新一代组播虚拟专用网络 (MVPN)
静态 LSP
不支持以下功能:
Junos OS 12.3、13.1 和 13.2 版中用于点到多点 LSP 的不间断活动路由
平滑重启切换点到多点 LSP
路由实例的链路保护
示例:配置 LDP 链路保护
此示例说明如何为单播和组播 LDP 标签交换路径 (LSP) 配置标签分配协议 (LDP) 链路保护。
要求
此示例使用以下硬件和软件组件:
六个路由器,可以是 M 系列、MX 系列或 T 系列路由器的组合,带有一个根节点和两个叶节点,运行一个点到多点 LDP LSP。
所有路由器上运行的 Junos OS 12.3 或更高版本。
开始之前:
配置设备接口。
配置以下协议:
RSVP
MPLS
OSPF 或任何其他 IGP
LDP
概述
在链路故障时,LDP 链路保护支持快速重新路由通过 LDP LSP 传输的流量。LDP 点对多点 LSP 可用于从单个根节点或入口节点向遍历一个或多个中继节点的多个叶节点或出口节点发送流量。当点到多点树的一个链路发生故障时,子树可以分离,直到 IGP 重新融合和组播 LDP 使用从下游路由器到新的上游路由器的最佳路径发起标签映射。为了在链路发生故障时保护流量,可以配置一个显式隧道,以便可以使用隧道重新路由流量。Junos OS 支持“先试后断”功能,可确保在尝试在拆除旧 LSP 路径之前向新 LSP 路径发出信号时,将丢包降至最低。此功能还增加了用于组播 LDP 链路保护的目标 LDP 支持。
配置 LDP 链路保护时,请注意以下注意事项:
在 IGP 下配置流量工程(如果默认情况下不受支持),并包括为 MPLS 和 RSVP 配置的接口,以便 RSVP 使用受限最短路径优先 (CSPF) 发出基于受限链路保护的动态 RSVP LSP 信号。如果不满足此条件,则 RSVP LSP 可能无法启动,LDP 无法将其用作受保护的下一跃点。
在两个标签交换路由器 (LSR) 之间配置一条路径,当出现链路故障时,在路由器之间提供 IP 连接。这使得 CSPF 能够计算链路保护的替代路径。当路由器之间的连接中断时,LDP 的目标邻接不会出现,也无法发出动态 RSVP LSP 信号,从而导致对等方是下行 LSR 的 LDP 转发等效类 (FEC) 无法得到保护。
如果仅在一个 LSR 上激活链路保护,则不应使用语句配置另一个
strict-targeted-hellos
LSR。这使得没有链路保护的 LSR 能够允许非对称远程邻接方发现,并定期向发起远程邻接方的 LSR 发送定向问候。未满足此条件时,不会形成 LDP 目标邻接。必须在 LSR 的环路接口上启用 LDP,以便基于 LDP 隧道、基于 LDP 的虚拟专用 LAN 服务 (VPLS)、第 2 层电路或 LDP 会话保护创建远程邻接方。未满足此条件时,不会形成 LDP 目标邻接。
对于单播 LDP LSP,应在 IGP 中配置无环路替代 (LFA)。
到合并点的入口路由应至少有一个下一跃点,以避免合并点与单播 LDP LSP 本地修复点之间的主链路。
本地修复点应具有用于备份下一跃点的单播 LDP 标签,以到达合并点。
拓扑

在此示例中,路由器 R5 是连接到两个叶节点(路由器 R3 和 R4)的根节点。路由器 R0 是本地维修点。
配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到层级的 [edit]
CLI 中,然后从配置模式进入 commit
。
R5
set interfaces ge-0/0/0 unit 0 family inet address 10.10.10.1/30 set interfaces ge-0/0/0 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.1.5/32 set routing-options router-id 10.255.1.5 set routing-options autonomous-system 100 set protocols rsvp interface all set protocols rsvp interface fxp0.0 disable set protocols mpls traffic-engineering set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface all metric 1 set protocols ospf area 0.0.0.0 interface fxp0.0 disable set protocols ldp interface all link-protection dynamic-rsvp-lsp set protocols ldp interface fxp0.0 disable set protocols ldp p2mp
R0
set interfaces ge-0/0/0 unit 0 family inet address 10.10.10.2/30 set interfaces ge-0/0/0 unit 0 family mpls set interfaces ge-0/0/1 unit 0 family inet address 20.10.10.1/30 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 30.10.10.1/30 set interfaces ge-0/0/2 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.1.0/32 set routing-options router-id 10.255.1.0 set routing-options autonomous-system 100 set protocols rsvp interface all set protocols rsvp interface fxp0.0 disable set protocols mpls traffic-engineering set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface all metric 1 set protocols ospf area 0.0.0.0 interface fxp0.0 disable set protocols ldp interface all link-protection dynamic-rsvp-lsp set protocols ldp interface fxp0.0 disable set protocols ldp p2mp
R1
set interfaces ge-0/0/0 unit 0 family inet address 60.10.10.2/30 set interfaces ge-0/0/0 unit 0 family mpls set interfaces ge-0/0/1 unit 0 family inet address 40.10.10.1/30 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 30.10.10.2/30 set interfaces ge-0/0/2 unit 0 family mpls set interfaces ge-0/0/3 unit 0 family inet address 50.10.10.1/30 set interfaces ge-0/0/3 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.1.1/32 set routing-options router-id 10.255.1.1 set routing-options autonomous-system 100 set protocols rsvp interface all set protocols rsvp interface fxp0.0 disable set protocols mpls traffic-engineering set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface all metric 1 set protocols ospf area 0.0.0.0 interface fxp0.0 disable set protocols ldp interface all link-protection dynamic-rsvp-lsp set protocols ldp interface fxp0.0 disable set protocols ldp p2mp
R2
set interfaces ge-0/0/0 unit 0 family inet address 60.10.10.1/30 set interfaces ge-0/0/0 unit 0 family mpls set interfaces ge-0/0/1 unit 0 family inet address 20.10.10.2/30 set interfaces ge-0/0/1 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.1.2/32 set routing-options router-id 10.255.1.2 set routing-options autonomous-system 100 set protocols rsvp interface all set protocols rsvp interface fxp0.0 disable set protocols mpls traffic-engineering set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface all set protocols ospf area 0.0.0.0 interface fxp0.0 disable set protocols ldp interface all link-protection dynamic-rsvp-lsp set protocols ldp interface fxp0.0 disable set protocols ldp p2mp
R3
set interfaces ge-0/0/1 unit 0 family inet address 40.10.10.2/30 set interfaces ge-0/0/1 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.1.3/32 set routing-options router-id 10.255.1.3 set routing-options autonomous-system 100 set protocols rsvp interface all set protocols rsvp interface fxp0.0 disable set protocols mpls traffic-engineering set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface all metric 1 set protocols ospf area 0.0.0.0 interface fxp0.0 disable set protocols ldp interface all link-protection dynamic-rsvp-lsp set protocols ldp interface fxp0.0 disable set protocols ldp p2mp root-address 10.255.1.5 lsp-id 1
R4
set interfaces ge-0/0/3 unit 0 family inet address 50.10.10.2/30 set interfaces ge-0/0/3 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.1.4/32 set protocols rsvp interface all set protocols rsvp interface fxp0.0 disable set protocols mpls traffic-engineering set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface all metric 1 set protocols ospf area 0.0.0.0 interface fxp0.0 disable set protocols ldp interface all link-protection dynamic-rsvp-lsp set protocols ldp interface fxp0.0 disable set protocols ldp p2mp root-address 10.255.1.5 lsp-id 1
程序
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 在配置模式下使用 CLI 编辑器。
要配置路由器 R0:
配置路由器 R0 接口。
[edit interfaces]
user@R0# set ge-0/0/0 unit 0 family inet address 10.10.10.2/30 user@R0# set ge-0/0/0 unit 0 family mpls user@R0# set ge-0/0/1 unit 0 family inet address 20.10.10.1/30 user@R0# set ge-0/0/1 unit 0 family mpls user@R0# set ge-0/0/2 unit 0 family inet address 30.10.10.1/30 user@R0# set ge-0/0/2 unit 0 family mpls user@R0# set lo0 unit 0 family inet address 10.255.1.0/32配置路由器 R0 的路由器 ID 和自治系统。
[edit routing-options]
user@R0# set router-id 10.255.1.0 user@R0# set autonomous-system 100在路由器 R0 的所有接口上启用 RSVP(管理接口除外)。
[edit protocols]
user@R0# set rsvp interface all user@R0# set rsvp interface fxp0.0 disable在路由器 R0(不包括管理接口)的所有接口上启用 MPLS 以及流量工程功能。
[edit protocols]
user@R0# set mpls traffic-engineering user@R0# set mpls interface all user@R0# set mpls interface fxp0.0 disable在路由器 R0 的所有接口(不包括管理接口)上启用 OSPF,为链路分配等价成本指标,并启用流量工程功能。
[edit protocols]
user@R0# set ospf traffic-engineering user@R0# set ospf area 0.0.0.0 interface all metric 1 user@R0# set ospf area 0.0.0.0 interface fxp0.0 disable注:有关采用无环路替代 (LFA) 的组播 LDP 链路保护,在层级下
[edit protocols]
启用以下配置:set ospf area 0 interface all link-protection
在路由器 R0(不包括管理接口)的所有接口上启用 LDP,并使用动态 RSVP 旁路 LSP 配置链路保护。
[edit protocols]
user@R0# set ldp interface all link-protection dynamic-rsvp-lsp user@R0# set ldp interface fxp0.0 disable user@R0# set ldp p2mp
结果
在配置模式下,输入 、 show routing-options
和show protocols
命令,show interfaces
以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@R0# show interfaces ge-0/0/0 { unit 0 { family inet { address 10.10.10.2/30; } family mpls; } } ge-0/0/1 { unit 0 { family inet { address 20.10.10.1/30; } family mpls; } } ge-0/0/2 { unit 0 { family inet { address 30.10.10.1/30; } family mpls; } } lo0 { unit 0 { family inet { address 10.255.1.0/32; } } }
user@R0# show routing-options router-id 10.255.1.0; autonomous-system 100;
user@R0# show protocols rsvp { interface all; interface fxp0.0 { disable; } } mpls { traffic-engineering; interface all; interface fxp0.0 { disable; } } ospf { traffic-engineering; area 0.0.0.0 { interface all { metric 1; } interface fxp0.0 { disable; } } } ldp { interface all { link-protection { dynamic-rsvp-lsp; } } interface fxp0.0 { disable; } p2mp; }
验证
验证配置是否工作正常。
验证旁路 RSVP LSP 路径
目的
验证是否已在本地修复点 (PLR) 上创建旁路 RSVP LSP 路径。
行动
在操作模式下,运行 show route tale mpls.0
命令。
user@R0> show route tale mpls.0 mpls.0: 17 destinations, 17 routes (17 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 0 *[MPLS/0] 05:28:13, metric 1 Receive 1 *[MPLS/0] 05:28:13, metric 1 Receive 2 *[MPLS/0] 05:28:13, metric 1 Receive 13 *[MPLS/0] 05:28:13, metric 1 Receive 299792 *[LDP/9] 00:41:41, metric 1 > to 30.10.10.2 via ge-0/0/2.0, Pop 299792(S=0) *[LDP/9] 00:41:41, metric 1 > to 30.10.10.2 via ge-0/0/2.0, Pop 299808 *[LDP/9] 00:41:41, metric 1 > to 20.10.10.2 via ge-0/0/1.0, Pop 299808(S=0) *[LDP/9] 00:41:41, metric 1 > to 20.10.10.2 via ge-0/0/1.0, Pop 299920 *[RSVP/7/1] 01:51:43, metric 1 > to 30.10.10.2 via ge-0/0/2.0, label-switched-path ge-0/0/0.0:BypassLSP->10.255.1.1 299920(S=0) *[RSVP/7/1] 01:51:43, metric 1 > to 30.10.10.2 via ge-0/0/2.0, label-switched-path ge-0/0/0.0:BypassLSP->10.255.1.1 299936 *[RSVP/7/1] 01:51:25, metric 1 > to 20.10.10.2 via ge-0/0/1.0, label-switched-path ge-0/0/0.0:BypassLSP->10.255.1.2 299936(S=0) *[RSVP/7/1] 01:51:25, metric 1 > to 20.10.10.2 via ge-0/0/1.0, label-switched-path ge-0/0/0.0:BypassLSP->10.255.1.2 299952 *[LDP/9] 00:06:11, metric 1 > to 10.10.10.1 via ge-0/0/0.0, Pop 299952(S=0) *[LDP/9] 00:06:11, metric 1 > to 10.10.10.1 via ge-0/0/0.0, Pop 299968 *[LDP/9] 00:05:39, metric 1 > to 30.10.10.2 via ge-0/0/2.0, Swap 299984 299984 *[LDP/9] 00:05:38, metric 1 > to 30.10.10.2 via ge-0/0/2.0, Swap 300000 300000 *[LDP/9] 00:05:15, metric 1 > to 30.10.10.2 via ge-0/0/2.0, Swap 300016
含义
当 R0-R1 链路中断时,将使用 RSVP 旁路 LSP 来路由流量。
验证标签操作
目的
验证 PLR 上的标签交换。
行动
在操作模式下,运行 show route table mpls.0 label label extensive
命令。
user@R0> show route table mpls.0 label 300000 extensive mpls.0: 17 destinations, 17 routes (17 active, 0 holddown, 0 hidden) 300000 (1 entry, 1 announced) TSI: KRT in-kernel 300000 /52 -> {Swap 300016} *LDP Preference: 9 Next hop type: Router, Next hop index: 589 Address: 0x9981610 Next-hop reference count: 2 Next hop: 30.10.10.2 via ge-0/0/2.0, selected Label operation: Swap 300016 Load balance label: Label 300016: None; Session Id: 0x2 State: <Active Int> Local AS: 100 Age: 12:50 Metric: 1 Validation State: unverified Task: LDP Announcement bits (1): 1-KRT AS path: I Prefixes bound to route: 10.255.1.4/32
含义
该标签必须到达路由器 R4,这是一个叶节点。
了解仅组播快速重新路由
当发生链路故障时,仅组播快速重新路由 (MoFRR) 可将组播分配树中流量的数据包丢失降至最低,从而在支持这些功能的设备上增强组播路由协议,如协议无关组播 (PIM) 和多点标签分配协议(多点标签分配协议(多点 LDP)。
在交换机上,不支持带有 MPLS 标签交换路径和多点 LDP 的 MoFRR。
对于 MX 系列路由器,仅在配备 MPC 线卡的 MX 系列路由器上支持 MoFRR。作为先决条件,您必须将路由器 network-services enhanced-ip
配置为模式,并且路由器中的所有线卡都必须是 MPC。
启用 MoFRR 后,设备在主路径和备份上游路径上向组播源发送加入消息。设备从主路径和备份路径接收数据包,并根据优先级(分配给主路径和备份路径的权重)丢弃冗余数据包。当设备在主路径上检测到故障时,会立即开始接受来自辅助接口(备份路径)的数据包。在主路径链路故障时,快速切换大大缩短了融合时间。
MoFRR 的一个应用是流 IPTV。IPTV 流组播为 UDP 流,因此不会重新传输任何丢失的数据包,从而导致用户体验不尽如人意。MoFRR 可以改善这种情况。
MoFRR 概述
通过对单播流进行快速重新路由,上游路由设备可预先建立 MPLS 标签交换路径 (LSP),或预计算 IP 无环路备用 (LFA) 快速重新路由备份路径,以处理下游路径中某个分段的故障。
在组播路由中,接收方通常发起流量分布图。这与通常建立从源到接收器的路径的单播路由不同。PIM(适用于 IP)、多点 LDP(适用于 MPLS)和 RSVP-TE(适用于 MPLS)是能够建立组播分布图的协议。其中,PIM 和多点 LDP 接收器会启动分布图设置,因此 MoFRR 可以在支持的情况下使用这两种组播协议。
在组播树中,如果设备检测到网络组件故障,则执行被动修复需要一段时间,这会导致在设置备用路径时造成重大流量损失。当网络组件发生故障时,MoFRR 减少了组播分布树中的流量损失。借助 MoFRR,其中一个下游路由设备会设置指向源的备用路径,以接收相同组播流量的备份实时流。当主流发生故障时,MoFRR 路由设备可以快速切换到备份流。
启用 MoFRR 后,对于每个 (S,G) 条目,设备使用两个可用的上游接口来发送加入消息并接收组播流量。如果两个此类路径可用,则协议会尝试选择两个不相交的路径。如果不相交的路径不可用,则协议会选择两个不相交的路径。如果两个不相交的路径不可用,则仅选择一个主路径,无需备份。MoFRR 优先考虑不相交的备份,而倾向于均衡可用路径的负载。
IPv4 和 IPv6 协议家族都支持 MoFRR。
图 12 显示了从组播接收器路由设备(也称为出口提供商边缘 (PE) 设备)到组播源路由设备(也称为入口 PE 设备)的两条路径。

启用 MoFRR 后,出口(接收器端)路由设备会针对每个组播源 (S,G) 设置两个组播树,一个主路径和一个备用路径。换句话说,出口路由设备将相同的 (S,G) 加入消息传播到两个不同的上游邻接方,从而创建两个组播树。
其中一个组播树通过平面 1,另一个通过平面 2,如所示 图 12。对于每个 (S,G), 出口路由设备都会转发在主路径上接收的流量,并丢弃在备份路径上接收的流量。
等价多路径 (ECMP) 路径和非 ECMP 路径均支持 MoFRR。设备需要启用单播无环路备用 (LFA) 路由,以支持非 ECMP 路径上的 MoFRR。您可以在内部网关协议 (IGP) 配置中使用语句启用 LFA 路由 link-protection
。在 OSPF 或 IS-IS 接口上启用链路保护时,设备会为遍历受保护接口的所有目标路由创建到主下一跃点的备份 LFA 路径。
Junos OS 在 IP 网络中实施 MoFRR,在 MPLS 标签边缘路由设备 (LER) 实施 MoFRR 以实现多点 LDP MoFRR。
多点 LDP MoFRR 用于 MPLS 网络的出口设备,其中数据包转发到 IP 网络。借助多点 LDP MoFRR,此设备会建立两条通往上游 PE 路由设备的路径,以在 LER 接收两个 MPLS 数据包流。设备接受其中一个流(主流),另一个流(备份流)在 LER 处丢弃。如果主路径发生故障,设备将接受备份流。带内信令支持是采用多点 LDP 的 MoFRR 的先决条件(请参阅 了解点到多点 LSP 的多点 LDP 带内信令)。
PIM 功能
Junos OS 支持 MoFRR 用于 PIM 源特定组播 (SSM) 和任意源组播 (ASM) 中的最短路径树 (SPT) 加入。SSM 和 ASM 范围都支持 MoFRR。要为 (*,G) 连接启用 MoFRR,请将 mofrr-asm-starg
配置语句包含在层次结构中 [edit routing-options multicast stream-protection]
。对于每个 G 组,MoFRR 将针对 (S,G) 或 (*,G) 运行,但不能同时同时运行。(S,G) 始终优先于 (*,G)。
启用 MoFRR 后,PIM 路由设备在两个上游反向路径转发 (RPF) 接口上传播加入消息,以接收同一加入请求的两个链路上的组播流量。MoFRR 优先选择两条不会收敛到同一直接上游路由设备的路径。PIM 通过上游 RPF 下一跃点安装适当的组播路由,并带有两个接口(适用于主路径和备用路径)。
当主路径发生故障时,备份路径将升级到主状态,并相应地转发流量。如果有备用路径可用,MoFRR 会计算新的备份路径,并更新或安装相应的组播路由。
您可以通过 PIM 加入负载平衡启用 MoFRR(请参阅 join-load-balance automatic
语句)。但是,在这种情况下,连接消息在链路中的分布可能并不均匀。添加新 ECMP 链路后,将重新分配主路径上的加入消息并均衡负载。备份路径上的加入消息可能仍遵循同一路径,并且可能不会均匀重新分配。
您可以在层次结构中使用stream-protection
[edit routing-options multicast]
配置语句启用 MoFRR。MoFRR 由一组过滤器策略管理。
当出口 PIM 路由设备收到加入消息或 IGMP 报告时,它会检查 MoFRR 配置,如下所示:
如果不存在 MoFRR 配置,PIM 向上游向一个上游邻接方(例如,平面 2) 图 12发送加入消息。
如果存在 MoFRR 配置,设备将检查是否存在策略配置。
如果策略不存在,设备将检查主要路径和备份路径(上游接口),并按以下步骤进行:
如果存在策略,设备将检查策略是否允许此 (S,G) 的 MoFRR,然后按如下操作:
多点 LDP 功能
为了避免 MPLS 流量重复,多点 LDP 通常只选择一个上游路径。(请参见第 2.4.1.1 节。确定 RFC 6388 中的“上游 LSR”, 即点到多点和多点到多点标签交换路径的标签分配协议扩展。)
对于带有 MoFRR 的多点 LDP,多点 LDP 设备会选择两个单独的上游对等方,并发送两个单独的标签,一个给每个上游对等方。设备使用 RFC 6388 中描述的相同算法来选择主上游路径。设备使用相同的算法来选择上游备份路径,但将主要上游 LSR 排除为候选路径。两个不同的上游对等方向出口路由设备发送两个 MPLS 流量流。设备仅选择一个上游邻接方路径作为接受 MPLS 流量的主路径。另一条路径成为备份路径,设备丢弃该流量。当上游主路径发生故障时,设备将开始接受来自备份路径的流量。多点 LDP 设备根据内部网关协议 (IGP) 根设备下一跃点选择两个上游路径。
转发同等类 (FEC) 是一组 IP 数据包,它们以相同方式、在同一路径上转发,并采用相同的转发处理。通常,放在特定数据包上的标签表示该数据包所分配到的 FEC。在 MoFRR 中,每个 FEC 的 mpls.0 表中都会有两个路由— 一个路由用于主标签,另一个路由用于备份标签。
如果与同一直接上游设备有并行链路,则设备将两个并行链路视为主链路。在任何时间点,上游设备仅针对多个并行链路中的一个发送流量。
萌芽节点是一个 LSR,它是一个出口 LSR,但也有一个或多个直接连接的下游 LSR。对于萌芽节点,来自上游主路径的流量将被转发到下行 LSR。如果主上游路径发生故障,来自备份上游路径的 MPLS 流量将被转发到下行 LSR。这意味着下游 LSR 下一跃点随出口下一跃点一起添加到两个 MPLS 路由中。
与 PIM 一样,您可以使用层次结构上的[edit routing-options multicast]
配置语句通过多点 LDP stream-protection
启用 MoFRR,并通过一组过滤器策略进行管理。
如果为 MoFRR 启用了多点 LDP 点对多点 FEC,设备在选择上游路径时会考虑以下事项:
如果有非目标 LDP 会话,则跳过目标 LDP 会话。如果有一个目标 LDP 会话,则会选择目标 LDP 会话,但相应的点到多点 FEC 将失去 MoFRR 功能,因为没有与目标 LDP 会话关联的接口。
属于同一上游 LSR 的所有接口均被视为主路径。
对于任何根节点路由更新,上游路径会根据 IGP 中的最新下一跃点进行更改。如果有更好的路径可用,多点 LDP 会尝试切换到更好的路径。
分组转发
对于 PIM 或多点 LDP,设备在入口接口处执行组播源流选择。这可以保留交换矩阵带宽并最大限度地提高转发性能,因为它:
避免在交换矩阵中发送重复流
防止进行多个路由查找(这会导致丢包)。
对于 PIM,每个 IP 组播流都包含相同的目标地址。无论数据包到达的接口如何,数据包的路由都是相同的。设备会检查每个数据包到达的接口,并仅转发来自主接口的接口。如果接口与备份流接口匹配,设备将丢弃数据包。如果接口与主流接口或备用流接口不匹配,设备会将这些数据包作为控制平面中的例外处理。
图 13 显示了包含 PIM 的路由器的主接口和备份接口示例的过程。 图 14 对于具有 PIM 的交换机,同样也显示了这一点


对于路由器上具有多点 LDP 的 MoFRR,设备使用多个 MPLS 标签来控制 MoFRR 流选择。每个标签表示一个单独的路由,但每个都引用相同的接口列表检查。设备仅转发主标签,而丢弃所有其他标签。多个接口可以接收使用同一标签的数据包。
图 15 显示了具有多点 LDP 的路由器的此过程。

限制和警告
交换和路由设备上的 MoFRR 限制和警告
MoFRR 在路由和交换设备上具有以下限制和警告:
支持 MoFRR 故障检测,以即时为启用 MoFRR 的路由设备提供链路保护,而不是组播流量路径中的所有链路(端到端)上。
MoFRR 支持在指向源的两条选定不相交路径上快速重新路由。所选的两个上游邻接方不能位于同一接口上,换言之,一个 LAN 分段上有两个上游邻接方。如果上游接口恰好是组播隧道接口,情况也是如此。
不支持检测最大端到端不交上游路径。接收方端(出口)路由设备只能确保上游设备(上一跃点)不相交。PIM 和多点 LDP 不支持等效的显式路由对象 (EROs)。因此,不相交的上游路径检测仅限于控制上一跃点设备。由于此限制,可能会共享上一跃点选择为主跃点和备份的上游设备的路径。
您可能会在以下场景中看到一些流量丢失:
出口设备上会提供更好的上游路径。
当有活动流量流时,在出口设备上启用或禁用 MoFRR。
不支持用于备份路径的加入消息的 PIM 加入负载平衡。
对于组播组 G,不允许对 (S,G) 和 (*,G) 加入消息使用 MoFRR。(S,G) 加入消息优先于 (*,G)。
使用两个不同的组播组的组播流量流不支持 MoFRR。每个 (S,G) 组合都被视为唯一的组播流量流。
MoFRR 不支持双向 PIM 范围。
MoFRR 不支持 PIM 密集模式。
备份流量流的组播统计信息不由 PIM 维护,因此在命令的操作输出
show
中不可用。不支持速率监控。
使用 PIM 的交换设备的 MoFRR 限制
具有 PIM 的 MoFRR 对交换设备有以下限制:
上游接口为集成路由和桥接 (IRB) 接口时,不支持 MoFRR,这会影响其他组播功能,例如互联网组管理协议版本 3 (IGMPv3) 侦听。
转发组播流量时的数据包复制和组播查找可能会导致数据包多次通过 PFE 重新运行。因此,命令中显示的组播数据包计数
show pfe statistics traffic
值可能会在输出字段(如Input packets
和Output packets
)中显示高于预期的数字。在 MoFRR 场景中,您可能会更频繁地注意到这种行为,因为重复的主流和备份流通常会增加流量。
使用多点 LDP 的路由设备的 MoFRR 限制和警告
当与多点 LDP 配合使用时,MoFRR 对路由器有以下限制和警告:
MoFRR 不适用于在 RSVP 隧道上接收的多点 LDP 流量,因为 RSVP 隧道不与任何接口相关联。
不支持混合上游 MoFRR。这是指 PIM 多点 LDP 带内信令,其中一个上游路径通过多点 LDP,第二个上游路径通过 PIM。
不支持作为内部标签的多点 LDP 标签。
如果可通过多个入口(源端)提供商边缘 (PE) 路由设备访问源,则不支持多点 LDP MoFRR。
目标 LDP 上游会话未选择为 MoFRR 的上游设备。
不支持备份路径上的多点 LDP 链路保护,因为不支持 MoFRR 内部标签。
配置仅组播快速重新路由
您可以配置仅组播快速重新路由 (MoFRR),以在出现链路故障时最大程度地减少网络中数据包的丢失。
对单播流应用快速重新路由时,上游路由器会预先建立 MPLS 标签交换路径 (LSP) 或预计算 IP 无环路备用 (LFA) 快速重新路由备份路径,以处理下游路径中某个分段的故障。
在组播路由中,流量分布图通常源自接收器。这与通常建立从源到接收器的路径的单播路由不同。能够建立组播分布图的协议包括 PIM(适用于 IP)、多点 LDP(用于 MPLS)和 RSVP-TE(适用于 MPLS)。其中,PIM 和多点 LDP 接收器会启动分布图设置,从而:
在 QFX 系列上,PIM 域中支持 MoFRR。
在 MX 系列和 SRX 系列上,PIM 和多点 LDP 域中支持 MoFRR。
除非另有说明,否则在支持此功能的所有设备上为 PIM 启用 MoFRR 的配置步骤相同。此外,还会指明不适用于多点 LDP MoFRR 的配置步骤。
(仅适用于 MX 系列路由器)带有 MPC 线卡的 MX 系列路由器支持 MoFRR。作为先决条件,路由器中的所有线卡都必须是 MPC。
在路由器或交换机上配置 MoFRR:
示例:在多点 LDP 域中配置仅组播快速重新路由
此示例说明如何配置仅组播快速重新路由 (MoFRR),以在发生链路故障时最大程度地减少网络中数据包的丢失。
多点 LDP MoFRR 用于 MPLS 网络的出口节点,其中数据包转发到 IP 网络。使用多点 LDP MoFRR 时,会建立通往上游提供商边缘 (PE) 路由器的两条路径,以在标签边缘路由器 (LER) 接收两个 MPLS 数据包流。接受其中一个流(主流),另一个流(备份)在 LER 被丢弃。如果主路径发生故障,则接受备份流。
要求
配置此示例之前,不需要除设备初始化之外的特殊配置。
在多点 LDP 域中,要使 MoFRR 正常工作,只有出口 PE 路由器需要启用 MoFRR。其他路由器不需要支持 MoFRR。
带有 MPC 线卡的 MX 系列平台支持 MoFRR。作为先决条件,路由器必须设置为 network-services enhanced-ip
模式,并且平台中的所有线卡都必须是 MPC。
此示例要求出口 PE 路由器上安装 Junos OS 14.1 或更高版本。
概述
在此示例中,设备 R3 是出口边缘路由器。仅在此设备上启用 MoFRR。
OSPF 用于连接,但可以使用任何内部网关协议 (IGP) 或静态路由。
出于测试目的,路由器用于模拟源和接收器。设备 R4 和设备 R8 配置为使用 set protocols igmp interface interface-name static group group
命令静态加入所需的组。如果真正的组播接收器主机不可用(如本例所示),则此静态 IGMP 配置会很有用。在接收器上,为了让他们侦听组播组地址,此示例使用 set protocols sap listen group
。
MoFRR 配置包括一个策略选项,此示例中未显示,但需单独说明。选项的配置如下所示:
stream-protection { policy policy-name; }
CLI 快速配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层次结构级别的 CLI 中 [edit]
。
设备 src1
set interfaces ge-1/2/10 unit 0 description src1-to-R1 set interfaces ge-1/2/10 unit 0 family inet address 10.5.0.1/30 set interfaces ge-1/2/11 unit 0 description src1-to-R1 set interfaces ge-1/2/11 unit 0 family inet address 192.168.219.11/24 set interfaces lo0 unit 0 family inet address 10.0.1.17/32 set protocols ospf area 0.0.0.0 interface all set protocols ospf area 0.0.0.0 interface lo0.0 passive
设备 src2
set interfaces ge-1/2/24 unit 0 description src2-to-R5 set interfaces ge-1/2/24 unit 0 family inet address 10.5.0.2/30 set interfaces lo0 unit 0 family inet address 10.0.1.18/32 set protocols rsvp interface all set protocols ospf area 0.0.0.0 interface all set protocols ospf area 0.0.0.0 interface lo0.0 passive
设备 R1
set interfaces ge-1/2/12 unit 0 description R1-to-R2 set interfaces ge-1/2/12 unit 0 family inet address 10.1.2.1/30 set interfaces ge-1/2/12 unit 0 family mpls set interfaces ge-1/2/13 unit 0 description R1-to-R6 set interfaces ge-1/2/13 unit 0 family inet address 10.1.6.1/30 set interfaces ge-1/2/13 unit 0 family mpls set interfaces ge-1/2/10 unit 0 description R1-to-src1 set interfaces ge-1/2/10 unit 0 family inet address 10.1.0.2/30 set interfaces ge-1/2/11 unit 0 description R1-to-src1 set interfaces ge-1/2/11 unit 0 family inet address 192.168.219.9/30 set interfaces lo0 unit 0 family inet address 10.1.1.1/32 set protocols rsvp interface all set protocols mpls interface all set protocols bgp group ibgp local-address 10.1.1.1 set protocols bgp group ibgp export static-route-tobgp set protocols bgp group ibgp peer-as 65010 set protocols bgp group ibgp neighbor 10.1.1.3 set protocols bgp group ibgp neighbor 10.1.1.7 set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface all set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ldp interface ge-1/2/12.0 set protocols ldp interface ge-1/2/13.0 set protocols ldp interface lo0.0 set protocols ldp p2mp set protocols pim mldp-inband-signalling policy mldppim-ex set protocols pim rp static address 10.1.1.5 set protocols pim interface lo0.0 set protocols pim interface ge-1/2/10.0 set protocols pim interface ge-1/2/11.0 set policy-options policy-statement mldppim-ex term B from source-address-filter 192.168.0.0/24 orlonger set policy-options policy-statement mldppim-ex term B from source-address-filter 192.168.219.11/32 orlonger set policy-options policy-statement mldppim-ex term B then p2mp-lsp-root address 10.1.1.2 set policy-options policy-statement mldppim-ex term B then accept set policy-options policy-statement mldppim-ex term A from source-address-filter 10.1.1.7/32 orlonger set policy-options policy-statement mldppim-ex term A from source-address-filter 10.1.0.0/30 orlonger set policy-options policy-statement mldppim-ex term A then accept set policy-options policy-statement static-route-tobgp term static from protocol static set policy-options policy-statement static-route-tobgp term static from protocol direct set policy-options policy-statement static-route-tobgp term static then accept set routing-options autonomous-system 65010
设备 R2
set interfaces ge-1/2/12 unit 0 description R2-to-R1 set interfaces ge-1/2/12 unit 0 family inet address 10.1.2.2/30 set interfaces ge-1/2/12 unit 0 family mpls set interfaces ge-1/2/14 unit 0 description R2-to-R3 set interfaces ge-1/2/14 unit 0 family inet address 10.2.3.1/30 set interfaces ge-1/2/14 unit 0 family mpls set interfaces ge-1/2/16 unit 0 description R2-to-R5 set interfaces ge-1/2/16 unit 0 family inet address 10.2.5.1/30 set interfaces ge-1/2/16 unit 0 family mpls set interfaces ge-1/2/17 unit 0 description R2-to-R7 set interfaces ge-1/2/17 unit 0 family inet address 10.2.7.1/30 set interfaces ge-1/2/17 unit 0 family mpls set interfaces ge-1/2/15 unit 0 description R2-to-R3 set interfaces ge-1/2/15 unit 0 family inet address 10.2.94.1/30 set interfaces ge-1/2/15 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.1.1.2/32 set interfaces lo0 unit 0 family mpls set protocols rsvp interface all set protocols mpls interface all set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface all set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ldp interface all set protocols ldp p2mp set policy-options policy-statement mldppim-ex term B from source-address-filter 192.168.0.0/24 orlonger set policy-options policy-statement mldppim-ex term B from source-address-filter 192.168.219.11/32 orlonger set policy-options policy-statement mldppim-ex term B then p2mp-lsp-root address 10.1.1.2 set policy-options policy-statement mldppim-ex term B then accept set routing-options autonomous-system 65010
设备 R3
set chassis network-services enhanced-ip set interfaces ge-1/2/14 unit 0 description R3-to-R2 set interfaces ge-1/2/14 unit 0 family inet address 10.2.3.2/30 set interfaces ge-1/2/14 unit 0 family mpls set interfaces ge-1/2/18 unit 0 description R3-to-R4 set interfaces ge-1/2/18 unit 0 family inet address 10.3.4.1/30 set interfaces ge-1/2/18 unit 0 family mpls set interfaces ge-1/2/19 unit 0 description R3-to-R6 set interfaces ge-1/2/19 unit 0 family inet address 10.3.6.2/30 set interfaces ge-1/2/19 unit 0 family mpls set interfaces ge-1/2/21 unit 0 description R3-to-R7 set interfaces ge-1/2/21 unit 0 family inet address 10.3.7.1/30 set interfaces ge-1/2/21 unit 0 family mpls set interfaces ge-1/2/22 unit 0 description R3-to-R8 set interfaces ge-1/2/22 unit 0 family inet address 10.3.8.1/30 set interfaces ge-1/2/22 unit 0 family mpls set interfaces ge-1/2/15 unit 0 description R3-to-R2 set interfaces ge-1/2/15 unit 0 family inet address 10.2.94.2/30 set interfaces ge-1/2/15 unit 0 family mpls set interfaces ge-1/2/20 unit 0 description R3-to-R6 set interfaces ge-1/2/20 unit 0 family inet address 10.2.96.2/30 set interfaces ge-1/2/20 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.1.1.3/32 primary set routing-options autonomous-system 65010 set routing-options multicast stream-protection set protocols rsvp interface all set protocols mpls interface all set protocols bgp group ibgp local-address 10.1.1.3 set protocols bgp group ibgp peer-as 10 set protocols bgp group ibgp neighbor 10.1.1.1 set protocols bgp group ibgp neighbor 10.1.1.5 set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface all set protocols ospf area 0.0.0.0 interface fxp0.0 disable set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ldp interface all set protocols ldp p2mp set protocols pim mldp-inband-signalling policy mldppim-ex set protocols pim interface lo0.0 set protocols pim interface ge-1/2/18.0 set protocols pim interface ge-1/2/22.0 set policy-options policy-statement mldppim-ex term B from source-address-filter 192.168.0.0/24 orlonger set policy-options policy-statement mldppim-ex term B from source-address-filter 192.168.219.11/32 orlonger set policy-options policy-statement mldppim-ex term B then accept set policy-options policy-statement mldppim-ex term A from source-address-filter 10.1.0.1/30 orlonger set policy-options policy-statement mldppim-ex term A then accept set policy-options policy-statement static-route-tobgp term static from protocol static set policy-options policy-statement static-route-tobgp term static from protocol direct set policy-options policy-statement static-route-tobgp term static then accept
设备 R4
set interfaces ge-1/2/18 unit 0 description R4-to-R3 set interfaces ge-1/2/18 unit 0 family inet address 10.3.4.2/30 set interfaces ge-1/2/18 unit 0 family mpls set interfaces ge-1/2/23 unit 0 description R4-to-R7 set interfaces ge-1/2/23 unit 0 family inet address 10.4.7.1/30 set interfaces lo0 unit 0 family inet address 10.1.1.4/32 set protocols igmp interface ge-1/2/18.0 version 3 set protocols igmp interface ge-1/2/18.0 static group 232.1.1.1 group-count 2 set protocols igmp interface ge-1/2/18.0 static group 232.1.1.1 source 192.168.219.11 set protocols igmp interface ge-1/2/18.0 static group 232.2.2.2 source 10.2.7.7 set protocols sap listen 232.1.1.1 set protocols sap listen 232.2.2.2 set protocols rsvp interface all set protocols mpls interface all set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface all set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols pim mldp-inband-signalling policy mldppim-ex set protocols pim interface ge-1/2/23.0 set protocols pim interface ge-1/2/18.0 set protocols pim interface lo0.0 set policy-options policy-statement static-route-tobgp term static from protocol static set policy-options policy-statement static-route-tobgp term static from protocol direct set policy-options policy-statement static-route-tobgp term static then accept set policy-options policy-statement mldppim-ex term B from source-address-filter 192.168.0.0/24 orlonger set policy-options policy-statement mldppim-ex term B from source-address-filter 192.168.219.11/32 orlonger set policy-options policy-statement mldppim-ex term B then p2mp-lsp-root address 10.1.1.2 set policy-options policy-statement mldppim-ex term B then accept set routing-options autonomous-system 65010
设备 R5
set interfaces ge-1/2/24 unit 0 description R5-to-src2 set interfaces ge-1/2/24 unit 0 family inet address 10.5.0.1/30 set interfaces ge-1/2/16 unit 0 description R5-to-R2 set interfaces ge-1/2/16 unit 0 family inet address 10.2.5.2/30 set interfaces ge-1/2/16 unit 0 family mpls set interfaces ge-1/2/25 unit 0 description R5-to-R6 set interfaces ge-1/2/25 unit 0 family inet address 10.5.6.1/30 set interfaces ge-1/2/25 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.1.1.5/32 set protocols rsvp interface all set protocols mpls interface all set protocols bgp group ibgp local-address 10.1.1.5 set protocols bgp group ibgp export static-route-tobgp set protocols bgp group ibgp peer-as 65010 set protocols bgp group ibgp neighbor 10.1.1.7 set protocols bgp group ibgp neighbor 10.1.1.3 set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface all set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ldp interface ge-1/2/16.0 set protocols ldp interface ge-1/2/25.0 set protocols ldp p2mp set protocols pim interface lo0.0 set protocols pim interface ge-1/2/24.0 set policy-options policy-statement static-route-tobgp term static from protocol static set policy-options policy-statement static-route-tobgp term static from protocol direct set policy-options policy-statement static-route-tobgp term static then accept set routing-options autonomous-system 65010
设备 R6
set interfaces ge-1/2/13 unit 0 description R6-to-R1 set interfaces ge-1/2/13 unit 0 family inet address 10.1.6.2/30 set interfaces ge-1/2/13 unit 0 family mpls set interfaces ge-1/2/19 unit 0 description R6-to-R3 set interfaces ge-1/2/19 unit 0 family inet address 10.3.6.1/30 set interfaces ge-1/2/19 unit 0 family mpls set interfaces ge-1/2/25 unit 0 description R6-to-R5 set interfaces ge-1/2/25 unit 0 family inet address 10.5.6.2/30 set interfaces ge-1/2/25 unit 0 family mpls set interfaces ge-1/2/26 unit 0 description R6-to-R7 set interfaces ge-1/2/26 unit 0 family inet address 10.6.7.1/30 set interfaces ge-1/2/26 unit 0 family mpls set interfaces ge-1/2/20 unit 0 description R6-to-R3 set interfaces ge-1/2/20 unit 0 family inet address 10.2.96.1/30 set interfaces ge-1/2/20 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.1.1.6/30 set protocols rsvp interface all set protocols mpls interface all set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface all set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ldp interface all set protocols ldp p2mp
设备 R7
set interfaces ge-1/2/17 unit 0 description R7-to-R2 set interfaces ge-1/2/17 unit 0 family inet address 10.2.7.2/30 set interfaces ge-1/2/17 unit 0 family mpls set interfaces ge-1/2/21 unit 0 description R7-to-R3 set interfaces ge-1/2/21 unit 0 family inet address 10.3.7.2/30 set interfaces ge-1/2/21 unit 0 family mpls set interfaces ge-1/2/23 unit 0 description R7-to-R4 set interfaces ge-1/2/23 unit 0 family inet address 10.4.7.2/30 set interfaces ge-1/2/23 unit 0 family mpls set interfaces ge-1/2/26 unit 0 description R7-to-R6 set interfaces ge-1/2/26 unit 0 family inet address 10.6.7.2/30 set interfaces ge-1/2/26 unit 0 family mpls set interfaces ge-1/2/27 unit 0 description R7-to-R8 set interfaces ge-1/2/27 unit 0 family inet address 10.7.8.1/30 set interfaces ge-1/2/27 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.1.1.7/32 set protocols rsvp interface all set protocols mpls interface all set protocols bgp group ibgp local-address 10.1.1.7 set protocols bgp group ibgp export static-route-tobgp set protocols bgp group ibgp peer-as 65010 set protocols bgp group ibgp neighbor 10.1.1.5 set protocols bgp group ibgp neighbor 10.1.1.1 set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface all set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ldp interface ge-1/2/17.0 set protocols ldp interface ge-1/2/21.0 set protocols ldp interface ge-1/2/26.0 set protocols ldp p2mp set protocols pim mldp-inband-signalling policy mldppim-ex set protocols pim interface lo0.0 set protocols pim interface ge-1/2/27.0 set policy-options policy-statement mldppim-ex term B from source-address-filter 192.168.0.0/24 orlonger set policy-options policy-statement mldppim-ex term B from source-address-filter 192.168.219.11/32 orlonger set policy-options policy-statement mldppim-ex term B then accept set policy-options policy-statement mldppim-ex term A from source-address-filter 10.1.0.1/30 orlonger set policy-options policy-statement mldppim-ex term A then accept set policy-options policy-statement static-route-tobgp term static from protocol static set policy-options policy-statement static-route-tobgp term static from protocol direct set policy-options policy-statement static-route-tobgp term static then accept set routing-options autonomous-system 65010 set routing-options multicast stream-protection policy mldppim-ex
设备 R8
set interfaces ge-1/2/22 unit 0 description R8-to-R3 set interfaces ge-1/2/22 unit 0 family inet address 10.3.8.2/30 set interfaces ge-1/2/22 unit 0 family mpls set interfaces ge-1/2/27 unit 0 description R8-to-R7 set interfaces ge-1/2/27 unit 0 family inet address 10.7.8.2/30 set interfaces ge-1/2/27 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.1.1.8/32 set protocols igmp interface ge-1/2/22.0 version 3 set protocols igmp interface ge-1/2/22.0 static group 232.1.1.1 group-count 2 set protocols igmp interface ge-1/2/22.0 static group 232.1.1.1 source 192.168.219.11 set protocols igmp interface ge-1/2/22.0 static group 232.2.2.2 source 10.2.7.7 set protocols sap listen 232.1.1.1 set protocols sap listen 232.2.2.2 set protocols rsvp interface all set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface all set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols pim mldp-inband-signalling policy mldppim-ex set protocols pim interface ge-1/2/27.0 set protocols pim interface ge-1/2/22.0 set protocols pim interface lo0.0 set policy-options policy-statement static-route-tobgp term static from protocol static set policy-options policy-statement static-route-tobgp term static from protocol direct set policy-options policy-statement static-route-tobgp term static then accept set policy-options policy-statement mldppim-ex term B from source-address-filter 192.168.0.0/24 orlonger set policy-options policy-statement mldppim-ex term B from source-address-filter 192.168.219.11/32 orlonger set policy-options policy-statement mldppim-ex term B then p2mp-lsp-root address 10.1.1.2 set policy-options policy-statement mldppim-ex term B then accept set routing-options autonomous-system 65010
配置
程序
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅《Junos OS CLI 用户指南》中的在配置模式下使用 CLI 编辑器。
要配置设备 R3:
启用增强型 IP 模式。
[edit chassis] user@R3# set network-services enhanced-ip
配置设备接口。
[edit interfaces] user@R3# set ge-1/2/14 unit 0 description R3-to-R2 user@R3# set ge-1/2/14 unit 0 family inet address 10.2.3.2/30 user@R3# set ge-1/2/14 unit 0 family mpls user@R3# set ge-1/2/18 unit 0 description R3-to-R4 user@R3# set ge-1/2/18 unit 0 family inet address 10.3.4.1/30 user@R3# set ge-1/2/18 unit 0 family mpls user@R3# set ge-1/2/19 unit 0 description R3-to-R6 user@R3# set ge-1/2/19 unit 0 family inet address 10.3.6.2/30 user@R3# set ge-1/2/19 unit 0 family mpls user@R3# set ge-1/2/21 unit 0 description R3-to-R7 user@R3# set ge-1/2/21 unit 0 family inet address 10.3.7.1/30 user@R3# set ge-1/2/21 unit 0 family mpls user@R3# set ge-1/2/22 unit 0 description R3-to-R8 user@R3# set ge-1/2/22 unit 0 family inet address 10.3.8.1/30 user@R3# set ge-1/2/22 unit 0 family mpls user@R3# set ge-1/2/15 unit 0 description R3-to-R2 user@R3# set ge-1/2/15 unit 0 family inet address 10.2.94.2/30 user@R3# set ge-1/2/15 unit 0 family mpls user@R3# set ge-1/2/20 unit 0 description R3-to-R6 user@R3# set ge-1/2/20 unit 0 family inet address 10.2.96.2/30 user@R3# set ge-1/2/20 unit 0 family mpls user@R3# set lo0 unit 0 family inet address 10.1.1.3/32 primary
配置自治系统 (AS) 编号。
user@R3# set routing-options autonomous-system 6510
配置路由策略。
[edit policy-options policy-statement mldppim-ex] user@R3# set term B from source-address-filter 192.168.0.0/24 orlonger user@R3# set term B from source-address-filter 192.168.219.11/32 orlonger user@R3# set term B then accept user@R3# set term A from source-address-filter 10.1.0.1/30 orlonger user@R3# set term A then accept [edit policy-options policy-statement static-route-tobgp] user@R3# set term static from protocol static user@R3# set term static from protocol direct user@R3# set term static then accept
配置 PIM。
[edit protocols pim] user@R3# set mldp-inband-signalling policy mldppim-ex user@R3# set interface lo0.0 user@R3# set interface ge-1/2/18.0 user@R3# set interface ge-1/2/22.0
配置 LDP。
[edit protocols ldp] user@R3# set interface all user@R3# set p2mp
配置 IGP 或静态路由。
[edit protocols ospf] user@R3# set traffic-engineering user@R3# set area 0.0.0.0 interface all user@R3# set area 0.0.0.0 interface fxp0.0 disable user@R3# set area 0.0.0.0 interface lo0.0 passive
配置内部 BGP。
[edit protocols bgp group ibgp] user@R3# set local-address 10.1.1.3 user@R3# set peer-as 65010 user@R3# set neighbor 10.1.1.1 user@R3# set neighbor 10.1.1.5
配置 MPLS,并选择性地配置 RSVP。
[edit protocols mpls] user@R3# set interface all [edit protocols rsvp] user@R3# set interface all
启用 MoFRR。
[edit routing-options multicast] user@R3# set stream-protection
结果
在配置模式下,输入 、 show chassis
show interfaces
、 show protocols
、 show policy-options
和show routing-options
命令,以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@R3# show chassis network-services enhanced-ip;
user@R3# show interfaces ge-1/2/14 { unit 0 { description R3-to-R2; family inet { address 10.2.3.2/30; } family mpls; } } ge-1/2/18 { unit 0 { description R3-to-R4; family inet { address 10.3.4.1/30; } family mpls; } } ge-1/2/19 { unit 0 { description R3-to-R6; family inet { address 10.3.6.2/30; } family mpls; } } ge-1/2/21 { unit 0 { description R3-to-R7; family inet { address 10.3.7.1/30; } family mpls; } } ge-1/2/22 { unit 0 { description R3-to-R8; family inet { address 10.3.8.1/30; } family mpls; } } ge-1/2/15 { unit 0 { description R3-to-R2; family inet { address 10.2.94.2/30; } family mpls; } } ge-1/2/20 { unit 0 { description R3-to-R6; family inet { address 10.2.96.2/30; } family mpls; } } lo0 { unit 0 { family inet { address 192.168.15.1/32; address 10.1.1.3/32 { primary; } } } }
user@R3# show protocols rsvp { interface all; } mpls { interface all; } bgp { group ibgp { local-address 10.1.1.3; peer-as 65010; neighbor 10.1.1.1; neighbor 10.1.1.5; } } ospf { traffic-engineering; area 0.0.0.0 { interface all; interface fxp0.0 { disable; } interface lo0.0 { passive; } } } ldp { interface all; p2mp; } pim { mldp-inband-signalling { policy mldppim-ex; } interface lo0.0; interface ge-1/2/18.0; interface ge-1/2/22.0; }
user@R3# show policy-options policy-statement mldppim-ex { term B { from { source-address-filter 192.168.0.0/24 orlonger; source-address-filter 192.168.219.11/32 orlonger; } then accept; } term A { from { source-address-filter 10.1.0.1/30 orlonger; } then accept; } } policy-statement static-route-tobgp { term static { from protocol [ static direct ]; then accept; } }
user@R3# show routing-options autonomous-system 65010; multicast { stream-protection; }
完成设备配置后,请从配置模式进入 commit
。
验证
确认配置工作正常。
检查 LDP 点到多点转发同等等级
目的
请确保启用 MoFRR,并确定正在使用的标签。
行动
user@R3> show ldp p2mp fec LDP P2MP FECs: P2MP root-addr 10.1.1.1, grp: 232.1.1.1, src: 192.168.219.11 MoFRR enabled Fec type: Egress (Active) Label: 301568 P2MP root-addr 10.1.1.1, grp: 232.1.1.2, src: 192.168.219.11 MoFRR enabled Fec type: Egress (Active) Label: 301600
含义
输出显示 MoFRR 已启用,并且显示标签 301568 和 301600 用于两个多点 LDP 点对多点 LSP。
检查标签信息
目的
请确保出口设备有两个上游接口用于组播组加入。
行动
user@R3> show route label 301568 detail mpls.0: 18 destinations, 18 routes (18 active, 0 holddown, 0 hidden) 301568 (1 entry, 1 announced) *LDP Preference: 9 Next hop type: Flood Address: 0x2735208 Next-hop reference count: 3 Next hop type: Router, Next hop index: 1397 Address: 0x2735d2c Next-hop reference count: 3 Next hop: 10.3.8.2 via ge-1/2/22.0 Label operation: Pop Load balance label: None; Next hop type: Router, Next hop index: 1395 Address: 0x2736290 Next-hop reference count: 3 Next hop: 10.3.4.2 via ge-1/2/18.0 Label operation: Pop Load balance label: None; State: <Active Int AckRequest MulticastRPF> Local AS: 65010 Age: 54:05 Metric: 1 Validation State: unverified Task: LDP Announcement bits (1): 0-KRT AS path: I FECs bound to route: P2MP root-addr 10.1.1.1, grp: 232.1.1.1, src: 192.168.219.11 Primary Upstream : 10.1.1.3:0--10.1.1.2:0 RPF Nexthops : ge-1/2/15.0, 10.2.94.1, Label: 301568, weight: 0x1 ge-1/2/14.0, 10.2.3.1, Label: 301568, weight: 0x1 Backup Upstream : 10.1.1.3:0--10.1.1.6:0 RPF Nexthops : ge-1/2/20.0, 10.2.96.1, Label: 301584, weight: 0xfffe ge-1/2/19.0, 10.3.6.1, Label: 301584, weight: 0xfffe
user@R3> show route label 301600 detail mpls.0: 18 destinations, 18 routes (18 active, 0 holddown, 0 hidden) 301600 (1 entry, 1 announced) *LDP Preference: 9 Next hop type: Flood Address: 0x27356b4 Next-hop reference count: 3 Next hop type: Router, Next hop index: 1520 Address: 0x27350f4 Next-hop reference count: 3 Next hop: 10.3.8.2 via ge-1/2/22.0 Label operation: Pop Load balance label: None; Next hop type: Router, Next hop index: 1481 Address: 0x273645c Next-hop reference count: 3 Next hop: 10.3.4.2 via ge-1/2/18.0 Label operation: Pop Load balance label: None; State: <Active Int AckRequest MulticastRPF> Local AS: 65010 Age: 54:25 Metric: 1 Validation State: unverified Task: LDP Announcement bits (1): 0-KRT AS path: I FECs bound to route: P2MP root-addr 10.1.1.1, grp: 232.1.1.2, src: 192.168.219.11 Primary Upstream : 10.1.1.3:0--10.1.1.6:0 RPF Nexthops : ge-1/2/20.0, 10.2.96.1, Label: 301600, weight: 0x1 ge-1/2/19.0, 10.3.6.1, Label: 301600, weight: 0x1 Backup Upstream : 10.1.1.3:0--1.1.1.2:0 RPF Nexthops : ge-1/2/15.0, 10.2.94.1, Label: 301616, weight: 0xfffe ge-1/2/14.0, 10.2.3.1, Label: 301616, weight: 0xfffe
含义
输出显示主要上游路径和备份上游路径。它还显示了 RPF 下一跃点。
检查组播路由
目的
检查 IP 组播转发表,确保有一个上游 RPF 接口列表,其中带有一个主接口和一个备用接口。
行动
user@R3> show ldp p2mp path P2MP path type: Transit/Egress Output Session (label): 10.1.1.2:0 (301568) (Primary) Egress Nexthops: Interface ge-1/2/18.0 Interface ge-1/2/22.0 RPF Nexthops: Interface ge-1/2/15.0, 10.2.94.1, 301568, 1 Interface ge-1/2/20.0, 10.2.96.1, 301584, 65534 Interface ge-1/2/14.0, 10.2.3.1, 301568, 1 Interface ge-1/2/19.0, 10.3.6.1, 301584, 65534 Attached FECs: P2MP root-addr 10.1.1.1, grp: 232.1.1.1, src: 192.168.219.11 (Active) P2MP path type: Transit/Egress Output Session (label): 10.1.1.6:0 (301584) (Backup) Egress Nexthops: Interface ge-1/2/18.0 Interface ge-1/2/22.0 RPF Nexthops: Interface ge-1/2/15.0, 10.2.94.1, 301568, 1 Interface ge-1/2/20.0, 10.2.96.1, 301584, 65534 Interface ge-1/2/14.0, 10.2.3.1, 301568, 1 Interface ge-1/2/19.0, 10.3.6.1, 301584, 65534 Attached FECs: P2MP root-addr 10.1.1.1, grp: 232.1.1.1, src: 192.168.219.11 (Active) P2MP path type: Transit/Egress Output Session (label): 10.1.1.6:0 (301600) (Primary) Egress Nexthops: Interface ge-1/2/18.0 Interface ge-1/2/22.0 RPF Nexthops: Interface ge-1/2/15.0, 10.2.94.1, 301616, 65534 Interface ge-1/2/20.0, 10.2.96.1, 301600, 1 Interface ge-1/2/14.0, 10.2.3.1, 301616, 65534 Interface ge-1/2/19.0, 10.3.6.1, 301600, 1 Attached FECs: P2MP root-addr 10.1.1.1, grp: 232.1.1.2, src: 192.168.219.11 (Active) P2MP path type: Transit/Egress Output Session (label): 10.1.1.2:0 (301616) (Backup) Egress Nexthops: Interface ge-1/2/18.0 Interface ge-1/2/22.0 RPF Nexthops: Interface ge-1/2/15.0, 10.2.94.1, 301616, 65534 Interface ge-1/2/20.0, 10.2.96.1, 301600, 1 Interface ge-1/2/14.0, 10.2.3.1, 301616, 65534 Interface ge-1/2/19.0, 10.3.6.1, 301600, 1 Attached FECs: P2MP root-addr 10.1.1.1, grp: 232.1.1.2, src: 192.168.219.11 (Active)
含义
输出显示主要会话和备份会话以及 RPF 下一跃点。
检查 LDP 点到多点流量统计信息
目的
请确保同时列出了主要统计信息和备份统计信息。
行动
user@R3> show ldp traffic-statistics p2mp P2MP FEC Statistics: FEC(root_addr:lsp_id/grp,src) Nexthop Packets Bytes Shared 10.1.1.1:232.1.1.1,192.168.219.11, Label: 301568 10.3.8.2 0 0 No 10.3.4.2 0 0 No 10.1.1.1:232.1.1.1,192.168.219.11, Label: 301584, Backup route 10.3.4.2 0 0 No 10.3.8.2 0 0 No 10.1.1.1:232.1.1.2,192.168.219.11, Label: 301600 10.3.8.2 0 0 No 10.3.4.2 0 0 No 10.1.1.1:232.1.1.2,192.168.219.11, Label: 301616, Backup route 10.3.4.2 0 0 No 10.3.8.2 0 0 No
含义
输出显示带有标签的主路由和备份路由。
示例:按需配置 LDP 下游
此示例说明如何按需配置 LDP 下游。LDP 通常使用下游未经请求的播发模式进行配置,这意味着所有路由的标签播发将从所有 LDP 对等方接收。随着服务提供商将接入和聚合网络集成到单个 MPLS 域中,需要按需 LDP 下游分配接入和聚合网络之间的绑定,并降低对控制平面的处理要求。
下游节点可能从上游聚合节点接收数以万计的标签绑定。下游聚合节点可以按需使用 LDP 下游配置,以便仅请求与配置了服务的出口节点的环路地址对应的 FEC 的标签绑定,而不是在整个 MPLS 网络中学习和存储所有可能环路地址的标签绑定。
要求
此示例使用以下硬件和软件组件:
-
M 系列路由器
-
Junos OS 12.2
概述
通过在层次结构级别包含下游按需语句[edit protocols ldp session]
,可以为 LDP 会话启用 LDP 下游按需标签通告。如果您配置了下游按需,瞻博网络路由器将下游按需请求播发至对等路由器。对于在两个路由器之间建立下游按需会话,必须在 LDP 会话建立期间播发下游按需模式。如果一个路由器播发下游未经请求模式,另一个路由器按需向下游播发,则使用下游非请求模式。
配置
按需配置 LDP 下游
逐步过程
要配置 LDP 下游按需策略,然后配置该策略并在 LDP 会话上启用 LDP 下游按需设置 LDP:
-
配置下游按需策略(DOD-Request-Loopbacks 本例中)。
此策略会使路由器仅将标签请求消息转发至与策略匹配的 DOD-Request-Loopbacks FEC。
[edit policy-options] user@host# set prefix-list Request-Loopbacks 10.1.1.1/32 user@host# set prefix-list Request-Loopbacks 10.1.1.2/32 user@host# set prefix-list Request-Loopbacks 10.1.1.3/32 user@host# set prefix-list Request-Loopbacks 10.1.1.4/32 user@host# set policy-statement DOD-Request-Loopbacks term 1 from prefix-list Request-Loopbacks user@host# set policy-statement DOD-Request-Loopbacks term 1 then accept
-
在层次结构级别使用
dod-request-policy
语句[edit protocols ldp]
指定 DOD-Request-Loopbacks 策略。该语句指定的
dod-request-policy
策略用于识别发送标签请求消息的前缀。此策略类似于出口策略或导入策略。处理 inet.0 路由表中的路由时,Junos OS 软件会检查与策略匹配的DOD-Request-Loopbacks
路由(在本示例中)。如果路由与策略匹配,并且使用 DOD 播发模式协商 LDP 会话,则标签请求消息将发送到相应的下游 LDP 会话。[edit protocols ldp] user@host# set dod-request-policy DOD-Request-Loopbacks
-
将
downstream-on-demand
语句包含在 LDP 会话的配置中,以启用下游按需分配模式。[edit protocols ldp] user@host# set session 172.16.1.1 downstream-on-demand
将 LDP 下游按需路由分布到带标签的 BGP 中
逐步过程
要向下游分配 LDP 按需路由到带标签的 BGP 中,请使用 BGP 导出策略。
-
配置 LDP 路由策略(
redistribute_ldp
本例中)。[edit policy-options] user@host# set policy-statement redistribute_ldp term 1 from protocol ldp user@host# set policy-statement redistribute_ldp term 1 from tag 1000 user@host# set policy-statement redistribute_ldp term 1 then accept
-
将 LDP 路由策略
redistribute_ldp
包含在 BGP 配置中(作为此示例中 BGP 组配置的ebgp-to-abr
一部分)。BGP 根据
redistribute_ldp
策略将 LDP 路由转发到远程 PE 路由器[edit protocols bgp] user@host# set group ebgp-to-abr type external user@host# set group ebgp-to-abr local-address 192.168.0.1 user@host# set group ebgp-to-abr peer-as 65319 user@host# set group ebgp-to-abr local-as 65320 user@host# set group ebgp-to-abr neighbor 192.168.6.1 family inet unicast user@host# set group ebgp-to-abr neighbor 192.168.6.1 family inet labeled-unicast rib inet.3 user@host# set group ebgp-to-abr neighbor 192.168.6.1 export redistribute_ldp
逐步过程
要限制标签传播到在下游未经请求模式(而非按需向下游)配置的其他路由器,请配置以下策略:
-
将
dod-routes
策略配置为接受来自 LDP 的路由。user@host# set policy-options policy-statement dod-routes term 1 from protocol ldp user@host# set policy-options policy-statement dod-routes term 1 from tag 1145307136 user@host# set policy-options policy-statement dod-routes term 1 then accept
-
将
do-not-propagate-du-sessions
策略配置为不将路由转发给邻接方10.1.1.1
和10.2.2.2
10.3.3.3
。user@host# set policy-options policy-statement do-not-propagate-du-sessions term 1 to neighbor 10.1.1.1 user@host# set policy-options policy-statement do-not-propagate-du-sessions term 1 to neighbor 10.2.2.2 user@host# set policy-options policy-statement do-not-propagate-du-sessions term 1 to neighbor 10.3.3.3 user@host# set policy-options policy-statement do-not-propagate-du-sessions term 1 then reject
-
filter-dod-on-du-sessions
配置策略以防止将策略检查的dod-routes
路由转发到策略中do-not-propagate-du-sessions
定义的相邻路由器。user@host# set policy-options policy-statement filter-dod-routes-on-du-sessions term 1 from policy dod-routes user@host# set policy-options policy-statement filter-dod-routes-on-du-sessions term 1 to policy do-not-propagate-du-sessions
-
将
filter-dod-routes-on-du-sesssion
策略指定为 BGP group 的ebgp-to-abr
导出策略。[edit protocols bgp] user@host# set group ebgp-to-abr neighbor 192.168.6.2 export filter-dod-routes-on-du-sessions
结果
在配置模式下,输入和 show protocols ldp
命令以确认show policy-options
您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@host# show policy-options prefix-list Request-Loopbacks { 10.1.1.1/32; 10.1.1.2/32; 10.1.1.3/32; 10.1.1.4/32; } policy-statement DOD-Request-Loopbacks { term 1 { from { prefix-list Request-Loopbacks; } then accept; } } policy-statement redistribute_ldp { term 1 { from { protocol ldp; tag 1000; } then accept; } }
user@host# show protocols ldp dod-request-policy DOD-Request-Loopbacks; session 172.16.1.1 { downstream-on-demand; }
user@host# show protocols bgp group ebgp-to-abr { type external; local-address 192.168.0.1; peer-as 65319; local-as 65320; neighbor 192.168.6.1 { family inet { unicast; labeled-unicast { rib { inet.3; } } } export redistribute_ldp; } }
验证
验证标签播发模式
目的
确认配置工作正常。
show ldp session
使用命令验证 LDP 会话的标签播发模式的状态。
行动
show ldp session
发出和 show ldp session detail
命令:
-
以下命令命令
show ldp session
输出表示Adv. Mode
(标签播发模式)为DOD
(意味着 LDP 下游按需会话可正常运行):user@host>
show ldp session
Address State Connection Hold time Adv. Mode 172.16.1.2 Operational Open 22 DOD -
命令的
show ldp session detail
以下命令输出指示Local Label Advertisement mode
为 isDownstream unsolicited
, 默认值(表示未在本地会话上配置下游按需)。相反,Remote Label Advertisement mode
Negotiated Label Advertisement mode
两者均表示Downstream on demand
在远程会话上配置的user@host>
show ldp session detail
Address: 172.16.1.2, State: Operational, Connection: Open, Hold time: 24 Session ID: 10.1.1.1:0--10.1.1.2:0 Next keepalive in 4 seconds Passive, Maximum PDU: 4096, Hold time: 30, Neighbor count: 1 Neighbor types: configured-tunneled Keepalive interval: 10, Connect retry interval: 1 Local address: 10.1.1.1, Remote address: 10.1.1.2 Up for 17:54:52 Capabilities advertised: none Capabilities received: none Protection: disabled 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 on demand Negotiated Label Advertisement mode: Downstream on demand Nonstop routing state: Not in sync Next-hop addresses received: 10.1.1.2
配置 LDP 原生 IPv6 支持
LDP 在仅限 IPv6 的网络中受支持,以及如 RFC 7552 所述在 IPv6 或 IPv4 双堆栈网络中受支持。将地址家族inet
配置为 IPv4 和/或 inet6
IPv6,并将传输优先级配置为或IPv4
IPv6
。该 dual-transport
语句允许 Junos OS LDP 通过 IPv4 与 IPv4 邻接方建立 TCP 连接,通过 IPv6 与 IPv6 邻接方建立 TCP 连接,作为单堆栈 LSR。inet6-lsr-id
和 inet-lsr-id
ISR 是必须配置为通过 IPv4 和 IPv6 TCP 传输建立 LDP 会话的两个 LSR ID。这两个 ID 应为非零,并且必须使用不同的值进行配置。
将 IPv6 配置为双堆栈之前,请确保配置路由和信令协议。
要配置 LDP 原生 IPv6 支持,您必须请执行以下操作:
示例:配置 LDP 原生 IPv6 支持
此示例说明如何允许 Junos OS 标签分配协议 (LDP) 通过 IPv4 与 IPv4 邻接方建立 TCP 连接,通过 IPv6 与 IPv6 邻接方建立 TCP 连接,以作为单堆栈 LSR。这有助于避免使用 IPv4 信号 MPLS 标签交换路径 (LSP) 基于 IPv4 MPLS 核心的 IPv6 隧道。
要求
此示例使用以下硬件和软件组件:
-
两台 MX 系列路由器
-
在所有设备上运行的 Junos OS 16.1 或更高版本
将 IPv6 配置为双堆栈之前,请确保配置路由和信令协议。
概述
LDP 在仅 IPv6 网络中受支持,以及如 RFC 7552 所述在 IPv6 或 IPv4 双堆栈网络中受支持。将地址家族 inet
配置为 IPv4 或 inet6
IPv6。默认情况下,当同时启用 IPv4 和 IPv6 时,IPv6 用作 LDP 会话及其对等方的 TCP 传输。双传输语句允许 Junos LDP 通过 IPv4 与 IPv4 邻接方建立 TCP 连接,通过 IPv6 与 IPv6 邻接方建立 TCP 连接,作为单堆栈 LSR。和inet-lsr-id
inet6-lsr-id
,是必须配置为通过 IPv4 和 IPv6 TCP 传输建立 LDP 会话的两个 LSR ID。这两个 ID 应为非零,并且必须使用不同的值进行配置。
配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到层级的 [edit] CLI 中,然后从配置模式进入 commit
。
R1
set interfaces ge-1/0/0 unit 0 family inet address 192.168.12.1/24 set interfaces ge-1/0/0 unit 0 family iso set interfaces ge-1/0/0 unit 0 family inet6 address 2001:db8:0:12::/64 eui-64 set interfaces ge-1/0/0 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.0.1/32 set interfaces lo0 unit 0 family iso address 49.0001.1720.1600.1010.00 set interfaces lo0 unit 0 family inet6 address 2001:db8::1/128 set protocols isis interface ge-1/0/0.0 set protocols isis interface lo0.0 set protocols mpls interface ge-1/0/0.0 set protocols ldp deaggregate set protocols ldp interface ge-1/0/0.0 set protocols ldp interface lo0.0 set protocols ldp family inet6 set protocols ldp family inet
R2
set interfaces ge-1/0/1 unit 0 family inet address 192.168.12.2/24 set interfaces ge-1/0/1 unit 0 family iso set interfaces ge-1/0/1 unit 0 family inet6 address 2001:db8:0:12::/64 eui-64 set interfaces ge-1/0/1 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.0.2/32 set interfaces lo0 unit 0 family iso address 49.0001.1720.1600.2020.00 set interfaces lo0 unit 0 family inet6 address 2001:db8::2/128 set protocols isis interface ge-1/0/1.0 set protocols isis interface lo0.0 set protocols mpls interface ge-1/0/1.0 set protocols ldp deaggregate set protocols ldp interface ge-1/0/1.0 set protocols ldp interface lo0.0 set protocols ldp family inet6 set protocols ldp family inet
配置 R1
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 Junos OS CLI 用户指南中的“ Using the CLI Editor in Configuration Mode ”。
要配置设备 R1:
-
配置接口。
[edit interfaces] set ge-1/0/0 unit 0 family inet address 192.168.12.1/24 set ge-1/0/0 unit 0 family iso set ge-1/0/0 unit 0 family inet6 address 2001:db8:0:12::/64 eui-64 set ge-1/0/0 unit 0 family mpls
-
为设备分配环路地址。
[edit interfaces lo0 unit 0] set family inet address 10.255.0.1/32 set family iso address 49.0001.1720.1600.1010.00 set family inet6 address 2001:db8::1/128
-
配置 IS-IS 接口。
[edit protocols isis] set interface ge-1/0/0.0 set interface lo0.0
-
配置 MPLS 以在设备上使用 LDP 接口。
[edit protocols mpls] set protocols mpls interface ge-1/0/0.0 set interface ge-1/0/0.0 set interface lo0.0
-
启用转发同等类 (FEC) 分解,以便为不同的地址族使用不同的标签。
[edit protocols ldp] set deaggregate
-
配置 LDP 地址族。
[edit protocols ldp] set family inet6 set family inet
结果
在配置模式下,输入和 show protocols 命令以确认show interfaces您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@R1# show interfaces ge-1/0/0 { unit 0 { family inet { address 192.168.12.1/24; } family iso; family inet6 { address 2001:db8:0:12::/64 { eui-64; } } family mpls; } } lo0 { unit 0 { family inet { address 10.255.0.1/32; } family iso { address 49.0001.1720.1600.1010.00 } family inet6 { address 2001:db8::1/128; } } }
user@R1# show protocols mpls { interface ge-1/0/0.0; } isis { interface ge-1/0/0.0; interface lo0.0; } ldp { deaggregate; interface ge-1/0/0.0; interface lo0.0; family { inet6; inet; } }
配置传输优先级以选择首选传输
CLI 快速配置
逐步过程
您可以配置语句, transport-preference
以在同时启用 IPv4 和 IPv6 时为 TCP 连接选择首选传输。默认情况下,IPv6 用作建立 LDP 连接的 TCP 传输。
-
(可选)为 LDP 连接配置传输优先级。
[edit protocols ldp] set transport-preference ipv4
逐步过程
结果
在配置模式下,输入命令以确认 show protocols 您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@R1# show protocols mpls { interface ge-1/0/0.0; } isis { interface ge-1/0/0.0; interface lo0.0; } ldp { deaggregate; interface ge-1/0/0.0; interface lo0.0; family { inet6; inet; } transport-preference ipv4; }
配置双传输,为具有 IPv4 邻接方和 IPv6 邻接方的 IPv6 建立单独的会话
逐步过程
您可以将该 dual-transport
语句配置为允许 LDP 与 IPv4 邻接方建立单独的 IPv4 会话,以及与 IPv6 邻接方建立 IPv6 会话。这需要配置 inet-lsr-id
为 IPv4 的 LSR ID 和 inet6-lsr-id
IPv6 的 LSR ID。
-
(可选)配置双传输以允许 LDP 通过 IPv4 与 IPv4 邻接方建立 TCP 连接,通过 IPv6 与 IPv6 邻接方建立 TCP 连接,作为单堆栈 LSR。
[edit protocols ldp dual-transport] set inet-lsr-id 10.255.0.1 set inet6-lsr-id 10.1.1.1
结果
在配置模式下,输入命令以确认 show protocols 您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@R1# show protocols mpls { interface ge-1/0/0.0; } isis { interface ge-1/0/0.0; interface lo0.0; } ldp { deaggregate; interface ge-1/0/0.0; interface lo0.0; family { inet6; inet; } dual-transport { inet-lsr-id 10.255.0.1; inet6-lsr-id 10.1.1.1; } }
验证
确认配置工作正常。
验证 mpls.0 表中的路由条目
目的
显示 mpls.0 路由表信息。
行动
在设备 R1 上,从操作模式运行 show route table mpls.0
命令以显示 mpls.0 路由表信息。
user@R1> show route table mpls.0
mpls.0: 8 destinations, 8 routes (8 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
0 *[MPLS/0] 05:19:58, metric 1
Receive
1 *[MPLS/0] 05:19:58, metric 1
Receive
2 *[MPLS/0] 05:19:58, metric 1
Receive
13 *[MPLS/0] 05:19:58, metric 1
Receive
299824 *[LDP/9] 04:28:45, metric 1
> to fe80::21f:1200:cb6:4c8d via ge-1/0/0.0, Pop
299824(S=0) *[LDP/9] 04:28:45, metric 1
> to fe80::21f:1200:cb6:4c8d via ge-1/0/0.0, Pop
299888 *[LDP/9] 00:56:12, metric 1
> to 192.168.12.2 via ge-1/0/0.0, Pop
299888(S=0) *[LDP/9] 00:56:12, metric 1
> to 192.168.12.2 via ge-1/0/0.0, Pop
含义
输出显示 mpls.0 路由表信息。
验证 inet.3 表中的路由条目
目的
显示 inet.3 路由表信息。
行动
在设备 R1 上,从操作模式运行 show route table inet.3
命令以显示 inet.3 路由表信息。
user@R1> show route table inet.3
inet.3: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
10.255.0.2/32 *[LDP/9] 00:58:38, metric 1
> to 192.168.12.2 via ge-1/0/0.0
含义
输出显示 inet.3 路由表信息。
验证 inet6.3 表中的路由条目
目的
显示 inet6.3 路由表信息。
行动
在设备 R1 上,从操作模式运行 show route table inet6.3
命令以显示 inet6.3 路由表信息。
user@R1> show route table inet6.3
inet6.3: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
2001:db8::2/128 *[LDP/9] 04:31:17, metric 1
> to fe80::21f:1200:cb6:4c8d via ge-1/0/0.0
含义
输出显示 inet6.3 路由表信息。
验证 LDP 数据库
目的
显示 LDP 数据库信息。
行动
在设备 R1 上,从操作模式运行 show ldp database
命令以显示 LDP 数据库信息。
user@R1> show ldp database
Input label database, 10.255.0.1:0--10.255.0.2:0
Labels received: 3
Label Prefix
299840 10.255.0.1/32
3 10.255.0.2/32
299808 2001:db8::1/128
3 2001:db8::2/128
Output label database, 10.255.0.1:0--10.255.0.2:0
Labels advertised: 3
Label Prefix
3 10.255.0.1/32
299888 10.255.0.2/32
3 2001:db8::1/128
299824 2001:db8::2/128
含义
输出显示 LDP 数据库中的条目。
验证 LDP 邻接方信息
目的
显示 LDP 邻接方信息。
行动
在设备 R1 上,从操作模式运行 show ldp neighbor
和 show ldp neighbor extensive
命令以显示 LDP 邻接方信息。
user@R1>show ldp neighbor
Address Interface Label space ID Hold time fe80::21f:1200:cb6:4c8d ge-1/0/0.0 10.255.0.2:0 12 192.168.12.2 ge-1/0/0.0 10.255.0.2:0 11 user@R1>show ldp neighbor extensive
Address Interface Label space ID Hold time 192.168.12.2 ge-1/0/0.0 10.255.0.2:0 11 Transport address: 10.255.0.2, Transport preference: IPv6, Configuration sequence: 10 Up for 00:04:35 Reference count: 1 Hold time: 15, Proposed local/peer: 15/15 Hello flags: none Neighbor types: discovered Address Interface Label space ID Hold time fe80::21f:1200:cb6:4c8d ge-1/0/0.0 10.255.0.2:0 14 Transport address: 2001:db8::2, Transport preference: IPv6, Configuration sequence: 10 Up for 00:04:35 Reference count: 1 Hold time: 15, Proposed local/peer: 15/15 Hello flags: none Neighbor types: discovered
含义
输出显示 IPv4 和 IPv6 地址的 LDP 邻接方信息。
验证 LDP 会话信息
目的
显示 LDP 会话信息。
行动
在设备 R1 上,从操作模式运行 show ldp session
和 show ldp session extensive
命令以显示 LDP 会话信息。
user@R1>show ldp session
session Address State Connection Hold time Adv. Mode 2001:db8::2 Operational Open 20 DU user@R1>show ldp session extensive
Address: 2001:db8::2, State: Operational, Connection: Open, Hold time: 29 Session ID: 10.255.0.1:0--10.255.0.2:0 Next keepalive in 9 seconds Passive, Maximum PDU: 4096, Hold time: 30, Neighbor count: 1 Neighbor types: discovered Keepalive interval: 10, Connect retry interval: 1 Local address: 2001:db8::1, Remote address: 2001:db8::2 Up for 00:05:31 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: 10.255.0.2 192.168.12.2 2001:db8::2 fe80::21f:1200:cb6:4c8d Queue depth: 0 Message type Total Last 5 seconds Sent Received Sent Received Initialization 1 1 0 0 Keepalive 34 34 0 0 Notification 0 0 0 0 Address 1 1 0 0 Address withdraw 0 0 0 0 Label mapping 3 3 0 0 Label request 0 0 0 0 Label withdraw 0 0 0 0 Label release 0 0 0 0 Label abort 0 0 0 0
含义
输出显示使用 IPv6 作为 TCP 传输的 LDP 会话的信息。
验证
确认配置工作正常。
验证 LDP 邻接方信息
目的
显示 LDP 邻接方信息。
行动
在设备 R1 上,从操作模式运行 show ldp neighbor extensive
命令以显示 LDP 邻接方信息。
user@R1> show ldp neighbor extensive
Address Interface Label space ID Hold time
192.168.12.2 ge-1/0/0.0 10.255.0.2:0 14
Transport address: 10.255.0.2, Transport preference: IPv4, Configuration sequence: 9
Up for 00:00:14
Reference count: 1
Hold time: 15, Proposed local/peer: 15/15
Hello flags: none
Neighbor types: discovered
Address Interface Label space ID Hold time
fe80::21f:1200:cb6:4c8d ge-1/0/0.0 10.255.0.2:0 14
Transport address: 2001:db8::2, Transport preference: IPv4, Configuration sequence: 9
Up for 00:00:14
Reference count: 1
Hold time: 15, Proposed local/peer: 15/15
Hello flags: none
Neighbor types: discovered
含义
输出显示 IPv4 和 IPv6 地址的 LDP 邻接方信息。
验证 LDP 会话信息
目的
显示 LDP 会话信息。
行动
在设备 R1 上,从操作模式运行 show ldp session extensive
命令以显示 LDP 会话信息。
user@R1> show ldp session extensive
Address: 10.255.0.2, State: Operational, Connection: Open, Hold time: 24
Session ID: 10.255.0.1:0--10.255.0.2:0
Next keepalive in 4 seconds
Passive, Maximum PDU: 4096, Hold time: 30, Neighbor count: 2
Neighbor types: discovered
Keepalive interval: 10, Connect retry interval: 1
Local address: 10.255.0.1, Remote address: 10.255.0.2
Up for 00:05:26
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:
10.255.0.2
192.168.12.2
2001:db8::2
fe80::21f:1200:cb6:4c8d
Queue depth: 0
Message type Total Last 5 seconds
Sent Received Sent Received
Initialization 1 1 0 0
Keepalive 33 33 1 1
Notification 0 0 0 0
Address 2 2 0 0
Address withdraw 0 0 0 0
Label mapping 6 6 0 0
Label request 0 0 0 0
Label withdraw 0 0 0 0
Label release 0 0 0 0
Label abort 0 0 0 0
含义
输出显示使用 IPv6 作为 TCP 传输的 LDP 会话的信息。
验证
确认配置工作正常。
验证 LDP 邻接方信息
目的
显示 LDP 邻接方信息。
行动
在设备 R1 上,从操作模式运行 show ldp neighbor extensive
命令以显示 LDP 邻接方信息。
user@R1> show ldp neighbor extensive
Address Interface Label space ID Hold time
192.168.12.2 ge-1/0/0.0 10.255.0.2:0 11
Transport address: 10.255.0.2, Configuration sequence: 10
Up for 00:04:35
Reference count: 1
Hold time: 15, Proposed local/peer: 15/15
Hello flags: none
Neighbor types: discovered
Address Interface Label space ID Hold time
fe80::21f:1200:cb6:4c8d ge-1/0/0.0 10.255.0.2:0 14
Transport address: 2001:db8::2, Configuration sequence: 10
Up for 00:04:35
Reference count: 1
Hold time: 15, Proposed local/peer: 15/15
Hello flags: none
Neighbor types: discovered
含义
输出显示 IPv4 和 IPv6 地址的 LDP 邻接方信息。
验证 LDP 会话信息
目的
显示 LDP 会话信息。
行动
在设备 R1 上,从操作模式运行 show ldp session extensive
命令以显示 LDP 邻接方信息。
user@R1> show ldp session extensive
Address: 2001:db8::2, State: Operational, Connection: Open, Hold time: 29
Session ID: 10.1.1.1:0--10.255.0.2:0
Next keepalive in 9 seconds
Passive, Maximum PDU: 4096, Hold time: 30, Neighbor count: 1
Neighbor types: discovered
Keepalive interval: 10, Connect retry interval: 1
Local address: 2001:db8::1, Remote address: 2001:db8::2
Up for 00:05:31
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:
2001:db8::2
fe80::21f:1200:cb6:4c8d
Queue depth: 0
Message type Total Last 5 seconds
Sent Received Sent Received
Initialization 1 1 0 0
Keepalive 34 34 0 0
Notification 0 0 0 0
Address 1 1 0 0
Address withdraw 0 0 0 0
Label mapping 3 3 0 0
Label request 0 0 0 0
Label withdraw 0 0 0 0
Label release 0 0 0 0
Label abort 0 0 0 0
Address: 10.255.0.2, State: Operational, Connection: Open, Hold time: 29
Session ID: 10.255.0.1:0--10.255.0.2:0
Next keepalive in 9 seconds
Passive, Maximum PDU: 4096, Hold time: 30, Neighbor count: 1
Neighbor types: discovered
Keepalive interval: 10, Connect retry interval: 1
Local address: 10.255.0.1, Remote address: 10.255.0.2
Up for 00:05:31
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:
10.255.0.2
192.168.12.2
Queue depth: 0
Message type Total Last 5 seconds
Sent Received Sent Received
Initialization 1 1 0 0
Keepalive 34 34 0 0
Notification 0 0 0 0
Address 1 1 0 0
Address withdraw 0 0 0 0
Label mapping 3 3 0 0
Label request 0 0 0 0
Label withdraw 0 0 0 0
Label release 0 0 0 0
Label abort 0 0 0 0
示例:为点到多点 LSP 配置多点 LDP 带内信令
了解点到多点 LSP 的多点 LDP 带内信令
用于带内信令的点对点到多点标签交换路径 (LSP) 的多点标签分配协议 (M-LDP) 在部署现有 IP/MPLS 主干网(例如需要承载组播流量)时很有用,例如,对于 IPTV。
多年来,用于传输组播流量的解决方案一直是在服务提供商核心中使用本机 IP 组播和多点 IP 隧道来隔离客户流量。部署了组播路由协议,通常是协议无关组播 (PIM),用于设置转发路径。IP 组播路由用于转发,在核心中使用 PIM 信令。要使该模型发挥作用,必须启用核心网络组播。即使在自治间系统 (AS) 场景中,也能实现高效且稳定的部署。
但是,在现有 IP/MPLS 网络中,部署 PIM 可能不是首选。一些服务提供商希望用 MPLS 标签封装取代 IP 隧道。转向 MPLS 标签交换的动机是利用 MPLS 流量工程和保护功能,并减少提供商核心中的控制流量开销。
为此,服务提供商希望利用现有部署的扩展来允许组播流量通过。IP/MPLS 的现有组播扩展包括适用于 RSVP-TE 和 LDP 的点到多点扩展和多点到多点扩展。RFC 6826 中的 多点 LDP 带内信令(用于点到多点和多点到多点标签交换路径的多点 LDP 带内信令)中讨论了这些部署方案。此功能概述仅限于 LDP 的点到多点扩展。
- M-LDP 的工作原理
- 术语
- 入口加入转换和伪接口处理
- 入口拼接
- 反向路径转发
- LSP 根检测
- 出口加入转换和伪接口处理
- 出口拼接
- 支持的功能
- 不支持的功能
- LDP 功能
- 出口 LER 功能
- 传输 LSR 功能
- 入口 LER 功能
M-LDP 的工作原理
M-LDP 信令中的标签绑定
LDP 的多点扩展使用点到多点和多点到多点的转发同等类 (FEC) 元素(在 RFC 5036, LDP 规格中定义)以及功能通告、标签映射和信令程序。FEC 元素包括 LSP 根的概念(即 IP 地址)和“不透明”值,后者是一个选择器,用于将具有相同不透明值的叶节点组合在一起。不透明值对中间节点透明,但对 LSP 根节点有意义。每个 LDP 节点都会将其本地传入标签绑定播发至最短路径上的上游 LDP 节点,以达到 FEC 中的根 IP 地址。接收标签绑定的上游节点会创建自己的本地标签和传出接口。如果有多个传出分支,则此标签分配过程可能会导致数据包复制。如中 图 18所示,如果 LDP 节点发现共享同一上游节点的下游节点,将合并同一不透明值的标签绑定。这样就可以有效地构建点到多点 LSP 并保护标签。

无 PIM MPLS 核心中的 M-LDP
图 19 显示了一个横向扩展的部署场景两个独立的 PIM 域通过无 PIM 核心站点互连。此核心站点中的边界路由器在边界接口上支持 PIM。此外,这些边界路由器会收集路由信息,并将其从相邻站点分发到核心网络。站点 C 中的边缘路由器运行 BGP 进行根节点发现。内部网关协议 (IGP) 路由不能用于入口发现,因为在大多数情况下,IGP 提供的下一跃点不会提供有关入口设备向源的信息。M-LDP 带内信令在点到多点 LSP 和 (S,G) 流之间具有一对一映射。借助带内信令,PIM 消息可直接转换为 M-LDP FEC 绑定。相比之下,带外信令基于手动配置。M-LDP 带内信令的一个应用是在 MPLS 主干网中承载 IPTV 组播流量。

配置
当 LER 未检测到 PIM 上游邻接方时,标签边缘路由器 (LER) 上的 配置语句 mldp-inband-signalling
使 PIM 可以为上游邻接方使用 M-LDP 带内信令。使用策略的 PIM 配置中包含 MPLS LSP 根的静态配置。当 IBGP 在核心站点中不可用或要覆盖基于 IBGP 的 LSP 根检测时,需要此功能。
例如:
protocols { pim { mldp-inband-signalling { policy lsp-mapping-policy-example; } } }
policy-options { policy-statement lsp-mapping-policy-example { term channel1 { from { source-address-filter ip-prefix</prefix-length>; #policy filter for channel1 } then { p2mp-lsp-root { # Statically configured ingress address of edge # used by channel1 address ip-address; } accept; } } } }
支持 PIM 的 MPLS 核心中的 M-LDP
从 Junos OS 14.1 版开始,为了将现有 IPTV 服务从本机 IP 组播迁移到 MPLS 组播,您需要在尽可能少的中断的情况下从 PIM 平稳过渡到 M-LDP 点到多点 LSP。 图 20 显示的 M-LDP 拓扑 图 19与 ,但不同场景。核心由 PIM 启用,一个源流传输所有 IPTV 频道。电视频道作为 ASM 流发送,每个频道均由其组地址标识。以前,这些通道以 IP 流式传输,并使用 PIM 发出信号。

通过在这种情况下配置 mldp-inband-signaling
,只有当源没有 PIM 邻接方时,才会启动 M-LDP 信令。但是,由于源上始终存在 PIM 邻接方,除非出口 PE 的上游接口上停用 PIM,因此 PIM 优先于 M-LDP,M-LDP 不会生效。
配置
要逐条通道逐步迁移到使用 M-LDP 上游的 M-LDP MPLS 核心,其他流使用现有 PIM 上游,请将配置语句和基于组的过滤器包含在 selected-mldp-egress
用于 M-LDP 带内信令的策略过滤器中。
M-LDP 带内信令策略过滤器可以包含 source-address-filter
语句或 route-filter
语句,或者两者的组合。
例如:
protocols { pim { mldp-inband-signalling { policy lsp-mapping-policy-example; } } }
policy-options { policy-statement lsp-mapping-policy-example { term channel1 { from { source-address-filter ip-prefix</prefix-length>; #policy filter for channel1 } then { selected-mldp-egress; accept; } } term channel2 { from { source-address-filter ip-prefix</prefix-length>; #policy filter for channel2 route-filter ip-prefix</prefix-length>; #policy filter on multicast group address } then { selected-mldp-egress; p2mp-lsp-root { # Statically configured ingress address of edge # used by channel2 address ip-address; } accept; } } term channel3 { from { route-filter ip-prefix</prefix-length>; #policy filter on multicast group address } then { selected-mldp-egress; accept; } } } }
上述配置的一些限制如下:
selected-mldp-egress
仅应在 LER 上配置语句。在非出口 PIM 路由器上配置selected-mldp-egress
语句可能会导致路径设置失败。当对从 PIM 上游到 M-LDP 上游的交换流量(反之亦然)进行更改时,在控制平面执行分断和使机制时,预计会丢失数据包。
术语
以下术语对于了解组播流量的 M-LDP 带内信令非常重要。
Point-to-point LSP | 具有一个入口标签交换路由器 (LSR) 和一个出口 LSR 的 LSP。 |
Multipoint LSP | 点对多点或多点对多点 LSP。 |
Point-to-multipoint LSP | 具有一个入口 LSR 和一个或多个出口 LSR 的 LSP。 |
Multipoint-to-point LSP | 具有一个或多个入口 LSR 和一个唯一出口 LSR 的 LSP。 |
Multipoint-to-multipoint LSP | 连接一组节点的 LSP,以便 LSP 中任何节点发送的流量将传递到所有其他节点。 |
Ingress LSR | 特定 LSP 的入口 LSR 是可沿着 LSP 发送数据包的 LSR。多点到多点 LSP 可以有多个入口 LSR。点对多点 LSP 只有一个,该节点通常称为根节点。 |
Egress LSR | 特定 LSP 的出口 LSR 是一种 LSR,可以从该 LSP 中移除数据包以便进一步处理。点对点和多点到点 LSP 只有一个出口节点。点对多点和多点到多点 LSP 可以有多个出口节点。 |
Transit LSR | 一种 LSR,通过直接连接的上游 LSR 和一个或多个直接连接的下游 LSR,可以到达多点 LSP 的根。 |
Bud LSR | 作为出口但也有一个或多个直接连接的下游 LSR 的 LSR。 |
Leaf node | 在点到多点 LSP 上下文中,出口或萌芽 LSR。在多点到多点 LSP 的上下文中,LSR 既是同一多点到多点 LSP 的入口和出口,也可以是一个萌芽 LSR。 |
入口加入转换和伪接口处理
在入口 LER,LDP 会通知 PIM 有关通过带内信令接收的 (S,G) 消息。PIM 将每个 (S,G) 消息与一个伪接口相关联。随后,向源发起最短路径树 (SPT) 加入消息。PIM 将其视为新型本地接收器。拆除 LSP 时,PIM 会根据 LDP 的通知移除此本地接收器。
入口拼接
LDP 为 PIM 提供下一跃点,以便与每个 (S,G) 条目相关联。PIM 使用 LDP 下一跃点和其他 PIM 接收器安装 PIM (S,G) 组播路由。下一跃点是本地接收器的复合下一跃点 + PIM 下游邻接方列表 + LDP 隧道的子级别下一跃点。
反向路径转发
PIM 的反向路径转发 (RPF) 计算在出口节点上执行。
当以下所有条件均成立时,PIM 执行 M-LDP 带内信令:
源上没有 PIM 邻接方。
配置了 M-LDP 带内信令语句。
下一跃点通过 BGP 学习,或存在于静态映射中(在 M-LDP 带内信令策略中指定)。
否则,如果 LSP 根检测失败,PIM 将保留 RPF 状态为未解析的 (S,G) 条目。
每次单播路由信息更改时,PIM RPF 都会注册此源地址。因此,如果指向源的路由发生变化,RPF 重新计算将重复发生。此外,也会监控 BGP 协议向源的下一跃点,了解 LSP 根中的变化。此类更改可能会在短时间内导致流量中断。
LSP 根检测
如果 RPF 操作检测到需要 M-LDP 带内信令上游,将检测 LSP 根(入口)。此根是 LDP LSP 信令的参数。
将按如下方法检测到根节点:
如果现有静态配置指定了源地址,则根将按配置中的给定顺序进行。
在单播路由表中执行查找。如果找到源地址,则指向该源的协议下一跃点将用作 LSP 根。
在 Junos OS 16.1 版之前,M-LDP 点到多点 LSP 使用入口 LSR 的根地址发出从出口到入口的信号。此根地址只能通过 IGP 访问,因此 M-LDP 点到多点 LSP 仅限于单个自治系统。如果根地址无法通过 IGP 访问,但可通过 BGP 访问,并且该 BGP 路由通过 MPLS LSP 递归解析,则点到多点 LSP 不会从该点进一步向入口 LSR 根地址发出信号。
这些非分段的点对多点 LSP 需要跨多个自治系统发出信号,这些信号可用于以下应用:
具有非分段点对多点 LSP 的 AS 间 MVPN。
通过 MPLS 核心网络连接的客户端网络之间的 AS 间 M-LDP 带内信令。
区域间 MVPN 或 M-LDP 带内信令,采用非分段点对多点 LSP(无缝 MPLS 组播)。
从 Junos OS 16.1 版开始,M-LDP 可以在 ASBR 发出点到多点 LSP 信号,当根地址为 BGP 路由时,该路由可通过 MPLS LSP 进一步递归解析。
出口加入转换和伪接口处理
在出口 LER,PIM 通知 LDP (S,G) 消息与 LSP 根信号一起发出。PIM 会创建一个伪接口作为此 (S,G) 消息的上游接口。收到 (S,G) 删除消息后,将删除此关联。
出口拼接
在核心网络的出口节点上,接收来自下行站点的 (S,G) 加入消息,此加入消息将转换为 M-LDP 带内信令参数,并收到 LDP 通知。此外,当 (S,G) 条目丢失、LSP 根目录发生变化或者通过 PIM 邻接方可访问 (S,G) 条目时,LSP 也会出现 LSP 拆解。
支持的功能
对于 M-LDP 带内信令,Junos OS 支持以下功能:
使用 LDP 路由的 PIM 下一跃点的出口拼接
PIM 路由与 LDP 下一跃点的入口拼接
将 PIM 加入消息转换到 LDP 点到多点 LSP 设置参数
转换 M-LDP 带内 LSP 参数以设置 PIM 加入消息
静态配置和 BGP 协议基于下一跃点的 LSP 根检测
PIM 源特定组播 (SSM) 和任何源组播 (ASM) 范围内的 PIM (S,G) 状态
入口和出口 LE 上的配置语句,使它们能够充当边缘路由器
LE 上的 IGMP 加入消息
将 IPv6 源和组地址作为不透明的信息承载到 IPv4 根节点
静态配置,用于将 IPv6 (S,G) 映射到 IPv4 根地址
不支持的功能
对于 M-LDP 带内信令,Junos OS 不支持 以下功能:
对 PIM ASM 的全面支持
mpls lsp point-to-multipoint ping
使用 (S,G) 选项的命令不间断活动路由 (NSR)
用于 PIM 的先决后决 (MBB)
IPv6 LSP 根地址(LDP 不支持 IPv6 LSP.)
不直接连接的 PIM 发送方之间的邻接方关系
平滑重启
PIM 密集模式
PIM 双向模式
LDP 功能
PIM (S,G) 信息作为 M-LDP 不透明的类型长度值 (TLV) 编码进行。点到多点 FEC 元素由根节点地址组成。如果是下一代组播 VPN (NGEN MVPN),则点对多点 LSP 由根节点地址和 LSP ID 标识。
出口 LER 功能
在出口 LER 上,PIM 会使用以下信息触发 LDP,以创建点对多点 LSP:
根节点
(S,G)
下一跃点
PIM 会根据组播树的源查找根节点。如果为此 (S,G) 条目配置了根地址,则配置的地址将用作点到多点 LSP 根地址。否则,将使用路由表来查找到源的路由。如果组播树源的路由是 BGP 学习的路由,PIM 将检索 BGP 下一跃点地址并将其用作点对多点 LSP 的根节点。
LDP 会基于根节点查找上游节点,分配标签,并将标签映射发送至上游节点。LDP 不会将倒数第二跃点弹出 (PHP) 用于带内 M-LDP 信令。
如果组播树源的根地址发生变化,PIM 将删除点到多点 LSP 并触发 LDP 创建新的点对多点 LSP。发生这种情况时,传出接口列表变为 NULL,PIM 触发 LDP 删除点到多点 LSP,LDP 向上游节点发送标签提取消息。
传输 LSR 功能
传输 LSR 会将标签播发至上游 LSR,指向点到多点 FEC 的源,并安装必要的转发状态来转发数据包。传输 LSR 可以是任何支持 M-LDP 的路由器。
入口 LER 功能
在入口 LER 上,LDP 在收到标签映射后向 PIM 提供以下信息:
(S,G)
泛滥下一跃点
然后 PIM 安装转发状态。如果添加或删除了新分支,将相应地更新泛洪下一跃点。如果由于标签被撤销而删除所有分支,LDP 会将更新的信息发送至 PIM。如果上游和下游邻接方之间有多个链路,则点对多点 LSP 负载未均衡。
另请参阅
示例:为点到多点 LSP 配置多点 LDP 带内信令
此示例说明如何为组播流量配置多点 LDP (M-LDP) 带内信令,作为协议无关组播 (PIM) 协议的扩展或 PIM 的替代。
要求
此示例可使用以下硬件和软件组件进行配置:
Junos OS 版本 13.2 或更高版本
适用于提供商边缘 (PE) 路由器的 MX 系列 5G 通用路由平台或 M 系列多服务边缘路由器
用作传输标签交换路由器的 PTX 系列数据包传输路由器
适用于核心路由器的 T 系列核心路由器
PE 路由器也可以是 T 系列核心路由器,但这并不典型。根据您的扩展要求,核心路由器也可以是 MX 系列 5G 通用路由平台或 M 系列多服务边缘路由器。客户边缘 (CE) 设备可以是瞻博网络或其他供应商提供的其他路由器或交换机。
配置此示例之前,不需要除设备初始化之外的特殊配置。
概述
CLI 快速配置 显示了中 图 21所有设备的配置。#d158e70__d158e837本节介绍有关设备出口PE 的步骤。

配置
程序
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层次结构级别的 CLI 中 [edit]
。
设备 src1
set logical-systems src1 interfaces fe-1/2/0 unit 0 family inet address 10.2.7.7/24 set logical-systems src1 interfaces lo0 unit 0 family inet address 10.1.1.7/32 set logical-systems src1 protocols ospf area 0.0.0.0 interface all
设备入口PE
set interfaces so-0/1/2 unit 0 family inet address 192.168.93.9/28 set interfaces fe-1/2/0 unit 0 family inet address 10.2.3.2/24 set interfaces fe-1/2/0 unit 0 family mpls set interfaces fe-1/2/1 unit 0 family inet address 10.2.5.2/24 set interfaces fe-1/2/2 unit 0 family inet address 10.2.6.2/24 set interfaces fe-1/2/2 unit 0 family mpls set interfaces fe-1/2/3 unit 0 family inet address 10.2.7.2/24 set interfaces fe-1/3/1 unit 0 family inet address 192.168.219.9/28 set interfaces lo0 unit 0 family inet address 10.1.1.2/32 set protocols igmp interface fe-1/2/1.0 version 3 set protocols igmp interface fe-1/2/1.0 static group 232.1.1.1 source 192.168.219.11 set protocols bgp group ibgp type internal set protocols bgp group ibgp local-address 10.1.1.2 set protocols bgp group ibgp family inet any set protocols bgp group ibgp family inet-vpn any set protocols bgp group ibgp neighbor 10.1.1.3 set protocols bgp group ibgp neighbor 10.1.1.4 set protocols bgp group ibgp neighbor 10.1.1.1 set protocols ospf area 0.0.0.0 interface all set protocols ldp interface fe-1/2/0.0 set protocols ldp interface fe-1/2/2.0 set protocols ldp interface lo0.0 set protocols ldp p2mp set protocols pim mldp-inband-signalling policy mldppim-ex set protocols pim rp static address 10.1.1.5 set protocols pim interface fe-1/3/1.0 set protocols pim interface lo0.0 set protocols pim interface fe-1/2/0.21 set protocols pim interface fe-1/2/3.0 set protocols pim interface fe-1/2/1.0 set protocols pim interface so-0/1/2.0 set policy-options policy-statement mldppim-ex term B from source-address-filter 192.168.0.0/24 orlonger set policy-options policy-statement mldppim-ex term B from source-address-filter 192.168.219.11/32 orlonger set policy-options policy-statement mldppim-ex term B then accept set policy-options policy-statement mldppim-ex term A from source-address-filter 10.1.1.7/32 orlonger set policy-options policy-statement mldppim-ex term A from source-address-filter 10.2.7.0/24 orlonger set policy-options policy-statement mldppim-ex term A then accept set routing-options autonomous-system 64510
设备出口PE
set interfaces so-0/1/3 unit 0 point-to-point set interfaces so-0/1/3 unit 0 family inet address 192.168.92.9/28 set interfaces fe-1/2/0 unit 0 family inet address 10.1.3.1/24 set interfaces fe-1/2/0 unit 0 family mpls set interfaces fe-1/2/1 unit 0 family inet address 10.1.4.1/24 set interfaces fe-1/2/2 unit 0 family inet address 10.1.6.1/24 set interfaces fe-1/2/2 unit 0 family mpls set interfaces fe-1/3/0 unit 0 family inet address 192.168.209.9/28 set interfaces lo0 unit 0 family inet address 10.1.1.1/32 set routing-options autonomous-system 64510 set protocols igmp interface fe-1/3/0.0 version 3 set protocols igmp interface fe-1/3/0.0 static group 232.1.1.1 group-count 3 set protocols igmp interface fe-1/3/0.0 static group 232.1.1.1 source 192.168.219.11 set protocols igmp interface fe-1/3/0.0 static group 227.1.1.1 set protocols igmp interface so-0/1/3.0 version 3 set protocols igmp interface so-0/1/3.0 static group 232.1.1.1 group-count 2 set protocols igmp interface so-0/1/3.0 static group 232.1.1.1 source 192.168.219.11 set protocols igmp interface so-0/1/3.0 static group 232.2.2.2 source 10.2.7.7 set protocols mpls interface fe-1/2/0.0 set protocols mpls interface fe-1/2/2.0 set protocols bgp group ibgp type internal set protocols bgp group ibgp local-address 10.1.1.1 set protocols bgp group ibgp family inet any set protocols bgp group ibgp neighbor 10.1.1.2 set protocols msdp local-address 10.1.1.1 set protocols msdp peer 10.1.1.5 set protocols ospf area 0.0.0.0 interface all set protocols ospf area 0.0.0.0 interface fxp0.0 disable set protocols ldp interface fe-1/2/0.0 set protocols ldp interface fe-1/2/2.0 set protocols ldp interface lo0.0 set protocols ldp p2mp set protocols pim mldp-inband-signalling policy mldppim-ex set protocols pim rp local address 10.1.1.1 set protocols pim rp local group-ranges 227.0.0.0/8 set protocols pim rp static address 10.1.1.4 set protocols pim rp static address 10.2.7.7 group-ranges 226.0.0.0/8 set protocols pim interface lo0.0 set protocols pim interface fe-1/3/0.0 set protocols pim interface fe-1/2/0.0 set protocols pim interface fe-1/2/1.0 set protocols pim interface so-0/1/3.0 set policy-options policy-statement mldppim-ex term B from source-address-filter 192.168.0.0/24 orlonger set policy-options policy-statement mldppim-ex term B from source-address-filter 192.168.219.11/32 orlonger set policy-options policy-statement mldppim-ex term B then p2mp-lsp-root address 10.1.1.2 set policy-options policy-statement mldppim-ex term B then accept set policy-options policy-statement mldppim-ex term A from source-address-filter 10.2.7.0/24 orlonger set policy-options policy-statement mldppim-ex term A then accept
设备 p6
set interfaces fe-1/2/0 unit 0 family inet address 10.1.6.6/24 set interfaces fe-1/2/0 unit 0 family mpls set interfaces fe-1/2/1 unit 0 family inet address 10.2.6.6/24 set interfaces fe-1/2/1 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.1.1.6/32 set interfaces lo0 unit 0 family mpls set protocols ospf area 0.0.0.0 interface all set protocols ldp interface fe-1/2/0.0 set protocols ldp interface fe-1/2/1.0 set protocols ldp interface lo0.0 set protocols ldp p2mp
设备 pr3
set interfaces ge-0/3/1 unit 0 family inet address 192.168.215.9/28 set interfaces fe-1/2/0 unit 0 family inet address 10.1.3.3/24 set interfaces fe-1/2/0 unit 0 family mpls set interfaces fe-1/2/1 unit 0 family inet address 10.2.3.3/24 set interfaces fe-1/2/1 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.1.1.3/32 set protocols igmp interface ge-0/3/1.0 version 3 set protocols igmp interface ge-0/3/1.0 static group 232.1.1.2 source 192.168.219.11 set protocols igmp interface ge-0/3/1.0 static group 232.2.2.2 source 10.2.7.7 set protocols bgp group ibgp local-address 10.1.1.3 set protocols bgp group ibgp type internal set protocols bgp group ibgp neighbor 10.1.1.2 set protocols ospf area 0.0.0.0 interface all set protocols ospf area 0.0.0.0 interface fe-1/2/1.0 metric 2 set protocols ldp interface fe-1/2/0.0 set protocols ldp interface fe-1/2/1.0 set protocols ldp interface lo0.0 set protocols ldp p2mp set protocols pim mldp-inband-signalling policy mldppim-ex set protocols pim interface fe-0/3/1.0 set protocols pim interface lo0.0 set policy-options policy-statement mldppim-ex term B from source-address-filter 192.168.0.0/24 orlonger set policy-options policy-statement mldppim-ex term B from source-address-filter 192.168.219.11/32 orlonger set policy-options policy-statement mldppim-ex term B then p2mp-lsp-root address 10.1.1.2 set policy-options policy-statement mldppim-ex term B then accept set policy-options policy-statement mldppim-ex term B from source-address-filter 192.168.0.0/24 orlonger set policy-options policy-statement mldppim-ex term B from source-address-filter 192.168.219.11/32 orlonger set policy-options policy-statement mldppim-ex term B from source-address-filter 10.2.7.7/32 orlonger set policy-options policy-statement mldppim-ex term B then p2mp-lsp-root address 10.1.1.2 set policy-options policy-statement mldppim-ex term B then accept set routing-options autonomous-system 64510
设备 pr4
set interfaces ge-0/3/0 unit 0 family inet address 192.168.207.9/28 set interfaces fe-1/2/0 unit 0 family inet address 10.1.4.4/24 set interfaces fe-1/2/0 unit 0 family iso set interfaces lo0 unit 0 family inet address 10.1.1.4/32 set protocols igmp interface ge-0/3/0.0 version 3 set protocols igmp interface ge-0/3/0.0 static group 232.1.1.2 source 192.168.219.11 set protocols igmp interface ge-0/3/0.0 static group 225.1.1.1 set protocols bgp group ibgp local-address 10.1.1.4 set protocols bgp group ibgp type internal set protocols bgp group ibgp neighbor 10.1.1.2 set protocols msdp local-address 10.1.1.4 set protocols msdp peer 10.1.1.5 set protocols ospf area 0.0.0.0 interface all set protocols pim rp local address 10.1.1.4 set protocols pim interface ge-0/3/0.0 set protocols pim interface lo0.0 set protocols pim interface fe-1/2/0.0 set routing-options autonomous-system 64510
设备 pr5
set interfaces fe-1/2/0 unit 0 family inet address 10.2.5.5/24 set interfaces lo0 unit 0 family inet address 10.1.1.5/24 set protocols igmp interface lo0.0 version 3 set protocols igmp interface lo0.0 static group 232.1.1.1 source 192.168.219.11 set protocols msdp local-address 10.1.1.5 set protocols msdp peer 10.1.1.4 set protocols msdp peer 10.1.1.1 set protocols ospf area 0.0.0.0 interface all set protocols pim rp local address 10.1.1.5 set protocols pim interface all
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用CLI 编辑器。
要配置设备出口PE:
配置接口。
在面向核心的接口上启用 MPLS。在出口下一跃点上,无需启用 MPLS。
[edit interfaces] user@EgressPE# set fe-1/2/0 unit 0 family inet address 10.1.3.1/24 user@EgressPE# set fe-1/2/0 unit 0 family mpls user@EgressPE# set fe-1/2/2 unit 0 family inet address 10.1.6.1/24 user@EgressPE# set fe-1/2/2 unit 0 family mpls user@EgressPE# set so-0/1/3 unit 0 point-to-point user@EgressPE# set so-0/1/3 unit 0 family inet address 192.168.92.9/28 user@EgressPE# set fe-1/2/1 unit 0 family inet address 10.1.4.1/24 user@EgressPE# set fe-1/3/0 unit 0 family inet address 192.168.209.9/28 user@EgressPE# set lo0 unit 0 family inet address 10.1.1.1/32
在出口接口上配置 IGMP。
出于测试目的,此示例包括静态组地址和源地址。
[edit protocols igmp] user@EgressPE# set interface fe-1/3/0.0 version 3 user@EgressPE# set interface fe-1/3/0.0 static group 232.1.1.1 group-count 3 user@EgressPE# set interface fe-1/3/0.0 static group 232.1.1.1 source 192.168.219.11 user@EgressPE# set interface fe-1/3/0.0 static group 227.1.1.1 user@EgressPE# set interface so-0/1/3.0 version 3 user@EgressPE# set interface so-0/1/3.0 static group 232.1.1.1 group-count 2 user@EgressPE# set interface so-0/1/3.0 static group 232.1.1.1 source 192.168.219.11 user@EgressPE# set interface so-0/1/3.0 static group 232.2.2.2 source 10.2.7.7
在面向核心的接口上配置 MPLS。
[edit protocols mpls] user@EgressPE# set interface fe-1/2/0.0 user@EgressPE# set interface fe-1/2/2.0
配置 BGP。
BGP 是一种策略驱动型协议,因此还可以配置和应用任何所需的路由策略。
例如,您可能想将静态路由导出到 BGP 中。
[edit protocols bgp group ibgp] user@EgressPE# set type internal user@EgressPE# set local-address 10.1.1.1 user@EgressPE# set family inet any user@EgressPE# set neighbor 10.1.1.2
(可选)配置与设备 pr5 的 MSDP 对等连接,以便将不同的 PIM 域互连,从而启用冗余 IP。
[edit protocols msdp] user@EgressPE# set local-address 10.1.1.1 user@EgressPE# set peer 10.1.1.5
配置 OSPF。
[edit protocols ospf area 0.0.0.0] user@EgressPE# set interface all user@EgressPE# set interface fxp0.0 disable
在面向核心的接口和环路接口上配置 LDP。
[edit protocols ldp] user@EgressPE# set interface fe-1/2/0.0 user@EgressPE# set interface fe-1/2/2.0 user@EgressPE# set interface lo0.0
启用点对多点 MPLS LSP。
[edit protocols ldp] user@EgressPE# set p2mp
在下游接口上配置 PIM。
[edit protocols pim] user@EgressPE# set interface lo0.0 user@EgressPE# set interface fe-1/3/0.0 user@EgressPE# set interface fe-1/2/1.0 user@EgressPE# set interface so-0/1/3.0
配置 RP 设置,因为此设备用作 PIM 集合点 (RP)。
[edit protocols pim] user@EgressPE# set rp local address 10.1.1.1 user@EgressPE# set rp local group-ranges 227.0.0.0/8 user@EgressPE# set rp static address 10.1.1.4 user@EgressPE# set rp static address 10.2.7.7 group-ranges 226.0.0.0/8
启用 M-LDP 带内信令并设置相关策略。
[edit protocols pim] user@EgressPE# set mldp-inband-signalling policy mldppim-ex
配置路由策略,用于为点到多点 LSP 和关联的源地址指定根地址。
[edit policy-options policy-statement mldppim-ex] user@EgressPE# set term B from source-address-filter 192.168.0.0/24 orlonger user@EgressPE# set term B from source-address-filter 192.168.219.11/32 orlonger user@EgressPE# set term B then p2mp-lsp-root address 10.1.1.2 user@EgressPE# set term B then accept user@EgressPE# set term A from source-address-filter 10.2.7.0/24 orlonger user@EgressPE# set term A then accept
配置自治系统 (AS) ID。
[edit routing-options] user@EgressPE# set autonomous-system 64510
结果
在配置模式下,输入 show interfaces
、 show protocols
、 show policy-options
和 show routing-options
命令,以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
设备出口PE
user@EgressPE# show interfaces
so-0/1/3 {
unit 0 {
point-to-point;
family inet {
address 192.168.92.9/28;
}
}
}
fe-1/2/0 {
unit 0 {
family inet {
address 10.1.3.1/24;
}
family mpls;
}
}
fe-1/2/1 {
unit 0 {
family inet {
address 10.1.4.1/24;
}
}
}
fe-1/2/2 {
unit 0 {
family inet {
address 10.1.6.1/24;
}
family mpls;
}
}
fe-1/3/0 {
unit 0 {
family inet {
address 192.168.209.9/28;
}
}
}
lo0 {
unit 0 {
family inet {
address 10.1.1.1/32;
}
}
}
user@EgressPE# show protocols
igmp {
interface fe-1/3/0.0 {
version 3;
static {
group 232.1.1.1 {
group-count 3;
source 192.168.219.11;
}
group 227.1.1.1;
}
}
interface so-0/1/3.0 {
version 3;
static {
group 232.1.1.1 {
group-count 2;
source 192.168.219.11;
}
group 232.2.2.2 {
source 10.2.7.7;
}
}
}
}
mpls {
interface fe-1/2/0.0;
interface fe-1/2/2.0;
}
bgp {
group ibgp {
type internal;
local-address 10.1.1.1;
family inet {
any;
}
neighbor 10.1.1.2;
}
}
msdp {
local-address 10.1.1.1;
peer 10.1.1.5;
}
ospf {
area 0.0.0.0 {
interface all;
interface fxp0.0 {
disable;
}
}
}
ldp {
interface fe-1/2/0.0;
interface fe-1/2/2.0;
interface lo0.0;
p2mp;
}
pim {
mldp-inband-signalling {
policy mldppim-ex;
}
rp {
local {
address 10.1.1.1;
group-ranges {
227.0.0.0/8;
}
}
static {
address 10.1.1.4;
address 10.2.7.7 {
group-ranges {
226.0.0.0/8;
}
}
}
}
interface lo0.0;
interface fe-1/3/0.0;
interface fe-1/2/0.0;
interface fe-1/2/1.0;
interface so-0/1/3.0;
}
user@EgressPE# show policy-options
policy-statement mldppim-ex {
term B {
from {
source-address-filter 192.168.0.0/24 orlonger;
source-address-filter 192.168.219.11/32 orlonger;
}
then {
p2mp-lsp-root {
address 10.1.1.2;
}
accept;
}
}
term A {
from {
source-address-filter 10.2.7.0/24 orlonger;
}
then accept;
}
}
user@EgressPE# show routing-options
autonomous-system 64510;
同样,配置其他出口设备。
完成设备配置后,请从配置模式进入 commit
。
验证
确认配置工作正常。
检查 PIM 加入状态
目的
显示有关 PIM 加入状态的信息,以验证 M-LDP 带内上游和下游详细信息。在入口设备上, show pim join extensive
为下行接口显示 Pseudo-MLDP
命令。在出口上 show pim join extensive
,为上游接口显示 Pseudo-MLDP
命令。
行动
在操作模式下,输入 show pim join extensive
命令。
user@IngressPE> show pim join extensive Instance: PIM.master Family: INET R = Rendezvous Point Tree, S = Sparse, W = Wildcard Group: 232.1.1.1 Source: 192.168.219.11 Flags: sparse,spt Upstream interface: fe-1/3/1.0 Upstream neighbor: Direct Upstream state: Local Source Keepalive timeout: Uptime: 1d 23:00:12 Downstream neighbors: Interface: Pseudo-MLDP Interface: fe-1/2/1.0 10.2.5.2 State: Join Flags: S Timeout: Infinity Uptime: 1d 23:00:12 Time since last Join: 1d 23:00:12 Group: 232.1.1.2 Source: 192.168.219.11 Flags: sparse,spt Upstream interface: fe-1/3/1.0 Upstream neighbor: Direct Upstream state: Local Source Keepalive timeout: Uptime: 1d 22:59:59 Downstream neighbors: Interface: Pseudo-MLDP Group: 232.1.1.3 Source: 192.168.219.11 Flags: sparse,spt Upstream interface: fe-1/3/1.0 Upstream neighbor: Direct Upstream state: Local Source Keepalive timeout: Uptime: 1d 22:07:31 Downstream neighbors: Interface: Pseudo-MLDP Group: 232.2.2.2 Source: 10.2.7.7 Flags: sparse,spt Upstream interface: fe-1/2/3.0 Upstream neighbor: Direct Upstream state: Local Source Keepalive timeout: Uptime: 1d 22:59:59 Downstream neighbors: Interface: Pseudo-MLDP user@EgressPE> show pim join extensive Instance: PIM.master Family: INET R = Rendezvous Point Tree, S = Sparse, W = Wildcard Group: 227.1.1.1 Source: * RP: 10.1.1.1 Flags: sparse,rptree,wildcard Upstream interface: Local Upstream neighbor: Local Upstream state: Local RP Uptime: 1d 23:14:21 Downstream neighbors: Interface: fe-1/3/0.0 192.168.209.9 State: Join Flags: SRW Timeout: Infinity Uptime: 1d 23:14:21 Time since last Join: 1d 20:12:35 Group: 232.1.1.1 Source: 192.168.219.11 Flags: sparse,spt Upstream protocol: MLDP Upstream interface: Pseudo MLDP Upstream neighbor: MLDP LSP root <10.1.1.2> Upstream state: Join to Source Keepalive timeout: Uptime: 1d 23:14:22 Downstream neighbors: Interface: so-0/1/3.0 192.168.92.9 State: Join Flags: S Timeout: Infinity Uptime: 1d 20:12:35 Time since last Join: 1d 20:12:35 Downstream neighbors: Interface: fe-1/3/0.0 192.168.209.9 State: Join Flags: S Timeout: Infinity Uptime: 1d 20:12:35 Time since last Join: 1d 20:12:35 Group: 232.1.1.2 Source: 192.168.219.11 Flags: sparse,spt Upstream protocol: MLDP Upstream interface: Pseudo MLDP Upstream neighbor: MLDP LSP root <10.1.1.2> Upstream state: Join to Source Keepalive timeout: Uptime: 1d 23:14:22 Downstream neighbors: Interface: so-0/1/3.0 192.168.92.9 State: Join Flags: S Timeout: Infinity Uptime: 1d 20:12:35 Time since last Join: 1d 20:12:35 Downstream neighbors: Interface: fe-1/2/1.0 10.1.4.4 State: Join Flags: S Timeout: 198 Uptime: 1d 22:59:59 Time since last Join: 00:00:12 Downstream neighbors: Interface: fe-1/3/0.0 192.168.209.9 State: Join Flags: S Timeout: Infinity Uptime: 1d 20:12:35 Time since last Join: 1d 20:12:35 Group: 232.1.1.3 Source: 192.168.219.11 Flags: sparse,spt Upstream protocol: MLDP Upstream interface: Pseudo MLDP Upstream neighbor: MLDP LSP root <10.1.1.2> Upstream state: Join to Source Keepalive timeout: Uptime: 1d 20:12:35 Downstream neighbors: Interface: fe-1/3/0.0 192.168.209.9 State: Join Flags: S Timeout: Infinity Uptime: 1d 20:12:35 Time since last Join: 1d 20:12:35 Group: 232.2.2.2 Source: 10.2.7.7 Flags: sparse,spt Upstream protocol: MLDP Upstream interface: Pseudo MLDP Upstream neighbor: MLDP LSP root <10.1.1.2> Upstream state: Join to Source Keepalive timeout: Uptime: 1d 20:12:35 Downstream neighbors: Interface: so-0/1/3.0 192.168.92.9 State: Join Flags: S Timeout: Infinity Uptime: 1d 20:12:35 Time since last Join: 1d 20:12:35 user@pr3> show pim join extensive Instance: PIM.master Family: INET R = Rendezvous Point Tree, S = Sparse, W = Wildcard Group: 232.1.1.2 Source: 192.168.219.11 Flags: sparse,spt Upstream protocol: MLDP Upstream interface: Pseudo MLDP Upstream neighbor: MLDP LSP root <10.1.1.2> Upstream state: Join to Source Keepalive timeout: Uptime: 1d 20:14:40 Downstream neighbors: Interface: Pseudo-GMP ge-0/3/1.0 Group: 232.2.2.2 Source: 10.2.7.7 Flags: sparse,spt Upstream protocol: MLDP Upstream interface: Pseudo MLDP Upstream neighbor: MLDP LSP root <10.1.1.2> Upstream state: Join to Source Keepalive timeout: Uptime: 1d 20:14:40 Downstream neighbors: Interface: Pseudo-GMP ge-0/3/1.0 user@pr4> show pim join extensive Instance: PIM.master Family: INET R = Rendezvous Point Tree, S = Sparse, W = Wildcard Group: 225.1.1.1 Source: * RP: 10.1.1.4 Flags: sparse,rptree,wildcard Upstream interface: Local Upstream neighbor: Local Upstream state: Local RP Uptime: 1d 23:13:43 Downstream neighbors: Interface: ge-0/3/0.0 192.168.207.9 State: Join Flags: SRW Timeout: Infinity Uptime: 1d 23:13:43 Time since last Join: 1d 23:13:43 Group: 232.1.1.2 Source: 192.168.219.11 Flags: sparse,spt Upstream interface: fe-1/2/0.0 Upstream neighbor: 10.1.4.1 Upstream state: Local RP, Join to Source Keepalive timeout: 0 Uptime: 1d 23:13:43 Downstream neighbors: Interface: ge-0/3/0.0 192.168.207.9 State: Join Flags: S Timeout: Infinity Uptime: 1d 23:13:43 Time since last Join: 1d 23:13:43 user@pr5> show pim join extensive ge-0/3/1.0 Instance: PIM.master Family: INET R = Rendezvous Point Tree, S = Sparse, W = Wildcard Instance: PIM.master Family: INET6 R = Rendezvous Point Tree, S = Sparse, W = Wildcard
检查 PIM 源
目的
验证 PIM 源是否具有预期的 M-LDP 带内上游和下游详细信息。
行动
在操作模式下,输入 show pim source
命令。
user@IngressPE> show pim source Instance: PIM.master Family: INET Source 10.1.1.1 Prefix 10.1.1.1/32 Upstream interface Local Upstream neighbor Local Source 10.2.7.7 Prefix 10.2.7.0/24 Upstream protocol MLDP Upstream interface Pseudo MLDP Upstream neighbor MLDP LSP root <10.1.1.2> Source 192.168.219.11 Prefix 192.168.219.0/28 Upstream protocol MLDP Upstream interface Pseudo MLDP Upstream neighbor MLDP LSP root <10.1.1.2>
user@EgressPE> show pim source Instance: PIM.master Family: INET Source 10.2.7.7 Prefix 1.2.7.0/24 Upstream interface fe-1/2/3.0 Upstream neighbor 10.2.7.2 Source 10.2.7.7 Prefix 10.2.7.0/24 Upstream interface fe-1/2/3.0 Upstream neighbor Direct Source 192.168.219.11 Prefix 192.168.219.0/28 Upstream interface fe-1/3/1.0 Upstream neighbor 192.168.219.9 Source 192.168.219.11 Prefix 192.168.219.0/28 Upstream interface fe-1/3/1.0 Upstream neighbor Direct
user@pr3> show pim source Instance: PIM.master Family: INET Source 10.2.7.7 Prefix 1.2.7.0/24 Upstream protocol MLDP Upstream interface Pseudo MLDP Upstream neighbor MLDP LSP root <10.1.1.2> Source 192.168.219.11 Prefix 192.168.219.0/28 Upstream protocol MLDP Upstream interface Pseudo MLDP Upstream neighbor MLDP LSP root <10.1.1.2>
user@pr4> show pim source Instance: PIM.master Family: INET Source 10.1.1.4 Prefix 10.1.1.4/32 Upstream interface Local Upstream neighbor Local Source 192.168.219.11 Prefix 192.168.219.0/28 Upstream interface fe-1/2/0.0 Upstream neighbor 10.1.4.1
检查 LDP 数据库
目的
请确保 show ldp database
命令显示预期的 root-to-(S,G) 绑定。
行动
user@IngressPE> show ldp database Input label database, 10.255.2.227:0--10.1.1.3:0 Label Prefix 300096 10.1.1.2/32 3 10.1.1.3/32 299856 10.1.1.6/32 299776 10.255.2.227/32 Output label database, 10.255.2.227:0--10.1.1.3:0 Label Prefix 300144 10.1.1.2/32 299776 10.1.1.3/32 299856 10.1.1.6/32 3 10.255.2.227/32 Input label database, 10.255.2.227:0--10.1.1.6:0 Label Prefix 299936 10.1.1.2/32 299792 10.1.1.3/32 3 10.1.1.6/32 299776 10.255.2.227/32 Output label database, 10.255.2.227:0--10.1.1.6:0 Label Prefix 300144 10.1.1.2/32 299776 10.1.1.3/32 299856 10.1.1.6/32 3 10.255.2.227/32 300432 P2MP root-addr 10.1.1.2, grp: 232.2.2.2, src: 10.2.7.7 300288 P2MP root-addr 10.1.1.2, grp: 232.1.1.1, src: 192.168.219.11 300160 P2MP root-addr 10.1.1.2, grp: 232.1.1.2, src: 192.168.219.11 300480 P2MP root-addr 10.1.1.2, grp: 232.1.1.3, src: 192.168.219.11
user@EgressPE> show ldp database Input label database, 10.1.1.2:0--10.1.1.3:0 Label Prefix 300096 10.1.1.2/32 3 10.1.1.3/32 299856 10.1.1.6/32 299776 10.255.2.227/32 300144 P2MP root-addr 10.1.1.2, grp: 232.2.2.2, src: 10.2.7.7 300128 P2MP root-addr 10.1.1.2, grp: 232.1.1.2, src: 192.168.219.11 Output label database, 10.1.1.2:0--10.1.1.3:0 Label Prefix 3 10.1.1.2/32 299776 10.1.1.3/32 299808 10.1.1.6/32 299792 10.255.2.227/32 Input label database, 10.1.1.2:0--10.1.1.6:0 Label Prefix 299936 10.1.1.2/32 299792 10.1.1.3/32 3 10.1.1.6/32 299776 10.255.2.227/32 300128 P2MP root-addr 10.1.1.2, grp: 232.2.2.2, src: 10.2.7.7 299984 P2MP root-addr 10.1.1.2, grp: 232.1.1.1, src: 192.168.219.11 299952 P2MP root-addr 10.1.1.2, grp: 232.1.1.2, src: 192.168.219.11 300176 P2MP root-addr 10.1.1.2, grp: 232.1.1.3, src: 192.168.219.11 300192 P2MP root-addr 10.1.1.2, grp: ff3e::1:2, src: 2001:db8:abcd::10:2:7:7 Output label database, 10.1.1.2:0--10.1.1.6:0 Label Prefix 3 10.1.1.2/32 299776 10.1.1.3/32 299808 10.1.1.6/32 299792 10.255.2.227/32 ----- logical-system: default Input label database, 10.255.2.227:0--10.1.1.3:0 Label Prefix 300096 10.1.1.2/32 3 10.1.1.3/32 299856 10.1.1.6/32 299776 10.255.2.227/32 Output label database, 10.255.2.227:0--10.1.1.3:0 Label Prefix 300144 10.1.1.2/32 299776 10.1.1.3/32 299856 10.1.1.6/32 3 10.255.2.227/32 Input label database, 10.255.2.227:0--10.1.1.6:0 Label Prefix 299936 10.1.1.2/32 299792 10.1.1.3/32 3 10.1.1.6/32 299776 10.255.2.227/32 Output label database, 10.255.2.227:0--10.1.1.6:0 Label Prefix 300144 10.1.1.2/32 299776 10.1.1.3/32 299856 10.1.1.6/32 3 10.255.2.227/32 300432 P2MP root-addr 10.1.1.2, grp: 232.2.2.2, src: 10.2.7.7 300288 P2MP root-addr 10.1.1.2, grp: 232.1.1.1, src: 192.168.219.11 300160 P2MP root-addr 10.1.1.2, grp: 232.1.1.2, src: 192.168.219.11 300480 P2MP root-addr 10.1.1.2, grp: 232.1.1.3, src: 192.168.219.11 300496 P2MP root-addr 10.1.1.2, grp: ff3e::1:2, src: 2001:db8:abcd::10:2:7:7
user@p6> show ldp database Input label database, 10.1.1.6:0--10.1.1.2:0 Label Prefix 3 10.1.1.2/32 299776 10.1.1.3/32 299808 10.1.1.6/32 Output label database, 10.1.1.6:0--10.1.1.2:0 Label Prefix 299776 10.1.1.2/32 299792 10.1.1.3/32 3 10.1.1.6/32
user@pr3> show ldp database Input label database, 10.1.1.3:0--10.1.1.2:0 Label Prefix 3 10.1.1.2/32 299776 10.1.1.3/32 299808 10.1.1.6/32 299792 10.255.2.227/32 Output label database, 10.1.1.3:0--10.1.1.2:0 Label Prefix 300096 10.1.1.2/32 3 10.1.1.3/32 299856 10.1.1.6/32 299776 10.255.2.227/32 300144 P2MP root-addr 10.1.1.2, grp: 232.2.2.2, src: 10.2.7.7 300128 P2MP root-addr 10.1.1.2, grp: 232.1.1.2, src: 192.168.219.11 Input label database, 10.1.1.3:0--10.255.2.227:0 Label Prefix 300144 10.1.1.2/32 299776 10.1.1.3/32 299856 10.1.1.6/32 3 10.255.2.227/32 Output label database, 10.1.1.3:0--10.255.2.227:0 Label Prefix 300096 10.1.1.2/32 3 10.1.1.3/32 299856 10.1.1.6/32 299776 10.255.2.227/32
查找 MPLS 标签的路由信息
目的
显示点到多点 FEC 信息。
行动
user@EgressPE> show route label 299808 detail mpls.0: 14 destinations, 14 routes (14 active, 0 holddown, 0 hidden) 299808 (1 entry, 1 announced) *LDP Preference: 9 Next hop type: Flood Address: 0x931922c Next-hop reference count: 3 Next hop type: Router, Next hop index: 1109 Address: 0x9318b0c Next-hop reference count: 2 Next hop: via so-0/1/3.0 Label operation: Pop Next hop type: Router, Next hop index: 1110 Address: 0x93191e0 Next-hop reference count: 2 Next hop: 192.168.209.11 via fe-1/3/0.0 Label operation: Pop State: **Active Int AckRequest> Local AS: 10 Age: 13:08:15 Metric: 1 Validation State: unverified Task: LDP Announcement bits (1): 0-KRT AS path: I FECs bound to route: P2MP root-addr 10.1.1.2, grp: 232.1.1.1, src: 192.168.219.11
检查 LDP 流量统计信息
目的
监控点到多点 LSP 的数据流量统计信息。
行动
user@EgressPE> show ldp traffic-statistics p2mp P2MP FEC Statistics: FEC(root_addr:lsp_id/grp,src) Nexthop Packets Bytes Shared 10.1.1.2:232.2.2.2,10.2.7.7 so-0/1/3.0 0 0 No 10.1.1.2:232.1.1.1,192.168.219.11 so-0/1/3.0 0 0 No fe-1/3/0.0 0 0 No 10.1.1.2:232.1.1.2,192.168.219.11 so-0/1/3.0 0 0 No fe-1/3/0.0 0 0 No lt-1/2/0.14 0 0 No 10.1.1.2:232.1.1.3,192.168.219.11 fe-1/3/0.0 0 0 No 10.1.1.2:ff3e::1:2,2001:db8:abcd::1:2:7:7 fe-1/3/0.0 0 0 No
将分段路由的客户端和服务器映射到LDP 互操作性
分段路由映射服务器和客户端支持可在运行 LDP 和分段路由(SR 或 SPRING)的网络孤岛之间实现互操作性。在从 LDP 迁移到 SR 期间,这种互操作性非常有用。在过渡 期间,可以存在包含仅支持 LDP 或仅支持分段路由的孤岛 (或域 )。要使这些设备互连 LDP 分段路由映射服务器 (SRMS) 和分段路由映射客户端 (SRMC) 功能。您可以在分段路由网络的设备上启用这些服务器和客户端功能。
OSPF 或 ISIS 支持 SR 映射服务器和客户端功能。
分段路由到 LDP 互操作性概述
图 22 展示了一个简单的 LDP 网络拓扑,说明了分段路由设备与 LDP 设备的互操作性的工作原理。请记住,OSPF 和 ISIS 均受支持,因此现在我们将对 IGP 保持无关。示例拓扑具有 6 个设备(R1 到 R6),处于从 LDP 到分段路由迁移的网络中。
在拓扑中,设备 R1、R2 和 R3 仅为分段路由配置。设备 R5 和 R6 属于传统 LDP 域,当前不支持 SR。设备 R4 同时支持 LDP 和分段路由。所有设备的环路地址均显示。这些环路播发为 LDP 域中的出口 FEC,以及 SR 域中的 SR 节点 ID。互操作性基于将 LDP FEC 映射到 SR 节点 ID,反之亦然。

要使 R1 与 R6 互连,需要一个 LDP 分段路由映射服务器 (SRMS) 和一个分段路由映射客户端 (SRMC)。以单向方式查看流量,更容易理解 SRMS 和 SRMC 的角色。根据 图 22,我们可以说,从左到右流动的流量在 SR 域中发源,在 LDP 域中终止。同样,从右到左的流量在 LDP 域中发源,并在 SR 域中终止。
SRMS 提供从左到右拼接流量所需的信息。SRMC 为从右到左流动的流量提供映射。
- 从左到右的流量:分段路由映射服务器
SRMS 促进了 SR 和 LDP 域之间的 LSP 拼接。服务器将 LDP FEC 映射到 SR 节点 ID。您可以配置要映射在层级下映射的
[edit routing-options source-packet-routing]
LDP FEC。通常需要映射所有 LDP 节点环路地址才能实现全面连接。如下所示,您可以在单个范围语句中映射连续前缀。如果 LDP 节点环路不连续,则需要定义多个映射语句。您可以在或
[edit protocols isis]
层级下[edit protocols ospf]
应用 SRMS 映射配置。这一选择取决于正在使用的 IGP。请注意,SR 和 LDP 节点共享一个公共的单区域/级别的 IGP 路由域。SRMS 会生成扩展的前缀列表 LSA(如果是 ISIS,则为 LSP)。此 LSA 中的信息允许 SR 节点将 LDP 前缀 (FEC) 映射到 SR 节点 ID。LDP 前缀的映射路由安装在
inet.3
SR 节点的和mpls.0
路由表中,以方便从左至右的流量的 LSP 入口和拼接操作。扩展的 LSA(或 LSP)在整个(单个)IGP 区域泛洪。这意味着您可以自由地将 SRMS 配置放置在 SR 域中的任何路由器上。SRMS 节点不必运行 LDP。
- 从右到左的流量:分段路由映射客户端
要从右到左方向互操作,即从 LDP 孤岛到 SR 岛,您只需在同时使用 SR 和 LDP 的节点上启用分段路由映射客户端功能。在我们的示例中是 R4。您可以在层级使用
mapping-client
语句[edit protocols ldp]
激活 SRMC 功能。SRMC 配置会自动激活 LDP 出口策略,将 SR 域的节点和前缀 SID 播发为 LDP 出口 FEC。这为 LDP 节点提供了与 SR 域中节点的 LSP 可访问性。
- 必须在同时连接到 SR 和 LSP 域的路由器上配置 SRMC 功能。如果需要,同一节点也可作为 SRMS 运行。
使用 OSPF 实现 LDP 的分段路由互操作性
图 22请参阅,假设 device R2(在分段路由网络中)是 SRMS。
-
定义 SRMS 功能:
[edit routing-options source-packet-routing ] user@R2# set mapping-server-entry ospf-mapping-server prefix-segment-range ldp-lo0s start-prefix 192.168.0.5 user@R2# set mapping-server-entry ospf-mapping-server prefix-segment-range ldp-lo0s start-index 1000 user@R2# set mapping-server-entry ospf-mapping-server prefix-segment-range ldp-lo0s size 2
此配置可为示例拓扑中的 LDP 设备环路地址创建映射块。映射到 R5 环路的初始分段 ID (SID) 索引为
1000
。指定大小2
将导致 SID 索引 10001 映射到 R6 的环路地址。注:用作的
start-prefix
IP 地址是 LDP 网络中设备的环路地址(本例中为 R5)。要实现全面连接,您必须将 LDP 路由器的所有环路地址映射到 SR 域中。如果环路地址是连续的,则可以使用单个prefix-segment-range
语句来实现这一点。非连续环路需要定义多个前缀映射语句。我们的示例使用连续环路,因此上图显示了一
prefix-segment-range
个。以下是支持具有非连续环回寻址的两个 LDP 节点的多个映射示例:[edit routing-options source-packet-routing] show mapping-server-entry map-server-name { prefix-segment-range lo1 { start-prefix 192.168.0.5/32; start-index 1000; size 1; } prefix-segment-range lo2 { start-prefix 192.168.0.10/32; start-index 2000; size 1; } } }
-
接下来,为用于泛洪映射前缀的扩展 LSA 配置 OSPF 支持。
[edit protocols] user@R2# set ospf source-packet-routing mapping-server ospf-mapping-server
在设备 R2 上提交映射服务器配置后,扩展前缀范围TLV将泛洪到 OSPF 区域。支持分段路由(R1、R2 和 R3)的设备使用分段 ID (SID) 索引为指定的环路地址(本例中的 R5 和 R6)安装 OSPF 分段路由路由。分段路由设备也在路由表中更新
mpls.0
了 SID 索引。 -
启用 SRMC 功能。对于我们的示例拓扑,您必须在 R4 上启用 SRMC 功能。
[edit protocols] user@R4# set ldp sr-mapping-client
在设备 R4 上提交映射客户端配置后,SR 节点 ID 和标签块将作为出口 FEC 播发到路由器 R5,然后路由器 R5 将重新播发至 R6。
Junos OS 19.1R1 开始支持使用 OSPF 拼接分段路由和 LDP 下一跳。
Unsupported Features and Functionality for Segment Routing interoperability with LDP using OSPF
-
仅在 SRMS 检测到前缀冲突。 如果出现前缀范围冲突,则以路由器 ID 下部的前缀 SID 为准。在这种情况下,将生成系统日志错误消息
RPD_OSPF_PFX_SID_RANGE_CONFLICT
。 -
不支持 IPv6 前缀。
-
不支持跨 AS 边界(AS 间)对 OSPF 扩展前缀不透明 LSA 进行泛洪。
-
不支持区域间 LDP 映射服务器 功能 。
-
不支持扩展前缀不透明 LSA 的 ABR 功能。
-
不支持扩展前缀不透明 LSA 的 ASBR 功能。
-
不支持路由映射服务器优先级TLV。
使用 ISIS 与 LDP 的分段路由的互操作性
图 22请参阅,假设设备 R2(在分段路由网络中)是 SRMS。为映射功能添加了以下配置:
-
定义 SRMS 功能:
[edit routing-options source-packet-routing ] user@R2# set mapping-server-entry isis-mapping-server prefix-segment-range ldp-lo0s start-prefix 192.168.0.5 user@R2# set mapping-server-entry isis-mapping-server prefix-segment-range ldp-lo0s start-index 1000 user@R2# set mapping-server-entry isis-mapping-server prefix-segment-range ldp-lo0s size 2
此配置可为示例拓扑中的 LDP 设备环路地址创建映射块。映射到 R5 环路的初始分段 ID (SID) 索引为
1000
。指定大小2
将导致 SID 索引 10001 映射到 R6 的环路地址。注:用作的
start-prefix
IP 地址是 LDP 网络中设备的环路地址(本例中为 R5)。要实现全面连接,您必须映射 SR 域中 LDP 路由器的所有环路地址。如果环路地址是连续的,则可以使用语句来实现这一prefix-segment-range
点。非连续环路需要定义多个映射语句。我们的示例使用连续环路,因此上图显示了一
prefix-segment-range
个。下面是一个前缀映射示例,用于处理具有非连续环回寻址的两个 LDP 路由器的情况:[edit routing-options source-packet-routing] show mapping-server-entry map-server-name { prefix-segment-range lo1 { start-prefix 192.168.0.5/32; start-index 1000; size 1; } prefix-segment-range lo2 { start-prefix 192.168.0.10/32; start-index 2000; size 1; } } }
-
接下来,配置 ISIS 对用于泛洪映射前缀的扩展 LSP 的支持。
[edit protocols] user@R2# set isis source-packet-routing mapping-server isis-mapping-server
在设备 R2 上提交映射服务器配置后,扩展前缀范围TLV将泛洪到 OSPF 区域。能够分段路由(R1、R2 和 R3)的设备使用分段 ID (SID) 索引为指定的环路地址(本例中的 R5 和 R6)安装 ISIS 分段路由路由。分段路由设备也在路由表中更新
mpls.0
了 SID 索引。 -
启用 SRMC 功能。对于我们的示例拓扑,您必须在 R4 上启用 SRMC 功能。
[edit protocols] user@R4# set ldp sr-mapping-client
在设备 R4 上提交映射客户端配置后,SR 节点 ID 和标签块将作为出口 FEC 播发到路由器 R5,然后播发至 R6。
Junos OS 17.4R1 开始支持使用 ISIS 拼接分段路由和 LDP 下一跳。
Unsupported Features and Functionality for Interoperability of Segment Routing with LDP using ISIS
-
不支持标签绑定TLV的倒数第二跃点弹出 行为 。
-
不支持在标签绑定TLV中发布一系列前缀。
-
不支持解决分段路由冲突。
-
LDP 流量统计信息不起作用。
-
不支持不间断活动路由 (NSR) 和平滑路由引擎切换 (GRES)。
-
不支持 ISIS 级别间。
-
RFC 7794,不支持 扩展 IPv4 的 IS-IS 前缀属性 。
-
不支持在拼接节点上将 LDP 路由作为前缀 sid 重新分配。
其他 LDP 属性
以下部分介绍如何配置大量其他 LDP 属性。
- 将 LDP 配置为使用 IGP 路由指标
- 阻止将入口路由添加到 inet.0 路由表中
- 多实例 LDP 和运营商级 VPN
- 配置 MPLS 和 LDP 以在终极跃点路由器上弹出标签
- 通过 RSVP 建立的 LSP 启用 LDP
- 通过异构网络中 RSVP 建立的 LSP 启用 LDP
- 为 LDP 会话配置 TCP MD5 签名
- 配置 LDP 会话保护
- 禁用 LDP 的 SNMP 陷阱
- 在 LDP 链路上配置与 IGP 的 LDP 同步
- 配置与路由器上的 IGP 的 LDP 同步
- 配置标签撤销计时器
- 忽略 LDP 子网检查
将 LDP 配置为使用 IGP 路由指标
track-igp-metric
如果您希望内部网关协议 (IGP) 路由指标用于 LDP 路由,而不是默认 LDP 路由指标(默认 LDP 路由指标为 1),请使用语句。
要使用 IGP 路由指标,请包括以下 track-igp-metric
语句:
track-igp-metric;
有关可包含此语句的层次结构级别列表,请参阅此语句的语句摘要部分。
阻止将入口路由添加到 inet.0 路由表中
通过配置语句no-forwarding
,即使您在层级启用了traffic-engineering bgp-igp
[edit protocols mpls]
语句,也可以阻止将入口路由添加到 inet.0 路由表(而非 inet.3 路由表)中[edit logical-systems logical-system-name protocols mpls]
。默认情况下,语句 no-forwarding
处于禁用状态。
ACX 系列路由器不支持 [edit logical-systems
] 层次结构级别。
要省略 inet.0 路由表中的入口路由,请包含以下 no-forwarding
语句:
no-forwarding;
有关可包含此语句的层次结构级别列表,请参阅此语句的语句摘要部分。
多实例 LDP 和运营商级 VPN
通过配置多个 LDP 路由实例,您可以使用 LDP 将运营商的运营商 VPN 中的标签从服务提供商边缘 (PE) 路由器播发至客户运营商客户边缘 (CE) 路由器。当运营商客户是基本互联网服务提供商 (ISP) 并希望将完整的互联网路由限制到其 PE 路由器时,这一点特别有用。通过使用 LDP 而不是 BGP,运营商客户将其其他内部路由器与互联网隔离。当运营商客户希望向其客户提供第 2 层或第 3 层 VPN 服务时,多实例 LDP 也很有用。
有关如何为运营商的 VPN 配置多个 LDP 路由实例的示例,请参阅《 标签分发协议的多个实例用户指南》。
配置 MPLS 和 LDP 以在终极跃点路由器上弹出标签
默认播发的标签为标签 3(隐式空标签)。如果播发标签 3,倒数第二跃点路由器将移除该标签并将数据包发送至出口路由器。如果启用了最终跃点弹出,将播发标签 0(IPv4 显式空标签)。最终跃点弹出可确保遍历 MPLS 网络的任何数据包都包含标签。
要配置最终跃点弹出,请添加 explicit-null
以下语句:
explicit-null;
有关可包含此语句的层次结构级别列表,请参阅此语句的语句摘要部分。
瞻博网络路由器会根据传入标签对数据包进行队列。其他供应商的路由器可能会以不同的方式对数据包进行排队。在处理包含多个供应商路由器的网络时,请记住这一点。
通过 RSVP 建立的 LSP 启用 LDP
您可以在 RSVP 建立的 LSP 上运行 LDP,从而通过 RSVP 建立的 LSP 有效地通过 LSP 建立隧道。为此,可在 lo0.0 接口上启用 LDP(请参阅启用和禁用 LDP)。您还必须在层次结构级别包含语句ldp-tunneling
[edit protocols mpls label-switched-path lsp-name]
来配置希望 LDP 操作的 LSP:
[edit] protocols { mpls { label-switched-path lsp-name { from source; to destination; ldp-tunneling; } } }
有关可包含此语句的层次结构级别列表,请参阅此语句的语句摘要部分。
LDP 可以通过启用了链路保护的 RSVP 会话进行隧道传输。从 Junos OS Release 21.1R1 开始,显示有关 LDP 隧道路由的详细信息可同时显示主要和旁路 LSP 下一跃点。在之前的 Junos OS 版本中, 旁路 LSP 下一 跃点显示主 LSP 的下一 跃点。
通过异构网络中 RSVP 建立的 LSP 启用 LDP
其他一些供应商对环路地址使用 OSPF 指标 1。瞻博网络路由器将 OSPF 指标 0 用于环路地址。在异构网络中通过 RSVP LSP 部署 LDP 隧道时,可能需要手动配置 RSVP 指标。
当瞻博网络路由器通过 RSVP 隧道链接到其他供应商的路由器并同时启用 LDP 隧道时,默认情况下,如果 RSVP 路径的指标比物理 OSPF 路径大 1,则瞻博网络路由器可能不会使用 RSVP 隧道将流量路由到其他供应商出口路由器下游的 LDP 目标。
为了确保 LDP 隧道在异构网络中正常运行,您可以配置 OSPF 以忽略 RSVP LSP 指标,包括 ignore-lsp-metrics
以下语句:
ignore-lsp-metrics;
您可以在以下层级配置此语句:
-
[edit protocols ospf traffic-engineering shortcuts]
-
[edit logical-systems logical-system-name protocols ospf traffic-engineering shortcuts]
ACX 系列路由器不支持 [edit logical-systems
] 层次结构级别。
要通过 RSVP LSP 启用 LDP,您仍然需要完成部分 通过 RSVP 建立的 LSP 启用 LDP中的过程。
为 LDP 会话配置 TCP MD5 签名
您可以为 LDP TCP 连接配置 MD5 签名,以防止在 LDP 会话连接流中引入欺骗的 TCP 分段。有关 TCP 身份验证的更多信息,请参阅 TCP。有关如何使用 TCP 身份验证选项 (TCP-AO) 而不是 TCP MD5,请参阅 No link title。
使用 MD5 签名选项的路由器为每个需要身份验证的对等方配置一个密码。密码是加密存储的。
即使对等接口配置了不同的安全签名,仍然可以创建 LDP hello 邻接。但是,无法对 TCP 会话进行身份验证,并且永远不会建立。
您可以将 LDP 会话的散列消息认证代码 (HMAC) 和 MD5 身份验证配置为按会话配置或子网匹配(即最长前缀匹配)配置。对子网匹配身份验证的支持提供了为自动目标 LDP (TLDP) 会话配置身份验证的灵活性。这使得远程无环路替代 (LFA) 和 FEC 129 伪线的部署变得轻而易举。
要为 LDP TCP 连接配置 MD5 签名,请将该 authentication-key
语句包含在会话组中:
[edit protocols ldp] session-group prefix-length { authentication-key md5-authentication-key; }
session-group
使用该语句为 LDP 会话的远程端配置地址。
md5-authentication-key
配置中的密码长度可高达 69 个字符。字符可以包含任何 ASCII 字符串。如果包含空格,请将所有字符括在引号内。
您还可以为 LDP 路由协议配置身份验证密钥更新机制。此机制允许您更新身份验证密钥,而无需中断相关的路由和信令协议,例如开放式最短路径优先 (OSPF) 和资源预留设置协议 (RSVP)。
要配置身份验证密钥更新机制,请在 key-chain
层次结构级别包含该语句 [edit security authentication-key-chains]
,并指定 key
用于创建包含多个身份验证密钥的密钥链的选项。
[edit security authentication-key-chains] key-chain key-chain-name { key key { secret secret-data; start-time yyyy-mm-dd.hh:mm:ss; } }
要为 LDP 路由协议配置身份验证密钥更新机制,请在 authentication-key-chain
层次结构级别添加语句 [edit protocols ldp]
,以便将协议与 [edit security suthentication-key-chains]
身份验证密钥相关联。您还必须通过在层级包含 authentication-algorithm algorithm
语句 [edit protocols ldp]
来配置身份验证算法。
[edit protocols ldp] group group-name { neighbor address { authentication-algorithm algorithm; authentication-key-chain key-chain-name; } }
有关身份验证密钥更新功能的更多信息,请参阅 为 BGP 和 LDP 路由协议配置身份验证密钥更新机制。
配置 LDP 会话保护
通常,在通过一个或多个链路连接的一对路由器之间创建一个 LDP 会话。路由器会为连接它们的每个链路形成一个好邻接,并将所有邻接与相应的 LDP 会话相关联。当 LDP 会话的最后一个好邻接消失时,LDP 会话将终止。您可能需要修改此行为,以防止不必要地终止和重新建立 LDP 会话。
您可以通过配置语句,将 Junos OS 配置为保持两个路由器之间的 LDP 会话保持开启,即使连接两个路由器 session-protection
的链路上没有 hello 邻接。您可以选择使用选项指定时间( timeout
以秒为单位)。只要路由器保持 IP 网络连接,会话在指定的持续时间内保持正常运行。
session-protection { timeout seconds; }
有关可包含此语句的层次结构级别列表,请参阅语句摘要部分。
禁用 LDP 的 SNMP 陷阱
每当 LDP LSP 从上到下或从下到高过渡时,路由器就会发送 SNMP 陷阱。但是,可以在路由器、逻辑系统或路由实例上禁用 LDP SNMP 陷阱。
有关 LDP SNMP 陷阱和专用 LDP MIB 的信息,请参阅 SNMP MIB Explorer。。
要禁用 LDP 的 SNMP 陷阱,请 trap disable
指定 log-updown
语句的选项:
log-updown { trap disable; }
有关可包含此语句的层次结构级别列表,请参阅此语句的语句摘要部分。
在 LDP 链路上配置与 IGP 的 LDP 同步
LDP 是在非流量工程应用程序中分发标签的协议。标签按 IGP 确定的最佳路径分布。如果未保持 LDP 和 IGP 之间的同步,LSP 就会关闭。当给定链路上的 LDP 无法完全运行(未建立会话且未交换标签),IGP 将播发具有最大成本指标的链路。链路不是首选链路,但仍在网络拓扑中。
LDP 同步仅在活动点到点接口和在 IGP 下配置为点对点的 LAN 接口上受支持。平滑重启期间不支持 LDP 同步。
要播发最大成本指标,直到 LDP 运行以用于同步,请包括以下 ldp-synchronization
语句:
ldp-synchronization { disable; hold-time seconds; }
要禁用同步,请包含语句 disable
。要配置时间段来播发未完全正常运行的链路的最大成本指标,请包含该 hold-time
语句。
有关可配置此语句的层次结构级别列表,请参阅此语句的语句摘要部分。
配置与路由器上的 IGP 的 LDP 同步
您可以配置 LDP 等待的时间,然后通知 IGP 接口的 LDP 邻接方和会话正常运行。对于具有大量 FEC 的大型网络,您可能需要配置更长的值,以便有足够的时间交换 LDP 标签数据库。
要配置 LDP 在通知 IGP LDP 邻接方和会话正常运行之前等待的时间,请包含语句 igp-synchronization
并为选项指定时间(以秒为单位 holddown-interval
):
igp-synchronization holddown-interval seconds;
有关可配置此语句的层次结构级别列表,请参阅此语句的语句摘要部分。
配置标签撤销计时器
标签撤销计时器会延迟向邻接方发送 FEC 的标签撤销消息。当指向邻接方的 IGP 链路出现故障时,如果邻接方是 FEC 的下一跃点,则与 FEC 关联的标签必须从所有上游路由器中撤回。IGP 融合并接收来自新下一跃点的标签后,该标签将读至所有上游路由器。这是典型的网络行为将标签撤销延迟一小段时间(例如,在 IGP 融合和路由器从下一跃点收到 FEC 的新标签之前),可以很快避免标签撤销和发送标签映射。您可以通过 label-withdrawal-delay
语句配置此延迟时间。默认情况下,延迟为 60 秒。
如果路由器在计时器用完之前收到新标签,则标签撤销计时器将被取消。但是,如果计时器用完,则 FEC 的标签将从所有上游路由器中撤销。
默认情况下,LDP 会等待 60 秒才能撤回标签,以避免在 IGP 重新融合时多次重新调整 LSP。要配置标签撤销延迟时间(以秒为单位,请添加语句 label-withdrawal-delay
):
label-withdrawal-delay seconds;
有关可配置此语句的层次结构级别列表,请参阅此语句的语句摘要部分。
忽略 LDP 子网检查
在 Junos OS 8.4 及更高版本中,在邻接方建立过程中执行 LDP 源地址子网检查。LDP 链路 hello 数据包中的源地址与接口地址进行匹配。这会导致其他一些供应商的设备出现互操作性问题。
要禁用子网检查,请添加 allow-subnet-mismatch
语句:
allow-subnet-mismatch;
此语句可包含在以下层次结构级别:
-
[edit protocols ldp interface interface-name]
-
[edit logical-systems logical-system-name protocols ldp interface interface-name]
ACX 系列路由器不支持 [edit logical-systems
] 层次结构级别。
另请参阅
配置 LDP LSP Traceroute
您可以追踪路由后接 LDP 信号 LSP。LDP LSP traceroute 基于 RFC 4379, 用于检测多协议标签交换 (MPLS) 数据平面故障。此功能允许您定期跟踪 FEC 中的所有路径。FEC 拓扑信息存储在可以通过 CLI 访问的数据库中。
拓扑更改不会自动触发 LDP LSP 的踪迹。但是,您可以手动启动 traceroute。如果 traceroute 请求针对当前位于数据库中的 FEC,则数据库的内容将随结果一起更新。
定期追踪路由功能适用于在[edit protocols ldp]
层次结构级别配置语句oam
指定的所有 FEC。要配置定期 LDP LSP traceroute,请添加以下 periodic-traceroute
语句:
periodic-traceroute { disable; exp exp-value; fanout fanout-value; frequency minutes; paths number-of-paths; retries retry-attempts; source address; ttl ttl-value; wait seconds; }
您可以在以下层级配置此语句:
您可以自行配置语句, periodic-traceroute
也可使用以下任一选项配置语句:
exp
- 指定发送探测器时使用的服务等级。fanout
- 指定每个节点要搜索的最大下一跃点数。frequency
- 指定 traceroute 尝试之间的间隔。paths
- 指定要搜索的最大路径数。retries
- 指定放弃之前将探测发送到特定节点的尝试次数。source
- 指定发送探测时使用的 IPv4 源地址。ttl
- 指定最大生存时间值。不会跟踪超过此值的节点。wait
- 在重新发送探测数据包之前指定等待间隔。
收集 LDP 统计数据
LDP 流量统计信息显示通过路由器上特定 FEC 的流量。
在层次结构级别配置 traffic-statistics
语句 [edit protocols ldp]
时,将定期收集 LDP 流量统计信息并写到文件中。您可以使用选项配置收集统计信息的频率(以秒 interval
为单位)。默认收集间隔为 5 分钟。您必须配置 LDP 统计信息文件;否则,不会收集 LDP 流量统计信息。如果 LSP 出现故障,将重置 LDP 统计信息。
要收集 LDP 流量统计信息,请包括以下 traffic-statistics
语句:
traffic-statistics { file filename <files number> <size size> <world-readable | no-world-readable>; interval interval; no-penultimate-hop; }
有关可包含此语句的层次结构级别列表,请参阅此语句的语句摘要部分。
本节包含以下主题:
LDP 统计信息输出
以下示例输出来自 LDP 统计信息文件:
FEC Type Packets Bytes Shared 10.255.350.448/32 Transit 0 0 No Ingress 0 0 No 10.255.350.450/32 Transit 0 0 Yes Ingress 0 0 No 10.255.350.451/32 Transit 0 0 No Ingress 0 0 No 220.220.220.1/32 Transit 0 0 Yes Ingress 0 0 No 220.220.220.2/32 Transit 0 0 Yes Ingress 0 0 No 220.220.220.3/32 Transit 0 0 Yes Ingress 0 0 No May 28 15:02:05, read 12 statistics in 00:00:00 seconds
LDP 统计信息文件包含以下列数据:
FEC
— 收集 LDP 流量统计信息的 FEC。Type
—来自路由器Ingress
的流量类型(来自此路由器)或Transit
(通过此路由器转发)。Packets
- 自 FEC 出现 LSP 以来通过的数据包数。Bytes
-FEC 自出现 LSP 以来传递的数据字节数。Shared
-值Yes
表示多个前缀绑定到同一标签(例如,当使用出口策略播发多个前缀时)。此案例的 LDP 流量统计信息适用于所有前缀,应将其视为此类前缀。read
-此数字(显示在日期和时间旁边)可能与显示统计信息的实际编号不同。部分统计信息汇总后再显示。
禁用倒数第二跃点路由器上的 LDP 统计信息
在倒数第二跃点路由器上收集 LDP 流量统计信息会消耗过多的系统资源,特别是在下一跃点路由上。如果您除了配置语句外 deaggregate
,还配置了语句, traffic-statistics
则这个问题会更加严重。对于达到下一跃点路由使用限制的路由器,我们建议配置no-penultimate-hop
traffic-statistics
语句的选项:
traffic-statistics { no-penultimate-hop; }
有关可配置 traffic-statistics
语句的层次结构级别列表,请参阅此语句的语句摘要部分。
配置 no-penultimate-hop
选项时,不会为此路由器倒数第二跃点的 FEC 提供统计信息。
无论何时在配置中包含或移除此选项,LDP 会话都将关闭,然后重新启动。
以下示例输出来自 LDP 统计数据文件,显示配置了选项的 no-penultimate-hop
路由器:
FEC Type Packets Bytes Shared 10.255.245.218/32 Transit 0 0 No Ingress 4 246 No 10.255.245.221/32 Transit statistics disabled Ingress statistics disabled 13.1.1.0/24 Transit statistics disabled Ingress statistics disabled 13.1.3.0/24 Transit statistics disabled Ingress statistics disabled
LDP 统计信息限制
以下是与通过配置 traffic-statistics
语句收集 LDP 统计信息相关的问题:
无法清除 LDP 统计信息。
如果缩短了指定的间隔,只有当统计信息计时器晚于新间隔到期时,才会发出新的 LDP 统计信息请求。
在完成上一个 LDP 统计信息收集操作之前,无法开始新的 LDP 统计信息收集操作。如果间隔较短或 LDP 统计信息数较大,则两个统计信息集合之间的时隙可能比间隔长。
LSP 出现故障时,将重置 LDP 统计信息。
跟踪 LDP 协议流量
以下部分介绍如何配置追踪选项以检查 LDP 协议流量:
在协议和路由实例级别跟踪 LDP 协议流量
要跟踪 LDP 协议流量,可以在层次结构级别的全局 traceoptions
语句 [edit routing-options]
中指定选项,并通过包括语句 traceoptions
来指定特定于 LDP 的选项:
traceoptions { file filename <files number> <size size> <world-readable | no-world-readable>; flag flag <flag-modifier> <disable>; }
有关可包含此语句的层次结构级别列表,请参阅此语句的语句摘要部分。
使用 file
语句指定接收跟踪操作输出的文件的名称。所有文件都放置在目录 /var/log 中。我们建议将 LDP 跟踪输出放在文件中 ldp-log。
以下跟踪标记显示与发送和接收各种 LDP 消息关联的操作。每个都可以携带一个或多个以下修改符:
address
- 跟踪地址和地址撤销消息的操作。binding
- 跟踪标签绑定操作。error
- 追踪错误状况。event
- 跟踪协议事件。initialization
- 跟踪初始化消息的操作。label
- 跟踪标签请求、标签映射、标签撤销和标签发布消息的操作。notification
-跟踪通知消息的操作。packets
- 跟踪地址、地址撤销、初始化、标签请求、标签映射、标签撤销、标签发布、通知和定期消息的操作。此修改符等同于设置address
、initialization
、label
、notification
和periodic
修改符。您还可以使用标志的
filter
子选项packets
配置标志修改器match-on address
。这允许您根据数据包的源地址和目标地址进行跟踪。path
- 跟踪标签交换路径操作。path
- 跟踪标签交换路径操作。periodic
- 跟踪 hello 和 keepalive 消息的操作。route
-跟踪路由消息的操作。state
- 跟踪协议状态转换。
跟踪 FEC 内的 LDP 协议流量
LDP 将一个转发等效类 (FEC) 与它创建的每个 LSP 相关联。与 LSP 关联的 FEC 指定将哪些数据包映射到该 LSP。当每个路由器选择 FEC 下一跃点播发的标签并将其拼接到播发至所有其他路由器的标签时,LSP 会通过网络进行扩展。
您可以追踪特定 FEC 内的 LDP 协议流量,并基于 FEC 过滤 LDP 追踪语句。当您想要跟踪或排解与 FEC 关联的 LDP 协议流量时,此功能会很有用。以下跟踪标志可用于此目的:route
、 path
和 binding
。
以下示例说明了您可以如何配置 LDP traceoptions
语句以基于 FEC 过滤 LDP 追踪语句:
[edit protocols ldp traceoptions] set flag route filter match-on fec policy "filter-policy-for-ldp-fec";
此功能具有以下限制:
过滤功能仅适用于由 IP 版本 4 (IPv4) 前缀组成的 FEC。
无法过滤第 2 层电路 FEC。
配置路由跟踪和过滤时,不会显示 MPLS 路由(它们被过滤器阻止)。
过滤由策略和选项配置的值
match-on
决定。配置策略时,请确保默认行为始终reject
为。唯
match-on
一选项是fec
。因此,您应包含的唯一策略类型是路由过滤器策略。
例子:跟踪 LDP 协议流量
详细追踪 LDP 路径消息:
[edit] protocols { ldp { traceoptions { file ldp size 10m files 5; flag path; } } }
跟踪所有 LDP 传出消息:
[edit] protocols { ldp { traceoptions { file ldp size 10m files 5; flag packets; } } }
跟踪所有 LDP 错误状况:
[edit] protocols { ldp { traceoptions { file ldp size 10m files 5; flag error; } } }
跟踪所有 LDP 传入消息和所有标签绑定操作:
[edit] protocols { ldp { traceoptions { file ldp size 10m files 5 world-readable; flag packets receive; flag binding; } interface all { } } }
跟踪与 LSP 关联的 FEC 的 LDP 协议流量:
[edit] protocols { ldp { traceoptions { flag route filter match-on fec policy filter-policy-for-ldp-fec; } } }