Multicast IP Address to MAC address mapping

This topic is to discuss the following lesson:

This is killing me. I have a task to convert 239.192.0.1 to a mac-address. I am just not getting it right now.

01:00:5e:ef: is as far as I get…how to I convert the 100 (binary for 192 is 11000000 so I eliminate the first 1) to hex? 01:00:5e:ef:?0:00:01 is where I am at.

Hi James,

I understand that these calculations make your head spin…they are kinda annoying :slight_smile:

Here’s how to figure out what MAC address your IP address maps to:

  1. We convert your IP address to binary:

decimal: 239.192.0.1
binary: 11101111 11000000 00000000 00000001

  1. We only care about the last 23 bits of your IP address so I removed the first 9 bits, that gives us:

1000000 00000000 00000001

  1. Now we need to convert these 23 bits into hexadecimal. You need to take 4 binary bits and convert them to hexadecimal:

binary: 100 0000 0000 0000 0000 0001
hex: 4 0 0 0 0 1

That gives us:

40:00:01

The first part of a multicast MAC address always starts with 01:00:5e so let’s put that in front:

01:00:5e + 40:00:01 = 01:00:5e:40:00:01 (your multicast MAC address).

Does that help?

Rene

5 Likes

Hi Rene,

Excellent post and excellent explanation of what should be simpler and was made unnecessarily complex :slight_smile:

Just one small correction:

Where you say “The multicast IP addresses above all map to the same multicast MAC address (01-00-5E-01-01)”, I think you’re missing one octet. I believe it should be 01-00-5E-01-01-01.

Hi Rene,
All your post are really good especially multicast part .I have one query here,In multicast MAC the first 24 bit (01-00-5E) is reserved range.so there are remaining 24 bits right.for what purpose we are mapping only 23 bits of MAC to 28 bits of IP. what is that 1-bit exactly used for?.

Thanks,
Mohan

Hi Mohan,

I explained it in the tutorial, back when Multicast was developed they bought 1x IOU of 24-bits but decided to split in in two, as a result there are only 23 bits left for MAC multicast addresses.

Rene

Hi Alfonso,

You are right, I just fixed it.

Rene

ok…thanks for yoyr reply.I appreicate it!!

maybe im missing the obvious - but if for the mac address the first part is always 01-00-5E

then the last 23 bits get the Multicast IP address
is the 24th bit in the MAC address always assumed to be 0 then because its a don’t care ?

Hi Jeffrey,

AFAIK the 24th bit doesn’t have any special meaning, it’s just that IANA has assigned 01-00-5E as the OUI for Multicast MAC.

Rene

thanks - I meant the 24th bit from the right in the MAC.
the first 23 are from the IP address.
the 24th bit is an “x”
and the rest is always 01-00-5E

is the 24th bit always 0 ?
it must be

Hi Jeffrey,

It doesn’t have to be, the RFC has the answer:

http://www.iana.org/assignments/ethernet-numbers/ethernet-numbers.xhtml

Look for the “IANA Multicast 48-bit MAC Addresses” part. The range for IPv4 unicast is 00-00-00 to 7F-FF-FF so then the 24th bit will always be a 0. Some of the other ranges (MPLS multicast for example) will use a 1 for the 24th bit.

Rene

1 Like

Awesome- thanks

Rene - if there is one source 224.1.0.1 and two receivers.
one receiver is listening for 239.1.0.1 and one listening to 226.1.0.1
all three of those MAC addresses will over lap right ?

if the receivers are on different LAN segments in the network will they both get the packets ?

Hi Jeffrey,

The source will always be a unicast address, the destination can be a group address. There will be some duplicate packets yes…routers might receive duplicate packets but forwarding will be OK since they route multicast packets based on L3 information in the multicast routing table. Receivers will receive duplicate packets if they are on the same Ethernet segment, the switch is only looking at destination MAC addresses so the receivers will receive packets from both groups.

Rene

ok thank you for explaining

FYI: There was an error in translating from Hex to Binary. You correctly state that 5 in binary is 0101 in your reference table, but when it comes time to translate the “5” in your 01:00:5e:0b:01:02, the binary is transposed to 1001 (9) instead of 0101 (5). You got lucky in that the 5 was higher than the significant 23 bits of the example, so it wound up having no effect on the results.

Hi Andrew,

Thanks for reporting this, you have a good eye :slight_smile: Just fixed the error.

Rene

Hi Rene,

Excellent creation as usual . Please confirm my understanding is correct which is grabbed from this lesson. Please let me know if I am wrong :slight_smile:

General format of MAC address is MM:MM:MM:SS:SS:SS.The leftmost 6 digits (24 bits : MM:MM:MM ) called a “prefix” is associated with the adapter manufacturer.
The rightmost digits (24 bits : SS:SS:SS) of a MAC address represent an identification number for the specific device with the same vendor prefix.

But here in this multicast we use the leftmost 3 octets are (24 bits : MM:MM:MM) always 01-00-5E and the right most digits(24 bits : SS:SS:SS) will be a single OUI (24bits). From this single OUI(24 bits) we use only half of this 24-bits which means 23 bits can be used for mapping 28 bits Mutlicast IP addresses.

Hello Sreenath,

That sounds correct yes, seems you got it :slight_smile:

Rene