cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3099
Views
10
Helpful
9
Replies

Subnetting

carl_townshend
Spotlight
Spotlight

Can anyone give me a good explanation of why you would use different subnets i.e 255.255.253 etc, whats the purpose of changing the subnet from 255 to 252 for example. Also is there a good site to help me learn how to subnet properly. I cant get my head around it very well. ? ?

please help

9 Replies 9

thisisshanky
Level 11
Level 11

Note, always subnet numbers will be a multiple of two (inluding masks, excluding the 255s)

So there is no 255.255.253.0 ? but I know you meant 255.255.252.0

Assume a subnet 192.168.1.0 255.255.255.0 -> Class C subnet with 254 assignable hosts (.0 and .255 are for network and broadcast addresses).

Assume a link between two routers R1-----R2. TO connect these two routers together and to help them communicate, we need ip addresses on R1 and R2s interface. I could do it very easily by assigning

192.168.1.1 255.255.255.0 to R1 and 192.168.1.2 255.255.255.0 to R2. See that addresses

192.168.1.3-192.168.1.254 are wasted because I cannot assign them any where else in my network.

To avoid wastage of IP addresses, subnetting was introduced. The idea is to break big networks into smaller networks depending upon number of hosts that require an IP in a network segment.

192.168.1.0 with a mask of 255.255.255.252 will give you 2 valid host IP addresses - 192.168.1.1 and 192.168.1.2. YOu can assign these addresses to R1 and R2.

When you break down 192.168.1.0 (mask 255.255.255.0) into smaller subnets such as 192.168.1.0 (mask 255.255.255.252), you also get a lot of other subnets namely,

192.168.1.0, 255.255.255.252 (already assigned)

192.168.1.4. 255.255.255.252

192.168.1.8. 255.255.255.252

192.168.1.12. 255.255.255.252

192.168.1.16. 255.255.255.252

192.168.1.20. 255.255.255.252

192.168.1.24. 255.255.255.252

.

.

.

192.168.1.252 255.255.255.252

Thus we save a lot of IP addresses by dividing the big subnet into smaller subnets as required. Now to learn how to do the math, check this link.

http://www.ralphb.net/IPSubnet/

Sankar Nair
UC Solutions Architect
Pacific Northwest | CDW
CCIE Collaboration #17135 Emeritus

Hi Shanki

thanks for the reply, I am interested in why you say if you apply the 2 addresses to the interfaces for the 2 routers, you say the other addresses are then wasted. Why would they be wasted ? ?

Once you assign a network address to a segment, you should not reassign the same network address to another segment in your network. This would cause address conflicts, as well as routing issues. Network addresses are just like identities, if there are two "Dave"'s in a room, if you just call out for Dave, both will answer. Same rule!!

Sankar Nair
UC Solutions Architect
Pacific Northwest | CDW
CCIE Collaboration #17135 Emeritus

I am still a little unclear on this, So how would you not waste the IP,s , are you saying if you put in the mask of 252 you can still use the other unused addresses on the network ? plesse explain ?

thank m8

It's a matter of history. Back when Vinton Cerf invented the IP protocol, the address space was split into networks: class A, class B, and class C. The class C networks were all those that began with 192 to 223, i.e. the top three bits were 110. Each class C network had 256 addresses. For example, 193.1.42.0 is a class C network, and has addresses 193.1.42.0 to 193.1.42.255.

Historically, these Class C networks could not be split up. For example a link could be considered a network. If you give a link the address 193.1.42.1 at one end and 193.1.42.2 at the other end, then the link is considered to be the network 193.1.42.0. Nobody else in the world would be allowed to use any addresses in the range 193.1.42.0 to 193.1.42.255. So, for the sake of using two addresses on your link, the other 254 addresses would be wasted.

Subnetting overcomes this by allowing you to split class C (and other class) networks into subnetworks. Thus, different parts of the same network 193.1.42.0 could be used on different links.

