Showing posts with label subnetting. Show all posts
Showing posts with label subnetting. Show all posts

Saturday, May 17, 2008

CCNA Exam Tips


In taking CCNA exams, there are about 60+ questions and you are to answer them within 90 minutes. Doing a quick math, it means that you have 90 seconds to answer each question. There are simple questions where you can answer them in just 10 to 15 seconds, and there are those that would probably take you more than 90 seconds to answer. Most of these questions involve conversion from decimal to binary or from binary to decimal.

This is what I want to focus in this article. Please forgive me if this post is so elementary, I just want to share my techniques in doing decimal to binary conversions and vice-versa in order for you to possibly save time in answering CCNA questions.

Decimal to Binary Conversion


This is what I do, in a scratch pad, I wrote the following place values:


____ ____ ____ ___ ___ ___ __ __ __ _ _ _ _
4096 2048 1024 512 256 128 64 32 16 8 4 2 1
Figure 1


Okay, so now I will show you how to use these values. Suppose you want to convert 202 decimal to binary, how are we going to do it? Doing it the conventional way is to divide 202 by 2 then get the answer and the remainder, then divide the answer by 2 again and so on...

I am not a math wizard, so for me, I can solve faster in addition or subtraction than in division. So let me show you how to convert 202 decimal to binary using subtraction and using the values presented in Figure 1.

First, look for the HIGHEST value in Figure 1 that we can subtract to 202 that will not result to a negative answer. So what will it be? It will be 128 right? And the answer to 202-128 is 74. So write 1 above 128 in Figure 1.


____ ____ ____ ___ ___ _1_ __ __ __ _ _ _ _
4096 2048 1024 512 256 128 64 32 16 8 4 2 1
Figure 2


So instead of doing a repetitive division, we will be doing a repetitive subtraction. Next, look for the HIGHEST value in Figure 1 that we can subtract to 74 that will not result to a negative answer. This time, it will be 64 right? And 74-64 is 10. So write 1 above 64 in Figure 2.


____ ____ ____ ___ ___ _1_ _1 __ __ _ _ _ _
4096 2048 1024 512 256 128 64 32 16 8 4 2 1
Figure 3


Next, look for the HIGHEST value in Figure 1 that we can subtract to 10 that will not result to a negative answer. It's 8 right? And 10-8 is 2. So write 1 above 8 in Figure 3.


____ ____ ____ ___ ___ _1_ _1 __ __ 1 _ _ _
4096 2048 1024 512 256 128 64 32 16 8 4 2 1
Figure 4


Next, look for the HIGHEST value in Figure 1 that we can subtract to 2 that will not result to a negative answer. It will be 2! And 2-2 is ... So write 1 above 2 in Figure 3.


____ ____ ____ ___ ___ _1_ _1 __ __ 1 _ 1 _
4096 2048 1024 512 256 128 64 32 16 8 4 2 1
Figure 4


Since our previous answer was 0, let's now stop and fill in the remaining blanks with 0, and that's the binary equivalent of 202 decimal.


__0_ __0_ __0_ _0_ _0_ _1_ _1 _0 _0 1 0 1 0
4096 2048 1024 512 256 128 64 32 16 8 4 2 1
Figure 5


The answer is 0000011001010 or simply 11001010. That's it! very elementary right? :)

Binary to Decimal Conversion


Now, let's do the reverse. Suppose we want to convert 11101011011 binary to decimal, how will we do it using Figure 1? This is so elementary again, just place the binary bits to our Figure 1 starting from the rightmost bit.


____ ____ __1_ _1_ _1_ _0_ _1 _0 _1 1 0 1 1
4096 2048 1024 512 256 128 64 32 16 8 4 2 1
Figure 6


Then add all the values that carries a 1 on top. That will be:


1024
+ 512
-----
1536
+ 256
-----
1792
+ 64
-----
1856
+ 16
-----
1872
+ 8
-----
1880
+ 2
-----
1882
+ 1
-----
=1883
Figure 7


That's it! The answer is 1883.

I hope that in a little way, you have gained something from this article. If you are not planning to take the CCNA exam, perhaps you can use this to teach your 3 year old child to do conversion from decimal to binary and binary to decimal.




Tuesday, April 8, 2008

Subnetting 101


IPv4 Overview


This is intented to give a brief review on IPv4 and discover the magic of Routing IPv4 packets then unravel the secrets of Subnetting.

Basically, the Internet Protocol Address Version 4(IPv4) has 3 different usable classes, namely:Class A, Class B and Class C. There is also a group of addresses used for multicast called Class D and another group of reserved addresses used for research called, Class E. This document will focus only on Class A, B, and C.

IPV4 Review



In order to start unraveling the mystery of subnetting, let us try first to review the characteristics of an IPv4 address. An IPv4 address as we all know is 32-bits in size which is divided into 4 groups called octets. Each octet represents 8-bits of data(4 groups x 8-bits per group equals 32, right?). In writing this 32-bit IP address, each octet is separated with a dot(.) and the leftmost octet is the most significant octet and the rightmost octet is the least significant octet.

IPv4 Address Binary Representation:




In order to be able to identify to which class does an IPv4 address belong, we look at its most significant bits(the leftmost bits) of the most signifacant octet of an IPv4 address.


In Figure 2, if you try to examine a Class A address, you will find that its most significant bit is equal to 0. The first two most significant of a Class B address is 10 and Class C address starts with 110. The x's found in Figure 2 represents either 0 or 1.

Simplifying the IP address:

Suppose we have an IP address in binary: 11000011101010100101010100001111 (32 bits)
It will be divided into 4 octets separated with a dot: 11000011.10101010.01010101.00001111

But binary numbers are hard to memorize, so an IPv4 address is commonly represented in decimal formats.
11000011.10101010.01010101.00001111 is now represented as 195.170.85.15

Binary to decimal conversion:
11000011 = 195
10101010 = 170
01010101 = 85
00001111 = 15

CCNA Practice Problems:



Q1: The IPv4 address 195.170.85.15 belongs to what class?
Q2: What could be the minimum and maximum value for the first octet of a Class A address?
Q3: What could be the minimum and maximum value for the first octet of a Class B address?
Q4: What could be the minimum and maximum value for the first octet of a Class C address?

Answers will be posted in the next blog related to this article.


To be continued...
Next topic: The Magic of Routing