BetaONE will rise again!


Reply
  #1  
Old 9th May 03, 06:03 PM
ecperez ecperez is offline
BetaONE Supporter
 
Join Date: Jul 2001
Location: Singapore
Posts: 542
ecperez is an unknown quantity at this point
Send a message via ICQ to ecperez Send a message via AIM to ecperez Send a message via MSN to ecperez Send a message via Yahoo to ecperez
TCP/IP ADDRESSING

BACKGROUND
Every IP address can be broken down into 2 parts, the Network ID(netid) and the Host ID (hostid). All hosts on the same network must have the same netid. Each of these hosts must have a hostid that is unique in relation to the netid. IP addresses are divided into 8 octets with each having a maximum value of 255. We view IP addresses in decimal notation such as xxx.xxx.xxx.xxx, but it is actually utilized as binary data so one must be able to convert addresses back and forth.

CONVERTING IP ADDRESSES BACK AND FORTH

DECIMAL BINARY When converting binary data to decimal, a "0" is equal to 0. "1" is equal to the number that corresponds to the field it is in. For example, the number 213 would be 11010101 in binary notation. This is calculated as follows:
128+64+0+16+0+4+0+1=213.

Remember that this only represents 1 octet of 8 bits, while a full IP address is 32 bits made up of 4 octets. This being true, the IP address 213.128.68.130 would look like 11010101 10000000 01000100 10000010. If you understand this then you are a geek and all of your friends will laugh at you. Believe me - I know!

128 10000000
64 01000000
32 00100000
16 00010000
8 00001000
4 00000100
2 00000010
1 00000001

CLASSES

CLASS RANGE IP addresses can be class A, B or C. Class A addresses are for networks with a large number of hosts. The first octet is the netid and the 3 remaining octets are the hostid. Class B addresses are used in medium to large networks with the first 2 octets making up the netid and the remaining 2 are the hostid. A class C is for smaller networks with the first 3 octets making up the netid and the last octet comprising the hostid.

A 10000000
B 01000000
C 00100000

SUBNETTING

BACKGROUND
A subnet mask blocks out a portion of an IP address and is used to differentiate between the hostid and netid. The default subnet masks are as follows:

CLASS DEFAULT SUBNET # OF SUBNETS # OF HOSTS PER SUBNET
Class A 255.0.0.0 126 16,777,214
Class B 255.255.0.0 16,384 65,534
Class C 255.255.255.0 2,097,152 254

In these cases, the part of the IP address blocked out by 255 is the netid.

The table above shows the default subnet masks. What subnet mask do you use when you want more that 1 subnet? Lets say, for example, that you want 8 subnets and will be using a class C address. The first thing you want to do is convert the number of subnets into binary, so our example would be 00001000. Moving from left to right, drop all zeros until you get to the first "1". For us that would leave 1000. It takes 4 bits to make 8 in binary so we add a "1" to the first 4 high order bits of the 4th octet of the subnet mask (since it is class C) as follows:
11111111.11111111.11111111.11110000 = 255.255.255.240.

There is our subnet mask. Lets try another one...Lets say that you are the network administrator for a chain of dry cleaning stores in New York and you have stores in 20 different neighborhoods and you want to have a separate subnet on your network for each store. It will be a class B network. First, we convert 20 to binary - 00010100. We drop all zeros before the first "1" and that leaves 10100. It takes 5 bits to make 20 in binary so we add a "1" to the first 5 high order bits which gives:
11111111.11111111.11111000.00000000 = 255.255.248.0.

The following table shows a comparison between the different subnet masks.

MASK # OF SUBNETS CLASS A HOSTS CLASS B HOSTS CLASS C HOSTS
192 2 4,194,302 16,382 62
224 6 2,097,150 8,190 30
240 14 1,048,574 4,094 14
248 30 524,286 2,046 6
252 62 262,142 1,022 2
254 126 131,070 510 Invalid
255 254 65,534 254 Invalid
Reply With Quote
  #2  
Old 9th May 03, 06:19 PM
Kawadevil Kawadevil is offline
Member
 
Join Date: Feb 2003
Posts: 61
Kawadevil
Thank for the lesson Ecperez,

Had to read it three times to understand the subnetmask calculation.
But it is clear now.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:32 PM.


Design by Vjacheslav Trushkin for phpBBStyles.com.
Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.