Home Training CCNA Online training materials CCNA Module 2 - Binary, Hex, Decimal, Subnetting
Content View Hits : 147383
We have 9 guests online
CCNA Module 2 - Binary, Hex, Decimal, IP addressing, Subnetting - by Paladin Intellects
CCNA module 02 - Binary, Decimal, Hexadecimal, IP addressing, subnetting
User Rating: / 0
PoorBest 

This module covers Binary, Decimal, Hexadecimal, IP addressing, subnetting....and it's one of the most important modules you could learn!!!

Just like Module One (the OSI Model ), the information in this module can be applied to virtually any certification exam you may run across. IP addressing will never change regardless if you are talking Microsoft or Cisco.

As previously mentioned though, there are three things that are the most important to learn in relation to the  CCNA exam :  OSI Model , IOS Command Line, and Access-Lists. You won't be able to configure a  router unless you know how to do subnetting and understand the subject of IP Addresses intimately. The same thing applies to access-lists, if you don't understand how subnetting works then you can plan on not passing the  CCNA test. Sorry for the bad news but that is the way it is.

But there is luck!!! We'll get you through this and you'll be a subnetting wizard quick!!!

VoIP available from Paladin Intellects

Binary to Decimal

First thing you need to know is binary and how to count in binary. Binary is just 1's and 0's unlike Decimal where we use 0-9 as numbers. Basically if you see a 1 then that bit is considered to be turned on....0 means turned off. Each bit also represents a number, so if that bit is turned on that number is active. The end result is that we add all the active values together to get our number.

First lets build the table and come up with some test numbers to work with.

128

64

32

16

8

4

2

1

<------this is the number that we will be adding together

0

0

0

0

1

1

0

1

<------this is the bit (1 for on and 0 for off)

So from the above example the bits that are turned on are 8, 4 and 1. When we add them all up we get 13. So the decimal number of 13 is the equivalent to 00001101 in binary.

If you know how to go from Binary to Decimal then going from Decimal to Binary is just the opposite. So, as an example lets say we want to convert 78 to binary, all we would do is start subtracting numbers from the left to the right until we ended up with 0.

128

64

32

16

8

4

2

1

<------this is the number that we will be adding together

0

1

0

0

1

1

1

0

<------this is the bit (1 for on and 0 for off)

To walk you through it :

  • Our number is 78...the first bit on the left is 128 (we can't subtract 128 from 78 and get 0) and not able to be used
  • 64 can be subtracted from 78 so we mark it as on (at this point our remainder is 14)
  • 32 can't be subtracted from 14 so we mark it as 0
  • 16 can't be subtracted from 14 so we mark it as 0
  • 8 can be subtracted from 14 so we mark it as 1 (our remainder at this point is 6)
  • 4 can be subtracted from 6 so we mark it as 1 (remainder is 2)
  • 2 can be subtracted from 2 so we mark it as 1 (we are at 0 now)
  • since we all ready reached 0 there is no reason to turn on any more bits.

Try these exercises for Binary to Decimal

  1. 10101010
  2. 01010101
  3. 11110000
  4. 11100000
  5. 00000111
  6. 00001111
  7. 11000110
  8. 10010011
  9. 10001000
  10. 11011011

The answers are :

  1. 170
  2. 85
  3. 240
  4. 224
  5. 7
  6. 15
  7. 198
  8. 147
  9. 136
  10. 219

A quick and easy way to come up with your own examples are to simply just randomly hit 1's and 0's until you get 8 digits....then work the problem out. To double check yourself any calculator in scientific mode can tell you if you are wrong or right

Decimal to Binary

To go from Decimal to Binary (the reverse) is to simply match up a number to something that could be found in our Binary chart up above.  So, for example, we take 224 Decimal and want to convert it to Binary.

128

64

32

16

8

4

2

1

<------this is the number we will be subtracting







1 1 1 0 0 0 0 0 <------this will be our binary answer

So we take 224 and see if we can subtract our columns.  In this example, 128 can be subtracted from 224 which leaves us with 96.  We then subtract 64 from 96 to end up with 32 and finally subtract 32 from itself to end up with zero.  Thus our answer is 11100000 binary for 224 decimal.  While it is extremely obvious to those who have been doing it a while, but it might be a good idea to state binary or decimal or hex behind your number so as to not confuse anyone you are talking to.

Decimal to Hex

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.

 

More practice questions : http://docs.google.com/Doc?id=dfkw4rxz_24hg2tzngm

 

This completes the module on subnetting. I want to warn everyone that it is critical that you completely understand subnetting before attempting any more modules. The next module is supernetting and VLSM (some call it stubnetting) and if you are not absolutely sure of yourself in those modules you will get lost quickly. When it comes the math, subnetting is the only real thing you will be doing for the rest of the CCNA program.  The other subjects are mostly command line, theory, etc... but several of the command line functions depend on mastery of subnetting.  Again, failure to know subnetting intimately will result in you failing virtually all certification tests.

 

Good luck to all, and please email me if you have any questions or want extra problems added to the module : This e-mail address is being protected from spambots. You need JavaScript enabled to view it


 

 

 

R e s o u r c e s

Downloadable Software Network Monitoring Enter a Trouble Ticket Document Manager DNS Management

 

PayPal Verified

 

Headquarters - 85 W. Combs Rd, STE 101#223, San Tan Valley, AZ, 85206

www.paladinintellects.com | Facebook | LinkedIn | info@paladinintellects.comsitemap | Gov. sales | Terms of Use | Privacy Policy | Submit a trouble ticket

Phoenix 480.305.7630 | Houston 832.247.1915 | Dallas 469.341.7834 | GSA 713-569-2558


 

 

Document Tree