Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

i have a small question ... i feel

i have a small question ... i feel

i have a small question ... i feel

i have a small question ... i feel like it is hard to understand ip addressing ... and i need any advise on this problem ... so would u please reply me and tell me spme tips that would help me in ip addressing and sub netting with in few few min..ok for example i need 50 hosts in my network wich subnet will support .



RE: i have a small question ... i feel

If you have a choice of networks, and are starting from scratch - it's easy.
Just choose to use the range through  
The subnet mask for this would be
The first available IP address would be and the last would be  (1-254)
If you are setting up a DHCP server, you need to make sure that you set aside some addresses for static IP's.  Things like printers and servers and an IP Office system would need to be static.
In any DCHP server you can specify the address range to give out.  So, start at through  This will give you plenty of IPs to play with both static and in the DHCP scope.
Put your router/firewall on, your IP office on, your Voicmail server on and etc.

RE: i have a small question ... i feel

To understand IP Addressing you need to understand the role of the Subnet mask. To do this you need to be able to count in binary (or use a calc)
The subnet mask is a mask used to determine which section of the address identifies your network (subnet), and which your host. What we see is the decimal value for a 32bit binary code, sectioned into 4 octets of 8 bits each. Your mask specifies the network by the 1's and your host by the 0's. An example:

IP Address:
Subnet Mask:

Binary IP Address:  11000000.10101000.00101010.00000010
Binary Subnet Mask: 11111111.11111111.11111111.00000000

From this we can see that our subnet address is and your host identifier is 2. Using your subnet mask, any packets destination's network address is compared to your own network address. If they are the same, the device sends an rap request for the MAC address of the destinations interface, otherwise, it is sent to your default gateway (or any corresponding route in it's routing table) which in turn will send it to the next gateway, and so on until its reached the destination host.

There are three classes of ip addresses:

ClassA = (11111111.00000000.00000000.00000000)
ClassB = (11111111.11111111.00000000.00000000)
ClassC = (11111111.11111111.11111111.00000000)

The classic ClassC network allows for 254 hosts, restricted to the 8 bits allocated for hosts in the final octet. You may wonder why only 254, not 255. As with subnets, you cannot have a host address all ones or all zeros, as this is used as a broadcast address for the whole subnet, and cannot specify a particular host. Sometimes you may want to allow for more hosts, or as in your case nivasi, less hosts to accommodate more subnets. All you do is then move where the 1's meet the 0's within the subnet mask i.e.

  255   .   255  .  255   .  240

This is now a submitted ClassC network. Having allocated more bits to identify subnet, you have fewer bits to specify hosts. In this particular scenario you are only aloud 13 hosts on this network. How did I get that figure? Easy take the bits in the subnet mask allocated to hosts, change them to 1's and convert to decimal. In the example above, the last four bits specify hosts, so the decimal of 1111 is 15. I then need to subtract 2 (Used for the network and broadcast addresses). This leaves me with 13 usable hosts on each subnet when using the mask

This can be worked backwards, for example, you need 50 hosts on your network. Ok add 2 to the number of host you require (for network and broadcast addresses) = 52. Take a binary value that consists of just 1's, and who's decimal equivalent is larger than 52. i.e.

1111 = 15 (two few bits)
11111 = 31 (Closer, but not there yet)
111111 = 63 (OK, that will accommodate my 52 hosts)

Convert the 1's to 0's (because hosts are specified by 0's) and working from right to left complete the mask:

    111111 = 000000 -----------------¦

So my subnet mask is: (binary of 11000000)

So my network address of mask of, I can have host addresses range of -
You can use this same method to allocate a certain number of subnets. The difference is that you do not need to convert the 1's to 0's because the mask uses 1's to specify subnets and you work from left to right.

This should have hopefully helped with your understanding of IP addressing. Good luck, There is a whole world of TCP/IP beyond this :))

RE: i have a small question ... i feel

This is an article if from a little company that just happens to focus on "IP" called Cisco.

This document will give you basic information you'll need to configure your router for routing IP, such as how addresses are broken down and how subnetting works. You'll learn how to assign each interface on the router an IP address with a unique subnet. And don't worry, we'll show you lots of examples to help tie everything together.

If definitions are helpful to you, here's some wirehead vocabulary to get you started.

Address -- the unique number id assigned to one host or interface in a network
Subnet -- a portion of a network sharing a particular subnet address
Subnet mask -- a 32-bit combination used to describe which portion of an address refers to the subnet and which part refers to the host
Interface -- a network connection
If you have already received your legitimate address(es) from the InterNIC (Internet Network Information Center), you are ready to begin. If you are not planning on connecting to the Internet, we strongly suggest that you use reserved addresses from RFC 1597. You can access RFCs via ftp nic.ddn.mil. Please see the introduction in any Cisco Hardware and Installation Guide for instructions on obtaining RFCs.

