MAC地址是以太网二层使用的一个48bit(6字节十六进制数)的地址,用来标识设备位置。MAC地址分成两部分,前24位是组织唯一标识符(OUI, Organizationally unique identifier),后24位由厂商自行分配。
MAC地址有单播、组播、广播之分。单播地址(unicast address)表示单一设备、节点,多播地址或者组播地址(multicast address、group address)表示一组设备、节点,广播地址(broadcast address)是组播的特例,表示所有地址,用全F表示:FF-FF-FF-FF-FF-FF。当然,三层的IP地址也有单播、组播、广播之分。
48bit的MAC地址一般用6字节的十六进制来表示,如XX-XX-XX-XX-XX。IEEE 802.3规定:以太网的第48bit用于表示这个地址是组播地址还是单播地址。如果这一位是0,表示此MAC地址是单播地址,如果这位是1,表示此MAC地址是多播地址。见IEEE 802.3 3.2.3 Address fields: “The first bit (LSB) shall be used in the Destination Address field as an address type designation bit to identify the Destination Address either as an individual or as a group address. If this bit is 0, it shall indicate that the address field contains an individual address. If this bit is 1, it shall indicate that the address field contains a group address that identifies none, one or more, or all of the stations connected to the LAN. In the Source Address field, the first bit is reserved and set to 0.”
因为以太网线路上按“Big Endian”字节序传送报文(也就是最高字节先传送,关于字节序请参考相关文档),而比特序是”Little Endian”(也就是最低位先传送)。所以有如下的图(从最左边开始传送):