1

Assume two stations, A and B, are connected by two intermediate routers.

A----R1-----R2----B

Now, when A sends a packet to B, then the OSI model will come into the picture. Like, A's TCP layer will add A's port address (let's say x), and then the Network layer will set the Source IP address as A and Destination IP address as B. I understand till this point, but I have some confusion regarding the next process. I am listing the it below:

  1. What will be the destination MAC address in the DLL header when A is transmitting? Will it be R1's address or B's address?
  2. If A has sent a packet to R1, will R1 change network header here, or will it only read the destination IP address and forward to R2 as is without any modification?
  3. At R1, the only sublayers of OSI that will be accessed are Physical layer, DLL, and Network layer only? Is this correct understanding?
  4. Will R1 change the destination MAC address in the DLL, and set it to R2's address, or will it be B's MAC address in DLL throughout the communication?

I don't feel the need to separate this into four questions. Please let me know if this is not allowed here.

1

2 Answers 2

5

HostA will look at the destination network address and compare it to its own network. It will realize that the destination network is a different network, so it will create a frame to its configured gateway, which should be R1.

R1 will receive the frame from HostA, strip off the frame to get to the packet, inspect the packet's destination address, look up the destination address in its routing table to discover that it should send the packet out its interface toward R2. It will build a new frame for the interface to R2 and forward the new frame out that interface.

R2 will do the same thing that R1 does.

Also, understand that not every layer-2 protocol uses MAC addresses. There is a possibility that the link between the routers uses something like HDLC, PPP, frame relay, or another WAN protocol that doesn't use MAC addresses. The routers strip off the frames, so if there are MAC addresses in the frames, they are lost. The routers will build new frames for the new interfaces out which they will forward frames. The routers are not changing the MAC address on the packets, but they end up with new frames with new MAC addresses, or no MAC addresses at all, depending on the layer-2 protocols of the new interfaces.

The routers may change the packet header. For example, with IPv4, the TTL is decremented, and that requires that the Header Checksum be recalculated and replaced, too. IPv6 will decrement the Hop Count, but it has no checksum.

8
  • 2
    You type faster than humanly possible ;)
    – Ron Trunk
    Commented Aug 16, 2017 at 2:08
  • I think I am just getting them before you do. I don't actually type very fast, and I need to go back and edit what I type (a lot).
    – Ron Maupin
    Commented Aug 16, 2017 at 2:10
  • Thank you @RonMaupin for you answer.This is exactly what i was looking for.But I have some confusion here:-Assume that we are using layer -2 protocol so as you mention that router will create the new frames with new MAC address. So this new Mac address means that router R1 will add its own MAC address as source Mac and R2 Mac address as destination address?Does router R1 has R2's MAc address even even R2 is in different network? Commented Aug 16, 2017 at 16:09
  • Yes. If the link between the routers uses a protocol with MAC addresses, then the source MAC address will be R1's, and the destination MAC address will be R2's. The frame is created for the protocol on the interface. It has nothing to do with any protocol on any other interface. R2 will be in the same network as R1 on the link between them.
    – Ron Maupin
    Commented Aug 16, 2017 at 16:32
  • 1
    I believe I did. The link between the two routers is one network, and both routers will share that network and have addresses on that network.
    – Ron Maupin
    Commented Aug 17, 2017 at 16:44
0

When A is sending packet to B

Source MAC address is = A device mac address

Destination mac address is =.

If destination is on same networks then destination mac address is destination mac address.

If destination on different networks then destination mac address is source device gateway mac address.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.