01-20-2017 10:40 AM - edited 03-08-2019 08:59 AM
Why is it that subnet mask of a host on a network has to be sent along with the data?
Solved! Go to Solution.
01-20-2017 12:42 PM
To explain this we should start with an understanding of classful routing, which came before classless routing. In classful routing there was an assumption that when a network was subnetted that all subnets would be the same size. This allowed there to be a simplification of the routing update message. All that needed to be sent was the subnet address - there was no need to advertise the mask since the size of the subnet mask would be known already since all subnets in the same network would be the same size. So instead of advertising 4 octets of address and 4 octets of subnet mask, the advertisement would have 4 octets of address (saving almost 50 per cent in size of the advertisement).
In the early days of networking this assumption made sense and was adopted. But as networks grew and became more sophisticated the assumption that all subnets in a network had to be the same size became inconvenient. It was desirable that some subnets could be small (perhaps /30 for links connecting router to router) and in the same network other subnets could be larger (perhaps /24 for subnets where users connect to the network). So networks began to switch from classful to classless routing. Since subnets could now be different sizes it became necessary for the routing advertisement to carry both the subnet address and the subnet mask.
HTH
Rick
01-22-2017 03:07 PM
Thank you for clarifying that the question was about classless routing protocols. I am glad that my response did clear your doubt. Thank you for marking this question as answered.
If the book that you are following discusses RIP and IGRP then it was probably talking about RIP version 1. Both RIP version 1 and IGRP are pretty old routing protocols (and current versions of IOS no longer support IGRP). So I would suggest that you find a more recent book for further studies of networking. But the question that you ask is about RIP and IGRP and so that is the question that I will answer. (and this answer will pretty well apply to more modern routing protocols such as EIGRP and OSPF). The first thing that I would clarify is that the traditional method of configuring routing protocols uses network statements. The purpose of the network statement is to tell the IOS router what interfaces to run the routing protocol on. It is a common misunderstanding that the network statement is telling the routing protocol what to advertise but this is not the case. The routing protocol uses the network statement to select interfaces on which to run and then uses the addressing of the interfaces to determine what to advertise.
So the first step in configuring the routing protocol is to specify the routing protocol for the IOS router to run. You would do this with a router statement. (Either router rip or router igrp. And if it is router igrp then it also includes an AS number such as router igrp 100)
The next step is to configure network statements for the interfaces that you want to include in the routing protocol. In your example there would be two network statements since you have interfaces in two networks. So
network 172.168.0.0
network 8.0.0.0
And with these statements your routing protocols are configured and will process on both of your interfaces.
HTH
Rick
01-20-2017 12:42 PM
To explain this we should start with an understanding of classful routing, which came before classless routing. In classful routing there was an assumption that when a network was subnetted that all subnets would be the same size. This allowed there to be a simplification of the routing update message. All that needed to be sent was the subnet address - there was no need to advertise the mask since the size of the subnet mask would be known already since all subnets in the same network would be the same size. So instead of advertising 4 octets of address and 4 octets of subnet mask, the advertisement would have 4 octets of address (saving almost 50 per cent in size of the advertisement).
In the early days of networking this assumption made sense and was adopted. But as networks grew and became more sophisticated the assumption that all subnets in a network had to be the same size became inconvenient. It was desirable that some subnets could be small (perhaps /30 for links connecting router to router) and in the same network other subnets could be larger (perhaps /24 for subnets where users connect to the network). So networks began to switch from classful to classless routing. Since subnets could now be different sizes it became necessary for the routing advertisement to carry both the subnet address and the subnet mask.
HTH
Rick
01-20-2017 01:29 PM
What case of a subnet mask of a host being sent with data do you have in mind?
If you're thinking of routing protocols, Rick nicely addresses that.
If you're asking about something like DHCP sending an IP to a host, if so, the host IP is sent with subnet mask information so that the host can identify what its network prefix is. It uses this information when sending to other hosts, as it assumes that other host destinations with the same network prefix can be directly ARP'ed for their MAC. IP hosts also assume other hosts on the same network segment support the same physical MTU. Hosts also uses the network prefix to identify IP broadcasts to their network address prefix.
Interestingly, the way subnet masks are normally used, I don't believe you really need to send the actual mask, you could instead send the length of the prefix, which would be much smaller than the whole mask, but the mask could be created from it.
01-20-2017 02:48 PM
I found the original post to be confusing. The text of the post talks about the subnet mask of a host and asks why that has to be sent along with the data. The context of this is quite unclear. But I thought that I could guess at the context based on the title of the post which was classless routing. So I based my response on the assumption that the question was really about classless routing advertising the mask along with the address.
So Joseph is correct that the question might be asking about something different. We need the original poster to clarify what they are really asking about.
HTH
Rick
01-20-2017 03:05 PM
Yup, ditto about post being confusing, but I did overlook the post's title after reading the question.
Again, Rick, you nicely addressed the question if it's related to routing, but when I read the question, something like DHCP came to mind.
Anyway, as you say, OP need to clarify if neither of us provided what's being sought.
01-22-2017 02:33 AM
Hello Richard,
Sorry about the question being a bit confusing.Yes, I was expecting an answer from the context of Classless routing.
You have nicely addressed the question and it has cleared by doubt.
Also Rick please explain me how to configure a router with respect to the routing protocols(RIP and IGRP). The book which I follow uses the commands
1.router rip
2.network _____
for example let's say,
1 interface of the router is connected to a network 172.168.0.0 and another interface is connected to a network say 8.8.8.8.
I only came across examples where a router is configured for different subnets of a single network.
How do I configure a router for these networks using the commands as listed above?
Thanks.
01-22-2017 03:07 PM
Thank you for clarifying that the question was about classless routing protocols. I am glad that my response did clear your doubt. Thank you for marking this question as answered.
If the book that you are following discusses RIP and IGRP then it was probably talking about RIP version 1. Both RIP version 1 and IGRP are pretty old routing protocols (and current versions of IOS no longer support IGRP). So I would suggest that you find a more recent book for further studies of networking. But the question that you ask is about RIP and IGRP and so that is the question that I will answer. (and this answer will pretty well apply to more modern routing protocols such as EIGRP and OSPF). The first thing that I would clarify is that the traditional method of configuring routing protocols uses network statements. The purpose of the network statement is to tell the IOS router what interfaces to run the routing protocol on. It is a common misunderstanding that the network statement is telling the routing protocol what to advertise but this is not the case. The routing protocol uses the network statement to select interfaces on which to run and then uses the addressing of the interfaces to determine what to advertise.
So the first step in configuring the routing protocol is to specify the routing protocol for the IOS router to run. You would do this with a router statement. (Either router rip or router igrp. And if it is router igrp then it also includes an AS number such as router igrp 100)
The next step is to configure network statements for the interfaces that you want to include in the routing protocol. In your example there would be two network statements since you have interfaces in two networks. So
network 172.168.0.0
network 8.0.0.0
And with these statements your routing protocols are configured and will process on both of your interfaces.
HTH
Rick
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide