IP ADDRESSING


To go somewhere on the Internet, you must type a Uniform Resource Locator (URL) into the Address field on your browser. A unique domain name combines with its organization category to form a URL, such as http://www.velte.com. Actually, you seldom even have to type a URL; you just click a hyperlink that has the URL stored in the HTML that makes up the Web page you're leaving.

URLs only exist to make surfing the Internet easier; they aren't true IP addresses. In other words, if you type the URL http://www.velte.com into your browser, a query is sent to a DNS server (configured as the primary DNS server in the PC network configuration) to translate the URL to an IP address, as shown in Figure 2-18.

image from book
Figure 2-18: DNS servers find the numerical IP addresses assigned to domain names

Translation to IP addresses is necessary because the routers and switches that run the Internet don't recognize domain names. Indeed, an IP address must be used just for your query to get as far as the DNS server.

All Internet addresses are IP addresses. The Internet Assigned Numbers Authority (IANA) issues IP addresses. Domain names used to be issued by an organization called InterNIC (Internet Information Center). The primary responsibility of these organizations was to assure that all IP addresses and domain names are unique. For example, http://www.velte.com was issued by InterNIC; and its IP address at the time, 209.98.208.34, was issued by the ISP, which, for its part, was issued the IP address from the IANA. The Internet Corporation for Assigned Names and Numbers (ICANN) was started in early 1999 to take over assignment duties. Now, users are still assigned IP addresses by Internet service providers (ISPs). But ISPs now get their IP addresses from a local or regional Internet registry (LIR) or national Internet registry (NIR).

The IP Address Format

Every node on the Internet must have an IP address. This includes hosts as well as networks. There's no getting around this rule because IP addressing is what ties the Internet together. Even stations connected to a LAN with its own addressing system (AppleTalk, for example) must translate to IP in order to enter the Internet.

It's somewhat ironic that, despite the requirement that every IP address be unique to the world, at the same time, all IP addresses must be in the same format. IP addresses are 32 bits long and divided into four sections, each 8 bits long, called octets.

Routers use IP addresses to forward messages through internetworks. Put simply, as the packet hops from router to router, it progresses through various networks until it finally reaches the router to which the destination address is attached.

image from book

Of course, sometimes a message will go through several router hops before moving closer to its destination. Sometimes, hops are needed to find the next destination.

From Bits to Dotted-Decimal Format

As discussed earlier, computers only understand instructions and data in binary format. This goes for IP addresses, too, but the dotted-decimal format was invented so that people could read binary IP addresses. Dotted-decimal takes its name from the fact that it converts bits to decimal numbers for each octet, punctuated with periods. Figure 2-19 shows the conversion of an IP address to dotted-decimal format.

image from book
Figure 2-19: Thirty-two bits define the IP addresses you see in dotted-decimal format

Figure 2-19 also shows the two reserved addresses. Assuming a 24-bit subnet mask, all 1's in an octet are for broadcast, where the router automatically forwards a message to all hosts attached to networks addressed thus far in the address. For example, messages addressed to 220.151.102.255 will be forwarded to all interfaces whose first three octets are 220.151.102. The other reserved address-called the "this network" address-is used for technical purposes not discussed here. Just understand that an address like 220.151.102.0 means "this interface" on network 220.151.102. One thing to take note of is that the subnet mask, and the subnet mask alone, defines what the broadcast and network IDs are. For example, 10.255.0.10 with a subnet mask of 255.255.255.0 is a valid IP address, even though the second octet is all 1's and the third octet is all 0's. Similarly,10.1.1.0 with a subnet mask of 255.255.240.0 and all 1's in the forth octet is not the broadcast address, nor is all 0's the network. Since the mask is a 20-bit mask, all of the last 12 bits must be all 1's to signify the broadcast and all 0's to signify the network.

IP Address Classes

The Internet Engineering Task Force (IETF) divides IP addresses into three general classes (plus two specialized ones). As mentioned earlier, IP addresses are divided into four dotted-decimal octets. Figure 2-20 shows the first octet number ranges. The shaded octets show how much of the IP address space is reserved for addressing networks. As the shaded portion moves to the right, there are more possible networks, but fewer possible hosts.

image from book
Figure 2-20: Three IP address classes differ by the octets they use for network addresses

This designation of ranges is called the first octet rule. Any router in the world can read the first octet of an IP address and know which bits to interpret as part of the network address versus the host address. If routers weren't able to make this distinction, the Internet couldn't work at all.

