Net Masks - The Binary Explanation - Lindy Switch User Manual

Ip access switch plus - dvi audio
Table of Contents

Advertisement

Net masks - the binary explanation

To really understand the operation of a net mask it is necessary to delve deeper
into the life blood of computers – binary; this is native digital, where everything
is either a 1 (one) or 0 (zero), on or off, yes or no.
The net mask operation described on the
AND function'. The example of 255.255.255.0 is handy because the last octet
is completely zero and is "clean" for illustrative purposes. However, actual net
mask calculations are carried out, not on whole decimal numbers, but bit by bit
on binary numbers, hence the term 'bit-wise'. In a real local network, a net mask
might be 255.255.255.240. Such an example would no longer be quite so clear,
until you look at the net mask in its binary form:
11111111.11111111.11111111.11110000
In this case, the four zeroes at the end of the net mask indicate that the local
part of the address is formed by only the last four bits. If you use the diagram
from the previous example and insert the new net mask, it will have the
following effect on the final result:
192
168
142
154
192
168
142
144
Inside a bit-wise AND function
When you "open up" the last octet
of the net mask and look at the
binary inside, you can see the last
four zero bits preventing any 1's in
the address from falling through.
Thus, when 154 is bit-wise ANDed with 240, the result is 144. Likewise, any
local address from 192.168.142.144 through to 192.168.142.159 would
produce exactly the same result when combined with this net mask, hence they
would all be local addresses. However, any difference in the upper three octets
or the upper four bits of the last octet would slip through the mask and the
address would be flagged as not being local.
previous page
is known as a 'bit-wise
154
Decimal octet prior to AND
operation with net mask
1
0
0
1
1
0
1
0
Binary equivalent of 
1
1 1 1 0 0 0 0
1
0
0
1
0
0
0
0
Binary octet after AND
operation with net mask
144
Decimal equivalent of 000000


Advertisement

Table of Contents
loading

Table of Contents