Network Class: Difference between revisions
Line 13: | Line 13: | ||
!Class | !Class | ||
!Public IP Range | !Public IP Range | ||
(NID) | |||
!Private IP Range | !Private IP Range | ||
('''CIDR -''' Classless Inter-Domain Routing) | ('''CIDR -''' Classless Inter-Domain Routing) | ||
Line 53: | Line 54: | ||
|D | |D | ||
|224.0.0.0 to 239.255.255.255 | |224.0.0.0 to 239.255.255.255 | ||
| | |All bits are fixed for NID | ||
| | | | ||
| | | | ||
Line 61: | Line 62: | ||
|E | |E | ||
|240.0.0.0 to 255.255.255.255 | |240.0.0.0 to 255.255.255.255 | ||
| | |All bits are fixed for NID | ||
| | | | ||
| | | | ||
Line 68: | Line 69: | ||
|} | |} | ||
== Network prefix | == Network ID (Network prefix) and Host ID in IP4 Address == | ||
To uniquely identify a host on the network, one needs to know the network's id and the host's id in the network. Thus IP address consist of two components, the network id and the host id. The network id is the number assigned to a network in the internet. Host id represents the id assigned to a host in the network. The total size of the IP4 address (NID + HID) is 32 bits and the IP4 address is divided into four octets each of size is 8 bits. And further, divide into NID and HID. | |||
Network prefix describes the specific location on the network to find where that IP addresses are located on. Network prefix portion is being used by Router to send packets through an internetwork becuase Routers are not concerned about host addresses. | Network prefix describes the specific location on the network to find where that IP addresses are located on. Network prefix portion is being used by Router to send packets through an internetwork becuase Routers are not concerned about host addresses. |
Latest revision as of 10:38, 12 March 2025
IP v4 Address Classification
There are five classes: A, B, C, D and E in the IPv4 IP address space. Primarily, class A, B, and C are used by the majority of devices on the Internet. Class D and class E are for special uses. Each class has a specific range of IP addresses.[1]
The IP Address Classification figure shows different classes of IP addresses. These addresses differ in the number of bits assigned to the network and host ids.
Within each network class, there are designated IP address that is reserved specifically for private/internal use only. Private IP address cannot be used on Internet-facing devices as they are non-routable - not allowed to be routed outside of your internal network.
Class | Public IP Range
(NID) |
Private IP Range
(CIDR - Classless Inter-Domain Routing) |
Special IP Range | Subnet Mask | Number of Networks | Number of Hosts per Network |
---|---|---|---|---|---|---|
A | 1.0.0.0 to 127.0.0.0 | 10.0.0.0 to 10.255.255.255
CIDR[2] example (10.0.0.0/8) |
255.0.0.0
(/8) |
126 | 16,777,214 | |
B | 128.0.0.0 to 191.255.0.0 | 172.16.0.0 to 172.31.255.255
CIDR example, (172.16.0.0/16) |
Automatic Private IP Addressing (APIPA) is a feature with Microsoft Windows-based computers to automatically assign itself an IP address within this range if a Dynamic Host Configuration Protocol (DHCP) server is not available on the network. | 255.255.0.0
(/16) |
16,382 | 65,534 |
C | 192.0.0.0 to 223.255.255.0 | 192.168.0.0 to 192.168.255.255
CIDR example, (192.168.0.0/24) |
127.0.0.1 to 127.255.255.255
127.0.0.1 is a network testing addresses (also known as loop-back addresses). |
255.255.255.0
(/24) |
2,097,150 | 254 |
D | 224.0.0.0 to 239.255.255.255 | All bits are fixed for NID | Multicasting | |||
E | 240.0.0.0 to 255.255.255.255 | All bits are fixed for NID | Research/Reserved/Experimental |
Network ID (Network prefix) and Host ID in IP4 Address
To uniquely identify a host on the network, one needs to know the network's id and the host's id in the network. Thus IP address consist of two components, the network id and the host id. The network id is the number assigned to a network in the internet. Host id represents the id assigned to a host in the network. The total size of the IP4 address (NID + HID) is 32 bits and the IP4 address is divided into four octets each of size is 8 bits. And further, divide into NID and HID.
Network prefix describes the specific location on the network to find where that IP addresses are located on. Network prefix portion is being used by Router to send packets through an internetwork becuase Routers are not concerned about host addresses.
Two type of routing
- Classless routing : the practice of assigning different size masks on your network—does not work unless you run a routing protocol that supports prefix routing. RIP version 2, OSPF, and EIGRP are examples of routing protocols that can support classless routing.
- Classful routing : means that all hosts have the same size mask. RIP version 1 and IGRP are classful routing protocols, and neither will work in a classless environment.
CIDR and Subnet
To create smaller networks (sub networks) out of a Class A network ID, you’d borrow bits from the host portion of the mask. The more bits you borrow, the more subnets you can have, but this means fewer hosts per subnet. following lists all the available Class A subnet masks:[3]
Subnetting applies equally whether you working with either private or public addresses. It becomes even more important when you’re working with globally routed IP space.[4]
Subnet defines the specification of bits that should be used for routing is specified by associating a subnet mask with a routing entry.Once define a subnet mask for subclassing large network to small network by assign subnet mask and validate subnet address, to valid subnet address ipcalc would be simplest way to
CIDR | Subnet Mask | Network number | Host Number |
---|---|---|---|
/1 | 128.0.0.0 | 128 A | 2,147,483,392 |
/2 | 192.0.0.0 | 64 A | 1,073,741,696 |
/3 | 224.0.0.0 | 32 A | 536,870,848 |
/4 | 240.0.0.0 | 16 A | 268,435,424 |
/5 | 248.0.0.0 | 8 A | 134,217,712 |
/6 | 252.0.0.0 | 4 A | 67,108,856 |
/7 | 254.0.0.0 | 2 A | 33,554,428 |
/8 | 255.0.0.0 | 1 A | 16,777,214 |
/9 | 255.128.0.0 | 128 B | 8,388,352 |
/10 | 255.192.0.0 | 64 B | 4,194,176 |
/11 | 255.224.0.0 | 32 B | 2,097,088 |
/12 | 255.240.0.0 | 16 B | 1,048,544 |
/13 | 255.248.0.0 | 8 B | 524,272 |
/14 | 255.252.0.0 | 4 B | 262,136 |
/15 | 255.254.0.0 | 2 B | 131,068 |
/16 | 255.255.0.0 | 1 B | 65,534 |
/17 | 255.255.128.0 | 128 C | 32,512 |
/18 | 255.255.192.0 | 64 C | 16,256 |
/19 | 255.255.224.0 | 32 C | 8,128 |
/20 | 255.255.240.0 | 16 C | 4,064 |
/21 | 255.255.248.0 | 8 C | 2,032 |
/22 | 255.255.252.0 | 4 C | 1,016 |
/23 | 255.255.254.0 | 2 C | 508 |
/24 | 255.255.255.0 | 1 C | 254 |
/25 | 255.255.255.128 | 2 subnets | 124 |
/26 | 255.255.255.192 | 4 subnets | 62 |
/27 | 255.255.255.224 | 8 subnets | 30 |
/28 | 255.255.255.240 | 16 subnets | 14 |
/29 | 255.255.255.248 | 32 subnets | 6 |
/30 | 255.255.255.252 | 64 subnets | 2 |
/31 | 255.255.255.254 | NA | NA |
/32 | 255.255.255.255 | 1/256 C | 1 |
Supernet
A supernet is a technique used to aggregate multiple IP networks into a single larger network. With supernet configuration, we can get the most efficient route in relation to network congestion and latency.
Advantages
- Supernetting reduce routing table entry.
- Router will take less time for processing the packet.
- It improve flexibility of IP address allocation and efficient use of IP address. for example, if someone required 500 address then we have no need to purchase class B network we can combine two class C network.
Disadvantages
- Security: If supernetting is not done in proper way then security may be a issue, id we combine several networks in a single network may increase the attacking surface and this make network security more challenging.
- Complexity and costy: Suppernetting is not a easy task, it is challenging task to merge different networks into single one. And supernetting software and hardware are required, this increase the cost and network complexity.
- Limited Scalability: We can not add two networks if their network id not contiguous.
Rules of Supernetting
Supernetting is applied in two networks if they follow below rules:
- Network ID must be contiguous.
- Size of the network must be same.
- Number of the network must be in the power of 2.
- First network id must be divisible by the total size of the suppernet.
Difference Between Subnetting and Supernetting[5]
Subnetting is a process of dividing a network into smaller networks called subnets. It enables an organization to use the same IP address space more efficiently. Subnetting helps in reducing the broadcast traffic, making it easier to manage large networks, and providing better security. By using subnetting, organizations can segment their network based on different departments or locations and control access to the different parts of the network. It also allows for more efficient routing of traffic within the network by reducing congestion and improving performance.
Supernetting is an advanced networking technique that allows network administrators to combine multiple networks into a single, larger network. It is a powerful tool that can save time and money by reducing the amount of hardware needed to connect multiple networks. Supernetting also increases security by allowing administrators to control access to specific networks and resources. By combining multiple networks, supernetting also increases efficiency by reducing the amount of traffic on each individual network. With supernetting, administrators can easily manage and monitor their entire network from one central location.
Subnetting | Supernetting |
---|---|
When a given CIDR value is greater than network class's CIDR | When a given CIDR value is less than network class's CIDR |
For example,
192.0.0.0 is a C class of Network and the default CIDR is /24
|
For example,
|
IP Routing
Networks in the internet are connected to each other via routers. Routers carry traffic from one network/subnet to another. Routers maintain a routing table to decide how to route the IP packets. Each routing entry consists of the destination address, subnet mask and "route to" field. When a message needs to be routed to an IP address[6]
Many IP routing protocols exist, in part due to the long history of IP; however, if you compare all the IP routing protocols, they all have some core features in common. Each routing protocol causes routers (and Layer 3 switches) to[7]
- Learn routing information about IP subnets from other neighboring routers
- Advertise routing information about IP subnets to other neighboring routers
- Choose the best route among multiple possible routes to reach one subnet, based on that routing protocol’s concept of a metric
- React and converge to use a new choice of best route for each destination subnet when the network topology changes—for example, when a link fails
This page provides more details about routing protocols.
Most common routing rule would be following steps,
- The destination IP address is masked with the subnet mask and then compared with the destination field for all entries in the routing table.
- This comparison may yield a match with more than one entry the entry with the longest subnet mask will be selected.
- Once an entry has been selected, the "route to" field is consulted and the action taken depends on the contents of this field:
- If the "route to" field contains SELF the packet is meant for this node. The IP packet is passed to the OS for application processing
- If the "route to" field contains a LAN interface id, the packet is destined for a LAN that is directly connected to the router/host. In this case, the packet is routed directly on the LAN.
- If the "route to" field contains an IP address, the packet is forwarded to the IP address specified. Further routing of the packet will be carried out by the specified IP address.
References
- ↑ https://www.meridianoutpost.com/resources/articles/IP-classes.php
- ↑ https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing
- ↑ https://www.techrepublic.com/article/subnet-a-class-a-network-with-ease/
- ↑ https://en.wikipedia.org/wiki/Subnetwork#Determining_the_network_prefix
- ↑ https://www.geeksforgeeks.org/what-is-supernet/
- ↑ https://www.eventhelix.com/networking/ip-routing/
- ↑ https://www.ciscopress.com/articles/article.asp?p=2262897&seqNum=2