Sunday 28 May 2017

Logical and Physical address

  1 comment

This topic is very easy but often students (and faculties as well) do get confused when they are asked about this topic. I will try my best to make it clear to you.

Physical address:

It is the address that is used to identify a host uniquely within its local network. To make it more clear let's consider the following scenario.

                          Network A                                                                            Network B

The physical address of all the host in the network is shown above. We can see that all the host in network A has different physical addresses. But two nodes in two different network can have same physical addresses. So, the physical address can only be used to find out a host uniquely inside their local network.

Logical address:

It is the address that is used to uniquely identify a host globally. It means if we pick two nodes from two different networks, then their logical address can never be same. The following diagram might give you some insight.

                              Network A                                                                   Network B

The logical address of the two nodes in network A and B are different. On the internet, the packet actually travels with the help of logical address.
Both logical and physical address are just the concepts. IP address and MAC address are the actual implementations of these concepts. The IP address is used as the logical address and MAC address is used as the physical address. 

IP address:

It is a unique string of numbers separated by full stops that identify each computer using the Internet Protocol to communicate over a network. The most common and popular representation of IP address is dotted decimal representation (IPv4) and Colon Hexa representation (IPv6).
To study in detail about IP addresses refer to IP addressing.

MAC address:

A media access control address (MAC address) of a computer is a unique identifier assigned to network interfaces for communications at the data link layer of a network segment. In simple words, MAC address is the address that is hard coded onto your NIC and it is used to communicate at the network layer. It is a 48-bit number. The 48-bit number is grouped into 6 bytes each byte separated by a colon. MAC address is divided into 3 parts as shown below:
The first two bytes is vendor ID, third-byte id date (also includes time) and the last three bytes are used for the serial number. For example 00:A0:C9:14:C8:29 is a MAC address.
This might feel weird but MAC address is also globally unique. Now the doubt you might get is, why didn't we use MAC address as our logical address?. Why were we forced to come up with IP address when we had MAC?
Well Answer to all these question lies in the drawback of MAC addresses. MAC addresses are hard to route in comparison to IP addresses. As IP addresses are divided into 2 parts, network id and host id. Using network id we can go to the required network and using host id we can go to the desired host. Where as it is very difficult to route MAC address in a network.
 How is MAC address unique?
→ Each vendor who produces these MAC has unique ID. Also, the serial number of each chip (having MAC address) is unique and also no two chips can be manufactured at the same time by the same vendor, so date is different. 
The physical address of a node in a network should always be static (constant). One reason for keeping it static is, if you do any illegal thing onto internet then you can be tracked down with the help of your physical address.
It is, therefore, illegal to change your physical address. MAC remains constant until or unless you change your NIC. This is one other reason we choose MAC address as the physical address. IP addresses keep changing as when you move in and out of the network.

There are some networks which don't use MAC address as the physical address. For example, Apple Talk is a network which randomly generates some number and uses it as the physical address.

Important points:

  • Ethernet and token ring uses MAC address as physical address
  • Data link layer deals with MAC address.
  • Network layer deals with IP address.
Hope this was helpful. Leave your questions, answers & suggestions in the comment section below. And make sure to like us on Facebook and follow on Google+.

Thank you!

1 comment :