How MAC addresses are changed by routers for forwarding?

Unanswered Question
Jan 16th, 2009

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

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
troy.d.hamilton Fri, 01/16/2009 - 15:49

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 Sat, 01/17/2009 - 00:20

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

Actions

This Discussion