Reklama
Reklama
ST Micro Connect 2 Choosing an IP address
D.5.1 Example
This example compares the following two network addresses to check if they are on the same subnet:
Address A: 192.168.16.20
, hex representation: 0xC0A81014 , binary representation:
11000000101010000001000000010100
Address B: 192.168.17.20
, hex representation 0xC0A81114 , binary representation:
11000000101010000001000100010100
Network mask for classful decimal 255.255.255.000
, hex representation: 0xFFFFFF00 , binary representation: 11111111111111111111111100000000
Network mask for classless decimal 255.255.240.000
hex representation 0xFFFFF000 binary representation: 11111111111111111111000000000000
To determine the subnet for address A with classful network MASK:
Address 11000000101010000001000000010100
Mask 11111111111111111111111100000000
Subnet 11000000101010000001000000000000 #bitwise AND
To determine the subnet for address B with classful network MASK:
Address 11000000101010000001000100010100
Mask 11111111111111111111111100000000
Subnet 11000000101010000001000100000000 #bitwise AND
To determine the subnet for address A with classless network MASK:
Address 11000000101010000001000000010100
Mask 11111111111111111111100000000000
Subnet 11000000101010000001000000000000 #bitwise AND
To determine the subnet for address B with classless network MASK:
Address 11000000101010000001000100010100
Mask 11111111111111111111100000000000
Subnet 11000000101010000001000000000000 #bitwise AND
The results show that for the classful network mask the addresses A and B are on separate subnets. When using the classless network mask the addresses are on the same subnet.
7912386 Rev 12 47/58
Preuzimanje
Reklama