DEV Community

Cover image for IP Addresses and Subnets
Abirami Prabhakar
Abirami Prabhakar

Posted on

IP Addresses and Subnets

In this Modern Age, we all know IP addresses are like the unique identifier for every device that is connected to a network. The IP addresses are the reason devices are able to communicate with eachother.

So what is the format of IP addresses?

The identity and IPs were first made in the format of IPv4 - which is made with binary numbers of four number, each number containing 8 bits

                         IPv4: 192.168.1.1
_ _ _ _ _ _ _ _ . _ _ _ _ _ _ _ _ . _ _ _ _ _ _ _ _ . _ _ _ _ _ _ _ _
Enter fullscreen mode Exit fullscreen mode
           IPv6 :2001:0db8:85a3:0000:0000:8a2e:0370:7334
Enter fullscreen mode Exit fullscreen mode

each number also represents a different sense of belonging of the IP address in the networK , In IPv4 only certain number of IP addresses can be created so IPv6 were introducted it is of the format with hexadecimal numbers and colon and can make vast number of IPs

Did You Know?
You can find your device's IP address using the 'ipconfig' comment in the terminal

What is a subnet?
Subnet is a smaller portion of network that is used for easier organization of network and navigation

Every IP Address Has A
Host Part - used by the router to send data to exact network
Network Part - used to send data to the exact device
The network part is responsible for identify the network group a IP belongs to, all devices in a same network share this part wheras the
The Host part specfies the device in a network and is unique within a network

What is the subnet mask ?

The subnet mask is used to define the number of bits of IP that is used to define the network part of a IP
it is carried out with a help of CIDR - Classless Inter Domain Routing

IP_address / number_of_bits
Enter fullscreen mode Exit fullscreen mode

example: 192.168.1.0/24
let's breakdown this example and understand
in this IP address it means from the total of 32 bits - 24 bits are used by the network part and remaining 8 are used by the host part

             network part -> 24
             host part -> 8
Enter fullscreen mode Exit fullscreen mode
         the number IP 2^8 = 256
Enter fullscreen mode Exit fullscreen mode

Top comments (0)