9

Somewhere I have read that both physical address and MAC address are the same,which is exactly the same attached with the NIC of a machine. And also in some other place I have read that a router is forwarding data packets based on the information such as Physical and Logical addresses available from a data packet. I have the knowledge that a MAC address will never go beyond the LAN's gateway. Then how come the other routers collect the information regarding my MAC address from a data packet send by me?

Am I supposed to believe that physical address is different from MAC address when comes into networking?

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
Anonymous Platypus
  • 1,242
  • 4
  • 18
  • 47
  • 'Somewhere' and 'somewhere else' such as where? SO isn't a validation site for arbitrary Internet junk, especially when you can't even be bothered citing it correctly. – user207421 Dec 30 '14 at 08:38
  • I agree, but I don't think citing the exact place is not necessary here in this case. The context is the difference between terminologies. – Anonymous Platypus Aug 16 '16 at 11:31
  • Not all layer-2 protocols use MAC addresses. Some may use 48-bit MAC addresses, some may use 64-bit MAC addresses, some may use something else (DLCI, VPI/VCI, etc.), and some (PPP, etc.) use no addressing. You could say that a MAC address is a hardware address, but not the reverse is not necessarily true. (All thumbs are fingers, but not all fingers are thumbs.) – Ron Maupin May 28 '18 at 19:56

3 Answers3

6

Physical address and MAC address are indeed the same. They are used to communicate between devices on Ethernet networks. When you send a request to a remote host's IP address (access a website for instance) your computer sends that request to your LAN's gateway (your router) and it uses its physical (MAC) address as the destination of the message but the logical (IP) address of the host for its final destination. The router then forwards that message onward and knows who to return the reply to.

Amir Keren
  • 201
  • 2
  • 7
  • 3
    If we have MAC address then why we need IP address? As MAC address is unique, it can uniquely identify the machine, then why IP address? – Pratik Patil Jul 20 '15 at 17:07
  • 2
    @PratikPatil if you look at CustomX 's answer, it explains how both IP and MAC are being used – ealeon Feb 17 '18 at 16:14
  • @PratikPatil , if only MAC address is used then all the routers will have to keep table of all the MAC address (also keep updating) to communicate with any other system on network. Which is very resource intensive and unnecessary. You can find more details on google. – Mayank Feb 19 '19 at 07:07
6

Physical and MAC addresses are the same, just different naming conventions. Each device should have a unique MAC address assigned by its vendor. The logical addressing is the IP address assigned to interfaces.

Physical addressing/MAC addresses work on Layer 2 and Logical addressing works on Layer 3. Let's use an example to demonstrate.

PC_A  -  R1  -  R2  -  PC_B

Let's say PC_A wants to send something to PC_B. PC_A will create an IP packet with Source IP of PC_A and Destination IP of PC_B. That IP packet will be encapsulated in an Ethernet frame with Source MAC of PC_A and Destination MAC of R1.

PC_A sends the frame to R1 and R1 deencapsulates the frame. R1 checks the destination IP and matches it to its routing table and sees that R2 is the way to go. So R1 creates a new frame with Source MAC of R1 and Destination MAC of R2. R2 performs the same steps and eventually sends the frame to PC_B.

During this entire proces the Frame changes, whilst the IP packet remains untouched.

CustomX
  • 9,948
  • 30
  • 85
  • 115
  • R1 is router? how does R1 knows about R2? and more specifically that such IP of PC_B belongs to R2 and not R3 or whoever else? and because it does not routed within R1 this isnt not LAN, correct? – ealeon Feb 17 '18 at 16:12
  • @ealeon, R1 is a router yes. R1 and R2 are interconnected in a separate subnet. So R1 knows about its neighbor on the otherside of its link. R1 and R2 also have a routing protocol enabled or just have a static route configured. It's still LAN until it passes the internet imo. – CustomX Feb 19 '18 at 09:16
1

You might have confused with Hw add and physical address. Basically, if you consider a router/switch with multiple ports. The device will have a Hw address then each of the interfaces will have a physical address. look at the output below. You generally see this in the devices supports L3 switching.

rtr1#sh int xe3/1
Interface xe3/1
  Scope: both
  Flexport: Breakout Control Port (Active): Break Out disabled
  Hardware is ETH  Current HW addr: ecf4.bb64.9aa0
  Physical:ecf4.bb64.9aa6  Logical:(not set)

The application to having different address is out of scope here.