Что происходит с MAC-адресом маршрутизатора после пересылки пакета в Интернет?

1139
sanjihan

Что происходит с данными заголовка Ethernet на канальном уровне, как только кадр достигает основного домашнего маршрутизатора и пересылается на первый сетевой маршрутизатор ядра?

Маршрутизаторы являются устройствами сетевого уровня и пересылаются на основе IP-адреса назначения. Локальная сеть переключается вперед на основе MAC-адреса в заголовках кадра. Чтобы получить кадр к домашнему маршрутизатору, MAC-адрес маршрутизатора помещается в заголовок кадра, исходящий от хоста, но при получении кадра от домашнего маршрутизатора к следующему в глобальной сети MAC-адрес не играет роли, поскольку это делается на основе IP-адреса. ,

Итак, что происходит с MAC-адресом, когда кадр достигает домашнего маршрутизатора и переходит к следующему? Это удалено? Существуют ли протоколы для обнаружения MAC-адреса следующего маршрутизатора (например, ARP в локальной сети); MAC-адрес следующего маршрутизатора вообще нужен?

1

2 ответа на вопрос

2
Ben N

When a packet crosses a subnet boundary (e.g. by reaching a LAN's router), the MAC address is discarded because it means absolutely nothing outside of the subnet in which it originated. It is not possible to recover the MAC address of somebody else's machine if your only method of getting to them involves a router. (The original MAC address is not transmitted to the next hop.) The Layer 3 data, which is the payload of the Layer 2 packet, needs to be repackaged.

When the router needs to send the packet to the next router in the chain, what happens depends on the Layer 2 protocol. If Ethernet is still being used, there will be some MAC address in the sent packets. (You could build routers that communicate with each other over serial ports.) It is theoretically possible to avoid using ARP even with Ethernet, since routing tables could map destination IP addresses to physical ports, removing the switch-like functionality of mapping MAC addresses to those ports. Nevertheless, there is still a field for a MAC address in all Ethernet packets.

2
Ron Maupin

A layer-3 device (router, host, etc.) will strip the layer-2 frame from the encapsulated packet, and the frame information is discarded as unneeded. A router will then switch the packet to the next interface in the path toward the destination.

At the next interface, the router will build a new frame for the layer-2 protocol for the next interface. Not all layer-2 protocols use MAC addresses. Of the ones which do use MAC addresses, some use 48-bit MAC addresses, and some use 64-bit MAC addresses. Whatever the layer-2 protocol of the next interface, a new frame is built for that protocol, and any previous frame information was already lost (the new frame could be for a completely different kind of layer-2 protocol than was the old frame).

Похожие вопросы