This is the first article of a series on IP Addressing and Subnetting, the understanding of which plays a vital role in designing and troubleshooting networks. Much of the information of this series is taken from the book CCNA Study Guide by Richard Deal. Take a moment to reinforce your understanding of IP address and MAC address before proceeding.
In this post I focus on the
- Role of an IP address
- IP address classes
- Network, Host & Directed broadcast address
- Subnet mask
- Private and Public IP addresses
IP address is a type of address designed to identify the nodes on the network. It plays the role in logically locating the network and the host in it. A familiar metaphor to IP addressing is home and street address which helps the postman to deliver the post without ambiguity.
IP address as a street address
A street address like “Basavasamithi Main Road” or “Chamundeshwari Nagar, 2nd cross” identifies the branch among many in a layout. Same analogy holds good in case of IP address like “192.168.1.0” which identifies the network segment among many in a network of networks.
IP address as a home name
A name such as “Nandagokula Nilaya” identifies the home logically. So does the IP address such as “192.168.1.10” in case of a node in the network. There’s a nuance in the analogy of home address pertaining to IP address and MAC address. Nevertheless, IP address’ role is pretty much close to the idea of hierarchy of addressing in the postal system.
IPv4 is a 32-bit binary value, usually represented as a dot separated 4 decimal numbers (dotted-decimal notation). The value in each octet is in the range 0 – 255. The decimal value of the first octet defines the class to which the address belongs to. There are five IPv4 address classes, namely A, B, C, D & E.
There are three specific types of IP addresses.
- Network address : It is the address of the entire network segment and the first IP address in the address space of a network. The last octet of a network address is always an even number ( such as 0, 128, 192, 224 etc. ). The network address is what routers use to make routing decisions to route a packet based on its destination IP address. No host can be assigned with the network address as it belongs to all hosts of the network.
- Directed broadcast address : It’s the broadcast address of the network segment and serves the purpose of sending the packet to all the hosts on the segment. It’s last address in the IP address space of the network, the last octet of which is always an odd number.
- Host address : The addresses between the network address and the directed broadcast address are host addresses which can be assigned to various nodes of the network.
Subnet mask is also an IP address but it’s job is to mark the boundary between the network bits and the host bits. Remember the IP address serves not only to identify the network but also the host (both street no. and home no.). In a subnet mask address,
- Binary 1 represents the network bit.
- Binary 0 represents the host bit.
Since Class A address’ first byte is network and last three bytes are host, it’s default subnet mask is 255.0.0.0. Similarly 255.255.0.0 for Class B and 255.255.255.0 for Class C. Surprisingly the mask 255.255.255.255 represents the given IP as the host address. Subnet mask determines the no. of networks and the hosts per network.
- No. of networks = 2^n, where n is the no. of network bits or ones in the mask
- No. of hosts = 2^h – 2, where h is the no. of host bits or zeroes in the mask
Private IP addresses are those that can be used on internal networks such as LANs or home networks without paying the ISP (Internet Service Provider) such as BSNL, Airtel, or Hathway. Three specific ranges of IP address in each class are reserved for private use. ISP routers by default drop any packet having a private IP address as its destination. ( It’s possible to route the private IP address packets across the Internet using SSL VPN.)
Excluding these private IP addresses every other IP address is public and requires to pay to ISP to use them.