client-server - 为什么服务器无法获取客户端MAC地址,如客户端IP?

标签 client-server tcp mac-address

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

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

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

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

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 地址在数据包传输过程中的每一跳都发生了变化

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

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

您可能想看看OSI 层模型encapsulation .

关于client-server - 为什么服务器无法获取客户端MAC地址,如客户端IP?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2854731/

相关文章:

.net - SQL Express 作为主数据库

php - 如何使用php从服务器在客户端打印机上打印

sockets - 如何在 ubuntu 12.04 中查找端口号?

objective-c - GCDAsyncSocket 错误

java - 从python获取客户端机器的mac地址

SNMP - 一次调用即可获得完整的 Mac 表

c - 客户端和服务器想同时通话时是否需要多线程?

database - 在测试 API 时编写用于验证数据库条目的测试代码

node.js - 无法正确连接到 Kubernetes 中的 Redis

Qt/C++ : How to get remote PC (communication peer) MAC address?