组播mac地址什么用

Every piece of hardware on your local network has a MAC address in addition to the IP address assigned to it by the local router or server. What exactly is that MAC address for?

除了本地路由器或服务器分配给它的IP地址外,本地网络上的每个硬件都有一个MAC地址。 该MAC地址到底是做什么用的?

Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.

今天的“问答”环节由SuperUser提供,它是Stack Exchange的一个分支,该社区是由社区驱动的Q&A网站分组。

问题 (The Question)

SuperUser reader Vishnu Vivek is curious about MAC addresses and their function:

超级用户阅读器Vishnu Vivek对MAC地址及其功能感到好奇:

I understand that IP addresses are hierarchical, so that routers throughout the internet know which direction to forward a packet. With MAC addresses, there is no hierarchy, and thus packet forwarding would not be possible. So, MAC addresses are not used for packet transfer.

我知道IP地址是分层的,因此整个Internet上的路由器都知道转发数据包的方向。 对于MAC地址,没有层次结构,因此无法进行数据包转发。 因此,MAC地址不用于数据包传输。

I don’t think it sits there for no reason. So my question is, where exactly does a MAC address come into play during a packet transfer?

我认为它没有任何理由坐在那里。 所以我的问题是,在数据包传输期间,MAC地址究竟在哪里起作用?

Where indeed? What is the specific function of the MAC address?

确实在哪里? MAC地址的具体功能是什么?

答案 (The Answer)

SuperUser contributor Werner Henze offers some insight into the function of the MAC address:

超级用户贡献者Werner Henze提供了一些有关MAC地址功能的见解:

What are MAC addresses used for?

MAC地址是做什么用的?

MAC addresses are the low level basics that make your ethernet based network work.

MAC地址是使您的基于以太网的网络正常工作的基础知识。

Network cards each have a unique MAC address. Packets that are sent on the ethernet are always coming from a MAC address and sent to a MAC address. If a network adapter is receiving a packet, it is comparing the packet’s destination MAC address to the adapter’s own MAC address. If the addresses match, the packet is processed, otherwise it is discarded.

每个网卡都有一个唯一的MAC地址。 以太网上发送的数据包始终来自MAC地址,然后发送到MAC地址。 如果网络适配器正在接收数据包,则它将数据包的目标MAC地址与适配器自己的MAC地址进行比较。 如果地址匹配,则处理该包,否则将其丢弃。

There are special MAC addresses, one for example is ff:ff:ff:ff:ff:ff, which is the broadcast address and addresses every network adapter in the network.

有一些特殊的MAC地址,例如ff:ff:ff:ff:ff:ff:ff,它是广播地址,它寻址网络中的每个网络适配器。

How do IP addresses and MAC addresses work together?

IP地址和MAC地址如何协同工作?

IP is a protocol that is used on a layer above ethernet. Another protocol for example would be IPX.

IP是在以太网之上的一层上使用的协议。 例如,另一个协议是IPX。

When your computer wants to send a packet to some IP address x.x.x.x, then the first check is if the destination address is in the same IP network as the computer itself. If x.x.x.x is in the same network, then the destination IP can be reached directly, otherwise the packet needs to be sent to the configured router.

当您的计算机希望将数据包发送到某个IP地址xxxx时,首先要检查的是目标地址是否与计算机本身位于同一IP网络中。 如果xxxx在同一网络中,则可以直接访问目标IP,否则需要将数据包发送到已配置的路由器。

Up to now things seem to have gotten worse, because now we have two IP addresses: one is the original IP packet’s target address, the other is the IP of the device to which we should send the packet (the next hop, either the final destination or the router).

到目前为止,情况似乎变得越来越糟,因为现在我们有两个IP地址:一个是原始IP数据包的目标地址,另一个是我们应该向其发送数据包的设备的IP地址(下一跳,即最后一个跃点)目的地或路由器)。

Since ethernet uses MAC addresses, the sender needs to get the MAC address of the next hop. There is a special protocol ARP (address resolution protocol) that is used for that. Once the sender has retrieved the MAC address of the next hop, he writes that target MAC address into the packet and sends the packet.

由于以太网使用MAC地址,因此发送方需要获取下一跳的MAC地址。 为此使用了特殊的协议ARP(地址解析协议)。 一旦发送者检索到下一跳的MAC地址,他就将该目标MAC地址写入数据包并发送数据包。

How does ARP work?

ARP如何工作?

