Saturday, November 19, 2011

Multicast Reverse Path Forwarding

Multicast Reverse Path Forwarding(RPF)
The router forwards the multicast packet away from the source along the distribution tree. The router's multicast forwarding state is  based on the reverse path, from the receiver back to the root of the distribution tree. When the router receives a packet, it checks its routing table for the source IP address.If the incoming multicast packet comes from the interface that is same as the outgoing interface for the routing table entry to the source IP address then the router forwards the packet, otherwise drops the paket.This process is known as reverse-path forwarding (RPF).
 We will provide an example for multicast RPF process:
Here is the topology for this example:


We run PIM dense-mode and Ospf between the routers in this example.Ospf costs are same on all routers:
R4 is the multicast source for the group 224.1.1.1 and R1 is the client for the same group.
Lets start the traffic from R4:

R4#ping
Protocol [ip]:
Target IP address: 224.1.1.1
Repeat count [1]: 1000
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Interface [All]: FastEthernet1/0
Time to live [255]:
Source address: 4.4.4.4
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 1000, 100-byte ICMP Echos to 224.1.1.1, timeout is 2 seconds:
Packet sent with a source address of 4.4.4.4

Reply to request 0 from 192.168.12.1, 112 ms
Reply to request 1 from 192.168.12.1, 84 ms
Reply to request 2 from 192.168.12.1, 80 ms

When we check the routing table and RPF from R2:

R2#show ip route 4.4.4.4
Routing entry for 4.4.4.4/32
  Known via "ospf 1", distance 110, metric 2, type intra area
  Last update from 192.168.24.4 on FastEthernet1/0, 00:00:01 ago
  Routing Descriptor Blocks:
  * 192.168.24.4, from 4.4.4.4, 00:00:01 ago, via FastEthernet1/0
      Route metric is 2, traffic share count is 1

R2#show ip rpf 4.4.4.4
RPF information for ? (4.4.4.4)
  RPF interface: FastEthernet1/0
  RPF neighbor: ? (192.168.24.4)
  RPF route/mask: 4.4.4.4/32
  RPF type: unicast (ospf 1)
  RPF recursion count: 0
  Doing distance-preferred lookups across tables

We see that packet is coming from FastEthernet1/0 which is same as the rpf interface.

Lets increase the cost of the R2 `s interface that is facing to R4:
R2#show ip ospf interface Fastethernet 1/0 | include Cost
  Process ID 1, Router ID 2.2.2.2, Network Type BROADCAST, Cost: 1
R2#conf t
R2(config)#interface Fastethernet 1/0
R2(config-if)#ip ospf cost 10000
R2(config-if)#end
R2#show ip ospf interface Fastethernet 1/0 | include Cost
  Process ID 1, Router ID 2.2.2.2, Network Type BROADCAST, Cost: 10000

Route to 4.4.4.4 is changed:

R2#show ip route 4.4.4.4
Routing entry for 4.4.4.4/32
  Known via "ospf 1", distance 110, metric 21, type intra area
  Last update from 192.168.23.3 on FastEthernet0/0, 00:00:11 ago
  Routing Descriptor Blocks:
  * 192.168.23.3, from 4.4.4.4, 00:00:11 ago, via FastEthernet0/0
      Route metric is 21, traffic share count is 1

R2#show ip rpf 4.4.4.4
RPF information for ? (4.4.4.4)
  RPF interface: FastEthernet0/0
  RPF neighbor: ? (192.168.23.3)
  RPF route/mask: 4.4.4.4/32
  RPF type: unicast (ospf 1)
  RPF recursion count: 0
  Doing distance-preferred lookups across tables

Lets start the ICMP and debug the multicast packets at R2:
R2#debug ip mpacket
IP multicast packets debugging is on
R2#
*Mar  1 00:36:12.911: IP(0): s=4.4.4.4 (FastEthernet1/0) d=224.1.1.1 id=139, ttl=254, prot=1, len=114(100), not RPF interface
R2#
*Mar  1 00:36:14.907: IP(0): s=4.4.4.4 (FastEthernet1/0) d=224.1.1.1 id=140, ttl=254, prot=1, len=114(100), not RPF interface
R2#
*Mar  1 00:36:16.891: IP(0): s=4.4.4.4 (FastEthernet1/0) d=224.1.1.1 id=141, ttl=254, prot=1, len=114(100), not RPF interface

We see that multicast packets are not coming from RPF interface and they are dropped by the router:
R2#show ip mroute 224.1.1.1 count
IP Multicast Statistics
3 routes using 2304 bytes of memory
2 groups, 0.50 average sources per group
Forwarding Counts: Pkt Count/Pkts(neg(-) = Drops) per second/Avg Pkt Size/Kilobits per second
Other counts: Total/RPF failed/Other drops(OIF-null, rate-limit etc)

Group: 224.1.1.1, Source count: 1, Packets forwarded: 0, Packets received: 17
  Source: 4.4.4.4/32, Forwarding: 0/0/0/0, Other: 17/17/0

1 comment: