Figuring out a subnet
Subnets divide blocks of IP addresses into separate networks. IP
addresses are set in blocks
of 256 starting with 0, and ending with 255. With IPv4, the IP address
may look like this.
192.168.1.55. The math in finding a subnet is 256 minus the amount
of IP addresses you need.
IP addresses need to group in sets of 1, 2, 4, 8, 16, 32,
64, 128, 256...
For example, if you want to use all
the IP addresses in a class C (256 Ips) then the equation will
be |
256
-256
255.255.255. 0 |
If you wanted to use blocks of 32
IP addresses then |
256
- 32
255.255.255. 224 |
If you wanted to use blocks of 32
IP addresses then be |
256
- 8
255.255.255. 248 |
This math even works for class A,
B, and C networks. If you wanted to use 2 class C networks that
are side by side |
256 256
- 2 -256
255.255.254. 0 |
The first IP address in a block of IP addresses is called the "network".
The last number in an IP block is called the "broadcast". Niether
of them are usable IP addresses.
256 |
0 All
IP Addresses in a Class C 255
|
0 127 |
128
255 |
0 63 |
64 127 |
128 191
|
192
255 |
0 31 |
32 63 |
64 95 |
96 127 |
128 159 |
160 191 |
192 223 |
224 255 |
0-15, 16-31,
32-47, 48-63, 64-79, 80-95, 96-111, 112-127, 128-143,144-159,
160-175, 176-191, 192-207, 208-223, 224-234, 240-255
|
128 |
64 |
32 |
16 |
8 |
0-7,
8-15, 16-23, 24-31, 32-39, 40-47, 48-55, 56-63,
64-71, 72-79, 80-87, 88-95, 96-103, 104-111, 112-119,
120-127, 128-135, 136-143, 144-151, 152-159, 160-167, 168-175,
176-183, 184-191, 192-199, 200-207, 208-215, 216-223, 224-231,
232-234, 240-247, 248-255 |
Subnets have to be in blocks that
are divisible by the IP address blocks. Say we want 32
IP addresses. 0-31, 32-63 are blocks that are ok for a subnet of
255.255.255.224.
16-47 is not... Your network will be split into two separate blocks.
16-31, 32-47 with both
31 and 32 unusable. 31 being the "broadcast" of the first network,
and 32 the "network" of the
second. There are devices though that bridges the gap between networks.
They are called routers.
Routers need to use NAT (Network Address Translation) to create
the bridge.
Author: Jeremy
Martin
|