ARP itself is a protocol above ethernet, like IP or IPX. When a device wants to know the MAC address for a given IP address, it sends a packet to the broadcast MAC address asking “Who has IP address y.y.y.y?” All devices receive that packet, but only the one with the IP address y.y.y.y will respond with a packet “It’s me.” The asking device receives the answer and now knows that the source MAC address is the right MAC address to use. Of course the result will be cached, so the device does not need to resolve the MAC address every time.

ARP本身是以太网之上的协议,例如IP或IPX。 当设备想要知道给定IP地址的MAC地址时,它会向广播MAC地址发送一个数据包,询问“谁拥有IP地址yyyy?” 所有设备都接收到该数据包,但是只有IP地址为yyyy的设备才会响应一个数据包“是我”。 询问设备接收到答案,现在知道源MAC地址是要使用的正确MAC地址。 当然,结果将被缓存,因此设备无需每次都解析MAC地址。

Routing

路由

I almost forgot to mention: there is no routing based on MAC addresses. Low level ethernet and MAC addresses can only reach every device on the same network (cabled or wireless). If you have two networks with a router in between you cannot have a device in network A send a packet to the MAC address of a device in network B. No device in network A has the MAC address of the device in network B, so a packet to this MAC address will be discarded by all devices in the network A (also by the router).

我几乎忘了提:没有基于MAC地址的路由。 低级以太网和MAC地址只能到达同一网络(电缆或无线)上的每个设备。 如果您有两个网络,并且它们之间有路由器,则网络A中不能有设备将数据包发送到网络B中设备的MAC地址。网络A中没有设备具有网络B中设备的MAC地址,因此a到此MAC地址的数据包将被网络A中的所有设备(也包括路由器)丢弃。

Routing is done on IP level. Simply seen the router is just doing what I described above in the section “How do IP addresses and MAC addresses work together?”. The router will receive packets for its own MAC address but for a different IP address. He will then check if he can directly reach the target IP address. If so, he sends the packet to the target. Otherwise the router itself also has an upstream router configured and will send the packet to that router.

路由在IP级别完成。 可以简单地看到路由器正在执行我在上面的“ IP地址和MAC地址如何一起工作?”部分中描述的操作。 路由器将接收其自己的MAC地址但其他IP地址的数据包。 然后,他将检查他是否可以直接到达目标IP地址。 如果是这样,他将数据包发送到目标。 否则,路由器本身也会配置一个上游路由器,并将数据包发送到该路由器。

Of course you can have multiple routers configured. Your home router will only have one upstream router configured, but in the internet backbone the big routers have big routing tables so they know the best ways for all packets.

当然,您可以配置多个路由器。 您的家庭路由器将仅配置一个上游路由器,但是在Internet主干中,大型路由器具有大型路由表,因此它们知道所有数据包的最佳方法。

Other use cases for MAC addresses

MAC地址的其他用例

  1. Network switches store a list of MAC addresses seen at every port and only forward packets to the ports that need to see the packet.网络交换机存储在每个端口看到的MAC地址列表,并且仅将数据包转发到需要查看数据包的端口。
  2. Wireless access points often use MAC addresses for access control. They only allow access for known devices (MAC address is unique and identifies devices) with the correct passphrase.无线访问点通常使用MAC地址进行访问控制。 它们仅允许使用正确的密码访问已知设备(MAC地址是唯一的并标识设备)。
  3. DHCP servers use the MAC address to identify devices and give some devices fixed IP addresses.DHCP服务器使用MAC地址来识别设备,并为某些设备提供固定的IP地址。


Have something to add to the explanation? Sound off in the the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.

有什么补充说明吗? 在评论中听起来不对。 是否想从其他精通Stack Exchange的用户那里获得更多答案? 在此处查看完整的讨论线程 。

翻译自: https://www.howtogeek.com/169540/what-exactly-is-a-mac-address-used-for/

组播mac地址什么用

