Rabu, 25 Oktober 2017

191

The subnet mask is a 32-bit value used with the IPv4 address that specifies the network por-tion of the address to the network devices. The subnet mask uses 1s and 0s to indicate which bits of the IPv4 address are network bits and which bits are hosts bits. The subnet mask is expressed in the same dotted decimal format as the IPv4 address.

There is a one-to-one correlation between the bits in the IPv4 address and the subnet mask. The subnet mask is created by placing a binary 1 in each appropriate bit position that repre-sents a network bit of the address and placing a binary 0 in the remaining bit positions that represent the host portion of the address.

A /24 prefix represents a subnet mask of 255.255.255.0

(11111111.11111111.11111111.00000000). The first three octets, the higher-order 24 bits, are all 1s. The remaining low-order bits of the subnet mask are 0s, indicating the host address within the network.

For example, examine the host 172.16.4.35/27 shown in Table 6-10.

Table 6-10       Determining the Network Address for the Host 172.16.4.35 /27


Dotted Decimal


Binary Octets



















Host
172
16
4
35
10101100
00010000
00000100
00100011









Mask
255
255
255
224
11111111
11111111
11111111
11100000









Network
172
16
4
32
10101100
00010000
00000100
00100000










Because the high-order bits of the subnet masks are contiguous 1s, there are only a limited number of subnet values within an octet. You only need to expand an octet if the network and host division falls within that octet. Therefore, there is a limited number of 8-bit pat-terns used in address masks. These bit patterns for the subnet masks, the number of network bits and the number of data bits within the octet, are shown in Table 6-11.

Table 6-11       Subnet Mask Values Within an Octet

Mask (Decimal)
Mask (Binary)
Network Bits
Host Bits








0
00000000
0
8




128
10000000
1
7




192
11000000
2
6




224
11100000
3
5




240
11110000
4
4




248
11111000
5
3




252
11111100
6
2




254
11111110
7
1




255
11111111
8
0





Tidak ada komentar:

Posting Komentar