Why can't the server get the client MAC address, like the client IP?

前端 未结 9 2094
失恋的感觉
失恋的感觉 2021-01-02 00:28

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

9条回答
  •  醉话见心
    2021-01-02 00:56

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

    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.

    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.

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

提交回复
热议问题