TCP/IP Addressing and Network Design

What is IP addressing

IP addressing is a fundamental concept in computer networking that involves assigning unique numerical labels to devices participating in a network. These numerical labels, known as IP addresses, serve two main purposes:

  • Host Identification: IP addresses uniquely identify each device (such as computers, smartphones, printers, and other networked devices) on a network. This identification is crucial for data communication, as it ensures that data packets are correctly routed to and from the intended destinations.
  • Location Addressing: IP addresses are used to locate devices within a network or on the Internet. They are structured hierarchically, allowing for efficient routing of data across different networks and subnetworks.

IP addresses come in two main versions: IPv4 (Internet Protocol version 4) and IPv6 (Internet Protocol version 6).

IPv4 addresses are composed of 32 bits and are expressed as four sets of numbers separated by dots (e.g.,

IP Address Classes

Class A ( to

  • First octet represents the network, and the remaining three octets represent hosts.
  • Supports up to 16 million hosts per network.
  • Example:

Class B ( to

  • First two octets represent the network, and the remaining two octets represent hosts.
  • Supports up to 65,000 hosts per network.
  • Example:

Class C ( to

  • First three octets represent the network, and the last octet represents hosts.
  • Supports up to 254 hosts per network.
  • Example:

Class D ( to – Reserved for multicast groups

IP Addressing Basics Video

IP Addressing Binary Conversion Video


Classful addressing, however, had limitations, especially in terms of address utilization. CIDR was introduced to address these limitations by allowing more flexible allocation of address space, breaking away from the strict boundaries defined by classes. In CIDR, the subnet mask can have a variable length, allowing for more efficient use of IP addresses. CIDR notation is expressed as an IP address followed by a slash and the subnet mask length, like this: IP_address/Prefix_Length (e.g.,

Subnet mask

A subnet mask is a 32-bit number that divides an IP address into network and host portions. It is used in conjunction with IP addresses to create subnetworks (subnets) within a larger network. The subnet mask consists of a series of consecutive ‘1’ bits followed by ‘0’ bits.

The primary purpose of a subnet mask is to determine which portion of an IP address identifies the network and which portion identifies the specific device on that network. When an IP packet is sent over a network, the destination IP address is compared with the subnet mask to determine whether the destination is on the local subnet or if routing to another network is necessary.

Common subnet mask examples include:

  • Class A: (or /8 in CIDR notation)
  • Class B: (or /16 in CIDR notation)
  • Class C: (or /24 in CIDR notation)

Public and private IP addressing

Public and private IP addressing are concepts related to the visibility and accessibility of IP addresses on the Internet. These terms help distinguish between addresses that can be used globally and those that are reserved for use within private networks.

Public IP Address

A public IP address is a globally unique address assigned to a device or a network interface that is directly connected to the Internet. Public IP addresses are routable across the Internet, allowing devices with these addresses to communicate with other devices on a global scale.

They are typically assigned by Internet Service Providers (ISPs) and are used for identifying and routing traffic over the Internet.

Examples of public IP addresses include the ones associated with web servers, email servers, or any device directly accessible from the Internet.

Private IP Address

A private IP address is used within a private network and is not directly accessible from the Internet. Private IP addresses are reserved for use in internal networks, such as those within homes, businesses, or organizations.

These addresses are defined by certain address ranges, including:

  • Class A Private Addresses: to
  • Class B Private Addresses: to
  • Class C Private Addresses: to

Devices within a private network use private IP addresses for local communication, and a router or gateway device with a public IP address is responsible for translating between private and public addresses when communicating with the Internet.

The use of private IP addressing helps alleviate the shortage of available IPv4 addresses by allowing many devices to share a small pool of public addresses. Network Address Translation (NAT) is often employed by routers to map multiple private IP addresses to a single public IP address, allowing internal devices to access the Internet using a smaller number of public addresses.

Watch this video to understand NAT

Published by Active Learning, Dec 2023