-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Using bool algebra

Do you ever wanted to know how to determine the network address, the broadcast address, starting and ending IP addresses and how many hosts there’s in a range, only knowing a IP address and its netmask ? Here’s the technique.

There’s no complex knowledge needed to determine everything, just the AND and OR logical operations of the Boole Algebra.

Boole Algebra reminder

Here’s how the AND operation works

^ 0 1
0 0 0
1 0 1

Here’s how the OR operation works

^ 0 1
0 0 1
1 1 1

How to do it

Let’s take 172.16.100.33 as exemple IP address and 255.255.255.128 as exemple netmask.

Binary representation:

IP address	172     .16      .100     .33
		10101100.00010000.01100100.00110001
Netmask		255     .255     .255     .128
		11111111.11111111.11111111.10000000

Determining the wildcard, by inverting the netmask (turning 0 as 1 and 1 as 0).

Netmask		255     .255     .255     .128
		11111111.11111111.11111111.10000000
Wildcard	0       .0       .0       .127
		00000000.00000000.00000000.01111111

Let’s determine the network address by applying the AND logical operation

IP address	172     .16      .100     .33
		10101100.00010000.01100100.00110001
Netmask		255     .255     .255     .128
		11111111.11111111.11111111.10000000
 
Network		10101100.00010000.01100100.00000000
			172     .16      .100     .0

Now determine the broadcast address by doing a boolean OR operation on the network address using the wildcard.

Network		172     .16      .100     .0
		10101100.00010000.01100100.00000000
Wildcard	0       .0       .0       .127
		00000000.00000000.00000000.01111111
Broadcast	10101100.00010000.01100100.01111111
			172     .16      .100     .127

Now, what’s left is to say that the start IP address for hosts in this network is 172.16.100.1, the end is 172.16.100.126 and there’s up to 126 hosts in this network

Article originally posted on my old website at this url

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJW5eRKAAoJEBeKS2x6xuR7KmwP/jMyANs6s7m59kSzVO1M4AZr
if/RaxFBPkj+9JRLiN5Xz6mesVmMk+tAXQpYuhS1SJQcEp1YsqNqk0youcWyluve
SC/aqpPicGyXoq35TaZqUQyvqfLazdnI3pxUbz8VkwwiimRTxw3lLoW0JpFy1SVv
0oEuoItv+myPyXsHnJ6HS3SIvAas18W6Hj4c+9XRXx/vBYks2gd+YHp9o+WhVRdu
0TvPcJO+1XQTTR0UXovWWPmy1JGrEOvz/CoiKTrwRYcJ7X7jMRQIj6sVDV5iI1rO
QG+abR7zGQMPEdzhaZdRIjf3pDj0bRQHaFo8+z3BuS1TNvlStX4ku2XswRnAiXYm
8tFgkWQc88a42s6sNvY/b6y1+U+HALSy6qGJiOAqDpxUMsHCXTo1RpL9auBMGAwa
IJpWz1EKZlsX+dHjhQivknajWx8w5gQ3cXadNJorf0ytNewugo456u9rS5D6oGAN
/AVxQyC0W9WEv4PfuCpDRLfh4bN3Utn4HOkoAF9HnQalmO471ONrff5uD3xqUu/X
/ND09cTAEFpxj+vKFk/+gNLrANMt69Uo/V47DDtwhlHgfKbWokj+21MhUhZg2yXm
sn0mIVUSmw3wnoytZMNX2CQJIi4BRoPe3ktS9mjnjQIDQ33YLEBaCUqh7ljljOe+
K4lnorIs7Vj/Hln/vjou
=kfkc
-----END PGP SIGNATURE-----

Hint: To validate signature, please view page source and copy html code between BEGIN PGP Signed message and END PGP Signature anchors.

Created the 2010-02-13

Share this


Article content

Resources

10 last blog posts

Related to this article

blog comments powered by Disqus