Computer Networking 2: IP Addresses

Syed Sadat Nazrul
5 min readJun 27, 2018

--

Continued from Computer Networking 1: Introduction

Each device connected to the internet has a unique identifier. Most networks today, including all computers on the internet, use the TCP/IP as a standard to communicate on the network. In the TCP/IP protocol, this unique identifier is the IP Address. The two kinds of IP Addresses are IPv4 and IPv6.

IPv4 vs IPv6

IPv4 uses 32 binary bits to create a single unique address on the network. An IPv4 address is expressed by four numbers separated by dots. Each number is the decimal (base-10) representation for an eight-digit binary (base-2) number, also called an octet.

IPv6 uses 128 binary bits to create a single unique address on the network. An IPv6 address is expressed by eight groups of hexadecimal (base-16) numbers separated by colons. Groups of numbers that contain all zeros are often omitted to save space, leaving a colon separator to mark the gap .

IPv6 space is much larger than the IPv4 space due the use of hexadecimals as well as having 8 groups. Most devices use IPv4. However, due to advent of IoT devices and the greater demand for IP Addresses, more and more devices are accepting IPv6.

Static vs Dynamic

How does your computer get its IP address? An IP address can be either dynamic or static.

Static address is one that you configure yourself by editing your computer’s network settings. This type of address is rare, and it can create network issues if you use it without a good understanding of TCP/IP.

Dynamic addresses are the most common. They’re assigned by the Dynamic Host Configuration Protocol (DHCP), a service running on the network. DHCP typically runs on network hardware such as routers or dedicated DHCP servers. Dynamic IP addresses are issued using a leasing system, meaning that the IP address is only active for a limited time. If the lease expires, the computer will automatically request a new lease.

IP Classes

Typically, the IPv4 space allows us to have addresses between 0.0.0.0 to 255.255.255.255. However, some numbers in that range are reserved for specific purposes on TCP/IP networks. These reservations are recognized by the authority on TCP/IP addressing, the Internet Assigned Numbers Authority (IANA). Four specific reservations include the following:

  • 0.0.0.0 — This represents the default network, which is the abstract concept of just being connected to a TCP/IP network.
  • 255.255.255.255 — This address is reserved for network broadcasts, or messages that should go to all computers on the network.
  • 127.0.0.1 — This is called the loopback address, meaning your computer’s way of identifying itself, whether or not it has an assigned IP address.
  • 169.254.0.1 to 169.254.255.254 — This is the Automatic Private IP Addressing (APIPA) range of addresses assigned automatically when a computer’s unsuccessful getting an address from a DHCP server.

The other IP address reservations are for subnet classes. A subnet is a smaller network of computers connected to a larger network through a router. The subnet can have its own address system so computers on the same subnet can communicate quickly without sending data across the larger network. A router on a TCP/IP network, including the Internet, is configured to recognize one or more subnets and route network traffic appropriately. The following are the IP addresses reserved for subnets:

  • 10.0.0.0 to 10.255.255.255 — This falls within the Class A address range of 1.0.0.0 to 127.0.0.0, in which the first bit is 0.
  • 172.16.0.0 to 172.31.255.255 — This falls within the Class B address range of 128.0.0.0 to 191.255.0.0, in which the first two bits are 10.
  • 192.168.0.0 to 192.168.255.255 — This falls within the Class C range of 192.0.0.0 through 223.255.255.0, in which the first three bits are 110.
  • Multicast (formerly called Class D) — The first four bits in the address are 1110, with addresses ranging from 224.0.0.0 to 239.255.255.255.
  • Reserved for future/experimental use (formerly called Class E) — addresses 240.0.0.0 to 254.255.255.254.

The first three (within Classes A, B and C) are those most used in creating subnets. Later, we’ll see how a subnet uses these addresses. The IANA has outlined specific uses for multicast addresses within Internet Engineering Task Force (IETF) document RFC 5771. However, it hasn’t designated a purpose or future plan for Class E addresses since it reserved the block in its 1989 document RFC 1112. Before IPv6, the Internet was filled with debate about whether the IANA should release Class E for general use.

Subnets

When you type ipconfig on your UNIX terminal (or CMD prompt for Windows users), you will get a pretty detailed display of your IP Address information. I have taken a screenshot of the section that I am interested in.

ipconfig partial output
  • IP address: 192.168.1.69
  • Subnet mask: 255.255.255.0
  • Twenty-four bits (three octets) reserved for network identity
  • Eight bits (one octet) reserved for nodes
  • Subnet identity based on subnet mask (first address): 192.168.1.0
  • The reserved broadcast address for the subnet (last address): 192.168.1.255
  • Example addresses on the same network: 192.168.1.1, 192.168.1.103
  • Example addresses not on the same network: 192.168.2.1, 192.168.2.103

IP addresses on a subnet have two parts: network and node. The network part identifies the subnet itself. The node, also called the host, is an individual piece of computer equipment connected to the network and requiring a unique address. Each computer knows how to separate the two parts of the IP address by using a subnet mask. A subnet mask looks somewhat like an IP address, but it’s actually just a filter used to determine which part of an IP address designates the network and node.

In the current situation, the subnet mask is 255.255.255.0, indicating that 1 byte being dedicated for the host. It can also be 255.255.0.0 (2 byes) and 255.0.0.0 (3 bytes).

--

--

Syed Sadat Nazrul

Using Machine Learning to catch cyber and financial criminals by day … and writing cool blogs by night. Views expressed are of my own.