IP addresses

Similar to how full street addresses consist of multiple parts, IP addresses also have multiple parts. Where a street address can consist of the increasingly specific parts Country, City, Postal Code, Street and House Number, an IP address consists of two main parts: IP network and addresses within the IP network. The addresses within the IP network are also called the host addresses because different hosts or computers have different unique addresses within the IP network.

  • The IP network corresponds to more general parts of a full street address, such as City, Postal Code and Street name.
  • The Host Addresses within the IP network correspond to specific house numbers on a street.

On a computer network, all devices that are connected to the same local network can talk directly with each other, as long as they have IP addresses that belong to the same IP network. If the computers belong to different IP networks then they have to communicate with each other via a router. The main purpose of a router is to be able to forward traffic to different destinations. Within computer networking, those destinations are different IP networks.

Two computers on the same IP network

Two computers belonging to the same IP network

Two computers on different IP networks

Two computers belonging to different IP networks

So how do you know if two IP addresses are on the same IP network or on two different IP networks? Unfortunately, it isn’t as easy as it is with street addresses to see which part of an IP address that is the IP network and which part belongs to the host addresses.

The answer is within something called a Subnet Mask. An IP address is always combined with a Subnet Mask, and it is the Subnet Mask that determines which part of the IP address that belongs to the IP network and which part that belongs to host addresses.

Subnet Masks and IP networks

To really understand exactly how the Subnet Mask works you would have to study and learn about binary numbers and a few other more advanced topics. Luckily you don’t need any of that deeper understanding unless you work with IT or computer networks professionally.

Both an IP address and a Subnet Mask consists of four parts separated by periods. Each part of an IP address and a Subnet Mask can have a value between 0-255

IP addresses and Subnet Masks

In its simplest form, each part of the Subnet Mask is either the number 255 or the number 0 (zero).

  • 255 means that the corresponding part of the IP address belongs to the IP network.
  • 0 (Zero) means that the corresponding part of the IP address belongs to the Host Addresses.

Here are a few examples of IP addresses and Subnet Masks in combination:

  • If the Subnet Mask is 255 in the first part then the first part of the IP address shows what IP network the address belongs to.

table-sm-1

  • If the second part of the Subnet Mask is also 255, then the second part of the IP address is also part of the IP network.

table-sm-2

  • If the third part of the Subnet Mask is 255, then the third part of the IP address also belongs to the IP network.

table-sm-3

Network Address, the name of the network

Each IP network has a so-called Network Address which is the “name” of the IP network. If you wanted to tell somebody which IP network a computer is located within you would always tell them the first (lowest numbered) address on the IP network, which is the Network Address.

Example 1:

In the picture below, the first three parts of the IP address belongs to the IP network. This is determined by the Subnet Mask.

IP address and Subnet Mask example

0 (Zero) is the lowest address that is available in the fourth part of the IP address. The computer thus belongs to the IP network 101.102.103.0

The fourth part (.5) of the IP address shows which host address that the computer is using on the IP network.

Example 2:

The next computer below belongs to the IP network 211.139.157.0. It is using the host address 9 on the IP network, and its IP address is 211.139.157.9

pc-ip-example-2

Example 3:

This computer belongs to IP network 192.168.1.0, which is one of the most common IP networks that you will find in home networks.  It has received host address 7 on the IP network, and its full IP address is 192.168.1.7

IP address and Subnet Mask example

IP networks in your home network

In a normal home network, the Subnet Mask is usually “255.255.255.0”. What that means is that the three first parts of the IP address determine which IP network that the IP addresses belong to. The last part of the IP address determines which unique address within that IP network that each individual computer has got.

As we mentioned earlier, each part of an IP address can have a value between 0-255. So the fourth part of the IP address permits for 256 different addresses (zero up to 255) that can be used for computers, IP phones, routers, laptops, printers and other devices. These type of devices are commonly referred to as hosts or clients. In a normal home network, those addresses are always more than enough to cover the devices that are connected to the network.

When speaking about the computers, wireless phones, printers etc that are connected to a computer network the term client is often used. A client is any device that acts as an end user device, something that a user is interacting with. This could be a PC, your mobile phone, the wireless printer you have, your Smart TV or your game console.

The term device is a bit more generic and can normally include clients but sometimes also the network equipment itself such as your router or switch.

Another term that is sometimes used is host which more commonly refers to computers and servers on the network – things that are running operating systems such as Windows, Linux, Android or Mac OS X.

But none of these terms are really set in stone, and they are often used interchangeably. The important bit is that since most of these devices behave in more or less the same way on a network it is often simpler to refer to them as clients, hosts or devices instead of having to specify exactly what types of devices the information is about.

The first address (zero) and the last address (255) in your home network can not be used for clients. They are reserved for special functions. The first address is the Network Address which has already been discussed. The last address is used for broadcasting, which is explained in the Switching part of this material.

So in the end, there are 254 available addresses that can be used in a home network. Normally the home router will use one of those addresses, and the rest are available for your computers and other devices.

It is usually your home router that determines which IP addresses that the computers can use in your home network. The router hands out IP addresses, the Subnet Mask and other details to the clients. This will be discussed later on in the section about how addresses are assigned to devices.

Previous part:
Routing, introduction to IP addresses

Next part:
Default Gateway, finding other IP networks