MAC地址(计算机用语)

由网友(护你余生无忧)分享简介:MAC地址,别称局域网地址、以太网地址、物理地址,直译为媒体存与节制位址,是用去确认收集设备位置的位址。MAC地址的少度为四八位(六个字节),凡是暗示为一二个一六入制数。MAC地址用于正在收集中独一标示1个网卡,1台设备如有1或者多个网卡,则每一个网卡都需求并会有1个独一的MAC地址。经由过程MAC地址过滤技能可以包管受权的MA...

MAC地址,别称局域网地址、以太网地址、物理地址,直译为媒体存取控制位址,是用来确认网络设备位置的位址。

苹果电脑带上飞机 苹果电脑mac能托运吗 系统城

MAC地址的长度为48位(6个字节),通常表示为12个16进制数。MAC地址用于在网络中唯一标示一个网卡,一台设备若有一或多个网卡,则每个网卡都需要并会有一个唯一的MAC地址。通过MAC地址过滤技术可以保证授权的MAC地址能对网络资源进行访问。[1]

中文名

MAC地址

全称

Media Access Control地址

释义

用来定义网络设备的位置

字节

六个字节

运用领域

计算机[2]

外文名

MAC Address

别称

硬件地址

表示

十六进制数

特性

产品出产后Mac地址就固定了

基本概述

MAC地址(MAC Address)

MAC(Medium/Media Access Control)地址,用来表示互联网上每一个站点的标识符,采用十六进制数表示,共六个字节(48位)。其中,前三个字节是由IEEE的注册管理机构RA负责给不同厂家分配的代码(高位24位),也称为“编制上唯一的标识符”(Organizationally Unique Identifier),后三个字节(低位24位)由各厂家自行指派给生产的适配器接口,称为扩展标识符(唯一性)。一个地址块可以生成224个不同的地址。MAC地址实际上就是适配器地址或适配器标识符EUI-48。

详细解释

MAC(Media Access Control,介质访问控制)地址,也叫硬件地址,长度是48比特(6字节),由16进制的数字组成,分为前24位和后24位:

  • 前24位叫做组织唯一标志符(Organizationally Unique Identifier,即OUI),是由IEEE的注册管理机构给不同厂家分配的代码,区分了不同的厂家。
  • 后24位是由厂家自己分配的,称为扩展标识符。同一个厂家生产的网卡中MAC地址后24位是不同的。

MAC地址对应于OSI参考模型的第二层数据链路层,工作在数据链路层的交换机维护着计算机MAC地址和自身端口的数据库,交换机根据收到的数据帧中的“目的MAC地址”字段来转发数据帧。

其中第1字节的第8Bit(如图中00-50-BA-...对应的00000000-01010000-10111010-...,加粗字体的Bit)标识这个地址是组播地址还是单播地址。这是由以太网的传输协议高字节先传,但每一字节内低位先传的特性所决定的,见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.”。事实上这传输的顺序为000000000000101001011101...“The first bit (LSB)”即是前言的第8Bit。

网卡的物理地址通常是由网卡生产厂家烧入网卡的EPROM(一种闪存芯片,通常可以通过程序擦写),它存储的是传输数据时真正赖以标识发出数据的电脑和接收数据的主机的地址。

也就是说,在网络底层的物理传输过程中,是通过物理地址来识别主机的,它一定是全球唯一的。比如,著名的以太网卡,其物理地址是48bit(比特位)的整数,如:44-45-53-54-00-00,以机器可读的方式存入主机接口中。以太网地址管理机构(除了管这个外还管别的)(IEEE)(IEEE:电气和电子工程师协会)将以太网地址,也就是48比特的不同组合,分为若干独立的连续地址组,生产以太网网卡的厂家就购买其中一组,具体生产时,逐个将唯一地址赋予以太网卡。

形象地说,MAC地址就如同我们身份证上的身份证号码,具有全球唯一性。

作用介绍

谈起MAC地址,不得不说一下IP地址。IP地址工作在OSI参考模型的第三层网络层。两者之间分工明确,默契合作,完成通信过程。IP地址专注于网络层,将数据包从一个网络转发到另外一个网络;而MAC地址专注于数据链路层,将一个数据帧从一个节点传送到相同链路的另一个节点。

