MAC : Java Glossary

go to home page M words local find full screen, hide local find menu Google search web for more information on this topic jump to foot of page translate this page with Babelfish 2008-07-21 by Roedy Green ©1996-2009 Canadian Mind Products
index page for letter ⇒ punctuation 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z (all)
MAC
Media Access Control. Huh? Every Ethernet LAN card has a unique 48-bit serial number, e.g. 00-0C-6E-27-4F-9B sometimes called its physical address. No other Ethernet and in the world has the same one unless they cheated. This physical address is usually usually just called the MAC, similar in function to the 32 bit IPv4 or 128-bit IPv6 IP addresses used on the Internet. Token Ring LAN cards don’t have a MAC. Though it is common to access the Internet via a small local Ethernet, some computers access the Internet via direct dialup and thus don’t necessarily have a MAC address.

The MAC is useful as a unique computer indentifier for software protection schemes. Intel’s Pentium class machines have a unique serial number burned into their silicon that can also serve that purpose. AMD’s do not.

In Java 1.6+ there is java.net.NetworkInterface. getHardwareAddress which will get you the hardware address of an adapter, usually the MAC. You need sufficient privilege to use it.

Here’s how to display a long MAC address in hex with the traditional dashes.

The code to extract the MAC in Windows in Java 1.5 or earlier is ugly, complicated, needs JNI and an extra iphlpapi library DLL not part of the normal Windows distribution. See this CodeGuru article. You can also find out what it is with the IPCONFIG utility.

MAC also stands for Message Authentication Codes. They are digital signatures used to verify that a piece of data originated with a given party and that it has not been tampered with. A MAC mechanism that is based on cryptographic hash functions is referred to as HMAC. HMAC can be used with any cryptographic hash function, e.g., MD5 or SHA-1, in combination with a secret shared key. How HMACs work is specified in RFC 2104. JCE has support for HMAC-MD5 and HMAC-SHA1.

The term Mac (not all caps) refers to Apple’s line of computers, the MacIntosh, deliberately spelled differently from the McIntosh apple tree species after which it was named and McIntosh the maker of high end stereo equipment, and presumably to avoid dealing with lawyers from that Scottish McFood company.

Learning More

Sun’s Javadoc on the getHardwareAddress method : available:

CMP homejump to top
CMP logo
feedback Please email your feedback for publication, errors, omissions, broken/redirected link reports
and suggestions to improve this page to Roedy Green : feedback email
made with CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[65.110.21.43]
Your face IP:[38.103.63.62] The information on this page is for non-military use only.
You are visitor number 18,351. Military use includes use by defence contractors.
You can get a fresh copy of this page from: or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror)
http://mindprod.com/jgloss/mac.html J:\mindprod\jgloss\mac.html