We have analyzed subnetting and understood how it works, but haven't yet dealt with the "communication" side of things. This will be analyzed here. It's an easy and very interesting page, so sit back and read through it comfortably.
Communication between subnets
After reading all the previous pages about subnetting, let me ask you the following:
Do you think computers that are on the same physical network but configured to be on separate subnets are able to communicate?
The answer is "no". Why? Simply because you must keep in mind that we are talking about the communication between two different networks!
Looking at our example of the class C network on the previous page, the fact is that one computer is part of the network 192.168.0.0 and the other one part of network 192.168.0.32, and these are two different networks. In our example, from the moment we modified the default subnet mask from 255.255.255.0 to 255.255.255.224, we split that one network to 8 smaller ones.
Let's try it
And because we just have to prove it, we are going to try it on my home network. In the worst case I'll have to spend all night trying to figure out what went wrong, but it will be worth it!
Without complicating things, here is a diagram of my home network. (I've excluded any computers
we are not going to be using, in order to save space.)
That's the network
In order to proceed to phase two of our experiment, I modified the subnet mask of my workstation
to 192.168.0.35 / 255.255.255.224 , my Slackware Linux Firewall to 192.168.0.1 / 255.255.255.224
(internal Network Interface Card) and my NetWare 6 server to 192.168.0.10 / 255.255.255.224 as
shown in the diagram below:
As you can see, the results for my workstation were devastating -- alone and totally unaware that the other two servers are still there. When my workstation tries to ping the Linux Firewall, it will get no reply, because its gateway is a host which belongs to another network, something that we knew would never work.
We have concluded that there cannot be any sort of communication between the computers of network 1 and network 2. How can two hosts in two different subnets talk to each other? That's what we are going to cover.
Building the bridge
There is a way to allow the communication between my workstation and my servers and the Internet. Actually, there are a few ways to achieve this and I'll show you a few , even though some might seem silly or impractical. We are not interested in the best solution at the moment, we just want to know the ways in which we can establish communication between the two subnets.
Considering that subnets are smaller networks, you would remember that we use routers to achieve communications between two networks. This example of my home network is no exception to this rule.
We need a router which will route packets from one network to the other. Let's have a look at the different ways we can solve this problem:
Method 1: Using a server with two network cards
Our first option is to use one of the servers, or a new Server which has at least two network cards installed. By connecting each network card to one of our networks and configuring the network cards so that each one belongs to one subnet/network we can route packets between them:
The above diagram shows pretty much everything that's needed. The second network card has been installed and it's been assigned an IP address that falls within our network 1 range and therefore can communicate with my workstation. On the other hand the NetWare server now acts as a gateway for network 1, so my workstation is reconfigured to use it as its gateway. Any packets from network 1 to network 2 or the Internet will pass through the NetWare server
Method 2: Binding 2 IP addresses to the same network card
This method is possibly the best and easiest way around our problem. We use the same network card on the NetWare server and bind another IP address to it.
This second IP address will obviously fall within the network 1 IP range so that my workstation
can communicate with the server:
As noted on the diagram, the only problem we might encounter is the need for the operating system of the server to support this type of configuration, but most modern operating systems would comply.
Once configured, the server takes care of any routing between the two networks.
Method 3: Installing a router
The third method is to install a router in the network.
This might seem a bit far fetched but remember that we are looking at all possible ways to
establish communications between our networks! If this was a large network, then a router could
possibly be the ideal solution, but given the size of my network, well... let's just say it would
be a silly idea :)
My workstation in this setup would forward all packets to its gateway, which is the router's interface and is connected to network 1 and it will be able to see all other servers and access the Internet. It's a similar setup to Method 1 but instead of a server we have a dedicated router. Oh, and by the way, if we would end up using such a configuration in real life.. the hub which both of the router's interfaces connects to would be replaced by some type of WAN link.
That completes our discussion on Subnet routing and communication.
Click over to Firewall.cx for more articles like this one. You don't have to register or jump through any hoops. All you do is get the networking information you want. Copyright 2004 Firewall.cx.
This was first published in October 2004