Discussion Locked

TCP/IP Subnetting

0 helpful
9 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
how we do subnetting?

9 replies

by ebob

The first question is "WHY" do subnetting. The short answer is that it is highly unlikely that the address space that you have available to your organisation is really appropriate for use on your network.

For example, I know one company with a class B address space. This provides 16K addresses. When the company got this space, they had about 14000 employees, in 12 countries, and not all of them had computers. Sounds like a good match? No! The problem here is that if we use the default mask, we have to treat this as one big network. So for users in Switzerland to talk with users in Canada, they would have had to setup a network with Bridges, instead of Routers. But Bridged networks also transmit all sorts of network broadcats and other "superfluous" traffic, which means the WAN links would have had to be huge, and expensive. But Routed networks just move "real" data (to keep it simple), so can run on smaller, less costly pipes. How to do that? Give each location its own "network" address space. Since this company had a class B (from the Internic) network already, it was a "relatively" simple matter to break it up. The formal process to break up an existing network into SUB-networks, is called subnetting. It uses "subnet masks" to identify the subsets (or "subnets") of the whole network. The routers recognise subnet masks as defining discrete networks, and do their work properly. In this way, systems in Switzerland aren't slowing down everytime somebody in Canada turns on aprinter (which pumps out an Ethernet broadcast, etc., which in turn is NOT routed across the WAN).

The other comment in this thread recommends a good site for lots more information.

by shanghai sam

Before you find out "How" you need to understand "Why".

Largely, it is because the address space that is available to your organisation likely does not fit.

For example you may have a nice "Class C" address (e.g., 196.10.10.0) which provides 256 addresses. Your organisation has 200 employees. 150 work in the head office in London, and 50 work at the branch in Hong Kong. So you seem to have enough addresses (200 < 254) with a little bit of room to spare for printers, etc. But can you builda network that connects these 2 sites? The real answer is: Yes, but...

Without subnetting these 2 sites would use the default mask (255.255.255.0) and are considered by ALL networking gear to be the SAME network segment. So you would actually need to run a BRIDGE between these sites. But a Bridge wants to support ALL Ethernet traffic, like broadcasts and such. Do your London users really NEED to know when a printer in Hong Kong is switched on? Probably not. With a switched network, they will, however!

So the BEST approach is to break your network up into subsets of the whole network (or "subnets"). You do that with "subnet masks", which simply extend the definition of what part of the address is the "network" vs. what part is the "host" (the PC, the printer, whatever).

For example, in this example, you could break the network using a subnet mask of 255.255.255.192 which splits it into 4 equal parts (196.10.10.0-63, ...64-127, ...128-191, ...192-255). You could deploy 3 in London and 1 in Hong Kong.

Then establish the link between the 2 sites, using a pair of routers and some sort of WAN line (like Frame/Relay). The routers will NOT forward broadcasts, and other superfluous LAN traffic. They will only forward traffic with an explicit address at the "other" site, so you can use a relatively small pipe (relative to what you would need for a BRIDGEd network, that is).

by admin

There are a lot of reasons to subnet and the answer could actually range (IMHO) from easy (like we are doing private internal addressing and our hr department needs to be on a seperate subnet as part of our security plan or some people need to be ona subnet that has no access to our internet router) to the very good comments I see above on the HUGE scope of subnetting especially over public networks.
Perhaps you should ask what you want to do. Subnetting may not even be the best way to accomplish your goals.... :)

by brecicure

I want to congratulate the people who posted replies, for being accurate and clarifying the point. thanks!

by brecicure

I have a question. Suppose my new company wants to deploy an intranet and a connection to the Internet. Thus, i am given an IP number. For example CLASS B. Does this mean that it is only possible to perform subnetting with the last 2 octects (bytes) of the 32 byte address?
And if the address where of class C, then i could only use the last octect?
Is this right?

by ebob

You're not likely to get a class B. Even C's are tough to come by. Depending on your location, you are more likely to get a subnet from your provider. "But that's too small for my internal use!" Fortunately this is not really a problem.

You will only use the addresses from your provider for system you want "known" from the public network (the Internet). Forexample, you might have some web servers hanging off the outside of your firewall ("DMZ"). You might also have a tunnel through your firewall to let in email from your provider. The outside end of this tunnel uses one of the addresses from your provider.

On the inside, you use one of the so-called private, non-routable (across the Internet) address spaces. (Check out the RFCs for all of the available address spaces.) For example, you could decide to use the class A 10.0.0.0 as your internal network. Then you subnet it appropriate to your needs. You can even run this address space across a private WAN.

For your users to connect to the Internet through your firewall, you just setupo your firewall to do NAT and PAT. You'll mostly use PAT (Port Address Translation). This changes all outgoing source addresses to that of one of the addresses in the list provided by your provider. And it changes the source port to one of almost 16K available ports. It keeps track of these translations. When packets come back from the Internet, your firewall looks up what is now the destination address and port, compares it to its translation table, and ships it across your internal network (assuming it passes all of your other firewall checks).

by ebob

Cool thing, PAT. It allows you to use as few as ONE public address, and it (like NAT) completely hides your internal network structure from prying eyes. If you have one of those nifty Cable/DSL Routers at home (or on a small network at work), you are using PAT. Your router's documentation probably calls it NAT, but your provider also calls that other box a DSL "Modem", which is also mostly wrong.

This discussion is closed to new replies.