IP Addressing
IP Addressing
IP Addressing
Subnetting
Subnetting an IP Network can be done for a variety of reasons, including organization, use of
different physical media (such as Ethernet, FDDI, WAN, etc.), preservation of address space,
and security. The most common reason is to control network traffic. In an Ethernet network, all
nodes on a segment see all the packets transmitted by all the other nodes on that segment.
Performance can be adversely affected under heavy traffic loads, due to collisions and the
resulting retransmissions. A router is used to connect IP networks to minimize the amount of
traffic each segment must receive.
Subnet Masking
Applying a subnet mask to an IP address allows you to identify the network and node parts of the
address. The network bits are represented by the 1s in the mask, and the node bits are represented
by the 0s. Performing a bitwise logical AND operation between the IP address and the subnet
mask results in the Network Address or Number.
For example, using our test IP address and the default Class B subnet mask, we get:
10001100.10110011.11110000.11001000 140.179.240.200 Class B IP Address
11111111.11111111.00000000.00000000 255.255.000.000 Default Class B
Subnet Mask
--------------------------------------------------------
10001100.10110011.00000000.00000000 140.179.000.000 Network Address
Default subnet masks:
• Class A - 255.0.0.0 - 11111111.00000000.00000000.00000000
• Class B - 255.255.0.0 - 11111111.11111111.00000000.00000000
• Class C - 255.255.255.0 - 11111111.11111111.11111111.00000000
An Example
Here is another, more detailed, example. Say you are assigned a Class C network number of
200.133.175.0 (apologies to anyone who may actually own this domain address). You want to
utilize this network across multiple small groups within an organization. You can do this by
subnetting that network with a subnet address.
We will break this network into 14 subnets of 14 nodes each. This will limit us to 196 nodes on
the network instead of the 254 we would have without subnetting, but gives us the advantages of
traffic isolation and security. To accomplish this, we need to use a subnet mask 4 bits long.
Recall that the default Class C subnet mask is
255.255.255.0 (11111111.11111111.11111111.00000000 binary)
Extending this by 4 bits yields a mask of
255.255.255.240 (11111111.11111111.11111111.11110000 binary)
This gives us 16 possible network numbers, 2 of which cannot be used:
Subnet bits Network Number Node Addresses Broadcast Address
0000 200.133.175.0 Reserved None
0001 200.133.175.16 .17 thru .30 200.133.175.31
0010 200.133.175.32 .33 thru .46 200.133.175.47
0011 200.133.175.48 .49 thru .62 200.133.175.63
0100 200.133.175.64 .65 thru .78 200.133.175.79
0101 200.133.175.80 .81 thru .94 200.133.175.95
0110 200.133.175.96 .97 thru .110 200.133.175.111
0111 200.133.175.112 .113 thru .126 200.133.175.127
1000 200.133.175.128 .129 thru .142 200.133.175.143
1001 200.133.175.144 .145 thru .158 200.133.175.159
1010 200.133.175.160 .161 thru .174 200.133.175.175
1011 200.133.175.176 .177 thru .190 200.133.175.191
1100 200.133.175.192 .193 thru .206 200.133.175.207
1101 200.133.175.208 .209 thru .222 200.133.175.223
1110 200.133.175.224 .225 thru .238 200.133.175.239
1111 200.133.175.240 Reserved None
Previous Next
# bits Subnet Mask CIDR # Subnets # Hosts Nets * Hosts
2 255.255.192.0 /18 2 16382 32764
3 255.255.224.0 /19 6 8190 49140
4 255.255.240.0 /20 14 4094 57316
5 255.255.248.0 /21 30 2046 61380
6 255.255.252.0 /22 62 1022 63364
7 255.255.254.0 /23 126 510 64260
8 255.255.255.0 /24 254 254 64516
9 255.255.255.128 /25 510 126 64260
10 255.255.255.192 /26 1022 62 63364
11 255.255.255.224 /27 2046 30 61380
12 255.255.255.240 /28 4094 14 57316
13 255.255.255.248 /29 8190 6 49140
14 255.255.255.252 /30 16382 2 32764
Previous Next
# bits Subnet Mask CIDR # Subnets # Hosts Nets * Hosts
2 255.255.255.192 /26 2 62 124
3 255.255.255.224 /27 6 30 180
4 255.255.255.240 /28 14 14 196
5 255.255.255.248 /29 30 6 180
6 255.255.255.252 /30 62 2 124
Logical Operations
This page will provide a brief review and explanation of the common logical bitwise
operations AND, OR, XOR (Exclusive OR) and NOT. Logical operations are performed
between two data bits (except for NOT). Bits can be either "1" or "0", and these
operations are essential to performing digital math operations.
In the "truth tables" below, the input bits are in bold, and the results are plain.
AND
The logical AND operation compares 2 bits and if they are both "1", then the result
is "1", otherwise, the result is "0".
01
000
101
OR
The logical OR operation compares 2 bits and if either or both bits are "1", then the
result is "1", otherwise, the result is "0".
01
001
111
XOR
The logical XOR (Exclusive OR) operation compares 2 bits and if exactly one of them
is "1" (i.e., if they are different values), then the result is "1"; otherwise (if the bits
are the same), the result is "0".
01
001
110
NOT
The logical NOT operation simply changes the value of a single bit. If it is a "1", the
result is "0"; if it is a "0", the result is "1". Note that this operation is different in that
instead of comparing two bits, it is acting on a single bit.
01
1 0