Understanding the IP Address
IP address refers to a unique address assigned to each machine participating in a network. The IP address identifies the machine uniquely in a network. The IP address is an Identification (ID), which is similar to an ID required by a student to access the services of a university. With the help of these IDs, devices get access to a network, which in turn allow them to communicate with other connected devices. Generally, the IP address is assigned to NIC than to a device (computer).
Understanding IPv4 Addresses
In IPv4 addressing, each device participating in a network is assigned a unique 32-bit binary address. This unique address is assigned for identifying these devices uniquely over the network. This 32 bit IP address is represented in the form of four octets separated by dots. The three commonly used representation of the 32-bit 113 address are:
- Dotted decimal notation (192.168.2.200)
- Dotted binary notation (11000000.10101000.0000010.11001000)
- Dotted hexadecimal notation (CO.A8.2.C8)
Types of IPv4 Address
Each computer or host in a network is identified by its IP address. Without the IP address, a device cannot connect to a network. The IPv4 address can be divided into two types- Private and Public. Lee’s now discuss these types.
Private IPv4 Address
All hosts are not connected directly to the Internet; therefore, their IP addresses need not be global and registered with the Network Information Centre. These addresses are not accessed by external entities. Several IP protocols are reserved to be used as a private network. These are not available on routers. Private 1P addresses enhance security and conserve public addressing space.
Public IPv4 Addresses
The Public IP address, also known as Static IP address, allows you to access a computer similar to a Web server as they are publicly registered IP addresses. In this case, the devices attached to the computer are accessed by everyone on the Internet. The Public IP address is designed for the public use specifically. Let’s now understand the structure of IPv4 addresses.
Structure of IPv4 Addresses
In real life, an addressing approach can be a flat addressing, in which all the ingredient of an address, uniquely identifies a single address, or it can be hierarchical, in which some part of the address represents a broader range of the address and another part represents a unique address in that range. For example, the pin number of a country follows the hierarchical approach, in which the digits in the beginning of the pin number, represents a state in the country and rest of the digits represents an area of the state. Similarly, IPv4 addressing follows the hierarchical approach of representing addresses of devices in network.
The IPv 4 address consists of two primary elements: Network ID and Host ID which can be identified by using subnet masks. The descriptions of these IDs are:
Network ID: Identifies the network to which a host is connected. Network ID is the same for all the hoses in a particular network.
Host ID: Identifies a host in a network. Host ID is different for different hosts in a network. Table 4.1 illustrates some examples showing the division of the IP address into the Network and Host IDs:
Division of IP Address into the Network and Host IDs
|Class||Network ID||Host ID|
Classes of the IPv4 Address
IPv4 addresses are classified into five classes: A, B, C, D, and E. the first four bits of the first octet of the IPv4 address determines the class.
The following list shows various IP address classes as per the variation of the first, second, third or fourth bit:
- If the first bit is zero, the ip address belongs to the IP address belongs to the Class A address.
- If the first bit is one and second bit is zero then the ip address belongs to the Class B address.
- If the first two bits are one and the third bit is zero, then the IP address belongs to the class C address.
- If the first three bits are one and the fourth bit is zero, then the ip address belongs to the class D address.
- If all the fourth bits are one, then the ip address belongs to the class E address.
|Classes||Net ID||Host ID|
|A||0||7 bit||24 bit|
|B||10||14 bit||16 bit|
|C||110||21 bit||8 bit|
The Class A Address
The Class A address is used when several hosts communicate in a large network. It uses the first octet of the IP address in which the first bit is set to zero and the other seven bits are set to one. As you know that, the IP address is a unique 32 bit logically assigned binary number of four octets. A network uses the first 8 bits of the IP address to identify a network address and the remaining 24 bits identify the host. The Class A address can have up to 224 different Host IDs, which means that a network can have up to 16,777,214 hosts.
The Class B Address
The Class B address uses the first 2 octets or 16 bits of the IP address to identify a network address and the remaining 16 bits or the last two octets to identify a Host ID or address. Class B has up to 216 different Host IDs, which means a network can have 65,534 hosts. The Class B address is used in medium as well as large-scale organizations.
The Class C Address
The Class C address uses the first 3 octets or 24 bits of the IP address to identify a network address and the last octet or 8 bits to identify a host address. The Class C address can have up to 28 different Host IDs, which means a network can have up to 254 hosts.
The Class D Address
The Class D address is not assigned to hosts, but is designed for multicasting (one-to-many) communication. Each class in the Class D address defines a particular group of hosts on the Internet.
The Class E Address
Similar to the Class D address, the Class E address is not assigned to hosts. Moreover, the Class D address is not used for general applications, but is reserved for experimental purposes.
IPv4 Address Ranges
IPv4 addresses are categorized in three basic ranges to avoid conflict, while assigning IP addresses to computers. The three categories of IPv4 address ranges are as follows:
- Automatic Private IP Addressing (APIPA): Assigns an IP address automatically to a computer which is organized to use DHCP but the DHCP server is not available for that system.
- Private IPv4 Addresses: Represents IP addresses used in a private network. The address ranging between 10.0.0.0 – 10.255255.254, 172.16.0.0 – 172.31.255.254, and 192.168.0.0 -192.168.255.254 are considered as private IPv4 addresses. Hosts that are assigned with private IPv4 addresses are connected to the Internet with the help of a server or a router.
- Public IPv4 Address: Represents IP addresses that are used in a public network, such as the Internet. As you know that all IP addresses in a network are unique; therefore, Internet Assigned Numbers Authority (IANA) has divided all the non-reserve IPv4 addresses into the regional registries that further provide IP addresses to Internet Service Providers (ISPs). These IPv4 addresses are public IPv4 addresses, which are then further distributed to the smaller ISPs or customers.
IPv4 ranges are used in the public and private networks. Also, managing the network traffic and communication between computers becomes cumbersome in a large network. You can divide the network into smaller subnets to simplify the management. Moreover, if multiple small networks exist in art enterprise, then the small networks can be grouped together to collectively represent in a single network Grouping various small networks in a single network is called supernetting.
A subnet is a network that exists within the Class A, B, or C IP address. A subnet is created to extend network IDs by using one or more Class A, B, or C IP addresses. Therefore, subnets can have a Network ID of any length. All devices that have IP addresses with same prefix act as subnets. These are connected to the internet by using the same shared network. While designing a subnet, always specify the maximum number of subnets that are required and ‘insure that enough host addresses are available.
A subnet mask is another 32 bit number defined to identify a subnet. A subnet mask describes the bits that are associated with a nework and Host IDs. If the octet in the subnet mask is equal to 1, then it refers to the Network ID, and if it is equal to 0, then it refers to the Host ID. Subnet masks inform routers about the working of subnetting. The Network ID of the IP address is determined when the router has both the IP address and subnet masks. The subnet masks that are defined with the Class A, B, and C addresses are the default subnet masks.
It is a process where networks get divided into logical subnetworks or subnets to control network traffic. This can also be stated as splitting a single IP address into many sub-network addresses. The subnet address allows you to manage distinct networks under a single class address by shifting bits from the Host ID to the Network ID. Subnetting allows you to have more networks with a fewer hosts, because the Network ID borrows a few bits from the Host ID. In this way, you can connect to the Internet with a single shared network address. In subnetting, Network IDs are merged with Host ID bits or a few Host IDs that are used as subnets. According to standard IP address classes; there are only three possible Network ID sizes: 8 bits for Class A, 16 bits for Class B, and 24 bits for Class C. Subnetting allows you to use the limited space of the IP address efficiently.
Supernetting usually refers to a way of comprising of two or more network address space in a single, large address space. Two smaller networks can be joined to form a large network, known as supernet. In supernetting, bits are added from the Network ID to Host ID. The supernetting method reduces the number of is in the subnet mask. This supernetting idea is used in routing protocols for determining the route.
Routing and Default Gateway
The transmission of data packets from source to destination is called routing. When computers in a network communicate, data is sent in the form of packets in the IPv4 addressing based network when a computer in the network receives IPv4 packets, the computer determines their Network ID with the help of a subnet mask. Moreover, it determines the Network ID assigned to it with the help of a local subnet mask. If the two Network ID matches, it concludes that this IPv4 packet broadcasts the packet. Otherwise, the computer sends the IPv4 packet to a specific address known as a default gateway. A gateway is a router that determines the destination subnet by comparing the IP address in the IPv4 packet and its routing table. After determining the destination subnet, the router forwards the packet to the default gateway of the destination subnet the router of the default gateway in the destination subnet then broadcasts the packet to the subnet, where the computer has specified the IP address on the IPv4 packet receives and processes the packet. After understanding the IPv4 addresses, let’s now explore the need for IPv6 in the next section.