cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
7357
Views
10
Helpful
2
Replies

How MAC addresses are changed by routers for forwarding?

gwhuang5398
Level 2
Level 2

Assuming Host A has packets to go to Host B in the following all-Ethernet connection:

Host A --- Switch A --- Router A --- Router B --- Switch B --- Host B

Host A and B are in different subnets, and their default gateways are Router A and Router B vlan interfaces. My question is when Router A forward the packets to Router B, does it change packets' source MAC to it outgoing interface MAC and destination MAC to Router B's incoming interface MAC?

Thanks a lot

2 Replies 2

troy.d.hamilton
Level 1
Level 1

qwhuang,

Basically, Router A knows the MAC address of because of ARP. So it will strip the source and destion MAC addresses from the outgoing frame. It will replace it with its outgoing interface as the source MAC address and it will use Router B's interface closest to it as the destination MAC address. Once the frame has been recreated, it will send it.

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello,

>> when Router A forward the packets to Router B, does it change packets' source MAC to it outgoing interface MAC and destination MAC to Router B's incoming interface MAC?

yes if the interface between the two routers is a LAN otherwise the ip packet is encapsulated inside a different type of frame (HDLC, PPP, or FR) to be sent out to RB.

only the ip packet travels unchanged (TTL is reduced and header checksum recalculated at each router hop) the frame that transports the ip packet is changed at each router hop.

This process is called packet rewrite and the router can store in its forwarding tables all the information that is needed.

RB MAC address in case of a LAN link is learned from ARP and can be refreshed by a routing protocol for example.

In some older books like Comer "Internetworking with TCP/IP" the action of the router is called inter networking meaning this capability to make communicate different media.

This is one of the strong point of IP

Hope to help

Giuseppe