The majority of networks are numbered using either Class B or Class C IP addresses. The first octet ranges for each class are as follows:

  • 0 to 127 Class A, range of network numbers is 0.0.0.0 to 127.0.0.0 for 128 networks. However, the network must not consist of only 0's, and 127.0.0.0 is reserved for loopback. What's left are 126 networks-1 to 126. There are 16,777,214 possible host addresses (16,777,216 minus 2).

  • 128 to 191 Class B, range of network numbers is 128.0.0.0 to 191.255.0.0 for 16,384 networks. There are 65,534 possible host addresses (65,536 minus 2).

  • 192 to 223 Class C, range of network numbers is 192.0.0.0 to 223.255.255.0 for 2,097,152 networks. There are 254 possible host addresses (256 minus 2).

As you look at the preceding list, you can imagine that only a few very large organizations and service providers have Class A addresses-only 126 of them, in fact.

Note 

Don't forget that a network, by strict definition, is a LAN segment-an individual, sharedaccess medium. That's what is meant by the word "network" in the context of IP addressing. A network (or LAN segment) is also identified as a network interface (or interface, for short), because only one network can connect to a router's interface. For example, Ford Motor Company's intranet is probably referred to as a network by its employees, but Ford's network manager must assign unique IP addresses to the tens of thousands of individual networks (LAN segments) connected to the company's router interfaces.

Private Addressing

The IANA reserved three blocks of IP addresses for private addresses. A private IP address is one that is not registered with the IANA and will not be used beyond the bounds of the enterprise's internetwork-in other words, not on the Internet. Privately numbered internetworks are also sometimes called private internets, but we term them "internetworks" in this book to avoid confusion. The three blocks of reserved private address space are as follows:

  • 10.0.0.0 to 10.255.255.255 The 10 block is a single Class A network number.

  • 172.16.0.0 to 172.31.255.255 The 172 block is 16 contiguous Class B network numbers.

  • 192.168.0.0 to 192.168.255.255 The 192 block is 256 contiguous Class C network numbers.

Edge devices, such as firewalls and boundary routers, must be assigned public IP addresses to conduct business with the outside. Private addresses are assigned only to hosts that make most or all of their connections within the private internetwork.

That's not to say, however, that a privately addressed host cannot connect to the outside world. Two IP address translation services are used to assign valid public Internet IP numbers temporarily to hosts with permanent private IP addresses. One technique is Network Address Translation (NAT), and the other is Port Address Translation (PAT).

NAT is a one-to-one mapping, while PAT is a one-to-many translation. That is, NAT assigns a unique IP address to each host when it connects to the Internet. This address will likely change each time a host reconnects. PAT, on the other hand, assigns the hosts to a single IP address by using different ports.

How the two work is depicted in Figure 2-21.

image from book
Figure 2-21: NAT temporarily assigns unique, reusable public addresses; PAT assigns a global IP address

Address translation is usually done by a firewall. Keep in mind that these private-topublic translations are temporary. In NAT, when the internal host terminates its connection to the outside, the public IP address is returned to the pool for reuse.

The obvious advantage of private addressing is to have virtually unlimited address space for numbering internal networks and hosts. With a properly configured firewall or edge router to perform NAT or PAT address translation, these privately addressed hosts are still afforded connectivity to the Internet. Moreover, because their actual addresses are "translated" by a temporarily assigned pool number, hackers see no indication of the private internetwork's topology.

Subnetting

Subnetting is the practice of squeezing more network addresses out of a given IP address than are available by default. As discussed, IP address classes define which bits, by default, will address networks versus hosts. What by default means here is that upon reading the first octet in an address, a router knows which bits to treat as network address bits. Taking a Class C address as an example, the router will, by default, see the first three octets as network bits, and the final octet as host bits.

image from book

However, in the real world, most enterprises need more network address space than they are assigned by their ISPs. This creates the need to "cheat" by claiming some of the default host bits for use in addressing networks. This is done by reassigning bits from the host portion of the IP address to the network portion. Figure 2-22 shows two IP addresses, one a subnetted Class B and the other a Class C address. They're shown in both dotted-decimal and binary format.

image from book
Figure 2-22: Subnetting extends network address space rightward

Which class an IP address belongs to is important, because subnets extend to the right, starting from the leftmost bit in the default network address space. In other words, only bit positions in the shaded portions of Figure 2-22 may be encroached for subnet addressing.

Be aware that the majority of enterprises are assigned Class C addresses, meaning that they have, at most, only eight bits with which to work. Indeed, many networks are assigned only a range of host numbers, for example, 221.198.20.32-47.

Whole Octet Subnet Example

Subnetting makes more efficient use of IP addresses without changing them. Take the network in Figure 2-23 as an example. The enterprise was issued the Class B public IP address 151.22.0.0 and subnetted the entire third octet.

