When hearing Subnet Masking, most people just cringe because of the horror stories that are shared throughout networking. In actuality it is fairly simple. The main things you need to understand are:
In this guide I will cover each of these aspects starting with converting binary to decimal and vice versa. In subnet masking you work with a series of 4 bytes each byte separated by a decimal. This makes up your IP Address. Remember 1 bits = 8 bytes. So each Address contains 4 bytes or 32 bits.
That is the basic structure of an IP Address. Going from left to right 7 to 0 is important in converting binary into decimal. I will further explain this now. When converting binary to decimal you go from left to right to get your values. Binary solely consists of 1s and 0s.
In the examples, you take 1 times 2 to the power of it's corresponding number, 7, 6, 5, 4, 3, 2, 1, 0. remember 20 = 1. You do that all of the way through the series of 8 numbers, and add up the totals from each one. This will give you your conversion, and in this case it is your subnet mask. Now to convert from decimal to binary… this is much easier to understand. Say you have an address of 192.168.10.49, and you need to find the binary of the 49 her is how we would do it:
Now read the 1s and 0s from bottom to top. You will get 110001, and yes that is the binary for 49. Pretty easy right? Here is an explanation on what goes on. Given 49, you divide by 2, you get 24.5, you only take the 24 and the .5 turns into a remainder of 1. You then take 24 divide it by 2, you get an even 12 remainder is 0. You take 6 and divide by 2, again, no remainder. With 3 you divide by 2 and you .5 which in turn you get a remainder of 1, then you divide 1 by 2, which gives you .5 which ends up as a remainder 1. If you still do not understand the conversion process, there is always an alternative. In your windows calculator, or you scientific calculator you can take anywhere you have options of BIN and DEC. Binary of course is BIN and Decimal is DEC. You can be in BIN mode and type in 10011001, press DEC and it will give you a figure of 153. Now if you are in DEC mode, and you put in 230 then hit BIN you will receive 11100110. You just converted both ways with much more ease, but if you do not have the tools available and only paper and a pen, you always have these ways to back you up. You are probably thinking now, holy cow what did I get myself into. Now into the real stuff! When it comes down to subnet masking you need to understand how to separate the network bits from the host bits. The subnet mask will show you how many network bits are being used within an IP Address. Most of you see the subnet mask of 255.255.255.0. This signifies that the first 24 bits or 3 bytes are all used to show the network bits, the 0 will signify the host bits. Simple right? But what if the subnet mask is 255.255.255.224? This is where knowing binary comes in handy. I will show you how to set the network bits apart from the host bits. Remember that 255 is the highest decimal number representing an octet, which is all 1s in the host section. First before we jump in you need to understand the 3 main classifications of Addresses, they are as follow: Class A = 8 Network bits, 24 Host bits NETWORK.HOST.HOST.HOST Class B = 16 Network bits, 16 Host bits NETWORK.NETWORK.HOST.HOST Class C = 24 Network bits, 8 Host bits. NETWORK.NETWORK.NETWORK.HOST The network address range also matters, in a Class A It is always between 0 and 127, Class B is always 128-191, and a Class C is always between 192 and 223. This range is always displayed in the first 1 byte (8 bits) of an IP Address. 32.0.0.0 = Class A Network Address 255.0.0.0 = Subnet mask 155.0.0.0 = Class B Network Address (the next octet must be filled also to be class b) 255.255.0.0 = Subnet mask 192.0.0.0 = Class C Network Address (the next 2 octets must be filled to be class c) 255.255.255.0 = Subnet Mask When viewing other IP Addresses, you may notice an IP address that is 192.16.144.230/27. In that address the /27 signifies the number of bits that are used to show the network address. It is also equivalent to 255.255.255.224. 8 8 8 3 = 27 Now to put everything together… Remember the subnet mask only identifies the network address. So we will take the Class C IP Address of 192.168.212.198. We want to take this IP Address and find what bits are used to take up the network with a subnet mask of 255.255.255.192. Remember in a Class C address you are automatically given the subnet mask of 255.255.255.0. This one has been broken up to give extra network bits to create networks within the given address of 192.168.212.0. You can always take host bits to make more network bits but you cannot do the same with host bits taking network bits.
Here the Green numbers signify the network bits taken to create a subnet, and the blue numbers show the host bits. You must always separate the two to understand a subnet mask. The first 3 octets you already knew would be like that because of the class c address. It all came into the last octet, where the numbers matched up on the address to the subnet mask we were able to gate off the network bits to show what host bits we have to work with. The host bits are designated to the nodes on a network like computers, printers, routers switches, etc. |
|||||||||||||||||||||||||||||||||||