Java Reference
In-Depth Information
CHAPTER 4
Internet Addresses
Devices connected to the Internet are called nodes . Nodes that are computers are called
hosts . Each node or host is identified by at least one unique number called an Internet
address or an IP address. Most current IP addresses are 4-byte-long IPv4 addresses.
However, a small but growing number of IP addresses are 16-byte-long IPv6 addresses.
(4 and 6 refer to the version of the Internet Protocol, not the number of the bytes in the
address.) Both IPv4 and IPv6 addresses are ordered sequences of bytes, like an array.
They aren't numbers, and they aren't ordered in any predictable or useful sense.
An IPv4 address is normally written as four unsigned bytes, each ranging from 0 to 255,
with the most significant byte first. Bytes are separated by periods for the convenience
of human eyes. For example, the address for login.ibiblio.org is 152.19.134.132. This is
called the dotted quad format.
An IPv6 address is normally written as eight blocks of four hexadecimal digits separated
by colons. For example, at the time of this writing, the address of www.hamiltonweath‐
er.tk is 2400:cb00:2048:0001:0000:0000:6ca2:c665 . Leading zeros do not need to be writ‐
ten. Therefore, the address of www.hamiltonweather.tk can be written as
2400:cb00:2048:1:0:0:6ca2:c665 . A double colon, at most one of which may appear in
any address, indicates multiple zero blocks. For example, the address
2001:4860:4860:0000:0000:0000:0000:8888 can be written more compactly as
2001:4860:4860::8888 . In mixed networks of IPv6 and IPv4, the last four bytes of the
IPv6 address are sometimes written as an IPv4 dotted quad address. For example,
FEDC:BA98:7654:3210:FEDC:BA98:7654:3210
could
instead
be
written
as
FEDC:BA98:7654:3210:FEDC:BA98:118.84.50.16 .
IP addresses are great for computers, but they are a problem for humans, who have a
hard time remembering long numbers. In the 1950s, G. A. Miller discovered that most
people could remember about seven digits per number; some can remember as many
as nine, while others remember as few as five. For more information on this, see “The
Magical Number Seven, Plus or Minus Two: Some Limits on Our Capacity for Pro‐
 
Search WWH ::




Custom Search