在一个稳定的网络中,IP地址和MAC地址是成对出现的。如果一台计算机要和网络中另一外计算机通信,那么要配置这两台计算机的IP地址,MAC地址是网卡出厂时设定的,这样配置的IP地址就和MAC地址形成了一种对应关系。在数据通信时,IP地址负责表示计算机的网络层地址,网络层设备(如路由器)根据IP地址来进行操作;MAC地址负责表示计算机的数据链路层地址,数据链路层设备(如交换机)根据MAC地址来进行操作。IP和MAC地址这种映射关系由ARP(Address Resolution Protocol,地址解析协议)协议完成。

IP地址就如同一个职位,而MAC地址则好像是去应聘这个职位的人才,职位既可以让甲坐,也可以让乙坐,同样的道理一个结点的IP地址对于网卡是不做要求,基本上什么样的厂家都可以用,也就是说IP地址与MAC地址并不存在着绑定关系。本身有的计算机流动性就比较强,正如同人才可以给不同的单位干活的道理一样的,人才的流动性是比较强的。职位和人才的对应关系就有点像是IP地址与MAC地址的对应关系。比如,如果一个网卡坏了,可以被更换,而无须取得一个新的IP地址。如果一个IP主机从一个网络移到另一个网络,可以给它一个新的IP地址,而无须换一个新的网卡。当然MAC地址除了仅仅只有这个功能还是不够的,就拿人类社会与网络进行类比,通过类比,我们就可以发现其中的类似之处,更好地理解MAC地址的作用。无论是局域网,还是广域网中的计算机之间的通信,最终都表现为将数据包从某种形式的链路上的初始结点出发,从一个结点传递到另一个结点,最终传送到目的结点。数据包在这些节点之间的移动都是由ARP负责将IP地址映射到MAC地址上来完成的。其实人类社会和网络也是类似的,试想在人际关系网络中,甲要捎个口信给丁,就会通过乙和丙中转一下,最后由丙 转告给丁。在网络中,这个口信就好比是一个网络中的一个数据包。数据包在传送过程中会不断询问相邻节点的MAC地址,这个过程就好比是人类社会的口信传送过程。相信通过这两个例子,我们就可以进一步理解MAC地址的作用。

MAC地址与IP地址区别

IP地址和MAC地址相同点是它们都唯一,不同的特点主要有:

  1. 对于网络上的某一设备,如一台计算机或一台路由器,其IP地址是基于网络拓扑设计出的,同一台设备或计算机上,改动IP地址是很容易的(但必须唯一),而MAC则是生产厂商烧录好的,一般不能改动。我们可以根据需要给一台主机指定任意的IP地址,如我们可以给局域网上的某台计算机分配IP地址为192.168.0.112 ,也可以将它改成192.168.0.200。而任一网络设备(如网卡,路由器)一旦生产出来以后,其MAC地址不可由本地连接内的配置进行修改。如果一个计算机的网卡坏了,在更换网卡之后,该计算机的MAC地址就变了。
  2. 长度不同。IP地址为32位,MAC地址为48位。
  3. 分配依据不同。IP地址的分配是基于网络拓扑,MAC地址的分配是基于制造商。
  4. 寻址协议层不同。IP地址应用于OSI第三层,即网络层,而MAC地址应用在OSI第二层,即数据链路层。 数据链路层协议可以使数据从一个节点传递到相同链路的另一个节点上(通过MAC地址),而网络层协议使数据可以从一个网络传递到另一个网络上(ARP根据目的IP地址,找到中间节点的MAC地址,通过中间节点传送,从而最终到达目的网络)。

获取方法

在Windows 2000/XP/Vista/7中

单击开始,点击运行,输入cmd,进入后输入ipconfig /all 即可。(或者输入ipconfig -all)(如图1所示)

Physical Address. . . . . . . . . : 00-23-5A-15-99-42

单击开始,点击运行,输入cmd,进入后输入getmac即可。

另外,还可以通过查看本地连接获取MAC地址:依次单击“本地连接”→“状态”——“常规”→“详细信息”。 即可看到MAC地址(实际地址),如图2所示。

linux/unix

在命令行输入ipconfig即可看到MAC地址,如图3所示:

修改方法

