Routing is an important term in the world of computer networks. It is basically the name given to the process of selecting a path for traffic in a network or between across multiple networks. Routing is basically performed in many types of networks like circuit-switched networks, for example, the public switched telephone network, commonly known as the PSTN or computer networks, for example, the internet.
Routing is the higher-level decision making in packet switching networks as it directs network packets from their source to their destination through intermediate network nodes with the help of particular packet forwarding mechanisms. When we talk about Packet forwarding, we refer to the transit of network packets from one network interface to another. The nodes in intermediate are basically hardware devices in the network, for example, routers, gateways, firewalls, switches including others. Packet forwarding is also done by general-purpose computers although there is no specially optimized hardware for the task.
When we talk about routing, one important term is routing tables. The process usually directs forwarding on the basis of routing tables that might be specified by an administrator. It basically maintains a record of the routes to different network destinations. Routing tables either learn by observing network traffic or are built with the assistance of particular routing protocols.
When the concept of routing is discussed, usually IP routing is talked about. IP routing basically assumes that network addresses are structured and that similar addresses have proximity within the network. In the concept of structured addresses, a single routing table entry is allowed to represent the entire route to a group of devices. In large networks, structured addressing, which is basically routing performs better than unstructured addressing, also known as bridging.
Routing has now become the most popular and widely used form of addressing on the Internet whereas bridging is still widely used within local area networks, also known as LAN.
In today’s blog, we are going to talk about an important concept related to the routing in computer networks. Classful and classless routing are protocols of routing. In today’s blog we are going to discuss the difference between classful and classless routing.
Before understanding the difference, it’s important to get a hang of classful and classless routing and the important terms associated with these routing protocols. Let’s get started with the blog in order to advance our knowledge in computer networks.
What is Classful Addressing?
Classful Addressing or Classful Routing was Introduced in 1981 where IPV4 addresses were divided into 5 classes namely from class A to class E. Where classes A to C contain unicast addresses and Class D talks about multicast addresses and Class E is reserved for future use. In this segment, we are going to talk about each class in detail beginning from Class A.
Class A has addresses where the first bit of the first octet is always ‘0’ and hence the address range of class A starts from 0.0.0.0 and reaches up to 127.255.255.255 (the decimal conversion of the binary number ‘0111’ is 127). The IP address is divided into four octets (with each octet having 8 bits) where the first octet denotes the network portion and the rest of the 3 octets (or the 24 bits) belong to the host portion. One example of Class A IP address can be 10.1.1.1
There is one exception in the Class A IP address. The address range 127.X.X.X is reserved for loopback while the address range 0.X.X.X is reserved for default network. Hence, the actual range of class A addresses starts from 18.104.22.168 and goes only up till the address 22.214.171.124
Class B has a range of addresses where the first octet would always start with ’10’ and hence the range of Class B starts from 126.96.36.199 and goes up to 188.8.131.52. The first two octets (that means 16 bits) denote the network portion and the remaining two octets (or the remaining 16 bits) belong to the host portion. One example of Class B IP address is 172.16.1.1
The next in line is the Class C where the first octet starts from ‘110’ and hence the addresses range starts from 192.0.0.0 and goes up to 184.108.40.206. In this class address, the first three octets, i.e., the first 24 bits denote the network portion and the rest of the bits or the remaining last octet belongs to the host portion. One example of Class C address is 192.168.1.1
Multicast addressing is represented in Class D where the first octet starts with ‘1110’ and hence the range of IP addresses start from 220.127.116.11 and ends with 18.104.22.168. An example of a Class D IP address is 22.214.171.124. In routing protocols like OSPF, RIP and others, IP addresses of Class D are used.
The last class is classful addressing is Class E which is reserved for research purposes and future use. The first octet in IP addresses from class E starts with ‘1111’ and thus, the IP address range in Class E is from 240.0.0.0 to 255.255.255.255.
We have discussed all the classes that are a major part of classful addressing. We hope that the concept is now clear in your mind. Classful Routing does not import subnet masks and subnet mask is provided after the route update. For classful routing, subnet mask does not vary for devices. In classful routing, VLMS which is the Variable Length Subnet Mask and CIDR which is an abbreviation for Classless Inter-Domain Routing is not supported.
Now that we have discussed the various nuances of classful addressing, it is time we discuss the disadvantages of Classful Addressing. We discussed that Class A has a mask of 255.0.0.0 and hence can support 16, 777, 214 addresses and Class B with a mask of 255.255.0.0 supports 65, 534 addresses whereas Class C with a mask of 255.255.255.0 support 254 addresses. The problem of classful addressing arises when 2000 addresses are required. The probable solution to this problem is to provide the user Class B or Class C address but that would result in a waste of either so many addresses or too many networks to handle. Hence, CIDR was introduced to resolve this issue.
This brings us to our next segment where we discuss Classless Inter-Domain Routing (CIDR).
Classless Inter-Domain Routing (CIDR)
CIDR or Class Inter-Domain Routing were introduced in 1993, replaced classful addressing as it allows the user to use VLSM, better known as Variable Length Subnet Masks, as mentioned above.
The notation used in CIDR is /X. For example, a subnet of 255.255.255.0 is denoted by /24. In CIDR, we have to first convert the value of each octet into its respective binary value. Let's understand the concept of CIDR with the help of an example. If the subnet is of 255.255.255.0. then, the value of the first octet is 255 and its binary conversion is 8 binary 1's. It is the same for all the three octets as the decimal value is the same, i.e., the binary conversion of the octet value is 8 binary 1's. The value of the fourth octet is 0 and hence the binary conversion is 0 binary 1's.
Hence, for the entire subnet, there is a total of 24 binary 1’s and therefore the subnet mask is /24. This is an example of a CIDR, we hope the concept is now clear in your mind.
A network in CIDR cannot have contagious masks. Therefore, a subnet mask like 10111111.X.X.X cannot exist. However, Variable Lengths Subnet Masks’ can be created with CIDR. This results in less wastage of IP addresses. In CIDR, it is not compulsory that the divider between the network and the host portions is at an octet boundary. In CIDR, we can expect subnet masks like 255.224.0.0 or 11111111.11100000.00000000.00000000 to exist.
Now that we have discussed the concept of routing, classful and classless routing in detail, it’s time to proceed to understand the difference between classful and classless routing.
Classful and Classless Routing
This section depicts a contrast between the two routing protocols. In this segment, we will look at the difference between classful routing and classless routing under broad sections. Let’s begin.
VLMS (Variable Length Subnet Mask) is not supported in classful routing while it is supported in classless routing.
More bandwidth is required to perform Classful routing; however, less bandwidth is required for classless routing.
Unlike in classless routing, the "hello" messages are not used in classful routing.
The subnet mask is not imported for classful routing and subnets are also not displayed but the classless routing imports subnet masks and are also displayed in other major subnets.
In case of classful routing, the address is divided into three parts, that is, Network, Subnet and Host. In classless routing, the address is divided into two parts: Subnet and Host.
Regular or periodic updates are used in classful routing but in classless routing, triggered updates are used.
Classful routing does not support CIDR while classless routing does support CIDR.
Fault detection is very easy in classful routing but it is a little tough when it comes to classless routing.
These were the basic differences between classful and classless routing; we hope that you have understood the basic concept of each protocol along with the differences of each of them.
With this we come to an end of our blog in which we compiled the basics of routing, an important concept of computer networks, along with the difference between classful routing and classless routing. Also, if you think there is a concept or a major point of difference that we missed, we would be happy to hear from you and build a community of successful technocrats.
In case you are interested in learning the basics as well as the complex nuances of web development, we have a course designed just for passionate learners like you. We make you learn the basics, encourage you to build projects and help you build competitive portfolios.
The course that we are talking about is Konfinity’s Web Development Course The course is well-researched and is one of the most beneficial training courses out there. It is developed by experts from IIT DELHI in collaboration with tech companies like Google, Amazon and Microsoft. It is trusted by students and graduates from IIT, DTU, NIT, Amity, DU and more.
We encourage technocrats like you to join the course to master the art of creating web applications by learning the latest technologies, right from basic HTML to advanced and dynamic websites, in just a span of a few months.
Konfinity is a great platform for launching a lucrative tech career. We will get you started by helping you get placed in a high paying job. One amazing thing about our course is that no prior coding experience is required to take up our courses. Start your free trial here.