|
Decimal to Hex is a little bit more difficult. First we have to understand our range of numbers. As all of you know, in the computer industry we always do ordinal counting. Ordinal counting is when you start with the number 0. So lets build our Decimal and Hex number chart.
|
Decimal
|
Hex
|
| 0 |
0 |
| 1 |
1 |
| 2 |
2 |
| 3 |
3 |
| 4 |
4 |
| 5 |
5 |
| 6 |
6 |
| 7 |
7 |
| 8 |
8 |
| 9 |
9 |
| 10 |
A |
| 11 |
B |
| 12 |
C |
| 13 |
D |
| 14 |
E |
| 15 |
F |
With the above chart, a quick example of converting would be to simply find the number 10 in Decimal and then see what it is in Hex (A). But what if you had 220 in Decimal? What would that be in Hex. The answer is as simple as dividing. First we take 220 and divide it by 16, but we do it using 2nd grade math!! 16 won't go into the first number 2 so we see if 16 will go into the first two digits (22) and it does ONE time with a remainder of 6. Then we slide the zero down to make that 6 a 60 and find out how many times 16 will go into that and it does THREE times with a remainder of 12. So we take our first two divisor numbers of ONE and THREE and put them together to make 13. 13 Decimal translates into D in Hex. Then we take the remainder of 12 and translate it using the same method and discover that 12 decimal is C in Hex. Then we simply take our two hex numbers and put them together to create DC...which is 220 in Decimal.
For subnetting, you pretty much have to completely understand everything there is. The unfortunate part is that if you don't know how to subnet, then you will most definitely fail the test. The even more unfortunate part is that will apply for almost every advanced networking course you will ever take. Subnetting is universal and you have to know it universally.
So enough of the good news about how easy subnetting is and lets just jump right into it!!! First in order to subnet you have to know some things about IP address.
- IP addresses are broken down into classes. These classes are based on the binary interpretation of the first number of the IP address.
- The classes are A, B, C, D, and E. For the purpose of almost any test the only classes we care about with subnetting is A, B, and C. Class D is for multicasting and E is experimental.
- IP addresses are composed of four octets. Each octet is separated by a period. So, for example, 131.10.24.52 would be the IP address showing the four octets and the periods separating the octets.
- Decimal IP addresses can also be represented by binary bits. For example, 131.10.24.52 would be represented as 10000011.00001010.00011000.00110100
- In the first bullet, I said the IP addresses are classified by the binary interpretation of the first number. Class A IP addresses will always start with a 0 in binary. Class A IP addresses will be between 0 and 127 in Decimal
- Class B IP addresses will be 10 in binary and will range from 128 to 191 in Decimal
- Class C IP address will be 110 in binary and range from 192 to 223 in Decimal
Now that we know that we now need to learn how to make one of two charts or cheatsheets. I am absolutely a proponent of charts and cheatsheets, especially when learning subnetting. There is no reason to make learning difficult when you don't have to. An old Sargeant Major of mine once told me "....working smart is always better than working hard....". While it sounded strange at first it completely makes sense...besides you don't become an old Sargeant Major by being stupid.
Anyway, to make our first chart we will do the following. The end result of your first chart should look like something below.
|
Networks
|
2 |
4
|
8
|
16
|
32
|
64
|
128
|
256
|
|
|
256 |
128 |
64 |
32 |
16 |
8 |
4 |
2 |
Possible IP Addresses |
| Binary Bit |
128 |
64 |
32 |
16 |
8 |
4 |
2 |
1 |
|
|
254 |
126 |
62 |
30 |
14 |
6 |
2 |
0 |
Usable Ip Addresses |
Now that we see what it should look like lets make it.
first, start with writing a number 2 down on your sheet of paper on the right side and multiple by two moving to the left. Keep about 1/2 inch between each number. This will be your Possible IP addresses.
Then, do the exact same thing, with starting with 2 right above the 256 you just wrote and move to the right. This is your "networks".
Then, under your first 2, divide that number by 2 and move to the left until you end up with 128 under the first 256. This is the value of your binary bit, which will come into play later
Lastly, under the last row of numbers you wrote down, subtract 2 from the list of possible IP addresses you created in the first step. This will be your Usable IP addresses.
Now that we have that, we now can talk a little bit more about subnetting. First, why do we have possible and then usable? Every network has to have a network ID and a broadcast ID. That is those two missing IP addresses. The lowest is always the network ID and the highest is always the broadcast ID.
Some rules you need to know about subnetting before we make the 2nd chart that mates up with the one you just drew.
- There are default subnet masks for each class of IP address.
- Class A default subnet mask is 255.X.X.X
- Class B default subnet mask is 255.255.X.X
- Class C default subnet mask is 255.255.255.X
- Only one octet can be subnetted at a time
- In which ever octet that is subnetted all octets to the left of it will always be 255 and all octets to the right will be 0 unless it is a class C subnet mask
- Regardless of what class, any requirement for over 126 hosts but less than 254 will always be 255.255.255.0
- No matter what the question, you will never have an answer that is 255.255.255.254
OK, now that we know the rules and have created our first chart, lets work on the 2nd one, which I call the / chart. The end result should look like the example below.
|
Network ID
|
/ |
Host ID |
Subnet mask |
| 1 |
/ |
7 |
128 |
| 2 |
/ |
6 |
192 |
| 3 |
/ |
5 |
224 |
| 4 |
/ |
4 |
240 |
| 5 |
/ |
3 |
248 |
| 6 |
/ |
2 |
252 |
| 7 |
/ |
1 |
254 |
First, on the left side, start with the number 1 and count to 7 going down. Then put a / right after that number
Then next to the / which is next to the 1, write down a 7 and count down to 1.
Believe it or not you have done almost 80% of all subnetting all ready, just need to do a little more and then solve a practice problem. The last step is to find the actual "subnet" with our / chart. We will start at the bottom. Taking the value of the first binary bit in the first chart you made (1) subtract from 255. This gives you 254. So for the 7/1 subnet mask you would put a 254 next to the 1. Then taking the value of the 2nd binary bit (2) subtract that from 254 to get 252. So, for the 6/2 subnet mask we would put a 252. Then take the value of the 3rd binary bit (4) and subtract that from 252 to end up with 248. So, for the 5/3 subnet mask we would put a 248. And the value of the 4th binary bit would be 8, subtract that from 248 and we end up with 240 for the 4/4 subnet mask. Easy stuff....fill in the rest of the chart using the same method to complete before we work a practice problem.
Now we apply our two charts to solve a problem. Lets say we have a requirement for 12 hosts out of a class C network. First, because it is class C, we know that the subnet mask is going to start with 255.255.255.X and we just need to figure out what the X is. You should also know that when someone asks for hosts, IP addresses, or computers, they are most likely all asking the same thing, just in a different way. So, next, we look at our first chart to find where we can meet our requirement of supporting 12 hosts. As we move along the usable area from 0 (not enough), 2 (not enough), 6 (not enough), 14 (enough...finally!!!!) we see that if we put a line between 14 and 30 then we have a 4/4 split. Taking our 4/4 split we match it up to the 2nd chart to find that equals to 240. So our final subnet mask to meet the requirement of 12 hosts would be 255.255.255.240.
We can also work in the other direction to find networks. Lets assume that we need 6 networks pulled out of a class C network. Again, it is a class C so we know the subnet mask is going to start with 255.255.255.X and we just need to figure out what the X is. Using the same method, but working from left to right this time and using the networks row, we see 2 (not enough), 4 (not enough), 8 (enough!!!) and when we count that up we see we have a 3/5 split. Using the 2nd chart, we match up 3/5 and find that our subnet is 224 so our final answer is 255.255.255.224.
Congrats, if that was easy for you then you just learned how to subnet with a minimum of hassle!!! As I stated earlier though, or if you had difficulty, if you want to be certified by Cisco, Microsoft, Linux, Novell, etc... then subnetting is a required item for you to MASTER!! Subnetting is used everyday in networking and there is no possible way I can see that you could survive without knowing how to do it. However, learning subnetting can be fun and whole new levels of confusion for those that have no idea can be reached when you try to explain it to them.
|