Is the Host on
My Network?
As a network associate, one of
the determinations you often have to make about a host is “Is it on my
network?” or “To what network does this host belong?” To make these
deter-minations, you will need to determine what hosts are in a given network.
ANDing: What Is
in Your Network?
Inside
data network devices, digital logic is applied for their interpretation of the
addresses. When creating or forwarding an IPv4 packet, the destination network
address must be extracted from the destination address. This is done by a logic
called AND.
The
IPv4 host address is logically ANDed with its subnet mask to determine the network
address to which the host is associated. When this ANDing between the address
and the subnet mask is performed, the result yields the network address.
AND Operation
ANDing
is one of three basic binary operations used in digital logic. The other two
are OR and NOT. While all three are used in data networks, AND is used in
determining the net-work address. Therefore, the discussion in this section is
limited to logical AND. Logical AND is the comparison of two bits that yields
the following results:
1 AND 1 = 1
1 AND 0 = 0
0 AND 1 = 0
0 AND 0 = 0
The
result from anything ANDed with a 1 yields a result that is the original bit.
That is, 0 AND 1 is 0, and 1 AND 1 is 1. Consequently, anything ANDed with a 0
yields a 0. These properties of ANDing are used with the subnet mask to “mask”
the host bits of an IPv4 address. Each bit of the address is ANDed with the
corresponding bit of the subnet mask.
Because
all the bits of the subnet mask that represent host bits are 0s, the host
portion of the resulting network address becomes all 0s. Recall that an IPv4
address with all 0s in the host portion represents the network address.
Likewise, all the bits of the subnet mask that indi-cate the network portion
are 1s. When each of these 1s is ANDed with the corresponding bit of the
address, the resulting bits are identical to the original address bits.
Tidak ada komentar:
Posting Komentar