image from book
Figure 2-23: Subnetting makes efficient use of address space; this Class B example has room for 254 subnets

Looking at the configuration in Figure 2-23, you can see that there is address space for 254 subnetworks, with space for 254 hosts per subnetwork. The shaded host at the bottom-right area shows a complete subnet address-in this example, host number 1 attached to subnet number 2 within IP address 151.22.0.1. The key feature of this example is that an entire octet-the third octet-is subnetted.

As remote routers work their way through the subnetted addresses in Figure 2-23, the packets will automatically fall through the correct interface in the edge router at the bottom center of the cloud.

What Subnet Masks Look Like and Where They Exist

All subnet masks are 32 bits in length. Take note that masks are not addresses; they are overlays that define how an IP address is to be used. They differ from IP addresses in two key ways:

  • Form A subnet mask is represented as a string of 1's in binary, or a number-like 255-in dotted-decimal format.

  • Location A subnet mask is applied to a specific host network interface and within the configuration file of the router to which the subnetwork is attached.

The configuration file is managed by the IOS software of the Cisco router. An attached LAN segment is subnetted by entering a statement like this:

 MyRouter(config-if)#ip address 151.22.1.1 255.255.255.0 

The MyRouter(config-if)# prompt means, "Configure this network interface on this router," where the command is being entered into a Cisco router named MyRouter. The ip address command is used to set the IP address for the network interface in question. The interface's proper IP address is 151.22.1.1 (a Class B address), and the subsequent 255.255.255.0 tells the router to subnet the entire third octet, represented in bits as:

image from book

That's not too complicated. A subnet mask is the contiguous string of 1-bits extending from the end of the network address space into the host portion. Where that point is depends on the address class (the preceding example is a Class B). The subnet mask is entered into the router's config file using the ip address command to append the subnet mask to the normal IP address and apply it to a specific network interface-and in so doing, a specific LAN segment.

Partial Octet Subnetting

In most cases, however, subnets aren't quite so simple. This is because most enterprises are issued Class C IP addresses, where only the fourth octet is reserved, by default, as host address space. In these cases, the subnet mask extends only partway into the host address space, and is thus represented by a dotted-decimal number less than 255.

The shaded portion in Figure 2-24 represents the host bits claimed for subnetting from the fourth octet. Notice that only half the bits were claimed, and not all eight. This is one of two so-called .240 masks-this one permitting up to 14 subnets. Each subnet in this example has enough address space for 14 hosts-for a total of 196 possible hosts. This example would be input into the router's config file as follows:

 MyRouter(config-if)#ip address 209.98.208.34 255.255.255.240 

image from book
Figure 2-24: Usually, only part of an octet is subnetted, as in the Class C example

This command instructs the router that the interface is connected to a subnet with 28 network ID bits and 4 host ID bits. From there, packet delivery into the subnet is automatic.

There are several subnet masks from which to choose, as illustrated with the Class C address examples in Table 2-1. The farther right a mask extends into the host address space, the lower the number of possible hosts per subnet. Which mask to use depends entirely on the needs of the organization. For example, if a network interface on a router is attached to a point-to-point connection with a remote office, only two host addresses are required-one for each end. In this scenario, it would make sense to use the .252 mask, which has only two host addresses.

Table 2-1: Subnet Masks Listed by Number of Network ID Bits

Subnet Mask

Network ID Bits

Host ID Bits

Example Notation

Number of Subnets

Number of Hosts per Subnet

.192

26

6

209.98.208.34/26

2

62

.224

27

5

209.98.208.34/27

6

30

.240

28

4

209.98.208.34/28

14

14

.248

29

3

209.98.208.34/29

30

6

.252

30

2

209.98.208.34/30

62

2

IP Version 6

While Internet addressing seems to run smoothly and without incident, the shocking truth is that we are running out of IP addresses. Really. It might seem that IPv4, the current 32-bit addressing system, provides more than enough addresses. In fact, using IPv4, there are about four billion addresses available. However, it turns out we need more.

When the IP addressing scheme was developed in the 1980s, no one had a clue that the Internet would become the behemoth that it has grown into. The sheer pervasiveness of the Internet is gobbling up IP addresses-not only are computers, servers, and other network equipment using IP addresses, but as other devices, such as Internet-enabled cellular telephones and PDAs, gain in popularity, more and more IP addresses will be sucked up.

