IPv4 and IPv6 Addresses

Commonly used IP addresses are composed of four numbers from 0 to 255 separated by dots, for example: 192.168.1.1. This version of the Internet Protocol is briefly called IPv4. The IPv4 standard was introduced in the 1980s and is still widely used. It uses 32 bits for addresses, which allows for approximately 4.3 billion unique addresses.

Although the number of available addresses was high (around 4.5 billion), with the increasing number of devices connected to the internet, IP addresses began to run out. A new standard called IPv6 was defined. IPv6 addresses are composed of numbers and letters, separated by colons, for example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334.

Subnets

TCP/IP-based networks can be segmented into smaller networks called subnets. The transfer of data between subnets occurs through routers netwok devices that route the traffic. All available addresses are divided into classes with a maximum number of addresses:

  • Class A with over 16 million IP addresses
  • Class B with 65,535 IP addresses
  • Class C with 254 IP addresses

Subnets can be further narrowed by specifying a subnet mask. Subnets become useful for isolating certain devices for security reasons or to avoid wasting resources on unnecessary addressing. For example, a typical home network has IP class 192.168.1.0 with mask 255.255.255.0, which means IPs from 192.168.1.1 to 192.168.1.254 can be used. By changing the subnet mask to 255.255.255.128, two subnets are obtained:

  • 192.168.1.0 to 192.168.1.128
  • 192.168.1.129 to 192.168.1.254

Communication between devices on the same subnet id direct and every device use a map between the IP address and a MAC address (Media Access Control address) that is a unique identifier assigned to network interfaces. The subnet mask is sometimes abbreviated using the shorter notation called Classless Inter-Domain Routing (CIDR). This is obtained by converting the subnet mask into its binary format and counting the number of 1s. For example, the subnet 255.255.255.0 becomes 11111111.11111111.11111111.00000000, which is 24, hence the notation 192.168.1.0/24.