Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subnet Mask

Status
Not open for further replies.
Feb 4, 2006
70
US
When studing subnet mask my course mention the class IP addresses of boring subnet mask and host but fail to mention the 255.255.255.0 subnet mask configuration. Can someone explain how the IP address and the subnet mask work together.
 
TCP/IP devices behave differently if they're communicating with devices on their own subnet. On Ethernet LANs, for example, if one device wants to talk to a device on a different subnet, it will forward that traffic to its default gateway, which is simply a local router.

If a device wants to talk to another device on its own subnet, however, it will send a broadcast ARP request to try to get the MAC address. If it receives a reply, it will populate its ARP cache with the destination address and proceed with unicast communication.

IP devices are configured with an IP address and a subnet mask. The IP address uniquely identifies the device in the network, while the subnet mask allows you to determine which part of the IP address is the network address.

In your example, a subnet mask of 255.255.255.0 means that the first three octets (bytes) of the IP address are the network address and the last octet is the host address.

Follow the link that vipergg provided. It will explain this all in much more detail.
 
jneiberger wrote>>In your example, a subnet mask of 255.255.255.0 means that the first three octets (bytes) of the IP address are the network address and the last octet is the host address.

From what I studied if you have a class C address 192.168.1.0 you have 254 available hosts. If I only need 50 host my IP address would be 192.168.1.192 what is my subnet mask and how do I figure that out.
 
No, your subnet mask would be a 255.255.255.192, allowing you 64 available IP addresses (62 usable, normally). Your network would be 192.168.1.0/26 and that would give you from 1-62 to use for hosts.
 
Each bit in a octet (byte) represents a certian number. In order to master subnetting, you must commit this to memory becasue it's the building block for all other IP addressing needs.

128 64 32 16 8 4 2 1

Notice that the numbers are cut in half as you go along.

If you add the nubers as you go along, you come to this:

128 192 224 240 248 252 254 255
(128 +64 +32 +16 +8 +4 +2 +1)

so the number that you added to get the next value is considered your "low order bit".

for example: 32 is the low order bit for the mask of 224

So if you use a 224 as your subnet, you will have subnets in blocks of 32 (your low order bit) (32-2=30 usable Ip addresses)

Example|:
192.168.1.0 255.255.255.224
192.168.1.32 255.255.255.224
192.168.1.64 255.255.255.224
etc...

or

192.168.0.0 255.255.224.0
192.168.32.0 255.255.224.0
192.168.64.0 255.255.224.0

___________________________________

so now to answer you question, if you need to assing 50 address(MAX!!) then you would need a block of 64 (-2 for subnet and broadcast), which translate to a mask of 255.255.255.192

192.168.1.0 255.255.255.192
192.168.1.64 255.255.255.192
192.168.1.128 255.255.255.192
etc...
____________________________________

if you have a particular number of address needs, the fastest way to find the subnet is

Step 1 (double the numbers, starting with 1)

1 2 4 8 16 32 64 128 256 512 1024 2048 ...

Step 2 (find the amount that best fits your needs and don't for get to count for growth)

lets say I need 500 addresses, so I can choose 512 and up. But I will choose 512 just to reserver my addresses.

Step 3 ( count the number of bits it took you to get to 512)

10 bits

Step 4 (subtrack 10 bits for the 4 octets starting from the end)

11111111.11111111.11111111.11111111
you get
11111111.11111111.11111100.00000000

now if you use my block method you would get the mask of 254

192.168.0.0 255.255.254.0
192.168.2.0 255.255.254.0
192.168.4.0 255.255.254.0
etc...

so for the second subnet
192.168.2.0/23 - 192.168.3.255/23 = 512 (510 usable) addresses.

Sorry for being long winded, but hope this helps.


 
Great that explains it I do understand now where you get the /23 from.
 
sorry one typo, should be

you get
11111111.11111111.11111110.00000000

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top