Class B Network

Class B:
255.255.xxx.yyy
xxx : from 0 to 255
yyy : from 0 to 255

We mask as follows:
-- As in class C.0,, that is we vary xxx and we fix yyy
255.255.0.0
255.255.128.0
255.255.192.0
255.255.224.0
255.255.240.0
255.255.248.0
255.255.252.0
255.255.254.0
And
As the class C, that is we fix xxx = 255 and we vary yyy
255.255.255.0
255.255.255.128
255.255.255.192
255.255.255.224
255.255.255.240
255.255.255.248
255.255.255.252

We do not vary xxx and yyy at the same time.

But 
Subnet Bits: Number of bits masked (equal to 1)

------------------
Class B Formulas:
------------------
IP Address:xxx.yyy.zzz.vvv
where the First Octet Range xxx's is:  128 - 191.
and the Second, third and fourth Octet Range is: 0 - 255

Mask : One of the elemnts of the following array: 
In decimal: [M] = {128, 192, 224, 240, 248, 252, 254, 255}
In binary: [M] = {10000000, 11000000, 11100000, 11110000, 11111000, 11111100, 11111110, 1111111}

Subnet Bits = the number of 1 in binary's representation of the Mask

Subnet Mask: 255.255.m.0 and 255.255.255.m (m belongs to [M])

Max Subnet = 2Subnet Bits

Number of Hosts = (256 - Mask) x 256 - 2
- 2 stands for that we reseve the first and the last host addresses: The first is called
Subnet ID, the second Broadcast Address

Subnet ID = xxx.yyy.0.0

Broadcast Address: xxx.yyy.(255 - Mask). (255 -Mask)

Wildcard Mask: 
0.0.(255 - Mask).255

Host Address Range:
xxx.yyy.0.1 - xxx.yyy.(255 - Mask).254

--------------
Subnet Mask	Subnet			Max
		Bits 			Subnet			Hosts 
0	255.255.0.0	Subnet Bits = 0 	Max Subnet = 1	 	Hosts = 256 x 256 - 2 = 65534
1	255.255.128.0	Subnet Bits = 1 	Max Subnet = 2	 	Hosts = 128 x 256 - 2 = 32766
2	255.255.192.0	Subnet Bits = 2 	Max Subnet = 4	 	Hosts = 64 x 256 - 2 =  16382
3	255.255.224.0	Subnet Bits = 3 	Max Subnet = 8	 	Hosts = 32 x 256 - 2 =  8190
4	255.255.240.0	Subnet Bits = 4 	Max Subnet = 16	 	Hosts = 16 x 256 - 2 =  4094
5	255.255.248.0	Subnet Bits = 5 	Max Subnet = 32	 	Hosts = 8 x 256 - 2 =  2046
6	255.255.252.0	Subnet Bits = 6 	Max Subnet = 64	 	Hosts = 4 x 256 - 2 =  1022
7	255.255.254.0	Subnet Bits = 7 	Max Subnet = 128	Hosts = 2 x 256 - 2 =  510
And
As the class C 
8	255.255.255.0 	Subnet Bits = 8 	Max Subnet = 256	256 - 2 =  254
9	255.255.255.128 Subnet Bits = 9 	Max Subnet = 512	128 - 2 = 126
10	255.255.255.192	Subnet Bits = 10 	Max Subnet = 1024	64 - 2 = 62
11	255.255.255.224	Subnet Bits = 11 	Max Subnet = 2048	32 - 2 = 30
12	255.255.255.240	Subnet Bits = 12 	Max Subnet = 4096	16 - 2 = 14
13	255.255.255.248	Subnet Bits = 13 	Max Subnet = 8192	8 - 2 = 6
14	255.255.255.252	Subnet Bits = 14 	Max Subnet = 16384	4 - 2 = 2




Subnet ID Example: 172.32.0.0  

-----------
From 0 - 7:
-----------
Hosts = (256 - Mask) x 256 - 2

Mask: 0
Broadcast Address: 172.32.255.255
0 + 255 = 255
Host Address Range: 172.32.0.1 - 172.32.255.254

Mask: 128
Broadcast Address: 172.32.127.255
128 + 127 = 255
Host Address Range: 172.32.0.1 - 172.32.127.254

Mask: 192
Broadcast Address: 172.32.63.255
192 + 63 = 255
Host Address Range: 172.32.0.1 - 172.32.63.254

Mask: 224
Broadcast Address: 172.32.31.255
Wildcard Mask: 0.0.31.255
224 + 31 = 255
Host Address Range: 172.32.0.1 - 172.32.31.254

Mask: 240
Broadcast Address: 172.32.15.255
Wildcard Mask: 0.0.15.255
240 + 15 = 255
Host Address Range: 172.32.0.1 - 172.32.15.254

Mask: 248
Broadcast Address: 172.32.7.255
Wildcard Mask: 0.0.7.255
248 + 7 = 255
Host Address Range: 172.32.0.1 - 172.32.7.254

Mask: 252
Broadcast Address: 172.32.3.255
Wildcard Mask: 0.0.3.255
252 + 3 = 255
Host Address Range: 172.32.0.1 - 172.32.3.254

Mask: 254
Broadcast Address: 172.32.1.255
Wildcard Mask: 0.0.1.255
254 + 1 = 255
Host Address Range: 172.32.0.1 - 172.32.1.254



-------------
From 8 - 15 :
------------
Hosts = (256 - Mask)  - 2

Mask: 0
Broadcast Address: 172.32.0.255
0 + 255 = 255
Host Address Range: 172.32.0.1 - 172.32.0.254

Mask: 128
Broadcast Address: 172.32.0.127
128 + 127 = 255
Host Address Range: 172.32.0.1 - 172.32.0.126

Mask: 192
Broadcast Address: 172.32.0.63
192 + 63 = 255
Host Address Range: 172.32.0.1 - 172.32.0.62

Mask: 224
Broadcast Address: 172.32.0.31
224 + 31 = 255
Host Address Range: 172.32.0.1 - 172.32.0.30

Mask: 240
Broadcast Address: 172.32.0.15
240 + 15= 255
Host Address Range: 172.32.0.1 - 172.32.0.14

Mask: 248
Broadcast Address: 172.32.0.7
248 + 7 = 255
Host Address Range: 172.32.0.1 - 172.32.0.6

Mask: 252
Broadcast Address: 172.32.0.3
252 + 3 = 255
Host Address Range: 172.32.0.1 - 172.32.0.2