The use of addresses 192.168.x.0 is also a special way of conserving address space. These addresses are not globally unique, and are not routed by the internet. Therefore NetAdmins are allowed to use them and reuse them at will.

Hope this makes it clearer.

Kevin Dorrell

Luxembourg

Hi again mate

Does that mean if I had network 10.1.1.0

mask 255.255.252.0, I would get 256 useable addresses in the 10.1.1.0 subnet ?

Hi again mate

Does that mean if I had network 10.1.1.0

mask 255.255.252.0, I would get 256 useable addresses in the 10.1.1.0 subnet ?

Carl,

Not really. If your mask is 255.255.252.0, then that means that in the third byte of the address, six bits are part of the subnet address, and the bottom two bits are part of the host address. Try writing 252 in binary. The host part is a total of 10 bits: two from the third octet and all eight from the fourth octet. That is, with a mask of 255.255.252.0, the subnets start at:

10.1.0.0

10.1.4.0

10.1.8.0

10.1.12.0

10.1.16.0

etc.

So a (sub)net of 10.1.1.0 and a mask of 255.255.252.0 does not make any sense. With that mask, the address 10.1.1.0 would be the 256'th (host) address in the 10.1.0.0 subnet. Each subnet would have 1024 addresses, of which the first (10.1.0.0) and last (10.1.3.255) are not useable.

Again, try writing it all out in binary.

I can sense how confusing this can be, but I'm not sure how to explain it any clearer. It's one of those things - once you get the hang of it, then it all becomes suddenly clear - like riding a bicycle or swimming. But until then, it is tough to understand.

Kevin Dorrell

Luxembourg

scottmac
Level 10
Level 10

Subnetting generally fulfills a couple needs:

It allows you to take an assigned block of addresses and "carve them up" for use across the network.

Routers are used to break up the size of a network (the "broadcast Domain") and connect different topologies (think: serial in the WAN, Ethernet in the LAN). Routers cannot route between addresses if they're in the same network/subnetwork.

Subnetting allows you to start with a larger block of addresses ("Network Addresses"), then break them up into smaller blocks (Sub-Network Addresses") and still be able to route (i.e., break up the network into segments) within the primary block.

"Back in the Old Days," the blocks of "private" addresses (10.x.x.x, 172.16-31.x.x, 192.168.X.0)didn't exist (or at least didn't exist as "private" addresses) as they do now ... it was very important to use the addresses assigned to you (and no more).

Also, because you only got a specific range of addresses (in the Good Old Days), it became important to conserve the addresses. Subnetting (specifically Variable Length Subnet Masks) allows you to use only the number of addresses to accommodate a given location on the network.

Next, if you take the time to design the subnetting scheme properly, you can split the subnets such that you can advertise a group of routes with a single address ("Route Summary" / Supernetting).

The result of proper subnetting is genuine economy of resources: bandwidth (because you only use a single summary route), Router CPU time (because it only has to compare / match a single destination in the routing table), memory (because your routing tables are much smaller), and time, because it's very easy to associate a given (summary) route to a given region / subnetwork that is a member of the summarized routes.

Carl, I gotta tell ya, there are volumes of info relating to this topic .... this is just a surface-scratching.

http://www.learntosubnet.com is a very popular place to pick up subnetting skills.

Todd Lammie (spelling?, sorry Todd) has some good material (in books and CBT) on how to learn to subnet quickly.

If you go to Cisco's main website and search on "subnetting" there are some good resources that teach you to subnet "The Cisco Way" (i.e., to get the same answers that are on the tests).

If you Google on "Internetworking," the Cisco online version of their "Internetworking" book is usually the first or second hit. Check it out, it covers basic networking technology (and subnetting) very, very well.

I hope this gives you a decent high-level overview, and a few other places to take a look.

If you still have some questions, post again and we'll give it a shot.

Good Luck

Scott