Likewise, it is irrelevant for the data line which kind of data is transmitted, as long as
packets are in the correct format.
13.1 IP Addresses and Routing
The discussion in this section is limited to IPv4 networks. For information about IPv6
protocol, the successor to IPv4, refer to Section 13.2, “IPv6—The Next Generation
Internet” (page 230).
13.1.1 IP Addresses
Every computer on the Internet has a unique 32-bit address. These 32 bits (or 4 bytes)
are normally written as illustrated in the second row in Example 13.1, “Writing IP
Addresses” (page 227).
Example 13.1:
Writing IP Addresses
IP Address (binary): 11000000 10101000 00000000 00010100
IP Address (decimal): 192. 168. 0. 20
In decimal form, the four bytes are written in the decimal number system, separated by
periods. The IP address is assigned to a host or a network interface. It can be used only
once throughout the world. There are exceptions to this rule, but these are not relevant
to the following passages.
The points in IP addresses indicate the hierarchical system. Until the 1990s, IP addresses
were strictly categorized in classes. However, this system proved too inexible and
was discontinued. Now, classless routing (CIDR, classless interdomain routing) is used.
13.1.2 Netmasks and Routing
Netmasks are used to dene the address range of a subnetwork. If two hosts are in the
same subnetwork, they can reach each other directly. If they are not in the same subnet-
work, they need the address of a gateway that handles all the trafc for the subnetwork.
To check if two IP addresses are in the same subnet, simply “AND” both addresses
with the netmask. If the result is identical, both IP addresses are in the same local net-
work. If there are differences, the remote IP address, and thus the remote interface, can
only be reached over a gateway.
Basic Networking 227