PIM
為建立Multicast Routing Table, 利用RPF checking技術, 在Routing Table(其實是rpf table)查找Source Address是否從best path 來
R1# show ip rpf 192.168.15.5 //查best path
RPF interface: Eth0/2
1. PIM-DM基本玩法
Source 強推Multicast Packet 到所有Host, RPF checking, 查Packet source IP 是經Best Path(如有兩條, 揀next hop大IP)而來, 才繼續強推, 繼而產生SPT(Shortest Path Tree)
如Best Path interface沒有啟動DM, 則會斷路, 可用Multicast Static Route 改路
R2(config)#ip mroute 192.168.15.5 255.255.255.255 192.168.24.4
如有Router認為自己不用Multicast, 可對上游Prune
R1-4(config)#ip multicast-routing
R1-4(config)#int range eth 0/0-1, R1做埋eth2
R1-4(config-if-range)#ip pim dense-mode
R2,R4(config)#int eth0/2
R2,R4(config-if)#ip igmp join-group 224.1.1.1
R5#ping 224.1.1.1
R2#show ip pim neighbor //查neighbor
查Multicast Routing Table
R1#show ip mroute
(*,G) route //天先有
(S,G) route //重點看
(*, 224.0.1.40) route //用作接收來自Mapping Agent關於RP的資訊
Assert
在Multi Access中, 有同Group的相同Traffic, 只有Assert Traffic(AD小>Metric小)才會推出去
R1#show ip mroute
(S,G) route, A //重點看
2. PIM-SM進階玩法
適合很少host用multicast, 節省Bandwidth, 因不像DM狂推Multicast, 需要中間人搭橋, RP (Rendeszvous Point)
當R5一Ping, R1報串R5 IP給RP, R2想訂閱group就同RP搭路, 初始R5>RP>R2, 之後R5>R2
R1-4(config)#ip multicast-routing
R1-4(config)#ip pim rp-address 3.3.3.3
R1-4(config)#int r eth0/0-1, R1做埋eth2, R3做埋lo0
R1-4(config-if-range)#ip pim sparse-mode
R2(config)#int eth0/2
R2(config-if)#ip igmp join-group 224.1.1.1
Designated Router
在Multi Access中, RP只信來自Designated Router的報串
R2(config)#int eth1/1
R2(config-if)#ip pim sparse-mode
R2(config-if)#ip pim dr-priority 1000
3. PIM-SDM高階玩法
2個multicast group, 一個有set RP, 另一個fallback用DM
R1(config)#ip pim rp-address 3.3.3.3 RPGroupList
R1(config)#ip access-list standard RPGroupList
R1(config-std-nacl)# permit 224.1.1.1
Auto-RP, 先DM後SM (SDM)
怕傳統RP ip改, 所有router都要改config
怕RP down, 所以要2個RP
- Candidate RP
- ip pim send-rp-announce <interface> scope <scope>
- IP大的就是Active RP
- 用 DM, multicast address 224.0.1.39發給mapping agent
- Mapping Agent
- ip pim send-rp-discovery <int> scope <scope>
- 把收集到的RP資訊發給所有Router, 可set兩隻Active
- 用 DM, multicast address 224.0.1.40 把RP資訊給所有Router
- 其他Router
- 用SD Mode: ip pim sparse-dense-mode
- 或ip pim autorp listener
R2-3(config)#ip pim send-rp-announce lo0 scope 255 //可加group list哪些group做rp, group-list 1 interval 10
R1(config)#ip pim send-rp-discovery lo0 scope 255
R2(config)access-list 1 permit 1.1.0 0.0.0.255
R4#show ip pim rp mapping
RP 3.3.3.3 Source 1.1.1.1, elected via Auto-RP
ip pim send-rp-announce lo0 scope 255 interval 10 //改10秒 RP failover 本身60秒太慢
RP-announce-filter
Mapping Agent 可禁止某IP成為RP
ip pim rp-announce-filter rp-list 1
access-list 1 permit 2.2.2.2
或禁止2.2.2.2成為RP, 除非它是為group 224.1.1.1服務
ip pim rp-announce-filter rp-list 1 group-list 2
access-list 1 permit 2.2.2.2
access-list 2 permit 224.1.1.1
MSDP
如有2個multicast domain想互通, 則要MSDP搭橋
R2(config)#ip msdp peer 192.168.35.3 connect-source eth1/1
R3(config)#ip msdp peer 192.168.25.2 connect-source eth1/0
R4(config)#int lo0
R4(config-if)#ip igmp join-group 224.1.1.1
如中間R5沒PIM, 可用GRE 打通
R2(config)#int tu23
R2(config-if)#tunnel source e1/1
R2(config-if)#tunnel destination 192.168.35.3
R2(config-if)#ip add 192.168.23.2 255.255.255.0
R2(config-if)#ip pim sparse-dense-mode
R3(config)#int tu23
R3(config-if)#tunnel source e1/0
R3(config-if)#tunnel destination 192.168.25.2
R3(config-if)#ip add 192.168.23.3 255.255.255.0
R3(config-if)#ip pim sparse-dense-mode