Enter IPv6, also known as IPng ("ng" meaning "next generation"). IPv4 utilizes a 32-bit binary number to identify unique networks and end stations. This allows for around four billion unique addresses. IPv6 is different in that it uses a 128-bit hexadecimal format (numbers range from 0000 to FFFF). This addressing scheme allows for 10^15 unique hosts, or 340,282,366,920,938,463,463,374,607,431,768,211,456 total addresses. Basically, that's one address for every grain of sand on the planet.

In addition to the exponential growth of IP addresses, IPv6 makes some functional improvements over IPv4, including:

  • Simplified header format

  • Routing efficiency improved with hierarchical network architecture

  • Support for popular routing protocols

  • Autoconfiguration

  • Embedded IPSec

  • Greater number of multicast addresses

Format

As noted earlier, IPv6 addresses are 128 bits in size. They are expressed as eight fields of 16-bit, hex notation numbers (0000-FFFF), in this format:

 x:x:x:x:x:x:x:x 

Examples of this format are

 FEDC:BA98:7654:3210:FEDC:BA98:7654:3210 

or

 1080:0:0:0:8:800:200C:417A 

IPv6 addresses can be presented in three ways:

  • The most straightforward method is to simply enter the values in each of the eight fields, as follows:

     1070:200:0:0:900:300C:618A 

    You'll note that it is not necessary to use the leading 0's in an individual field. That is, "200" is the same as "0200."

  • In some cases, IPv6 addresses will contain long strings of zero bits. As such, crafters of the IPv6 addressing scheme have figured out a way to save the "0" button on your keyboard. Rather than enter "0000:0000:0000:0000:0000:0000:00 00:1" or even "0:0:0:0:0:0:0:1," it is acceptable to indicate two or more groups of 0's using "::." As such, the aforementioned example can be abbreviated as "::: 1."

    The only hitch to this shorthand is that the "::" notation can only be used once in the address. By using the "::" notation, IPv6 is able to determine that the "missing" number of values must all be 0's. However, if the "::" notation is used more than once, it would be impossible to tell how many sets of 0's are missing from each section.

    Table 2-2 shows how different IPv6 addresses can be abbreviated.

    Table 2-2: Abbreviating IPv6 Addresses

    Address Type

    IPv6 Address

    Representation Using ::

    Unicast

    1070:200:0:0:900:300C:618A

    1070:200::900:300C:618A

    Multicast

    FF01:0:0:0:0:0:0:100

    FF01::100

    Loopback

    0:0:0:0:0:0:0:1

    ::1

    Unspecified

    Address 0:0:0:0:0:0:0:0

    ::

  • Finally, given that there will be a fair amount of transition time before IPv6 is completely adopted, there is a format that is used in mixed IPv6/IPv4 environments. That format combines both formats and is represented as:

     x:x:x:x:x:x:d.d.d.d 

    In this case, the "x" values are the hexadecimal values of the six high-order 16bit pieces of the address, and the "d" values are the decimal values of the four low-order 8-bit pieces of the address. For example:

     0:0:0:0:0:FFFF:129.144.40.20 

    To throw a bit of a curveball at you, you are still allowed to utilize the compressed form of the address, even in the mixed format. For instance:

     ::FFF:129:144:40:20 

IP Prefix

The IPv6 prefix is the portion of the address representing the leftmost, high-order bits. These bits represent the network identifier. The IPv6 prefix is represented using the prefix/prefix length notation. For example, 2001/16 identifies the Internet, while 2001: AB18/32 might identify an ISP. And 2001:4637:0:2930/64 identifies a specific network.

Types of Addressing

