Example for Configuring PIM for Anycast RP
Networking Requirements
In a traditional PIM-SM domain, all multicast groups map to only one RP. When the network is overloaded or traffic is concentrated on the RP, the RP may be overburdened. If the RP fails, routes are converged slowly or multicast data are forwarded over non-optimal paths. Configuring Anycast RP in a single PIM-SM domain can address this problem. IP routing will automatically select the closest RP for each source and receiver. This releases burdens on a single RP, implements RP backup, and optimizes multicast forwarding paths.
As shown in Figure 4-23, Receiver2 wants to receive multicast data from Source. You need to configure Anycast RP peering between RouterC and RouterD, so that Receiver2 can send a Join message to the closest RouterD. After RouterA receives multicast data from Source, it encapsulates the multicast data in a Register message and sends it to RouterC. On receiving the Register message, RouterC forwards it to RouterD, and Receiver2 can receive the multicast data from Source.
Configuration Roadmap
The configuration roadmap is as follows:
Configure IP addresses for interfaces of each router, and configure OSPF to implement IP interworking.
Enable the multicast function and enable PIM-SM on each interface.
Enable IGMP on the interfaces that connect router to hosts.
Configure loopback 0 on RouterC and RouterD as C-RP and C-BSR respectively.
Configure loopback 0 on RouterC and RouterD as Anycast RPs.
Configure the addresses of loopback 0 on RouterC and RouterD as local addresses of Anycast RPs.
Set an Anycast RP peer relationship between RouterC and RouterD.
Procedure
- Configure an IP address for each interface and configure the unicast routing protocol.
# Configure an IP address and mask for each interface according to Figure 4-23. Configure OSPF on each router to ensure IP connectivity between them, and enable them to dynamically update routing information. The configuration of RouterB, RouterC, and RouterD are similar to the configuration of RouterA, and are not mentioned.
<Huawei> system-view [Huawei] sysname RouterA [RouterA] interface gigabitethernet 1/0/0 [RouterA-GigabitEthernet1/0/0] ip address 10.110.1.1 24 [RouterA-GigabitEthernet1/0/0] quit [RouterA] interface gigabitethernet 2/0/0 [RouterA-GigabitEthernet2/0/0] ip address 192.168.1.1 24 [RouterA-GigabitEthernet2/0/0] quit [RouterA] ospf [RouterA-ospf-1] area 0 [RouterA-ospf-1-area-0.0.0.0] network 10.110.1.0 0.0.0.255 [RouterA-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255 [RouterA-ospf-1-area-0.0.0.0] quit [RouterA-ospf-1] quit
- Enable multicast routing on all routers and PIM-SM on all interfaces.
# Enable multicast routing on all routers and enable PIM-SM on all interfaces. The configurations of RouterB, RouterC, and RouterD are similar to the configuration of RouterA, and are not mentioned here.
# Configure RouterA.
[RouterA] multicast routing-enable [RouterA] interface gigabitethernet 1/0/0 [RouterA-GigabitEthernet1/0/0] pim sm [RouterA-GigabitEthernet1/0/0] quit [RouterA] interface gigabitethernet 2/0/0 [RouterA-GigabitEthernet2/0/0] pim sm [RouterA-GigabitEthernet2/0/0] quit
- Enable IGMP on the interfaces that connect the router to hosts.
# Enable IGMP on the interfaces that connect RouterC and RouterD to hosts.
# Configure RouterC.
[RouterC] interface gigabitethernet 3/0/0 [RouterC-GigabitEthernet3/0/0] igmp enable [RouterC-GigabitEthernet3/0/0] quit
# Configure RouterD.
[RouterD] interface gigabitethernet 2/0/0 [RouterD-GigabitEthernet2/0/0] igmp enable [RouterD-GigabitEthernet2/0/0] quit
- Configure loopback 0 on RouterC and RouterD as the C-RP and C-BSR respectively.
# Configure RouterC.
[RouterC] pim [RouterC-pim] c-bsr loopback 0 [RouterC-pim] c-rp loopback 0 [RouterC-pim] quit
# Configure RouterD.
[RouterD] pim [RouterD-pim] c-bsr loopback 0 [RouterD-pim] c-rp loopback 0 [RouterD-pim] quit
- Configure loopback 0 on RouterC and RouterD as Anycast RPs.
# Configure RouterC.
[RouterC] pim [RouterC-pim] anycast-rp 10.10.1.1 [RouterC-pim-anycast-rp-10.10.1.1] quit [RouterC-pim] quit
# Configure RouterD.
[RouterD] pim [RouterD-pim] anycast-rp 10.10.1.1 [RouterD-pim-anycast-rp-10.10.1.1] quit [RouterD-pim] quit
- Configure the addresses of loopback 0 on RouterC and RouterD as local addresses of Anycast RPs.
# Configure RouterC.
[RouterC] pim [RouterC-pim] anycast-rp 10.10.1.1 [RouterC-pim-anycast-rp-10.10.1.1] local-address 10.10.1.2 [RouterC-pim-anycast-rp-10.10.1.1] quit [RouterC-pim] quit
# Configure RouterD.
[RouterD] pim [RouterC-pim] anycast-rp 10.10.1.1 [RouterC-pim-anycast-rp-10.10.1.1] local-address 10.10.1.3 [RouterC-pim-anycast-rp-10.10.1.1] quit [RouterD-pim] quit
- Set an Anycast RP peer relationship between RouterC and RouterD.
# Configure RouterC.
[RouterC] pim [RouterC-pim] anycast-rp 10.10.1.1 [RouterC-pim-anycast-rp-10.10.1.1] peer 10.10.1.3 [RouterC-pim-anycast-rp-10.10.1.1] quit [RouterC-pim] quit
# Configure RouterD.
[RouterD] pim [RouterD-pim] anycast-rp 10.10.1.1 [RouterD-pim-anycast-rp-10.10.1.1] peer 10.10.1.2 [RouterD-pim-anycast-rp-10.10.1.1] quit [RouterD-pim] quit
- Verify the configuration.
# Run the display pim rp-info command on RouterC and RouterD to check RP information.
<RouterC> display pim rp-info VPN-Instance: public net PIM-SM BSR RP Number:1 Group/MaskLen: 224.0.0.0/4 RP: 10.10.1.1 (local) Priority: 0 Uptime: 00:45:19 Expires: 00:02:11
<RouterD> display pim rp-info VPN-Instance: public net PIM-SM BSR RP Number:1 Group/MaskLen: 224.0.0.0/4 RP: 10.10.1.1 (local) Priority: 0 Uptime: 02:27:56 Expires: 00:01:39
The command output shows that RouterC and RouterD serve as RPs and forward the Register message from the multicast source to each other.
# Run the display pim routing-table command to check PIM entries on each router. Source (10.110.1.2/24) in the PIM-SM domain sends multicast data to multicast group G (226.1.1.1). Receiver2 joins G and receives the multicast data sent to G. Source sends a Register message to RouterC and Receiver2 sends a Join message to RouterD.
<RouterC> display pim routing-table VPN-Instance: public net Total 0 (*, G) entry; 1 (S, G) entry (10.110.1.2, 226.1.1.1) RP: 10.10.1.1 (local) Protocol: pim-sm, Flag: 2MSDP ACT UpTime: 00:00:38 Upstream interface: Register Upstream neighbor: NULL RPF prime neighbor: NULL Downstream interface(s) information: None
<RouterD> display pim routing-table VPN-Instance: public net Total 1 (*, G) entry; 1 (S, G) entry (*, 226.1.1.1) RP: 10.10.1.1 (local) Protocol: pim-sm, Flag: WC UpTime: 00:01:25 Upstream interface: Register Upstream neighbor: NULL RPF prime neighbor: NULL Downstream interface(s) information: Total number of downstreams: 1 1: GigabitEthernet2/0/0 Protocol: igmp, UpTime: 00:01:25, Expires: - (10.110.1.2, 226.1.1.1) RP: 10.10.1.1 (local) Protocol: pim-sm, Flag: 2MSDP SWT ACT UpTime: 00:00:02 Upstream interface: Register Upstream neighbor: NULL RPF prime neighbor: NULL Downstream interface(s) information: Total number of downstreams: 1 1: GigabitEthernet2/0/0 Protocol: pim-sm, UpTime: 00:00:02, Expires: -
Configuration Files
RouterA configuration file
# sysname RouterA # multicast routing-enable # interface GigabitEthernet1/0/0 ip address 10.110.1.1 255.255.255.0 pim sm # interface GigabitEthernet2/0/0 ip address 192.168.1.1 255.255.255.0 pim sm # ospf 1 area 0.0.0.0 network 10.110.1.0 0.0.0.255 network 192.168.1.0 0.0.0.255 # return
RouterB configuration file
# sysname RouterB # multicast routing-enable # interface GigabitEthernet1/0/0 ip address 192.168.2.1 255.255.255.0 pim sm # ospf 1 area 0.0.0.0 network 192.168.2.0 0.0.0.255 # return
RouterC configuration file
# sysname RouterC # multicast routing-enable # interface GigabitEthernet1/0/0 ip address 192.168.3.1 255.255.255.0 pim sm # interface GigabitEthernet2/0/0 ip address 192.168.1.2 255.255.255.0 pim sm # interface GigabitEthernet3/0/0 ip address 10.110.2.1 255.255.255.0 pim sm igmp enable # interface LoopBack0 ip address 10.10.1.1 255.255.255.255 pim sm # interface LoopBack1 ip address 10.10.1.2 255.255.255.255 pim sm # ospf 1 area 0.0.0.0 network 192.168.1.0 0.0.0.255 network 192.168.3.0 0.0.0.255 network 10.110.2.0 0.0.0.255 network 10.10.1.1 0.0.0.0 network 10.10.1.2 0.0.0.0 # pim c-bsr LoopBack0 c-rp LoopBack0 anycast-rp 10.10.1.1 local-address 10.10.1.2 peer 10.10.1.3 # return
RouterD configuration file
# sysname RouterD # multicast routing-enable # interface GigabitEthernet1/0/0 ip address 192.168.2.2 255.255.255.0 pim sm # interface GigabitEthernet2/0/0 ip address 10.110.3.1 255.255.255.0 pim sm igmp enable # interface GigabitEthernet3/0/0 ip address 192.168.3.2 255.255.255.0 pim sm # interface LoopBack0 ip address 10.10.1.1 255.255.255.255 pim sm # interface LoopBack1 ip address 10.10.1.3 255.255.255.0 pim sm # ospf 1 area 0.0.0.0 network 192.168.2.0 0.0.0.255 network 192.168.3.0 0.0.0.255 network 10.110.3.0 0.0.0.255 network 10.10.1.3 0.0.0.0 network 10.10.1.1 0.0.0.0 # pim c-bsr LoopBack0 c-rp LoopBack0 anycast-rp 10.10.1.1 local-address 10.10.1.3 peer 10.10.1.2 # return