为什么服务器不能像客户端IP一样获取客户端MAC地址? [英] Why can't the server get the client MAC address, like the client IP?

查看:49
本文介绍了为什么服务器不能像客户端IP一样获取客户端MAC地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,数据包经过的所有 MAC 地址都在数据包中.这是因为进入某个路径的每个数据包也应该在相似的路径中返回.那么,如果服务器的路由器知道客户端的mac地址(所有),为什么服务器页面(如aspx)不能有这个信息?

From what I know, all the MAC addresses that the packet gone through are in the packet. This is because that each packet that goes in a certain path, should also be returned in similar path. So, if the router of the server know about the mac address of the client (all of them), why the server page (like aspx) cannot have this information?

请给个解释.(不要只是告诉我我错了).

Please, give an explanation. (don't just tell me that I'm wrong).

如果我理解正确,客户端会发送一个包含其 MAC 地址的数据包.当数据包通过代理(如客户端路由器)时,代理的地址也会添加到数据包中.等等.

If I understand it correctly, the client sends a packet that contains it's MAC address. when to packet go through a proxy (like the client router), the proxy's address is added to the packet too. and so on.

以下是维基百科关于 TCP/IP 数据线层的片段:
http://en.wikipedia.org/wiki/TCP/IP_model#Data_Link_Layer

Here is a snippet from Wikipedia about the TCP/IP data line layer:
http://en.wikipedia.org/wiki/TCP/IP_model#Data_Link_Layer

数据链路层用于移动Internet 层之间的数据包两个不同主机的接口同一个链接.的过程发送和接收数据包既可以控制一个给定的链接软件设备驱动程序网卡,以及固件或专用芯片组.这些将执行数据链接功能,例如添加一个数据包头来准备它用于传输,然后实际上通过物理传输帧中等的.TCP/IP 模型包括翻译规范使用的网络寻址方法互联网协议到数据链路寻址,例如媒体访问控制 (MAC),但所有其他低于该水平的方面是隐含地假设存在于链路层,但没有明确定义.

The Data Link Layer is used to move packets between the Internet Layer interfaces of two different hosts on the same link. The processes of transmitting and receiving packets on a given link can be controlled both in the software device driver for the network card, as well as on firmware or specialized chipsets. These will perform data link functions such as adding a packet header to prepare it for transmission, then actually transmit the frame over a physical medium. The TCP/IP model includes specifications of translating the network addressing methods used in the Internet Protocol to data link addressing, such as Media Access Control (MAC), however all other aspects below that level are implicitly assumed to exist in the Link Layer, but are not explicitly defined.

推荐答案

实际上,存储在数据包中的 MAC 地址在数据包旅程的每一跳都会改变.

Actually, the MAC-address stored in the packet is changed on every hop of a packet's journey.

MAC 是媒体访问控制的简写,媒体指的是本地通信媒体.虽然源和目标 IP 地址在整个旅程中保持相同(并用于长距离路由决策),但源和目标 MAC 地址仅指示下一跳.

MAC is shorthand for Media Access Control, with media refering to the local communication media. While source and destination IP-Addresses remain the same throughout the journey (and are used for long-distance routing decisions), the source and destination MAC-Addresses just indicate the next hop.

因此,您的服务器接收到的数据包中存储的 MAC 地址应该是您的存在点路由器或您的提供商的设备的 MAC 地址.

Because of this, the MAC-Address stored in packets received by your server should be the MAC address of your point of presence-router, or of the equipment of your provider.

您可能想看看 OSI 层模型封装.

You might want to have a look at the OSI Layer model and encapsulation.

这篇关于为什么服务器不能像客户端IP一样获取客户端MAC地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