其实更改网卡MAC地址的功能不论98、Win7、2000还是XP,都已经提供了,只是平时大家都没有注意到而已。下面我就说说怎么更改。

win8

1、右击桌面右下角的网络连接图标,点击“打开网络和共享中心”。

2、点击“更改适配器设置”,选择本地连接或以太网,右击,选择属性,

3、点击“网络”下的配置,配置里面的“高级”。

4、找到“网络地址”,填写mac地址(物理地址/物理ip)。

Win7

①点击桌面右下角电源与音量之间的网络连接按钮,在弹出的对话框最下端有“打开网络和共享中心”。

②点击“更改适配器设置”选取要更改的网络连接,点击属性

③在执行②后会弹出连接属性对话框,点击“配置”

④点击“高级”,在属性中选择网络地址(network address),点击左面的“值”,输入你所需的MAC地址后点击确定即可。

注意:在修改无线网卡地址的时候,Win7对地址做出一个限制。MAC出厂地址12个数字可以是0-9,A-F任何一个数字,但是在Win7软件修改地址的时候,MAC地址的第二位必须是2,6,A,或者E。

xy:xx:xx:xx:xx:xx

x=0-9,A-F

y=2,6,A或者E

Win2000

好了,先来看看WIN2000。在桌面上网上邻居图标上点右键,选"属性",在出来的"网络和拨号连接"窗口中一般有两个图标,一个是"新建连接"图标,一个是"我的连接"图标。如果你的机器上有两个网卡的话,那就有三个图标了。如果你只有一个网卡,那就在"我的连接"图标上点右键,选"属性",会出来一个"我的连接 属性"的窗口。在图口上部有一个"连接时使用:"的标识,下面就是你机器上的网卡型号了。在下面有一个"配置"按钮,点击该按钮后就进入了网卡的属性对话框了,这个对话框中有五个属性页,点击第二项"高级"页,在"属性"标识下有两项:一个是"Link Speed/Duplex Mode",这是设置网卡工作速率的,我们需要改的是下面一个"Network Address",点击该项,在对话框右边的"值"标识下有两个单选项,默认得是"不存在" ,我们只要选中上面一个单选项,然后在右边的框中输入你想改的网卡MAC地址,点"确定",等待一会儿,网卡地址就改好了,你甚至不用停用网卡!

另外,你也可以在"设置管理器"中,打开网卡的属性页来修改,效果一样。WINXP的修改方法跟WIN2000一样。

如果你想把网卡的MAC地址恢复原样,只要再次把"Network Address"项右边的单选项选择为下面一个"没有显示"再重新启动即可。在WIN2000、XP、WIN7下面是选择"不存在",当然也不用重新启动了。

  1. 1.修改注册表

几乎所有的网卡驱动程序都可以被NdisReadNetworkAddress参数调用,以便从注册表中读取一个用户指定的MAC地址。当驱动程序确定这个MAC地址是有效的,就会将这个MAC地址编程入其硬件寄存器中,而忽略网卡固有的MAC地址。我们通过手工修改Windows的注册表就可以达到目的。

在Winodws 98下运行Windows的注册表编辑器,展开“HKEY_LOCAL_MACHINESystemCurrent ControlSetServicesClassNet”,会看到类似“0000”、“0001”、“0002”的子键。从“0000”子键开始点击,依次查找子键下的“DriverDesc”键的内容,直到找到与我们查找的目标完全相同的网卡注册表信息为止。

当找到正确的网卡后,点击下拉式菜单“编辑/新建/字符串”,串的名称为“Networkaddress”,在新建的“Networkaddress”串名称上双击鼠标就可以输入数值了。输入你想指定的新的MAC地址值。新的MAC地址应该是一个12位的十六进制数字或字母,其间没有“-”,类似12个零的这样的数值(注意,在Windows 98和Windows 2000/XP中具体键值的位置稍有不同,大家可通过查找功能来寻找)。

在“NetworkAddress”下继续添加一个名为 “ParamDesc”的字串值,它将作为“NetworkAddress”项的描述,数值可以取为“MAC Address”。再把它的内容修改为你想设定的内容。如图所示。

这样,我们就成功地修改了网卡的MAC地址,重新启动计算机即可。

  1. 修改网卡属性