Understanding IP Addresses

An IP address consists of four octets (1 octet = 8 bits), or 32 bits. The value in each octet ranges from 0 to 255 decimal, or 00000000 - 11111111 binary. Here's how binary octets convert to decimal:

    1  1  1  1 1 1 1 1
  128 64 32 16 8 4 2 1 (128+64+32+16+8+4+2+1=255)

Now here's a sample octet conversion:

  0  1 0 0 0 0 0 1
  0 64 0 0 0 0 0 1 (0+64+0+0+0+0+0+1=65)

And this is a sample address representation (4 octets):

        10.       1.      23.      19 (decimal)
  00001010.00000001.00010111.00010011 (binary)

These octets are broken down to provide an addressing scheme that can accommodate large and small networks. There are five different classes of networks, A to E. Here, we'll only be addressing classes A to C, since classes D and E are reserved. To determine the class of an address, look at the first octet of the dotted-decimal address.

Class A: 1 - 126 (eg.
Class B: 128-191 (eg.
Class C: 192-223 (eg.

In a class A address, the first octet is the network portion, so the class A example above has a major network address of 10. Octets 2, 3, and 4 (the next 24 bits) are for the network manager to divide into subnets and hosts as she sees fit. Class A addresses are used for networks that have more than 65,536 hosts (actually, up to 16,581,375 hosts!).

In a class B address, the first two octets are the network portion, so the class B example above has a major network address of 172.16. Octets 3 and 4 (16 bits) are for local subnets and hosts. Class B addresses are used for networks that have between 256 and 65,536 hosts.

In a class C address, the first three octets are the network portion. The class C example above has a major network address of 193.18.9. Octet 4 (8 bits) is for local subnets and hosts - perfect for networks with less than 256 hosts.

Understanding Subnetting

In order to use your addresses, you need to understand subnetting. Subnetting allows you to create multiple logical networks that exist within a single Class A, B, or C network. If you don't subnet, you will only be able to use one network from your Class A, B, or C network. Unless you have been assigned many major networks, you really need to subnet.

Each data link on a network must be a unique subnet, with every node on that link being a member of the same subnet. For serial interfaces (standard HDLC), you will need one subnet for the circuit, or "wire" (both ends of the serial connection will be in the same subnet). If you are planning on implementing Frame Relay, SMDS, X.25 etc, read the Router Products Configuration and Reference Guides for assistance in configuring.

A subnet mask is defined for each IP address. The subnet mask identifies which portion of the 4 octets is used to identify the data link, with the remaining bits identifying the node. If you want no subnetting, use these default masks (255 - strictly follow number, 0 - wildcard):

Class A:
Class B:
Class C:

Let's use these two addresses for some examples: and If the subnet mask is, the first 24 bits are masked, so the router compares the first 3 octets of the two addresses. Since the masked bits are not the same, the router knows that these addresses belong to different subnets.

If the subnet mask is, the first 16 bits are masked, so the router compares the first 2 octets of the two addresses. Since the masked bits are the same, the router knows that these addresses belong to the same subnet.

Nodes and routers use the mask to identify the data link on which an address resides. For instance, imagine that San Francisco proper is a class B network, and think of the streets as subnets. Each street must have a unique name. How would the postal service deliver a letter or find the correct destination if there were two Lombard Streets? Each house number can be thought of as a unique identifier for that street. The house numbers themselves can be duplicated on other streets: 33 Market Street is not the same as 33 Van Ness Avenue.

San Francisco.Lombard.33
171.68. 3. 3
San Francisco.Market.33
171.68. 2. 3

Sometimes you need to perform a logical "AND" operation to find out what subnet your node is in. Performing an "AND" operation means that anytime you "AND" a 0 value to another 0 or a 1 value, the result is 0. Only a 1 ANDed with another 1 value will result in a 1 value. Here's how it works:

0 AND 0 IS 0
0 AND 1 IS 0
1 AND 1 IS 1

Let's compare our sample addresses ( and against the subnet mask We need to compare the binary representation of the third octet of the mask with the binary representation of the third octets of the addresses. In order to do this, we'll perform a logical "AND" operation on the corresponding bits in each octet.

The masked bits are those that are "turned on," or 1 in the mask. Since the masked bits in both addresses are the same, the router knows that these addresses belong to the same subnet.

Let's See Some Examples

Example 1: Class B

Let's use a class B address to illustrate how subnetting works. Let's say you were assigned the class B address 172.16 from the NIC. First determine how many subnets you need, and how many nodes per subnet you need to define. A typical (and easy to use) class B subnet mask would be 8 bits. Since the 3rd octet is the first "free" octet for Class B, you will start there. So, an 8 bit subnet mask would be This means you have 254* subnets available and 254 addresses for nodes per subnet.

*Why are there only 254 subnets available instead of 256 (0-255)? You should not use subnet 0 or a subnet of all 1s. With an all 1s subnet mask, this is also your broadcast address. You can configure this, but it is neither proper nor recommended to make your subnet the same as your broadcast address. Subnet 0 is also not recommended. Cisco will allow the use of subnet 0 with the IP subnet zero command.

Example 2: Class B

Now let's take this example: you have just assigned an interface the address with a mask of What subnet is it in? First represent the bits in binary (for class B, you start with the 3rd octet since octets 1 and 2 are fixed).

00001010 00110010 (address representation - 10.50)
11111111 00000000 (subnet mask representation - 255.0)
00001010 00000000 (results of logical "AND" - subnet 10)

This address is in subnet 10 ( Valid addresses for subnet 10 would be through Address is the broadcast address for this subnet. According to the standard, any host id consisting of all 1s is reserved for broadcast.

Example 3: Class B

Let's say you have a need for more subnets than 254. (Remember this is the maximum number of subnets in a single octet.) Sticking with our class B address, let's configure an 11 bit subnet. This means we will use all 8 bits from our 3rd octet and the first three bits from the 4th octet. The subnet mask is now (128+64+32=224). Now you need to find out what subnet the following address is in: First, denote the address in binary representation (just octets 3 and 4 for a class B address) like this:

00001010 10101010 (address representation 10.170)
11111111 11100000 (subnet mask representation 255.224 through
                   the first 11 bit subnet)
00001010 10100000 (results of logical "AND") 10 160

So, the address here is in subnet The valid addresses for this subnet are through (.191 is the broadcast address). As soon as you hit 10.192, the bits in the subnet change and you move into subnet 10.192.

Example 4: Class B

Let's take an example where the mask is shorter than one octet. Now we want only a few subnets, but need many hosts per subnet. We'll use a 3 bit subnet mask. Now we have: (the mask is now the first 3 bits of the 3rd octet). What subnet is this address in?

01000001 10101010 (address representation 65.170)
11100000 00000000 (subnet mask representation 224.0)
01000000 00000000 (results of logical "AND" - subnet 64)64

So the subnet here is The range of addresses that would fall into subnet 64 would be - with as the broadcast address. The next subnet would be Class A and class C map out exactly as class B. The only differences are at which octet subnetting starts and how many octets you can use for subnetting.

Example 5: Class C

Suppose the NIC assigned the address 192.1.10. You will need to use the 4th octet for your subnetting needs. Let's use a 4 bit subnet mask and map out the following address:

11001000 (address representation for 200)
11110000 (subnet mask representation for 240)
11000000 (results of logical "AND" - 128+64=192)

So, address is in subnet 192. The valid range of addresses in this subnet would be through, with .207 as the broadcast address. The next subnet would be .208.

Keeping the same subnet mask, you can choose different addresses to be in different subnets. For instance, address is in subnet 16 and therefore has another unique subnet address, with valid addresses in the range of through


Sample Config

(routers A and B are connected via serial interface)

Router A

  hostname routera
  ip routing
  int e 0
  ip address
  !(subnet 50)
  int e 1 ip address
  !(subnet 55)
  int t 0 ip address
  !(subnet 60) int s 0
  ip address (subnet 65)
  !S 0 connects to router B
  router rip

Router B

  hostname routerb
  ip routing
  int e 0
  ip address
  !(subnet 192)
  int e 1
  ip address
  !(subnet 64)
  int s 0
  ip address (same subnet as router A's s 0)
  !Int s 0 connects to router A
  router rip

Host/Subnet Quantities Table

Class B                   Effective  Effective
# bits        Mask         Subnets     Hosts
-------  ---------------  ---------  ---------
  2           2     16382
  3           6      8190
  4          14      4094
  5          30      2046
  6          62      1022
  7         126       510
  8         254       254
  9       510       126
  10      1022        62
  11      2046        30
  12      4094        14
  13      8190         6
  14     16382         2

Class C                   Effective  Effective
# bits        Mask         Subnets     Hosts
-------  ---------------  ---------  ---------
  2         2        62
  3         6        30
  4        14        14
  5        30         6
  6        62         2

*Subnet all zeroes and all ones excluded.
*Host all zeroes and all ones excluded.  

Thank you,
Frank Mirecki

RE: i have a small question ... i feel

Duuuuude, check out, www.learntosubnet.com
Used this to learn IP when I first went for my MCSE

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close