Using the first 01-00-5E, we now add 40, which makes the MAC 01-00-5E-40. Now we use this for the next part of our MAC Address. So from our example, converting 64 to hexadecimal equals 40 or (0x40). You can use this website to automatically convert it for you: Decimals use a base 10 while Hexadecimals use a base 16. Using this method makes it much easier to work with large numbers over using decimal standard. You can think of it as though A is 10, B is 11, C is 12, D is 13, E is 14, and F is 15. Hexadecimal numbers use a base 16 where numbers are counted from 0 to 9 then letters A to F before adding another digit. Now that we have determined what the last seven bits of our second octet are we can convert it to hexadecimal. After dropping that first bit it changes the binary to 64 instead of 192! Do not skip this part. Had our multicast IP been 239.192.100.1, that would mean our binary would be 11000000. I could have explained this above but then you would have skipped through this part which does make a difference. Last 7 bits of 64 which still equals 64 converted to binary = 1000000Īfter removing 1 bit from our binary result it still equals 64 so this is what we will be using in the next step. Since we are only using the last 7 bits from the second octet, just drop the first 0 or 1 from our binary number (first binary number on the left, the result from 128 above). So above we converted the second octet of our multicast IP which was 64 to decimal which equal 01000000. You keep doing this until you can no longer subtract from the octet and you have converted decimal to binary. Can 64 be subtracted from 64? Yes, write a 1. Can 128 be subtracted from 64? No, write a 0. A quick way to do this is by following this example below. In the example I will be using the second octet of the multicast IP 239.64.100.1 which would be 64. The first step is to convert the second octet of the multicast IP to binary. You should have a good understanding of IP sub-netting or this may get a bit confusing.Ĭonvert Second Octet of Multicast IP to Binary To determine the rest of the MAC address we will use the remaining 23 low order bits to generate the full MAC address. The high order 25 bits of the MAC address are fixed and that is the 01-00-5E. As I explained above, any MAC address you see that starts with 01-00-5E is related to a multicast address. There is a specific range assigned for multicast, 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for Ethernet and Fiber Distributed Data Interface (FDDI). I’ll explain below exactly how to determine the multicast MAC address from the multicast IP as well as provide a few helpful websites.Īt the layer 2 level whenever multicast is used it has to be assigned a MAC address in order to work. I knew that any mac address that started with 01-00-5E was a multicast address, but wasn’t sure how the rest of it was calculated. Using System using using System.Diagnostics using System.Linq using System.Net /// /// This class allows you to retrieve the IP Address and Host Name for a specific machine on the local network when you only know it's MAC Address.Recently I was working to track down a multicast problem for a client on an enterprise network and needed to determine what the exact multicast MAC address would be. I also added in the ability to get the machines Host Name using the the “ Dns.GetHostEntry” method. Below is an example on using the “IPInfo” class I created to perform the previously mentioned method of retrieving the IP Address for a specified MAC Address. I’m not going to give full detail on how to call “arp” from. Then just parse through the results and get out the IP Address for the desired MAC Address. All you need to do is use the class to execute the “arp –a” call and retrieve the results. NET application? Well, it’s rather simple. Now, you may be asking, how do we use this utility from within a. To see the IP / MAC Address translations, just open up the Command Prompt in Windows, and type “ arp –a” and press enter. “arp.exe” uses the Address Resolution Protocol to provide functionality to add, delete or display the IP address for MAC (Media Access Control) address translation. This took a bit of research to figure out, and eventually I stumbled across the “arp.exe” utility within Windows. While working on the Virtual Router project, I’ve come across a need to be able to retrieve the IP Address and Host Name of a given machine on the local network when only the machines MAC Address is known. Resolve IP Address And Host Name From MAC Address using C# and Windows ARP Utility
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |