In: Computer Science
Assume that you have the following MAC address 01:00:5e:XX:XX:XX (where the last 3 bytes matches the last 3 bytes of your own device MAC address), figure out what IPv4 multicast address does this MAC address belongs to?
Solution
Lets start with this MAC address
01:00:5e:0b:01:02
First step is to translate the MAC address from hex to binary
0 |
1 |
0 |
0 |
5 |
e |
0 |
b |
0 |
1 |
0 |
2 |
0000 |
0001 |
0000 |
0000 |
0101 |
1110 |
0000 |
1011 |
0000 |
0001 |
0000 |
0010 |
The above table shows that how we have translated the hex to binary the full MAC address is
0000 0001 |
0000 0000 |
0101 1110 |
0000 1011 |
0000 0001 |
0000 0010 |
Lets take the lowest 23-bits of the MAC address
0000 0001 |
0000 0000 |
0101 1110 |
0000 1011 |
0000 0001 |
0000 0010 |
The highlighted bits are the lowest 23-bit of the MAC address
Next step is to take class D multicast IP address in binary
1110 0000 |
0000
0000 |
0000 0000 |
0000 0000 |
1110 is the class D ip address that is mentioned in binary in decimal it is 224
The 00000 are the 5 bits we are losing the reason is we need to map 28-bit unique multicast IP address to 23-bit multicast MAC address
1110 0000 |
0000 1011 |
0000 0001 |
0000 0010 |
Now convert this binary to decimal
224 |
11 |
1 |
2 |
1110 0000 |
0000 1011 |
0000 0001 |
0000 0010 |
Therefore complete multicast IP address for MAC is
224.11.1.2
---
all the best