Overview of IP Addresses
TCP/IP requires that each interface on a TCP/IP network have its own unique IP address. There are two addressing schemes for TCP/IP: IPv4 and IPv6. You should know how these schemes differ.
IPv4
An IPv4 address is a 32-bit number, usually represented as a four-part decimal number with each of the four parts separated by a period or decimal point. You may also hear this method
of representation called dotted decimal or dotted quad decimal. In the IPv4 address, each individual byte, or octet as it is sometimes called, can have a value in the range of 0 through 255.
Note:
The term octet is the Internet community’s own term for an 8-bit byte. It came into common use because some of the early computers attached to the Internet had bytes of more than 8 bits; for example, DEC’s systems had blocks of 18 bits.
The way these addresses are used varies according to the class of the network, so all you can say with certainty is that the 32-bit IPv4 address is divided in some way to create an identifier for
the network, which all hosts on that network share, and an identifier for each host, which is unique among all hosts on that network. In general, though, the higher-order bits of the address make up the network part of the address and the rest constitutes the host part of the address. In addition, the host part of the address can be divided further to allow for a subnetwork address.
For more detail on this addressing scheme, see the sections “IPv4 Address Classifications” and “Understanding Subnets” later in this chapter. Some host addresses are reserved for special use. For example, in all network addresses, host numbers of all 0s and all 1s are reserved. An IPv4 host address with all host bits set to 0 in binary identifies the network itself, so 10.0.0.0 refers to network 10. An IP address with all host bits set to 1 in binary is known as a broadcast address. The broadcast address for network 172.16
is 172.16.255.255. A datagram sent to this address is automatically sent to every individual host on the 172.16 network.
American Registry for Internet Numbers (ARIN) assigns and regulates IP addresses on the Internet; you can get one directly from ARIN, or you can ask your Internet service provider (ISP)
to secure an IP address on your behalf. Another strategy is to obtain your address from ARIN and only use it internally until you are ready to connect to the Internet.
Note:
If you are setting up an intranet and you don’t want to connect to the outside world through the Internet, you don’t need to obtain a registered IP address from ARIN. Obtaining registered addresses from ARIN simply ensures that the addresses you use are unique over the entire Internet. If you are never going to connect to the Internet, there's no reason to worry about whether those addresses are the same as an address of a computer that isn't even on your network. Nowadays, however, it is rare to find an individual or organization that implements an IP-based internetwork that does not intend to connect to the Internet. More realistically, you might choose to use private address space (the 10.0.0.0 network, for example) internally while translating to a small pool of ARIN-registered addresses, using NAT, in order to communicate with the Internet, thus conserving public registered address space.
IPv4 Address Classifications
In an IPv4 address, the default number of bits used to identify the network and the host vary according to the network class of the address. While other methods, such as Classless Inter- Domain Routing, are currently more popular for specifying address space boundaries for entities of various sizes, the following classes of IP addresses originally offered a default set of
boundaries for varying sizes of address space and still provide a fallback mechanism for end and intermediate devices in the absence of ample subnetting information:
- Class A was designed for very large networks only. The default network portion for Class A networks is the first 8 bits, leaving 24 bits for host identification. The high-order bit is always binary 0, which leaves 7 bits available for IANA to define 127 networks. The remaining 24 bits of the address allow each Class A network to hold as many as 16,777,214 hosts. Examples of Class A networks include General Electric, IBM, Hewlett-Packard, Apple, Xerox,Compaq, Columbia University, MIT, and the private network 10.0.0.0. All possible Class A networks are in use; no more are available.
- Class B was designed for medium-sized networks. The default network portion for Class B networks is the first 16 bits, leaving 16 bits for host identification. The 2 high-order bits are always binary 10, and the remaining 14 bits are used for IANA to define 16,384 networks, each with as many as 65,534 hosts attached. Examples of Class B networks include Microsoft, Exxon, and the 16 private networks ranging from 172.16.0.0 to 172.31.0.0, inclusive. Class B networks are generally regarded as unavailable, but address conservation techniques have made some of these addresses become available from time to time over the years.
- Class C was designed for smaller networks. The default network portion for Class C networks is the first 24 bits, leaving 8 bits for host identification. The 3 high-order bits are always binary 110, and the remaining 21 bits are used by IANA to define 2,097,152 networks, but each network can have a maximum of only 254 hosts. Examples of Class C networks are the 256 private networks ranging from 192.168.0.0 to 192.168.255.0. Class C networks are still available.
- Class D is the multicast address range and cannot be used for networks. There is no network/ host structure to these addresses. They are taken as a complete address and used as destination addresses only, just like broadcast addresses. The 4 high-order bits are always 1110, and the remaining 28 bits allow access to more than 268 million possible addresses.
- Class E is reserved for experimental purposes. The first 4 bits in the address are always 1111.
One trick that works well, when faced with determining the class of an IP address written entirely in binary, is to assign the letters A through D to the first 4 bits, in alphabetical order. Wherever the first 0 falls signifies the class of address with which you are dealing. If none of the first 4 bits are set to 0, then you have a Class E address.
Figure 3.5 illustrates the relationships among these classes and shows how the bits are allocated by the Internet Network Information Center (InterNIC), an Internet Corporation for
Assigned Names and Numbers (ICANN) licensed service mark.
FIGURE 3 . 5 The IP address structure
- A value of 126 or less indicates a Class A address. The first octet is the network number; the next three, the host ID.
- A value of exactly 127, while technically in the Class A range, is reserved as a software loopback test address. If you send an echo request to 127.0.0.1, the ping doesn’t actually generate any network traffic. It does, however, test that TCP/IP is installed correctly. Using this number as a special test address has the unfortunate effect of wasting almost 17 million possible IP addresses, a case of early-70s short-sightedness, much like the theory that 64KB of RAM should be enough for PCs.
- A value of 128 through 191 is a Class B address. The first two octets are the network number, and the last two are the host address.
- A value of 192 through 223 is a Class C address. The first three octets are the network address, and the last octet is the host address.
- A value of 224 through 239 is a Class D multicast address. Again, there are no network or host portions to multicast addresses.
- A value greater than 239 indicates a reserved Class E address.
IPv6
IPv6 was originally designed because the number of available unregistered IPv4 addresses was running low. Because IPv6 uses a 128-bit addressing scheme, it has more than 79 octillion
(that’s 79,000,000,000,000,000,000,000,000,000 to you and me) times as many available addresses as IPv4. Also, instead of representing the binary digits as decimal digits, IPv6 uses eight sets of four hexadecimal digits, like so:
3FFE:0B00:0800:0002:0000:0000:0000:000C
In addition, you can abbreviate these very long addresses by dropping leading 0s (zeros) (like the 0 before the B in “0B00”). You can also drop any single grouping of zero octets (as in the number above) between numbers as long as you replace them with a double colon (::) and they are complete octets (you can’t drop the three 0s in the second octet to make it just “B” instead of
“0B00,” for example). If you apply this rule (known as the zero compression rule) to the above address, it would make the example address look like so:
3FFE:0B00:0800:0002::000C
Note:
The private address spaces listed with each class description are specified in RFC 1918 as being available to anyone who wants to use IP addressing on a private network but does not want to connect these networks directly to the Internet. Private addresses are those addresses that are not permitted to be routed by Internet routers. In fact, ISPs can be fined for passing traffic with these addresses as source or destination. Conversely, public addresses are those IP addresses that are allowed to be passed by Internet routers. You can use the private address space without the risk of compromising someone else’s registered network address space. If you use a private address and decide to interconnect your intranet with the Internet, you may use NAT to do so.
As with IPv4, there are several addresses that are reserved for special uses. For example, the IPv6 address ::/0 is the default address for a host that has yet to be assigned an address (like
0.0.0.0 in IPv4). The address ::1/128 is reserved for the local loopback (like 127.0.0.1 in IPv4). IPv6 also includes provisions for the old IPv4 hosts so they can be migrated to the new addressing
scheme. This is accomplished by using the address ::xxx.xxx.xxx.xxx, where the last four sets of digits refer to the old IPv4 address.
The way a host is configured is one very unique aspect of the IPv6 addressing scheme. Instead of an IP address, subnet mask, and default gateway, each station is required to have three different
addresses. First of all, the host has an address from each upstream supplier, a local address, and a link-local address. The local address is a number like ::1/128 that defines the local host. The link-local address is the address for the local subnet.
Finally, IPv6 has some other unique addressing concepts, like autoconfiguration (similar to DHCP, but extended further) and neighbor discovery, whereby the IPv6 host discovers its network
surroundings.
Warning:
You can’t use the zero compression rule to drop more than one grouping of zero octets. For example, you can’t make 3FFE:0000:0000:0002:0000:0000:0000:000C
into
3FFE::0002::000C.
This is also part of the zero compression rule: There can be
only one set of double colons! Otherwise, receiving devices would not be able to reverse-engineer the number of missing zeros. Therefore, since it’s up to the human entering the address, compress the longer series of zeros.
Note:
For more information on IPv6, check out RFC 2373 at www.ietf.org.
0 comments:
Post a Comment