Is the MAC address needed outside of the LAN?

6,228

Solution 1

MAC Addresses are used on layer 2 only, and Layer 2 is effectively a single Local Area Network with its own broadcast domains and link-local networks. The source MAC Address and target MAC address inside TCP/IP Packets is changed as they travel from network to network by routers which are forwarding the packets based on destination IP Address.

There is no usefulness of a PC's MAC address outside of its own local network, apart from potentially being able to use it to find the vendor of the network card for support purposes.

The reason the first router puts the target router's MAC address in the destination part of the header, is so that when it transmits it over the wire, the target router will know that the packet is destined for it, and will pick it up.

For more information, read the Wiki article on OSI Layer 2, known as the Data Link Layer

Solution 2

Q. Is there a real use for the MAC address outside of the LAN, for example when a Router is passing a packet directly to another Router (like the two Routers I circled in yellow in the above image).

A. Yes, the source mac address is replaced by the source mac address of the router and the process repeats.

Your original source mac address in the packet is replaced, but when the router gets the packet coming back with PC1's IP in the destination ip field, it will replace the destination mac address in the packet to that of PC1. And that is the reverse of the process you described.

Essentially you simply apply the concept of your local lan to every lan. I count 5 local networks between the pc and server, excluding the lines that go off the page. The network doesn't function differently if there are only 2 routers in the local lan as is the case with the line connecting both routers circled in yellow.

Both routers in each of the 3 "middle" lan's communicate with their own Mac addresses. The ip is only for the originating and final destination.


Q. When a Router is passing a packet directly to another Router, where is the benefit in it putting the MAC address in the packet of the next Router?

A. The routers need an address to use when communicating between each other locally, just like between your pc and router.

The IP system is for communicating outside of local networks. The routers cannot send the packets to each other by using the source and destination ip field as it has the webserver or pc address in it.


Think of ip as sender and receiver on paper mail. That would be your pc and the webserver.

Arp is all the addresses of all the trucks and post-offices and planes that are along the way. Post Office 32 -> Post office 35 -> truck 15... They have another system because all they need to know is who is just before or just after them in the chain. They don't care about originating and end destinations.


Here is some information from Cisco. Historically, they are one of the best sources for this type of information in general (non-product specific).

Address resolution works differently, however, when source and destination devices are attached to different LANs that are interconnected by a router. End System Y broadcasts an ARP request onto the LAN in an attempt to learn the MAC address of End System Z. The broadcast is received and processed by all devices on the LAN, including Router X, which acts as a proxy for End System Z by checking its routing table to determine that End System Z is located on a different LAN. Router X then replies to the ARP request from End System Y, sending an ARP reply containing its own MAC address as if it belonged to End System Z. End System Y receives the ARP reply and saves the MAC address of Router X in its ARP cache in the entry for End System Z. When End System Y must communicate with End System Z, it checks the ARP cache, finds the MAC address of Router X, and sends the frame directly without using ARP requests. Router X receives the traffic from End System Y and forwards it to End System Z on the other LAN.

http://www.cisco.com/cpress/cc/td/cpress/fund/ith/ith01gb.htm#xtocid1668423

Share:
6,228

Related videos on Youtube

John
Author by

John

Updated on September 18, 2022

Comments

  • John
    John over 1 year

    I am learning about MAC and IP addresses and why we need to have both of them and not just one. Say I have the following network:

    enter image description here

    Say PC 1 wants to send a packet to the Web Server. Now I understand that PC 1 needs to use two addresses for this task: the address of the Router (so that the Switch can pass the packet to the Router), and the address of the Web Server.

    The MAC address will be used as the address of the Router, and the IP address will be used as the address of the Web Server.


    My question is: is there a real use for the MAC address outside of the LAN, for example when a Router is passing a packet directly to another Router (like the two Routers I circled in yellow in the above image).

    I understand the benefit in PC 1 putting the MAC address (I am talking about destination MAC address of course) in the packet of the Router when inside of the LAN as I have previously explained, but when a Router is passing a packet directly to another Router, where is the benefit in it putting the MAC address in the packet of the next Router?