分类: LINUX
2016-02-02 10:14:01
原文地址:MAC 地址格式 解说 (转载) 作者:frankzfz
而这个6个字节中的最高有效字节中的最低有效位(b1)用来标识 unicast,和mulcast,即单播 和多播
而次最低有效位(b2)则用来标识 universally administered address 和
locally administered address
其中:universally administered address 是指烧录在固件中由厂商指定的地址,也也即大家通常所理解的MAC地址,
而 locally administered address 则是指由网络管理员为了加强自己对网络管理而指定的地址,由定义可知, locally administered address的U/L位要设置成1.所以 要表示 locally administered address的话,那
MAC 地址的第一个字节应该是 0x02, 因此不能够把MAC地址改成其它已经被厂商占用的 universally administered address了。但是通常情况下,很多人都不会遵守上面的约定。因为
MAC地址通常只能在局域网里发挥作用,因为在网络上传输,MAC地址是会被不断的替换掉的。所以即使你用了 已经被厂商占用的 universally administered address也不用担心会产生冲突。
说到着就更清楚了吧。说到底, locally administered address 和 universally administered address的区别在于是直接由生产的时候确定的还是由你自己修改过的。而它们两者理论是U/L位来区别的,但是在实际应用中,却没有人管这些。所以
locally administered address 的范围是:
1: 0000 0000 0001 - FFFF FFFF FFFD
2:在1中定义的,还不要用第一个字节中的最低有效位为1的地址,因为它们是多播的
3:同时还不要用全是0的和全是1的
U/L = 1
Locally administered address: the adapter uses a logical address (assigned by network administrator). U/L=1 may result in a hex code of 0x02 in the first byte. The U/L bit is always set when a logical address is assigned (even if the assigned address doesn't follow this convention). Therefore, it is impossible to imitate a burned-in address; but other logical address may be imitated at any time.
而且一旦 locally administered address地址由网管设定,它就会取代(overridding) universally administered address地址代发挥作用了。
至于为什么要设定 locally administered address 地址,则不清楚,留着以后再查。
Locally administered address主要有以下作用:
http://www.irongeek.com/i.php?page=security/changemac
对于 l ocally administered address地址,有些交换机和网桥不会转发包含了这样地址的帧。
而单播和多播就不多说了。The original MAC address comes from the original Ethernet addressing scheme. This 48-bit address space contains potentially 248 or 281,474,976,710,656 possible MAC addresses.
All three numbering systems use the same format and differ only in the length of the identifier. Addresses can either be "universally administered addresses" or "locally administered addresses".
A universally administered address is uniquely assigned to a device by its manufacturer; these are sometimes called "burned-in addresses" (BIA). The first three (in transmission order) identify the organization that issued the identifier and are known as the (OUI). The following three (MAC-48 and EUI-48) or five (EUI-64) octets are assigned by that organization in nearly any manner they please, subject to the constraint of uniqueness. The IEEE expects the MAC-48 space to be exhausted no sooner than the year 2100; EUI-64s are not expected to run out in the foreseeable future.
A locally administered address is assigned to a device by a network administrator, overriding the burned-in address. Locally administered addresses do not contain OUIs.
Universally administered and locally administered addresses are distinguished by setting the second of the most significant byte of the address. If the bit is 0, the address is universally administered. If it is 1, the address is locally administered. In the example address 06-00-00-00-00-01 the most significant byte is 06 (hex), the binary form of which is 00000110, where the second least significant bit is 1. Therefore, it is a locally administered address. Consequently, this bit is 0 in all OUIs.
If the least significant bit of the most significant octet of an address is set to 0 (zero), the frame is meant to reach only one receiving .[ ] This type of transmission is called . A unicast frame is transmitted to all nodes within the , which typically ends at the nearest or . Only the node with the matching hardware MAC address will accept the frame; network frames with non-matching MAC-addresses are ignored, unless the device is in promiscuous mode .[ ]
If the least significant bit of the most significant address octet is set to 1, the packet will still be sent only once; however, NICs will choose to accept it based on different criteria than a matching MAC address: for example, based on a configurable list of accepted multicast MAC addresses. This is called addressing.