大部分的网卡都可以通过在控制面板中修改网卡属性来更改其MAC地址,笔者的3COM 3C905B-TX和RTL8139芯片的网卡都可以这样轻松修改。

在“设备管理器中”,右键点击需要修改MAC地址的网卡图标,并选择“属性/高级”选项卡。在“属性”区,就可以看到一个称作“Network Address”或其他相类似名字的的项目,点击它,在右侧“值”的下方,输入要指定的MAC地址值。要连续输入12个十六进制数字或字母,不要在其间输入“-”。重新启动系统后设置就会生效了。

如果是Windows 2000/XP的用户,则可以使用免费MAC地址修改软件SMAC。运行SMAC后,窗口中的列表框列出计算机上正处于工作状态的网卡。选定要修改的网卡后,在列表框下方的六个输入框中输入新的MAC地址后,点击右侧的“Update MAC(修改MAC地址)”,即可完成MAC地址的修改。

应用介绍

平日身份证的作用并不是很大,但是到了有的关键时刻,身份证就是用来证明你的身份的。比如你要去银行提取现金,这时就要用到身份证。那么MAC地址与IP地址绑定就如同我们在日常生活中的本人携带自己的身份证去做重要事情一样的道理。有的时候,我们为了防止IP地址被盗用,就通过简单的交换机端口绑定(端口的MAC表使用静态表项),可以在每个交换机端口只连接一台主机的情况下防止修改MAC地址的盗用,如果是三层设备还可以提供:交换机端口/IP/MAC 三者的绑定,防止修改MAC的IP盗用。一般绑定MAC地址都是在交换机和路由器上配置的,是网管人员才能接触到的,对于一般电脑用户来说只要了解了绑定的作用就行了。比如你在校园网中把自己的笔记本电脑换到另外一个宿舍就无法上网了,这个就是因为MAC地址与IP地址(端口)绑定引起的。

攻击方法

ARP欺骗技术已经很成熟了,这里也不再阐述。此次重点讲解如何不用ARP欺骗进行嗅探以及会话劫持的技术原理,实际的攻击方法是进行MAC欺骗的原理,亦即根据附近共享的资源和自带的资源里带有BK,然后取得一些客户资料,算是商业间谍吧,只是这个更隐蔽具有很高的安全性。平常的ID和address都是可以不加密。

原理:在开始之前我们先简单了解一下交换机转发过程:交换机的一个端口收到一个数据帧时,首先检查该数据帧的目的MAC地址在MAC地址表(CAM)对应的端口,如果目的端口与源端口不为同一个端口,则把帧从目的端口转发出去,同时更新MAC地址表中源端口与源MAC的对应关系;如果目的端口与源端口相同,则丢弃该帧。

英文资料

In computer networking a Media Access Control address (MAC address) or Ethernet Hardware Address (EHA) or hardware address or adapter address is a quasi-unique identifier attached to most network adapters (NIC or Network Interface Card). It is a number that serves as an identifier for a particular network adapter. Thus network cards (or built-in network adapters) in two different computers will have different MAC addresses, as would an Ethernet adapter and a wireless adapter in the same computer, and as would multiple network cards in a router. However, it is possible to change the MAC address on most of today's hardware, often referred to as MAC spoofing.

Most layer 2 network protocols use one of three numbering spaces managed by the Institute of Electrical and Electronics Engineers (IEEE): MAC-48, EUI-48, andEUI-64, which are designed to be globally unique. Not all communications protocols use MAC addresses, and not all protocols require globally unique identifiers. The IEEE claims trademarks on the names "EUI-48" and "EUI-64" ("EUI" stands for Extended Unique Identifier).

MAC addresses, unlike IP addresses and IPX addresses, are not divided into "host" and "network" portions. Therefore, a host cannot determine from the MAC address of another host whether that host is on the same layer 2 network segment as the sending host or a network segment bridged to that network segment.

ARP is commonly used to convert from addresses in a layer 3 protocol such as Internet Protocol (IP) to the layer 2 MAC address. On broadcast networks, such as Ethernet, the MAC address allows each host to be uniquely identified and allows frames to be marked for specific hosts. It thus forms the basis of most of the layer 2 networking upon which higher OSI Layer protocols are built to produce complex, functioning networks.

Contents [hide]

1 Notational conventions

