Day 29 - Friday, January 29, 2021

Switch

Last day I explained about the Layers of the OSI model and how each layer is responsible for different task to operate on a network. Layer 2 and Layer 3 of the OSI model and also of the IPS model works with MAC and IP address respectively. These are the two topics that I will explain in this post for today.

What is a MAC address?

MAC address or Media Access Control address is a unique number used to identify a NIC or Network Interface Controller of a device. In simple words it is a unique number used to identify a device on a network. Each device which can connect with a network has a MAC address embeded into the hardware during manufacturing process. MAC addresses are stored in the hardware firmware and are designed to be not modified in any way. MAC address provides the physical address for the device and it does not provides any information about the location of the device. For Location IP address is used.

MAC address Format

MAC address are 48-bit, 12-digit hexadecimal numbers. The first 6-digits or 24-bits of a MAC address are numbers associated with the device manufacturer and the remaining 6-digits or 24-bits are the numbers that the manufacturer assigns by the method they see fit provided that the numbers are unique. There can be 2^48 or 281 trillion unique MAC addresses with 48-bits.

MAC addresse can look differently depending on the device. They may look like this

01-23-45-67-89-AB

or this

0123.4567.89AB

or like this

01:23:45:67:89:AB

There are also some devices that uses 64-bit MAC addresses and these extra 16-bits are added in the MAC address by the IPv6 when required.

IP Address

IP address or Internet Protocol address is a unique identifier assigned to a device connected to a network that uses IP to form a network. It allows the device to communicate with other devices over an IP-based network like The Internet.

Just as MAC address provides the information about the physical address of the device, the IP address provides the information about the location of the device over the network.

Two versions of IP address are widely used today. IPv4 or Internet Protocol version 4 and IPv6 or Internet Protocol version 6.

IPv4

Internet Protocol version 4 is the most widely used on the internet. It is a 32-bit number. It consists of four numbers ranging from 0 to 255 and connected by dots like 172.217.14.196 (Google's Search IP address).

With 32-bits we can have 4,294,967,296 unique IP addresses. Most of the addresses are reserved for reasearch and govermental use and for private networks (about more than 300m are reserved).

Due to increase in the use of the internet, the world is running out of the IPv4 addresses and has started to use the IPv6 addresses since mid-2000s.

IPv6

The Internet Protocol version 6 uses 128-bit for the IP addresses. It was standardized in the 1998 and is publicaly being used since mid-2000s. IPv6 uses eight 16-bit hexadecimal digits separated by the colon like 2a00:1450:4019:806::200e.

It is also more secure than the IPv4, configures automaticaly, has built-in privacy and is also more efficient in routing.

With 128-bits we can have 340 trillion trillion trillion (2^128) addresses.

Types of IP address

There are two types of IP adresses that are used on the internet, Private IP address and Public IP address.

Public IP address

The IP address that is used to locate the network on the internet. This means that any network, either your home netwrok or office network which is connected to the internet has a Public Ip address. Public IP are assigned by the ISP or Internet Service Providers.

Private IP address

The IP address that is used to locate the device connected to a network which is connect to the internet. These IP addresses looks something like these

192.168.10.0
to
192.168.1.255

These IP addresses are used by the router to communicate between devices to have them access to the internet.


zainscizainsci