There are three types of addressing available in IPv6:

  • Unicast One host transmits to another on a network. Cisco supports five types of unicast addresses:

    • Global unicast addresses, which are comparable to IPv4 global unicast addresses. That is, it is an IPv6 address from the global unicast prefix. Global unicast addresses move upward through organizations, and then to ISPs. Global unicast addresses contain a global routing prefix, a subnet ID, and an interface ID. With the exception of addresses beginning with 000, all global unicast addresses have a 64-bit interface ID. Currently, the global unicast allocation uses a range of addresses starting with the value 001 (2000::/3). Global unicast addresses use one-eighth of the total IPv6 address space and make up the largest block of assigned addresses.

      Figure 2-25 shows the global unicast address format.

      image from book
      Figure 2-25: The format of a global unicast IPv6 address

    • Site-local unicast addresses, which are similar to private addresses (like 10.0.0.0, 172.16.0.0, and 192.168.0.0) in IPv4.

    • Link-local unicast addresses, which are used for neighbor discovery and autoconfiguration. For example, these addresses are used in a network when no router is present.

    • IPv4-mapped IPv6 addresses, which are used to represent the address of an IPv4 node as an IPv6 address.

    • IPv4-compatible IPv6 addresses, which are used transitionally as IPv6 is used over existing IPv4 networks.

  • Anycast One host transmits to the closest destination host. Anycasting is designed to let one host initiate router table updating for a group of hosts. IPv6 can determine which gateway host is closest and sends packets to that host, singly. In turn, that host can anycast to another host in the group, and so on, until all routing tables are updated. An anycast address is a global unicast address assigned to a set of interfaces belonging to different nodes.

  • Multicast One host transmits to multiple hosts on a network. The multicast address scheme uses addresses with a prefix of FF00::/8. In total, the multicast address range uses 1/256 of the total IPv6 address space. The second octet following the prefix establishes the lifetime and scope of the multicast address. Permanent multicast addresses have a lifetime parameter set to 0; temporary addresses are set to 1. The next four bits are used to establish the scope of the address.

    Figure 2-26 not only shows the multicast address, but also includes the values of these bits. In order to identify specific functions, each block of multicast addresses within the range of FF00:: to FF0F:: is used accordingly:

    • FF01::1 All nodes within the interface-local scope

    • FF02::1 All nodes on the local link

    • FF01::2 All routers within the interface-local scope

    • FF02::2 All routers on the link-local scope

    • FF05::2 All routers in the site-local

    • FF02::1:FFXX:XXXX Solicited-node multicast address (XX:XXXX represents the last 24 bits of the IPv6 address of node)

    image from book
    Figure 2-26: IPv6 multicast addresses contain specific information about the addresses' lifetime and scope

Configuration

Using IPv4, addresses are assigned one of two ways:

  • Statically The address must be entered manually.

  • Dynamically DHCP/BOOTP automatically assigns IP addresses to a host when they boot onto the network.

IPv6 uses a feature called stateless autoconfiguration. This is similar to DHCP in that IP addresses are automatically assigned; however, it differs because a special DHCP application or server is not required. By using DHCP, any router using an IPv6 address becomes a "provider" of IP addresses to the network to which it is attached. To prevent duplicate addresses from being doled out, IPv6 uses a feature called duplicate address detection (DAD).

Address Allocation

Like IPv4, you can't just decide on an IP address and call it your own-even if there is a seemingly limitless amount. IANA is managing IPv6 addresses much in the way it has managed IPv4 addresses. It has allocated addresses from 2001::/16 to registries from the full address space. Each registry gets a /23 prefix within the 2001::/16 address space. The addresses are allocated as follows:

  • 2001:0200::/23 and 2001:0C00::/23 For use in Asia. These addresses were allocated to Asia Pacific Network Information Centre (APNIC).

  • 2001:0400::/23 For use in the Americas. The addresses were allocated to American Registry for Internet Numbers (ARIN).

  • 2001:0600::/23 and 2001:0800::/23 For use in Europe and the Middle East. These addresses were allocated to Reseaux IP Européens-Network Coordination Center (RIPE NCC).

Next, the registries allocate a /32 prefix to the IPv6 ISPs, and then the ISPs allocate a /48 prefix to each customer. The /48 prefix of each site could be further allocated to each LAN, using a /64 prefix. Each site could have a maximum of 65,535 LANs.

IPv6 Addresses in a URL

Since the colon (:) is already used to identify a specific port number in a URL (for instance, http://www.thisisjustatest.com:8080), it cannot be used within the address. As such, it is necessary to find a workaround to use this in Web browsers. The chosen way to make IPv6 addresses work as URLs is to enclose them in brackets, like this:

 http://[2001:0401:3:4F23::AE35] 

If we wanted to go to a specific port using an IPv6 address, the colon and port number would simply follow the address, like this:

 http://[2001:0401:3:4F23::AE35]:8080 

That having been said, using IPv6 as a URL is a giant pain. Best just to use the fully qualified domain name than mess around with the IPv6 address. After all, isn't it easier to remember http://www.thisisjustatest.com than 2001:0401:3:4F23::AE35?

IPv6 isn't going to phase out IPv4 anytime soon. There are plenty of pundits out there who think IPv4 won't run out of address space for more than a decade and that IPv6 doesn't really bring anything new and revolutionary to the IP party. Agree or disagree, this is relevant information to know, because many Cisco devices are ready to go using IPv6 for addressing. At this point in time, however, the vast majority of internetworking is achieved using the 32-bit, four-octet, IPv4.




Cisco. A Beginner's Guide
Cisco: A Beginners Guide, Fourth Edition
ISBN: 0072263830
EAN: 2147483647
Year: 2006
Pages: 102

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net