Exploding Garrmondo Weiner Interactive Swiss Army Penis

Exploding Garrmondo Weiner Interactive Swiss Army Penis (http://www.gamingforce.org/forums/index.php)
-   Help Desk (http://www.gamingforce.org/forums/forumdisplay.php?f=36)
-   -   Need a crash course in subnetting (http://www.gamingforce.org/forums/showthread.php?t=18133)

Soldier Jan 30, 2007 02:57 PM

Need a crash course in subnetting
 
My latest ITT class has been focusing on subnetting, a subject that forced me to withdraw from my previous class. I want to get it right this time with this second attempt, but it's a real pain to learn. Even worse, calculators won't be allowed during skills tests. Any websites that explain in great detail to retards like me on how to subnet? :tpg:

Fleshy Fun-Bridge Jan 31, 2007 12:47 AM

This is strait from my knowledge as a CCNA:

First off, some basics about subnetting, and why its a good thing:

Reduced Network Traffic. Subnetting breaks up broadcast domains. (Actually, routers break up broadcast domains, but when you subnet you need routers to move traffic across networks). Broadcast traffic has be to delt with by pretty much every node on a network, so by segmenting broadcast domains you can minimize the impact this traffic has on throughput.

Optimized Network Performance. Less broadcast traffic means more bandwidth available for useful purposes.

Simplified Management. Its a lot easier to troubleshoot network problems when your segments are smaller.

Facilitated Spanning of Large Geographical Distances. In general, Wide Area Network links are slower than Local Area Network links. Attempting to create one single large network that spans long distances would be a complete and total pain in the ass.

---

There are three classes of networks, each with their own default mask:
Code:

Class                Format                                Default Mask
Class A:        network.node.node.node                255.0.0.0
Class B:        network.network.node.node        255.255.0.0
Class C:        network.network.network.node        255.255.255.0

When you subnet these networks, you cannot change the first bytes of the default mask. For example, if you subnet a Class B network, you cannot use the mask 255.128.0.0. You also cannot use the mask 255.255.255.255 because that is the broadcast address.

Note There are a couple of different ways of expressing a subnet. One method is to explicitly write the address and subnet mask, like such:

172.16.10.5 255.255.255.128

If you expand the subnet mask into binary, it looks like this:

11111111.1111111.1111111.10000000

Another method is to use what is called Classless Inter-Domain Routing format (CIDR). The above would appear as such in CIDR notation:

172.16.10.5/25

The /25 means that the first twenty-five bits of the mask are set to 1, while the remaining seven bits are set to 0.

Subnetting a Class C Network

The possible subnets for a Class C Network are as follows:
Code:

Binary                Decimal                CIDR
10000000        128                /25                (This is NOT a valid subnet on any CISCO examination)
11000000        192                /26                2 subnets
11100000        224                /27                6 subnets
11110000        240                /28                14 subnets
11111000        248                /29                30 subnets
11111100        252                /30                62 subnets
11111110        254                /31                (This is also NOT a valid subnet)

/31 is not a valid subnet because it leaves on 1 bit for host assignment. If all the node bits are off (0), the address is the Network Address. If all the node bits are on (1), the address is the Broadcast Address. If you leave only one bit for node assignment, you can only have the Network Address or the Broadcast Address! So, /31 is right out.

RFCs state that subnet bits cannot be all off or all on. This makes /25 completely illegal, since the only possible subnets are either all off or all one. In practice, you can use /25--it is called subnet zero--but if you try to use subnet zero on any formal exams you will probably lose points.

The most common questions regarding subnets are:
How many subnets can you have given the subnet mask (and network class)?
How many hosts can you have per subnet?
What are the valid subnets?
What are the valid host ranges?
What are the broadcast addresses for each subnet?

Here's an example:
A Class C network with a network address of 192.168.10.0 and subnet mask of 255.255.255.252
CIDR notation would be 192.168.10.0/30

We know that the base mask for a Class C network is 255.255.255.0 or /24, so we can ignore those bits. This leaves us 6 bits left for subnetting, and two bits left for host assignment.

To compute the number of possible subnets, take the subnet bits (in this case 6 bits), raise 2 to that power (2^6) and subtract 2 (because you can't have all the bits off and you can't have all the bits on). Thus, the number of possible subnets is 2^6 - 2 = 64 - 2 = 62 subnets.

To compute the number of possible hosts available to each subnet, take the host bits (in this 2 bits), raise 2 to that power (2^2) and subtract 2 (because if all the host bits are off, that refers to the subnetwork itself; if all the host bits are on, that is the broadcast address). Thus, the number of possible hosts per subnet is 2^2 - 2 = 4 - 2 = 2 hosts.

The valid subnets are easier to compute by laying them out in binary: (We have 6 subnet bits, but you must calculate using all eight bits)
00000000 - Not valid. All the subnet bits are off.
00000100 - 4 (192.168.10.4)
00001000 - 8 (192.168.10.8)
00001100 - 12 (192.168.10.12)
00010000 - 16 (192.168.10.16)
00010100 - 20 (192.168.10.20)
...
11111000 - 248
11111100 - Not valid. All the subnet bits are on.

The broadcast addresses for each subnet are always the number right before the next subnet. So, for subnet 4 (192.168.10.4), the broadcast address is 7 (192.168.10.7). For subnet 12 (192.168.10.12), the broadcast address is 15 (192.168.10.15).

The valid host ranges are every other number between the subnet number and the broadcast address. For subnet 8 (192.168.10.8), the host range is 9-10 (192.168.10.9 - 192.168.10.10).

This same method extends to Class B and Class A networks, only you have more bits to work with.

This is only basic subnetting, and will get you a Classful Network. For simple network layout, that's okay, but you can end up wasting addresses. There is another topic, called Variable Length Subnet Masks (VLSM) that I will write about later.

Fleshy Fun-Bridge Feb 3, 2007 12:34 PM

VLSM -- Variable Length Subnet Masks

VLSM is simply a technique to more efficiently utilize an address space. Instead of dividing a network up into equal sized subnets (by using one subnet mask), networks can be divided up into finder pieces by 'sub-subnetting'.

Here's an example: Imagine you have nine labs (Lab A to Lab I) connected together via six routers (R1 to R6) with five point-to-point links between them. Each lab has 12 hosts, so you pick the subnet mask 255.255.255.240 (/28) which gives you 14 hosts. Each lab and each point-to-point link between routers requires its own subnetwork:
Code:

Lab A:      192.168.1.16/28    Lab C:      192.168.1.64/28
Lab B:      192.168.1.32/28    Lab D:      192.168.1.80/28
R1 to R2:  192.168.1.48/28    R2 to R3:  192.168.1.96/28

Lab E:      192.168.1.112/28    Lab G:      192.168.1.160/28
Lab F:      192.168.1.128/28    Lab H:      192.168.1.176/28
R3 to R4:  192.168.1.144/28    R3 to R5:  192.168.1.192/28

Lab I:      192.168.1.208/28
R5 to R6:  192.168.1.224/28

Notice that the subnetworks start at 192.168.1.16/28 instead of 192.168.1.0/28. 192.168.1.0/28 is subnet zero, and is not considered acceptable for use by CISCO on any of their exams.

Without VLSM, point-to-point links between routers have 14 valid host addresses given to them when you only need two! This is a huge waste of address space.

With VLSM, one can take two contiguous /28 subnets (14 hosts each), concatenate them into a /27 subnet (30 hosts), and then slice it up into seven /30 subnets (2 hosts each). Each of these sub-subnets is then assigned to the point-to-point links between routers. So, subnetworks 192.168.1.0/28 and 192.168.1.16/28 become 192.168.1.0/27. This is then sliced into 192.168.1.4/30, 192.168.1.8/30, 192.168.1.12/30, 192.168.1.16/30, 192.168.1.20/30, 192.168.1.24/30, and 192.168.1.28/30.

Code:

                                          /--- 192.168.1.0/30  <--- subnet zero
                                          |
                                          |--- 192.168.1.4/30
                                          |
                                          |--- 192.168.1.8/30
                                          |
192.168.1.0/28  ---\                      |--- 192.168.1.12/30
                  |--- 192.168.1.0/27 ---|
192.168.1.16/28 ---/                      |--- 192.168.1.16/30
                                          |
192.168.1.32/28                          |--- 192.168.1.20/30
                                          |
192.168.1.48/28                          |--- 192.168.1.24/30
                                          |
    (...)                                \--- 192.168.1.28/30

Five of these /30 subnets can be used for the point-to-point links. The network now becomes:
Code:

Lab A:      192.168.1.32/28    Lab C:      192.168.1.80/28
Lab B:      192.168.1.64/28    Lab D:      192.168.1.96/28
R1 to R2:  192.168.1.4/30      R2 to R3:  192.168.1.8/30

Lab E:      192.168.1.112/28    Lab G:      192.168.1.144/28
Lab F:      192.168.1.128/28    Lab H:      192.168.1.160/28
R3 to R4:  192.168.1.12/30    R3 to R5:  192.168.1.16/30

Lab I:      192.168.1.192/28
R5 to R6:  192.168.1.20/30

Much more efficient.

I should mention that the process of concatenating two contiguous subnets together into one larger subnet is called Summary Routing or Supernetting. Supernetting allows a router that understands VLSMs to advertise a route to many contiguous subnets with a single update. This saves bandwidth, since otherwise the router would have to advertise each individual subnet. In the example above, all of the point-to-point /30 subnets fall into a single /27 supernet: 192.168.1.0/27.

Update to make a note about how a network's class is determined from its IPv4 address (and some special IPv4 addresses)

An IPv4 address is a group of four bytes. The first byte can divided into two nibbles (four bits). The most significant nibble (the first four bits) is used to determine the class of the IPv4 address.

Here is a breakdown of the first four bits, their address range, and what class of network they belong to:

Code:

Bits    Address Range                  Class
0000    0.0.0.0 - 127.255.255.255      A
1000    128.0.0.0 - 191.255.255.255    B
1100    192.0.0.0 - 223.255.255.255    C
1110    224.0.0.0 - 239.255.255.255    D (multicast)
1111    240.0.0.0 - 255.255.255.254    E (research)

I didn't list 255.255.255.255 because that is the limited broadcast address.

Each class has some special ranges of addresses that are allocated for specific uses:

Class A
0.0.0.0/8 "This host on this network"; Can only be used as a source address
10.0.0.0/8 Private Network
14.0.0.0/8 Public Data Networks
127.0.0.0/8 Loopback addresses

Class B
169.254.0.0/16 Link-Local (Zeroconf)
172.16.0.0/12 Private Network
192.0.2.0/24 Documentation and Example Code. Think of these like "555" telephone numbers
192.88.99.0/24 IPv6 to IPv4 relay

Class C
192.168.0.0/16 Private Network
198.18.0.0/15 Network Benchmark Tests

Class D
224.0.0.0/4 Multicasts

Class E
240.0.0.0/4 Reserved

Ass you can see, there are three private networks available for user internally: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16.

Soldier Feb 12, 2007 05:16 PM

I'm surprised you typed all this up to me. Much thanks.


All times are GMT -5. The time now is 10:39 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2025, vBulletin Solutions, Inc.