2 Address details OSI snd sabyujizz come whereyonumg classmate

2.1 Individual address block

3 Bit-reversed notation by nothing whey sometimes ther fell

4 See also But caminong of Yoilonger

5 References

6 External links beat hotter address

[edit] Notational conventions

The standard (IEEE 802) format for printing MAC-48 addresses in human-readable media is six groups of two hexadecimal digits, separated by hyphens (-) in transmission order, e.g. 01-23-45-67-89-ab. This form is also commonly used forEUI-64. Other conventions include six groups of two separated by colons (:), e.g. 01:23:45:67:89:ab; or three groups of four hexadecimal digits separated by dots (.), e.g. 0123.4567.89ab; again in transmission order.

[edit] Address details of ID porexpect localy eonjiong perctayen

The original IEEE 802 MAC address comes from the original Xerox Ethernet addressing scheme.[1] 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 a address is uniquely assigned to a device by its manufacturer; these are sometimes called "burned-in addresses" (BIA). The first three octets (in transmission order) identify the organization that issued the identifier and are known as the Organizationally Unique Identifier (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 least significant bit 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. The bit is 0 in all OUIs. For example, The most significant byte is 02h. The binary is 00000010 and the second least significant bit is 1. Therefore, it is a locally administered address.[2]

If the least significant bit of the most significant byte is set to a 0, the packet is meant to reach only one receiving NIC. This is called unicast. If the least significant bit of the most significant byte is set to a 1, the packet is meant to be sent only once but still reach several NICs. This is called multicast.

MAC-48 and EUI-48 addresses are usually shown in hexadecimal format, with each octet separated by a dash or colon. An example of a MAC-48 address would be "00-08-74-4C-7F-1D". If you cross-reference the first three octets with IEEE's OUI assignments,[3] you can see that this MAC address came from Dell Computer Corp. The last three octets represent the serial number assigned to the adapter by the manufacturer.

The following technologies use the MAC-48 identifier format:

Ethernet

802.11wireless networks

Bluetooth

IEEE 802.5token ring and pectuikg wiff ssigned

most other IEEE 802 networks

FDDIreadable media is six groups and seven inmporint Exp

ATM (switched virtual connections only, as part of an NSAP address)

Fibre Channel and Serial Attached SCSI (as part of a World Wide Name)

The distinction between EUI-48 and MAC-48 identifiers is purely semantic: MAC-48 is used for network hardware; EUI-48 is used to identify other devices and software. (Thus, by definition, an EUI-48 is not in fact a "MAC address", although it is syntactically indistinguishable from one and assigned from the same numbering space.)

The IEEE now considers the label MAC-48 to be an obsolete term which was previously used to refer to a specific type of EUI-48 identifier used to address hardware interfaces within existing 802-based networking applications and should not be used in the future. Instead, the term EUI-48 should be used for this purpose.

EUI-64 identifiers are used in:

FireWire

IPv6 (as the low-order 64 bits of a unicast network address when temporary addresses are not being used)

ZigBee /802.15.4wireless personal-area networks

The IEEE has built in several special address types to allow more than one Network Interface Card to be addressed at one time:

Packets sent to the broadcast address, all one bits, are received by all stations on a local area network. In hexadecimal the broadcast address would be "FF:FF:FF:FF:FF:FF".00.101.22.01.112.10.12

Packets sent to a multicast address are received by all stations on a LAN that have been configured to receive packets sent to that address.

Functional addresses identify one of more Token Ring NICs that provide a particular service, defined in IEEE 802.5.

These are "group addresses", as opposed to "individual addresses"; the least significant bit of the first octet of a MAC address distinguishes individual addresses from group addresses. That bit is set to 0 in individual addresses and 1 in group addresses. Group addresses, like individual addresses, can be universally administered or locally administered.

In addition, the EUI-64 numbering system encompasses both MAC-48 and EUI-48 identifiers by a simple translation mechanism. To convert a MAC-48 into an EUI-64, copy the OUI, append the two octets "FF-FF", and then copy the organization-specified part. To convert an EUI-48 into an EUI-64, the same process is used, but the sequence inserted is "FF-FE". In both cases, the process can be trivially reversed when necessary. Organizations issuing EUI-64s are cautioned against issuing identifiers that could be confused with these forms. The IEEE policy is to discourage new uses of 48-bit identifiers in favor of the EUI-64 system.

IPv6—one of the most prominent standards that usesEUI-64—applies these rules inconsistently. Due to an error in the appendix to the specification of IPv6 addressing, it is standard practice to extend MAC-48 addresses (such as IEEE 802 MAC address) to EUI-64 using "FF-FE" rather than "FF-FF."

[edit] Individual address block

An Individual Address Block comprises a 24-bit OUI managed by the IEEE Registration Authority, followed by 12 IEEE-provided bits (identifying the organization), and 12 bits for the owner to assign to individual devices. An IAB is ideal for organizations requiring fewer than 4097 unique 48-bit numbers (EUI-48).[4]

[edit] Bit-reversed notation

The standard transmission order notation for MAC addresses, as seen in the output of the ifconfig command for example, is also called canonical format.

However, sinceIEEE 802.3(Ethernet) and IEEE 802.4 (Token Bug) send the bits over the wire with least significant bit first, while IEEE 802.5 (Token Ring) and IEEE 802.6 send the bits over the wire with most significant bit first, confusion may arise where an address in the latter scenario is represented with bits reversed from the canonical representation. So for instance, an address whose canonical form is 12-34-56-78-9A-BC would be transmitted over the wire as bits 0100 001011 01101010 00011110 01011001 00111101in the standard transmission order (least significant bit first). But for Token Ring networks, it would be transmitted as bits 00010010 00110100 01010110 01111000 10011010 10111100 in most significant bit first order. If care is not taken to translate correctly and consistently to the canonical representation, the latter might be displayed as 482C6A1E593D, which could cause confusion. This would be referred to as "Bit-reversed order", "Non-canonical form", "MSB format", "IBM format", or "Token Ring format" as explained by RFC 2469. Canonical form is preferred[anything].

[edit] See also

NSAP address, another endpoint addressing scheme.

Cisco Hot Standby Router Protocol or standard alternative VRRP Virtual router redundancy protocol, which allows multiple routers to share one IP address and MAC address to provide router redundancy. The OpenBSD project has an open source alternative, the Common Address Redundancy Protocol (CARP).

释疑问答

介绍:这个实例用IP-以太网说明组播和太网组播的关系,及以太网组播的细节过程。

  1. 什么是IP组播?协议层常需要和组群打交道,进行发现、通知、查询等工作。IP用组播IP地址在第三层组播,一个multicast IP address 可以有多个成员,组播数据包会被IP层路由器转发到组群成员所在的路由器,然后用以太网的组播功能把数据包送到组播成员的网卡接口。例,OSPF 用Hello来发现局域网中的OSPF邻居,HSRP发送Hello组播包把自己的状态通知其它的HSRP路由器,组播的路由器可以从一个技术终端发到任何的连接点,成为共享资源,其中一些被屏蔽的信息参数就有可能不被加密而被后面的连接点所共享,并且有收藏及版权,因为这些的流通的数据电脑是不会记录数据传输及浏览痕迹,正所谓有利就有弊。
  2. 以太网怎么组播(multicast)的?以太网具有广播属性,一个节点发送的数据包会被以太网洪泛,导致每一个以太网网卡接口都会收到这个数据包,有的时候会造成数据的泛滥和垃圾资源的共享,这样的就造成了大量的BK的携带更加方便与隐蔽,我的建议是给自己的IP设置一个屏蔽的功能或是设置一定的访问权限,安装类似防火墙的POB,对于外界即使是可以共享的资源软件具备筛选的功能。接口收到数据包后,并不马上交给节点CPU处理,而是进行MAC地址比较,如果数据包的目的MAC,这样有的人会觉得麻烦,只是个温暖的建议,地址和接口的MAC地址一样,它才接受,把数据包交给计算机,否则就把数据包丢弃。组群成员的网卡接口除了硬件MAC地址 (unicast MAC),还有组播MAC地址 (multicast MAC)。接口收到组播包,会把此包的目的MAC地址 (是个组播MAC)和自己的MAC地址比较,如果组播地址相同,就会接受此包。这样,局网内这个组群的所有成员,都会收到送往该组群的组播包。但是,IP的组播地址和以太网接口的组播MAC地址是什么关系呢?
  3. IP-Ethernet 的组播地址有什么关系?许多MAC组播地址是从IP组播地址转换而来,这就是所谓的资源共享,选择的时候需谨慎。

例,OSPF IP组播地址是224.0.0.5, 转换为相应的MAC组播地址如下:

  1. 把IP地址(32位)用二进制表现 11100000: 00000000: 00000000: 00000101
  2. 然后抽出最右边的23叫做A 0000000: 00000000: 00000101
  3. 把IEE定义的组播01:00:5e作为B. B有24位 (二进制是 00000001:00000000:01011110)
  4. 合成相应的MAC组播地址如下:

连接 B,0,A: B有24位,在左边; 0是一位,在中间,A有23位,在右边。共48位。. 二进制是 00000001:00000000:01011110:00000000: 00000000: 00000101

十六进制是 01:00:5e:00:00:05

  1. 有多少个IP组播地址?答:IP协议把224.0.0.0 ~ 239.255.255.255之间的IP地址都用做IP组播地址。以下列出前几个组播地址。 224.0.0.0 Base address (reserved) 224.0.0.1 The All Hosts multicast group that contains all systems on the same network segment 224.0.0.2 The All Routers multicast group that contains all routers on the same network segment 224.0.0.5 The Open Shortest Path First (OSPF) AllSPFRouters address. Used to send Hello packets to all OSPF routers on a network segment 224.0.0.6。The OSPF AllDRouters address. Used to send OSPF routing information to OSPF designated routers on a network segment 224.0.0.9 The RIP version 2 group address. Used to send routing information using the RIP protocol to all RIP v2-aware routers on a network segment 224.0.0.10 EIGRP group address. Used to send EIGRP routing information to all EIGRP routers 。 5) 有没有以太网专用的MAC组播地址?以下列出一些以太网专用的组播地址 Ethernet multicast address Type Field Usage 01-00-0C-CC-CC-CC 0x0802 CDP (Cisco Discovery Protocol), VTP (VLAN Trunking ) 01-00-0C-CC-CC-CD 0x0802 Cisco Shared Spanning Tree Protocol Address 01-80-C2-00-00-00 0x0802 Spanning Tree Protocol (for bridges) IEEE 802.1D

传递方法

【注】为突出重点,本文只讨论IP-以太网的知识点。

  1. IP-以太网怎么配合传送数据包? IP的任务是把原计算机发送的数据包经路由器转发到最后一站路由器,然后以太网把数据包从路由器传送给目的计算机。方法是使用数据包的报头: - 把IP报头的目的IP地址设为目的计算机的IP地址,路由器根据1这个地址查看路由表而把数据包转发到 下一站。一站一站的发展,最后把数据包转发到目的计算机所在的路由器。 - 把Link报头的目的MAC地址设为目的计算机的MAC地址。以太网洪泛,把数据包收到每一段网内的决定, 但只有目的计算机会接受,其它节点不会接受。

2)路由器怎么转发数据包?路由协议计算出传送路径,存放在路由器的路由表里。路由器上的数据包时,抽出报头里的目的计算机的目的IP地址,路由查看路由表,找到下一站的接口,把数据包从这个接口转发,抵达下一站。IP地址,路由器转发。

  1. 以太网怎么把数据包传递给目的计算机? 以太网内的计算机用网卡连接到以太网。一个网卡可以有几个接口1。每个网卡接口都配置一个IP地址,和一个固定的硬件地址 (hardware address),也叫做单播MAC地址 (Unicast MAC)。 由于以太网有广播的属性,数据包经路由器的以太网接口转发时,会被洪泛到以太网中所有的接口,网卡接口在收到一个数据包时,把数据包的目的MAC地址和自己的unicast MAC地址比较,若相同,就接受此包,否则丢弃。这样,只有接收方的技术会接收此包,其它接口会丢弃此包。
  2. 怎么配置数据包的报头?计算机发送信息前得先封装报头,把报头和数据合起来,成为一个数据包,发送时以数据包为单位。 - 数据 (payload) 是计算机所要传递的信息。 - 报头(header) 包含网络设备、协议所需的控制信息,与OSI模式的layer相应。常见的报头有link, IP, transport 等 (二,三,四层)。

阅读全文

相关推荐

最新文章