组播mac地址什么用_MAC地址到底是用来做什么的?相关推荐

  1. 【计算机网络】网络层 : IP 组播 ( IP 数据报传输方式 | 组播 IP 地址 | 组播 MAC 地址 | IGMP 协议 | 组播路由选择协议 )

    文章目录 一.IP 数据报传输方式 二.组播 IP 地址 三.组播 MAC 地址 四.IGMP 协议 五.组播路由选择协议 一.IP 数据报传输方式 IP 数据报传输方式 : ① 单播 : 发送数据到 ...

  2. 组播MAC地址和各类IP地址

    MAC地址是以太网二层使用的一个48bit(6字节十六进制数)的地址,用来标识设备位置.MAC地址分成两部分,前24位是组织唯一标识符(OUI, Organizationally unique ide ...

  3. 【博客546】组播IP地址与组播MAC地址的联系与转换

    组播IP地址与组播MAC地址的联系与转换 先直观感受一下ipv4的转换 ip多播地址: 对应mac多播地址: ipv4,ipv6各种情况 ip组播地址 mac组播地址

  4. 单播、广播和多播地址以及组播ip与组播mac间的换算

    转自:https://www.cnblogs.com/songdada/articles/4039468.html 除地址类外,还可根据传输的消息特征将IP地址分为单播.广播或多播.主机使用IP地址进 ...

  5. 组播MAC和单播MAC地址区别

    组播MAC和单播MAC地址区别 组播MAC地址与单播MAC地址的区别: xxxx xxx1 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx 组播MA ...

  6. IPv4/IPv6组播地址和组播MAC地址的转换

    IPv4地址的组播MAC地址: 组播MAC地址高24位固定为0x01005E,第25位为0 组播MAC地址低23位为IPv4地址的低23位 以上规则是IANA规定的,因为IPv4组播地址的高4位是11 ...

  7. linux配置添加组播mac地址,端口静态添加组播MAC地址如何实现

    端口静态添加组播MAC地址如何实现 组播MAC地址是一类逻辑的MAC地址,该MAC地址代表一个组播组,所有属于该组的成员都接收以该组对应的组播MAC地址为目的地址的'数据帧.下面是YJBYS小编整理的 ...

  8. 组播ip mac转换 c语言,组播IP地址与组播MAC地址之间的换算方法与例子

    组播IP地址与组播MAC地址之间的换算方法与例子 1个oui 有2 的24方个MAC地址 组播地址 :2的28次方,224.0.0.0-239.255.255.255 可用组播范围:0100.5E00 ...

  9. 组播MAC/IPv4/IPv6地址

    IPV4组播地址 分类 地址范围 含义 永久组播地址 224.0.0.0–224.0.0.255 永久组播地址(为特定协议分配) 224.0.0.1 网段内所有主机和路由器(等效于广播地址) 224. ...

最新文章

  1. 0元力压0.1元,中国电信中标连云港政务云项目
  2. Netty之实现一个简单的群聊系统
  3. 缓存与数据库的一致性:先操作缓存还是先操作数据库?
  4. csapp bufbomb实验
  5. 诗与远方:无题(三十)- 凄凉缘空
  6. mysql约束类型 A P_sql数据类型与约束总结
  7. 认识C#中的委托和事件
  8. 设计模式:观察者(Observer)模式
  9. 学python语言有前途吗-学习python的前景怎么样?
  10. 从零开始--系统深入学习android(实践-让我们开始写代码-Android框架学习-3. 菜单)...
  11. 第三季-第13课-无名管道通讯编程
  12. 17个值得收藏的国内外短信接码平台合集
  13. Leetcode--用两个栈实现一个队列
  14. 循迹避障小车制作第一篇(tb6612模块与降压模块的使用)
  15. python交通流预测代码,使用python进行交通流量预测
  16. 网络邻居计算机访问权限设置,windows7不能访问网上邻居的原因及解决方法
  17. java闰年2月有多少_java计算两个时间相隔月数,考虑闰年
  18. 西直门立交桥的破事儿
  19. 专访Riverbed CEO:私有化和出售业务瘦身后的Riverbed更专注
  20. BZOJ_2393_Cirno的完美算数教室BZOJ_1853_[Scoi2010]幸运数字 _深搜+容斥原理

热门文章

  1. linux的 dev vdb,LVM 操作: /dev/vdb
  2. android studio上实现Hello world 史上最全,最简单明了的教程
  3. 港股指数实时行情数据 API 接口
  4. 快速Mockito教程
  5. 提升丨学习,偷偷卷起来吧
  6. css 剪辑图片_使用CSS的clip-path实现图片剪切效果
  7. Linux ARM平台开发系列讲解(CAN) 2.14.3 CANFD协议介绍
  8. tftp服务器从交换机上下载配置命令_若要将交换机中的映像文件备份到TFTP服务器,其配置命令为( )。(2分)...
  9. php上个月,PHP获取上个月、下个月、本月的日期(strtotime(),date())
  10. Windows CreateEvent,SetEvent,WaitForSingleObject的用法