|
Home > Archive > CCNA > September 2001 > masking question
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
|
| An IP address of 172.19.114.153 with /21 mask, What is the IP address of the network and the valid host range?
I can subnet when given the subnet mask or figure the subnet mask when given the number of bits of subnetting but I can't figure out how they came up with the subnet mask of 255.255.248.0. | |
| jrivera 2001-09-27, 2:58 pm |
| Hey,
Hang in there, you're only drowning in a cup of water. Here is a simple table for you to follow:
#OF WEIGHT, #OF BITS
1-----0
2-----1
4-----2
8-----3
16----4
32----5
64----6
128---7
256---8
512---9
1024(1K)-10
2K----11
4K----12
8K----13
16K---14
32K---15
64K---16
128K--17
256k--18
128-64-32-16-8-4-2-1 = (255) = 11111111
ex. (128+64)=192(2 bits),(192+32)=224(3 bits)
etc. You got it? Just let me know@ alberto279@hotmail.com | |
|
| Thanks for your reply jrivera , That I understand but I'm not making the leap from that to how they get 255.255.248.0 with /21 mask and a class B IP address of 172.19.114.153. How do you get 248 from /21? | |
| doctorcisco 2001-09-27, 3:17 pm |
| quote: Originally posted by North
Thanks for your reply jrivera , That I understand but I'm not making the leap from that to how they get 255.255.248.0 with /21 mask and a class B IP address of 172.19.114.153. How do you get 248 from /21?
21 bits of mask - 16 bits (2 .255's) = 5 bits in the 3rd octet.
Therefore, 3rd octet of the mask is: 11111000
Now just add the bit values for the 5 1-bits:
128+64+32+16+8 = 248 for the 3rd octet
I find it very helpful to have memorized all the possible values of the octets in a mask:
128, 192, 224, 240, 248, 252, 254, 255.
= the values for 1-8 mask bits in an octet.
HTH,
doctorcisco | |
|
| Thanks DoctorCisco.
I understand how you arrived at the answer but when I apply that same formula (21 bits from 16 (2,255=16)) or (1,255=8) to a class c it doesn't work.
Before when I was given a class c IP and subnetting bits (example, 192.168.100.17 with 4 bits of subnetting) I would turn on the first 4 bits 11110000, 128+64+32+16=240 or 3 bits of subnetting would be 11100000, 128+64+32=224 Why am I not subtracting the 3 or 4 bits from 8 (1 octet)when subnetting a class c like you did with the class b ? Am I doing class C wrong and it just happens to come out with the right answer?
1 bit 128
2 bits 192
3 bits 224
4 bits 240
5 bits 248
6 bits 252
7 bits 254
8 bits 255
Sorry for being dense, but up to that question I thought I had subnetting down.
-A | |
| dmaftei 2001-09-27, 5:34 pm |
| quote: Originally posted by North
An IP address of 172.19.114.153 with /21 mask, What is the IP address of the network and the valid host range?
I can subnet when given the subnet mask or figure the subnet mask when given the number of bits of subnetting but I can't figure out how they came up with the subnet mask of 255.255.248.0.
Doesn't look like you can figure the subnet mask when given the number of bits...
Do you know what a subnet mask (or an IP address, for that matter) is? Bear with me: it's a 32-bit unsigned integer (written in binary, that is...) 32-bit unsigned integers run from
000000000000000000000000000000
00 through
111111111111111111111111111111
11. So far, so good.
For convenience, people group the bits in these number in bunches of 8, and they put a 'dot' between the bunches. So our numbers are 00000000.00000000.00000000.00000000 through 11111111.11111111.11111111.11111111 Note that you have the same numbers; the 'dots' are there only to make your life easier when you need to read (or otherwise deal with) such numbers.
Let's go one step further. In the IP world there is a requirement that a 'subnet mask' is 'contiguous'. To translate this in our binary language: a subnet mask is a block of '1's followed by a block of '0's. These are legal subnet masks:
11111111.11111111.00000000.00000000
11111111.11110000.00000000.00000000
while these are illegal:
11111111.11110000.11111111.00000000
10101010.10101010.10101010.10101010
Back to convenience. People don't like long strings of '1's and '0's, so they figured a way of writing these numbers in such a way that's easy to remember. So they convert the groups of of 8 bits to decimal numbers, and they get what's called the "dotted decimal" notation. The four examples above are (in dotted decimal):
255.255.0.0
255.240.0.0
255.240.255.0 (the first illegal)
170.170.170.170 (the second illegal)
We're close to finish... By now you should know that 255.255.0.0 and 11111111.11111111.00000000.00000000 are the same number, or that 255.248.0.0 and 11111111.11110000.00000000.00000000 are the same number. Note that for 255.255.0.0 the first 16 bits are '1', while for 255.240.0.0 the first 12 bits are '1'. Because of this, some people like to write 255.255.0.0 as '/16', or 255.240.0.0 as '/12'.
Now look at your problem. You have '/21'. That's 111111111111111111111000000000
00, or, for convenience 11111111.11111111.11111000.00000000. Since 11111111 binary is 255 decimal, 00000000 binary is 0 decimal, and 11111000 is 248 decimal, you can write your mask (for even more convenience) 255.255.248.0. Bingo!
BTW, take doc's advice and memorize those eight numbers (128, 192, 224, 240, 248, 252, 254 and 255). They come in handy.  | |
| doctorcisco 2001-09-28, 9:12 am |
| quote: Originally posted by North
Thanks DoctorCisco.
I understand how you arrived at the answer but when I apply that same formula (21 bits from 16 (2,255=16)) or (1,255=8) to a class c it doesn't work.
Before when I was given a class c IP and subnetting bits (example, 192.168.100.17 with 4 bits of subnetting) I would turn on the first 4 bits 11110000, 128+64+32+16=240 or 3 bits of subnetting would be 11100000, 128+64+32=224 Why am I not subtracting the 3 or 4 bits from 8 (1 octet)when subnetting a class c like you did with the class b ? Am I doing class C wrong and it just happens to come out with the right answer?
Because a mask actually has two parts: the default or network mask, which is 8, 16, or 24 bits for Class A, B, or C, and the subnet mask, which the network engineer decides on.
"4 bits of subnetting on a Class C address" means you have 28 bits of mask: 24 because it's Class C (the default or network mask), and 4 bits of subnetting within that Class C address space.
This would appear like this on a router:
192.168.1.170 /28
It's up to you to recognize this address as a Class C, and know that this is really 4 bits of subnetting and 24 bits of default/network mask.
172.168.1.170 /28 has 16 bits of default/network mask, and 12 bits of subnetting, because it's a Class B.
17.168.1.170 /28 has 8 bits of default/network mask, and 20 bits of subnetting, because it's a Class A.
In each instance, the mask is 255.255.255.240. The only thing that changes is the classful boundary in the mask, in other words, where the default classful mask ends and the subnetting done by the network administrator begins.
When you get to CCNP level, you'll start to think about CIDR, which breaks these rules. But first, understand the rules.
HTH,
doctorcisco | |
| North 2001-09-28, 10:47 am |
| Thanks DoctorCisco,
I'm back on track again.
Thanks again for your help and very detailed explanation.
-A |
|
|
|
|