How exactly do subnet masks work in terms of how packets are delivered?

266 viewsOtherTechnology

I’m studying for a certification at the moment so I know a medium amount about the structure of subletting. The one thing my courses don’t explain very well is the actual function/process of how this works.

Specifically one thing I learned really upended my understanding. The example was if you have a host with the address 10.1.16.42/24 and a host with the address 10.1.16.200/16 would they need a router to communicate?

From my understanding they would, the first host is on the network 10.1.16 and the host section is 42. The second one is on 10.1 and the host section is 16.200. Since their network sections are different why do they not need a router to communicate if their network id’s aren’t the same?

In: Technology

6 Answers

Anonymous 0 Comments

RFC 1519 “Classless Inter-Domain Routing: An Address Assignment and Aggregation Strategy” (Sept 1993) is what you are referring to. Before CIDR, the abbreviation, every network was assigned as a class A, B, or C. That was clumsy, so the engineers schemed a way to subdivide the 32 bit address space from 1 host to all hosts.

The simple way to think about this is to think of the IP address and the subnet mask as 2 32 bit data structures. The IP address is just a binary number like any other divided into 4 8 bit octets for 32 total bits. The subnet mask is simply a ruler, in essence, you line up the subnet mask under the IP address (in binary) and where the 1s stop is where the host address starts. That gives you the ability to describe two pieces of information with the IP address, the network address and the host address. Routers will only route to network addresses, the terminal router, so the router that owns the network you are routing too, is the one responsible for resolving the host address to a MAC address and delivering the packets to the appropriate physical interface.

In your example, the bigger network, 10.1.xxx.xx encompasses every IP address from [10.1.000.001](http://10.1.000.001) to 10.1.255.254. The smaller subnet, 10.1.16.xxx, is only 10.1.16.000 to 10.1.16.254. We would call this a supernet overlap, so the router for the bigger network doesn’t need to route to the smaller one since it can ARP that interface, but the smaller one is otherwise unaware of the fact that other hosts may have been configured with a supernet, so it will automatically look for its configured router since the network 10.1.whatever.whatever is outside of its network. This is a bad configuration and it should be done, but sometimes we do this between routers to do something called route summarization. If I know that my adjacent router owns several contiguous networks, I can route to the closest supernet and it will encompass all the adjacent router’s networks. That way I have 1 route instead of however many routes I would need without summarization.

Your scenario can play out when you need to expand a network, say I have a standard /24 bit mask network and I need to put 260 hosts on it. Can’t do it, right? Well, I can go into the router that owns that /24 and change it to /23, I can then add hosts and simply give them a /23 bit mask. The problem is that all the other hosts aren’t automatically notified of this change, even if I use a DHCP server depending on the lease duration there could be an amount of time where old hosts can’t talk to the new hosts because according to the configuration they have in their NIC, they shouldn’t be able to ARP any IP address above the configured /24.

Good luck on your CCNA or Network+ or both.

You are viewing 1 out of 6 answers, click here to view all answers.