Thursday, February 11, 2010

Multicast address to mac conversion.


MULTICAST:
=========

Converting the ip address of a multicast packet. I've launched vlc to listen to a multicast stream at 226.1.1.1

Above is the IGMP group request my pc has sent to the gateway
Now here are the steps to generate the Mac address.

Step 1:
--------
Our ip add is having the following digits

226.1.1.1
11100010-00000001-00000001-00000001

now we have to replace first 4 bits of this ip (means 1110) with 01-00-5E(standard mac for multicast)

01-00-5E-XX-XX-XX is our mac address as of now.

Step 2:
--------
Now we have to replace next 5 digits with a 0 in mac

11100010-00000001-00000001-00000001
01-00-5E-0X-XX-XX

Step 3:
-------
Now copy the remaining 23 bits of your ip address and convert them to HEX.

11100010-0 000001-00000001-00000001 ----> 10101(this is the hex)

So now our mac will be

01-00-5E-01-01-01

as shown in the packet capture.

No comments:

Post a Comment