Understanding IPv4 address

Nivas DevSecOps
3 min readAug 15, 2024

--

IP (Internet Protocol) addresses are identifiers for a specific machine on a particular network.

  • IPv4 addresses are the set of four numbers — an example address might be 192.158.1.38.
  • Each number contains one to three digits that are separated with a single dot (.)
  • Each number in the set can range from 0 to 255. So, the full IPv4 addressing range goes from 0.0.0.0 to 255.255.255.255
  • IPv4 addresses are 32 bits long (4 Byte) and the maximum value of a 32-bit number is ²³²=4,294,967,296. So the maximum number of IPv4 addresses is about 4.3 billion.

The 32 bit IP address is divided into five sub-classes.

  • Class A, Class B, Class C, Class D, Class E.
  • Classes A, B, C are commonly used, and Class D is only used for multicast, and class E is reserved exclusively for experimental purposes.

Class A Network:

  • IP range is (1–127) 1.0.0.1 to 126.255.255.254
  • An example of a Class A address is 102.168.212.226.
  • Here, “102” helps you identify the network, and 168.212.226 identifies the host.
  • Supports 16 million (²²⁴)hosts on each of 127 networks.
  • Used for a large number of hosts.

Class B Network:

  • IP range is (128 to 191) 128.1.0.1 to 191.255.255.254
  • An example of a Class B IP address is 168.212.226.204.
  • Here “168.212” identifies the network and “226.204” helps you identify the network host.
  • Supports 65,000 (²¹⁶) hosts on each of 16,000 networks.
  • Used for medium-size networks.

Class C Network:

  • IP range is (192 to 223) 192.0.1.1 to 223.255.254.254
  • An example of a Class C IP address is 192.168.178.67
  • Here “192.168.178” identifies the network and “67” helps you identify the network host.
  • Supports 254 hosts on each of 2 million networks.
  • Used for local area network.

Class D Network:

  • IP range is (224 to 239) 224.0.0.0 to 239.255.255.255
  • An example of a Class D IP address is 227.21.6.173
  • Reserve for multi-tasking and never used for regular networking operations.

Class E Network:

  • IP range is (240 to 254) 240.0.0.0 to 254.255.255.254
  • An example of a Class E IP address is 243.164.89.28
  • Reserved for future use, or research and development purposes

IPv4 address breakdown

The binary representation of IP address: 255.255.255.255

From the above picture, it is clear that

  • IPv4 addresses always are in a decimal format that humans can read and remember, and IP addresses that are in binary format computers can understand.
  • The first octet is always 8 bits or 1 byte and the IPv4 address is made of 4 bytes.

Now let’s understand how 255 = 11111111?

  • MSB stands for the most significant bit, while LSB is the least significant bit.
  • The positional value of bits is determined by 2 raised to a power (position-1)
  • For example, the value of a bit 1 at position 6 is 2^(6–1) that is ²⁵ that is 32.

This was all about the IPv4 address.

--

--

Nivas DevSecOps
Nivas DevSecOps

Written by Nivas DevSecOps

Cloud | DevSecOps| AWS ⭐Passionate Cloud and DevOps . 🎯 Like to stay up-to-date with the latest trends and insights.

No responses yet