示例:基于多个 LSP 配置的第 2 层 电路流量工程
图 1 显示了一种网络拓扑,该拓扑旨在通过选定的 LSP 对不同的第 2 层 电路进行流量工程。 在提供商边缘路由器 PE1 和 PE2 中,ATM AAL5 模式第 2 层 电路连接客户边缘路由器 CE1 和 CE2,帧中继第 2 层 电路连接路由器 CE3 和 CE4。为了保持流量分离,ATM 流量映射到具有名为 的gold
社区的 LSP1,帧中继流量映射到具有名为 silver
的社区的 LSP2 上。LSP1 采用路由器 PE1 和 PE2 之间的直接路由,而 LSP2 通过路由器 P0 从路由器 PE1 传输到 PE2。
除了流量工程之外,您还可以在第 2 层 电路的控制字中发送第 2 层 控制信息。在这种情况下,帧中继丢弃合格 (DE)、前向显式拥塞通知 (FECN) 和后向显式拥塞通知 (BECN) 信息将映射到控制字中。同样,ATM 信元丢失优先级 (CLP) 和显式前向拥塞指示器 (EFCI) 信息也映射到控制字中。
要在多个 LSP 上对第 2 层 电路进行流量工程,请将一组第 2 层 电路分配给社区,然后应用策略通过所需的 LSP 发送社区流量。要创建社区,请在层次结构级别包含community
community-name
语句[edit policy-options]
。要将第 2 层 电路分配给社区,请在层次结构级别包含community community-name
语句[edit protocols l2circuit neighbor neighbor-id interface interface-name]
。要通过特定 LSP 发送社区流量,请在层次结构级别包含[edit policy-options policy-statement policy-name term term-name from]
语句,install-next-hop lsp lsp-name
在层次结构级别包含community community-name
语句[edit policy-options policy-statement policy-name term term-name then]
。
在路由器 CE1 上,配置 ATM2 IQ 接口 at-0/0/1.32
以处理 ATM AAL5 流量:
路由器 CE1
[edit] interfaces { at-0/0/1 { description "to PE1 at-1/1/0"; atm-options { pic-type atm2; # Layer 2 circuits are compatible with vpi 0; # ATM2 IQ interfaces. } unit 0 { encapsulation atm-vc-mux; # Use ATM VC MUX encapsulation on the CE. point-to-point; vci 0.32; family inet { address 10.0.0.1/30; } } } }
在路由器 CE3 上,配置 SONET/SDH 接口 so-0/0/1
以处理帧中继流量:
路由器 CE3
[edit] interfaces so-0/0/1 { description “to PE1 so-1/1/1” encapsulation frame-relay; # Use Frame Relay encapsulation on the CE router. unit 0 { encapsulation frame-relay; point-to-point; dlci 512; family inet { address 10.10.0.1/30; } } }
在路由器 PE1 上,配置基于 ATM2 IQ 的面向 CE1 的接口at-1/1/0
,并在逻辑接口上配置带有 ATM VC 多路复用 CCC 封装。还要在[edit chassis]
层次结构级别启用相应的第 2 层 电路模式。在这种情况下,您必须在 FPC 1.
中的 PIC 1
上配置 AAL5 模式 配置基于 ATM2 IQ 的第 2 层 电路后,默认情况下,CLP 和 EFCI 位将映射到控制字。
接下来,在物理和逻辑接口上配置具有帧中继 CCC 封装的帧中继接口so-1/1/1
。在层次结构级别使用 [edit interfaces so-fpc/pic/port unit unit-number family ccc]
and translate-discard-eligible
语句将 translate-fecn-and-becn
DE、FECN 和 BECN 位映射到控制字。
通过在层次结构级别配置[edit protocols]
语句来l2circuit
建立第 2 层 电路。请记住在第 2 层 电路配置中包含远程 PE 邻居的 IP 地址(通常是邻居的环路地址)、连接到客户边缘 路由器的接口以及每个 VC 的虚拟电路标识符。在这种情况下,您将为 ATM AAL5 流量建立一个 VC,为帧中继流量建立另一个 VC。然后,配置 MPLS、LDP 和 IGP(例如 OSPF),为第 2 层 电路启用信令。为 ATM 和帧中继流量建立了两个 LSP:LSP1 用于直接进入路由器 PE2 的 ATM 流量,LSP 2 用于在进入路由器 PE2 之前通过路由器 P0 的帧中继流量。
最后,为 ATM 和帧中继第 2 层 电路配置流量分离社区。将社区分配给 ATM VC,将社区gold
silver
分配给帧中继 VC。请记住为社区提供数值并配置路由策略以将社区与特定 LSP 匹配。此策略作为策略应用于export
层次结构级别的转发表[edit routing-options]
。
路由器 PE1
[edit] chassis { fpc 1 { pic 1 { atm-l2circuit-mode { aal5; # This dedicates FPC 1 PIC 1 to AAL5 mode. } } } } interfaces { at-1/1/0 { description "to CE1 at-0/0/2"; atm-options { pic-type atm2; # Layer 2 circuits are compatible with vpi 0; # ATM2 IQ interfaces. } unit 0 { encapsulation atm-ccc-vc-mux; # CLP/EFCI bits are mapped to control word. vci 0.32; } } so-0/1/0 { description "to P0 so-0/0/0"; unit 0 { family inet { address 192.168.27.17/30; } family mpls; # Include the MPLS family on core-facing interfaces. } } so-1/1/0 { description "to PE2 so-1/0/1"; unit 0 { family inet { address 192.168.27.10/30; } family mpls; # Include the MPLS family on core-facing interfaces. } } so-1/1/1 { description "to CE3 so-0/0/1"; dce; encapsulation frame-relay-ccc; unit 0 { encapsulation frame-relay-ccc; point-to-point; dlci 512; family ccc { translate-fecn-and-becn; # Option to map FECN/BECN bits to control word. translate-discard-eligible; # Option to map DE bit to control word. } } } lo0 { unit 0 { family inet { address 10.255.17.2/32; } } } } routing-options { forwarding-table { export layer2communities; # This applies communities to the Layer 2 circuits. } } protocols { mpls { label-switched-path lsp1 { # ATM LSP 1 goes directly to PE2. to 10.255.17.4; primary direct; } label-switched-path lsp2 { # Frame Relay LSP 2 goes through P0. to 10.255.17.4; primary thruP0; } path direct { 192.168.27.9 strict; } path thruP0 { 192.168.27.18 strict; 192.168.27.25 strict; } interface so-0/0/1.0; interface so-1/1/0.0; } ospf { traffic-engineering; area 0.0.0.0 { interface so-0/0/1.0; interface so-1/1/0.0; interface lo0.0; } } ldp { # LDP is required as the signaling protocol for Layer 2 circuits. interface so-0/0/1.0; interface so-1/1/0.0; interface lo0.0; } l2circuit { neighbor 10.255.17.4 {# This points to the loopback of the PE neighbor. interface at-1/1/0.32 { # Here you include the local CE-facing interface. virtual-circuit-id 1; # Be sure this ID matches the ID of your PE neighbor. community gold;# Assigns the ATM Layer 2 circuit to the gold community. } } neighbor 10.255.17.4 {# This points to the loopback of the PE neighbor. interface so-1/1/1.512 { # Here you include the local CE-facing interface. virtual-circuit-id 2; # Be sure this ID matches the ID of your PE neighbor. community silver; # Assigns the Frame Relay Layer 2 circuit to silver. } } } } policy-options { policy-statement layer2communities { # Here you map the communities to LSPs. term 10 { from community gold; # Apply community gold to LSP 1. then { install-nexthop lsp lsp1; accept; } } term 20 { from community silver; # Apply community silver to LSP 2. then { install-nexthop lsp lsp2; accept; } } } community gold members 103:1; # Assign numerical value to community gold. community silver members 103:2; # Assign numerical value to community silver. }
在路由器 P0 上,在连接到 PE 路由器的接口上配置 LDP、MPLS 和 OSPF。核心路由器提供将第 2 层 流量从入口 PR 路由器隧道传输到出口 PE 路由器所需的 MPLS 主干网。只有用于帧中继的 LSP 2 通过路由器 P0。
路由器 P0
[edit] interfaces { so-1/1/1 { description "to PE1 so-0/0/1"; unit 0 { family inet { address 192.168.27.18/30; } family mpls; # Include the MPLS family on core interfaces. } } so-1/1/2 { description "to PE2 so-0/1/1"; unit 0 { family inet { address 192.168.27.26/30; } family mpls; # Include the MPLS family on core interfaces. } } lo0 { unit 0 { family inet { address 10.255.17.3/32; } } } } protocols { mpls { interface so-1/1/1.0; interface so-1/1/2.0; } ospf { traffic-engineering; area 0.0.0.0 { interface so-1/1/1.0; interface so-1/1/2.0; } } ldp {# LDP is required as the signaling protocol for Layer 2 circuits. interface so-1/1/1.0; interface so-1/1/2.0; } }
在路由器 PE2 上,通过配置语句以匹配之前在路由器 PE1 上设置的语句来完成第 2 层 电路。
通过在层次结构级别配置[edit protocols]
语句来l2circuit
建立第 2 层 电路。请记住在第 2 层 电路配置中包含远程 PE 邻居的 IP 地址(通常是邻居的环路地址)、连接到客户边缘路由器的接口以及每个 VC 的虚拟电路标识符。在这种情况下,您将为 ATM AAL5 流量建立一个 VC,为帧中继流量建立另一个 VC。然后,配置 MPLS、LDP 和 IGP(例如 OSPF),为第 2 层 电路启用信令。为 ATM 和帧中继流量建立了两个 LSP:LSP1 用于直接进入路由器 PE2 的 ATM 流量,LSP 2 用于在进入路由器 PE2 之前通过路由器 P0 的帧中继流量。
最后,为 ATM 和帧中继第 2 层 电路配置流量分离社区。ATM VC 有社区 gold
,帧中继 VC 有社区 silver
。请记住为社区提供数值并配置路由策略以将社区与特定 LSP 匹配。此策略作为策略应用于 export
层次结构级别的转发表 [edit routing-options]
。
路由器 PE2
[edit] chassis { fpc 1 { pic 0 { atm-l2circuit-mode { aal5; # This dedicates FPC 1 PIC 0 to AAL5 mode. } } } } interfaces { at-1/0/1 { description "to CE2 at-1/1/2"; atm-options { pic-type atm2; # Layer 2 circuits are compatible with vpi 0; # ATM2 IQ interfaces. } unit 0 { encapsulation atm-ccc-vc-mux; # CLP and EFCI appear in the control word. vci 0.32; } } so-0/1/1 { description "to P0 so-1/1/2"; unit 0 { family inet { address 192.168.27.25/30; } family mpls; # Include the MPLS family on core-facing interfaces. } } so-1/0/1 { description "to PE1 so-1/1/0"; unit 0 { family inet { address 192.168.27.9/30; } family mpls; # Include the MPLS family on core-facing interfaces. } } so-1/1/1 { description "to CE4 so-1/1/2"; dce; encapsulation frame-relay-ccc; unit 0 { encapsulation frame-relay-ccc; point-to-point; dlci 512; family ccc { translate-fecn-and-becn; # Option to map FECN/BECN bits to control word. translate-discard-eligible; # Option to map DE bit to control word. } } } lo0 { unit 0 { family inet { address 10.255.17.4/32; } } } } routing-options { forwarding-table { export layer2communities; # This maps communities to the Layer 2 circuits. } } protocols { mpls { label-switched-path lsp1 { # ATM LSP 1 goes directly to Router PE2. to 10.255.17.2; primary direct; } label-switched-path lsp2 { # Frame Relay LSP 2 goes through Router P0. to 10.255.17.2; primary thruP0; } path direct { 192.168.27.10 strict; } path thruP0 { 192.168.27.26 strict; 192.168.27.17 strict; } interface so-0/1/1.0; interface so-1/0/1.0; } ospf { traffic-engineering; area 0.0.0.0 { interface so-0/1/1.0; interface so-1/0/1.0; interface lo0.0; } } ldp { # LDP is required as the signaling protocol for Layer 2 circuits. interface so-0/1/1.0; interface so-1/0/1.0; interface lo0.0; } l2circuit { neighbor 10.255.17.2 {# This points to the loopback of the PE neighbor. interface at-1/0/1.32 { # Here you include the local CE-facing interface. virtual-circuit-id 1; # Be sure this ID matches the ID of your PE neighbor. community gold;# Assigns the ATM Layer 2 circuit to the gold community. } } neighbor 10.255.17.2 {# This points to the loopback of the PE neighbor. interface so-1/1/1.512 { # Here you include the local CE-facing interface. virtual-circuit-id 2; # Be sure this ID matches the ID of your PE neighbor. community silver; # Assigns the Frame Relay Layer 2 circuit to silver. } } } } policy-options { policy-statement layer2communities { # Here you map communities to LSPs. term 10 { from community gold; # Apply community gold to LSP 1. then { install-nexthop lsp lsp1; accept; } } term 20 { from community silver; # Apply community silver to LSP 2. then { install-nexthop lsp lsp2; accept; } } } community gold members 103:1; # Assign numerical value to community gold. community silver members 103:2; # Assign numerical value to community silver. }
在路由器 CE2 上,配置 ATM2 IQ 接口以处理 ATM 流量。接口 at-1/0/1
处理 AAL5 流量。
路由器 CE2
[edit] interfaces { at-1/1/2 { description "to PE2 at-1/0/1"; atm-options { pic-type atm2; # Layer 2 circuits are compatible with vpi 0; # ATM2 IQ interfaces. } unit 0 { encapsulation atm-vc-mux; # Use ATM VC MUX encapsulation on the CE. point-to-point; vci 0.32; family inet { address 10.0.0.2/30; } } } }
在路由器 CE4 上,配置 SONET/SDH 接口 so-1/1/2
以处理帧中继流量:
路由器 CE3
[edit] interfaces { so-1/1/2 { description “ to PE2 so-1/1/1”; encapsulation frame-relay-ccc; # Use Frame Relay encapsulation on the CE. unit 0 { encapsulation frame-relay-ccc; point-to-point; dlci 512; family inet { address 10.10.0.2/30; } } } }
验证您的工作
要验证流量工程第 2 层 电路的正常运行,请使用以下命令:
show route table mpls.0 detail
在路由器 PE1 上,您可以看到 ATM 流量是值为 103:1
LSP 1 并与 LSP 1 关联的社区的一部分gold
。同样,帧中继流量是社区的一部分silver
,其值103:2
为 LSP 2 并与 LSP 2 相关联:
user@PE1> show route table mpls.0 detail mpls.0: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden) at-1/1/0.32 (1 entry, 1 announced) *L2CKT Preference: 7 Next hop: 192.168.27.9 via so-1/1/0.0 weight 1, selected Label-switched-path lsp1 Label operation: Push 100032 Offset: -4 Next hop: via so-0/0/1.0 weight 1 Label-switched-path lsp2 Label operation: Push 100032 Offset: -4 Protocol next hop: 10.255.17.4 Push 100032 Offset: -4 Indirect next hop: 8576bd0 300 State: <Active Int> Age: 7:18 Task: Common L2 VC Announcement bits (2): 0-KRT 1-Common L2 VC AS path: I Communities: 103:1 # This is the gold community. so-1/1/1.512 (1 entry, 1 announced) *L2CKT Preference: 7 Next hop: 192.168.27.9 via so-1/1/0.0 weight 1 Label-switched-path lsp1 Label operation: Push 100048 Offset: -4 Next hop: via so-0/0/1.0 weight 1, selected Label-switched-path lsp2 Label operation: Push 100048 Offset: -4 Protocol next hop: 10.255.17.4 Push 100048 Offset: -4 Indirect next hop: 860f1f8 293 State: <Active Int> Age: 5:15 Task: Common L2 VC Announcement bits (2): 0-KRT 1-Common L2 VC AS path: I Communities: 103:2 # This is the silver community.