Explain the purpose of IP addressing. The topics covered in this chapter include details regarding both IPv4 addressing and IPv6 addressing, from representation techniques and addressing properties to hierarchical design and IPv4-to-IPv6 transition.
IP addresses are used to logically identify devices in a network for reachability and to communicate. The Layer 3 dedicated network device is the router, which connects to a different network on each interface and routes packets between them. Learn advanced IP addressing and subnetting in our IP Subnetting – Zero to Guru video course.
Unicast, Multicast, and Broadcast
IP addresses can be divided into three categories, based on how they are used to identify the receiver of a packet:
- Unicast addresses: These are the most common addresses in regular networks and on the Internet. They identify a single device and Unicast traffic is destined to a unique machine.
- Multicast addresses: These addresses identify a group of devices in a network (i.e., they don’t identify a single device or all devices). Multicast traffic is commonly used by multimedia applications that must transmit the same packet to multiple destinations. Only devices that are part of the same Multicast address group accept traffic destined to that group. IPv4 Class D is reserved for defining Multicast group addresses: 224.0.0.0 to 239.255.255.255 (this will be covered in detail in the following sections).
- Broadcast addresses: Unlike Unicast and Multicast addresses, Broadcast addresses define all the hosts in a particular network. Broadcast traffic is sent to all devices in a subnet, which can lead to link congestion and can decrease network performance. The Broadcast address is defined by filling the host portion with binary 1s (details on Broadcast addresses will be covered in subsequent sections).
IPv4 Addressing
This subject was introduced in Chapter 2. To recap, IPv4 addresses are 32-bit numbers represented as strings of zeros and ones. They are written in decimal notation (four groups of numbers, each number up to 255) but computers interpret them in binary notation (i.e., each group of decimal numbers is seen as a string of zeros and ones). The Layer 3 header contains a Source IP Address field and a Destination IP Address field. Each field is 32 bits in length.
To create a more intuitive representation of IPv4 addresses, the 32 bits can be divided into 4 octets (1 octet (or byte) = 8 bits) separated by dots, hence, dotted-decimal notation. The octets can be converted into decimal numbers by standard base-2 to base-10 translation.
For example, consider the following 32-bit string:
11000000101010001000000010101001
After dividing it into 4 octets, you have the following binary representation:
11000000.10101000.10000000.10101001
This translates into an easy to read decimal representation:
192.168.128.169
The maximum value of an octet is all bits equal to 1. The equivalent decimal value is 255.
Binary to Decimal Conversion
The binary to decimal/decimal to binary conversion can be performed by building a matrix that contains the first eight decimal numbers that represent powers of two, in the reverse order:
27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 |
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
To convert a decimal IP address into its binary form, take each of the four decimal numbers and apply a simple procedure:
- Try to subtract the first matrix number from the decimal number
- If it can be subtracted, place a 1 in the first position and subtract to obtain the result
- If it cannot be subtracted, place a 0 in the first position and try subtracting the next matrix number from the initial number
- Follow the same approach for each remaining decimal number: try to subtract the next matrix number from it, inserting a 1 or a 0 if this can or cannot be done, respectively
Let’s take the example presented above and follow the algorithm:
- Subtract 128 from 192: it can be done and the result is 64; the first bit is 1
- Subtract 64 from 64: it can be done and the result is 0; the second bit is 1
- No other number can be subtracted from 0, so all the other bits are 0
- The binary representation for 192 is 11000000
Now for the second position, which is represented by 168:
- Subtract 128 from 168: it can be done and the result is 40; the first bit is 1
- Subtract 64 from 40: it cannot be done, so the second bit is 0 and continue
- Subtract 32 from 40: it can be done and the result is 8; the third bit is 1 and continue
- Subtract 16 from 8: it cannot be done, so the fourth bit is 0 and continue
- Subtract 8 from 8: it can be done and the result is 0; the fifth bit is 1
- All the other bits are 0 because nothing is left
- The binary representation for 168 is 10101000
The same rules apply for the other two positions, so the final binary representation for 192.168.128.169 is 11000000.10101000.10000000.10101001.
The binary to decimal conversion is simply accomplished by taking any 0 or 1 bit and multiplying it with the corresponding number from the matrix you created, and then adding all the numbers. For example, consider the same IP address:
- 192 is 1*128 + 1*64 + 0*32 + 0*16 + 0*8 + 0*4 + 0*2 + 0*1
- 168 is 1*128 + 0*64 + 1*32 + 0*16 + 1*8 + 0*4 + 0*2 + 0*1
- 128 is 1*128 + 0*64 + 0*32 + 0*16 + 0*8 + 0*4 + 0*2 + 0*1
- 169 is 1*128 + 0*64 + 1*32 + 0*16 + 1*8 + 0*4 + 0*2 + 1*1
Each group of 8 bits is called a byte or an octet.
Note: The base-10 representation is easy to understand by humans, but computers internally compute IPv4 addresses as strings of zeros and ones. Therefore, there is no processing or storage advantage offered by the simplified representation. |
IPv4 Classes
IPv4 addresses are categorized into five classes. Classes A, B, and C are used for addressing devices, Class D is for Multicast groups, and Class E is reserved for experimental use. The first bits of the address define which class it belongs to, as depicted in Table 3.1 below. Knowing the class of an IPv4 address helps determine which part of the address represents the network and which part represents the host bits.
Table 3.1 – IPv4 Address Classes
Class | Leading Bits | Size of Network Portion | Size of Host Portion | Number of Networks | Addresses per Network | Start Address | End Address |
A | 0 | 8 bits | 24 | 128 | 16,777,216 | 0.0.0.0 | 127.255.255.255 |
B | 10 | 16 bits | 16 | 16,384 | 65,536 | 128.0.0.0 | 191.255.255.255 |
C | 110 | 24 bits | 8 | 2,097,152 | 256 | 192.0.0.0 | 223.255.255.255 |
D | 1110 | – | – | – | – | 224.0.0.0 | 239.255.255.255 |
E | 1111 | – | – | – | – | 240.0.0.0 | 225.255.255.255 |
The Internet Assigned Numbers Authority (IANA) is the organization that manages the allocation of IPv4 addresses on the Internet. IPv4 addresses can be classified into two categories, based on the location in which they are used and their exposure to the Internet:
- Public addresses: used for external communication and they can be accessed by every other Internet-facing machine. They are unique on the Internet.
- Private addresses: reserved, used only internally within a company. They are not advertised on the Internet, as multiple companies can use the same private IP address ranges.
Private address ranges, as defined by RFC 1918, are as follows:
- 0.0.0 to 10.255.255.255
- 16.0.0 to 172.31.255.255
- 168.0.0 to 192.168.255.255
Note: RFC stands for Request for Comments, which is a document published by the Internet Engineering Task Force (IETF) that defines a specific standard or technology used on the Internet. |
A special range of IP addresses is 127.0.0.0 to 127.255.255.255 (or 127.0.0.0/8), which represents Loopback addresses. These special IP addresses are used by a host to identify its own network adapter. Any traffic sent by a program to a Loopback address is immediately passed back to the program as if it was received from another device but without going over the network. Address 127.0.0.1 is used to test whether TCP/IP is working on your device.
Another special IP address range is 169.254.1.0 to 169.254.254.255, which is often used by Microsoft operating systems to auto-assign an IP address if one is not statically configured or offered by a DHCP server. This technique is called Automatic Private IP Addressing (APIPA) and is not generally used in modern networks.
When reserving full classes of addresses (i.e., classful addressing) for certain networks, certain limitations appear because of the large number of addresses per network and because of the limited IPv4 address space. For this reason, the concept of subnets and classless addressing was introduced in RFC 950.
Classless addressing allows Class A, B, and C addresses to be divided into smaller networks called subnets, resulting in a larger number of possible networks, each with fewer host addresses. The subnets are created by borrowing bits from the host portion and using them as subnet bits.
IPv4 Components
An important aspect in IPv4 addressing is separating the network and the host parts of the addressing string. This is accomplished using a subnet mask, also represented as a 32-bit number. The subnet mask starts with a continuous string of bits with the value of 1 and ends with a string of 0s. The number of bits with the value of 1 represents the number of bits in the IP address that must be considered in order to calculate the network address. A subnet mask bit of 0 indicates that the corresponding bit in the IPv4 address is a host bit. Using the same example as above with a 255.255.255.0 mask results in the following situation shown in Figure 3.1 below:
Figure 3.1 – IPv4 Addressing Components
With a string of 24 bits of 1s in the subnet mask, only the first 24 bits in the IP address are considered the network portion. This results in a network address of 192.168.128.0, with a subnet mask of 255.255.255.0. The last 8 bits in the IP address can be assigned to network devices and these bits represent the host portion of the IP address. With 8 bits free, you can assign an IP address to 28 hosts, meaning a total of 256 host addresses in the 192.168.128.0 network space. Every machine in a particular LAN will have the same network address and subnet mask. The host portion of the IP address is the only one that will differ.
Note: The network address is defined by filling the host portion with binary 0s, as opposed to the Broadcast address for a particular subnet, which is defined by filling the host portion with binary 1s. |
When using classless addressing, a subnet mask indicates which bits have been borrowed from the host field. Using subnet masks creates a three-level hierarchy: network, subnet, and host.
Another way the subnet mask can be represented is using a prefix length or slash notation (/) to indicate how many network bits the address contains. For example 192.168.10.0/24 means the first 24 bits of the 192.168.10.0 address are network bits. This corresponds to a 255.255.255.0 subnet mask.
Planning for IPv4 Addressing
The first step in the IPv4 addressing design is estimating the size of the network to establish how many IP addresses will be needed, which is illustrated in the sample topology in Figure 3.2 below:
Figure 3.2 – Sample Topology for IPv4 Addressing Design
Figure 3.2 above consists of a medium-sized to large company with its headquarters location connected to two regional offices via a backbone link. The regional offices further connect to several branch offices and home offices via cable/Frame Relay links. An ISDN provider is also used as a backup solution for both of the regional offices.
The first step is to determine how many networks (locations) will form the overall network. The topology illustrated above includes the following:
- 1 main location
- 2 regional locations
- 4 branch/home office locations
The second step is to determine the overall size of each network, meaning how many devices need to be addressed (e.g., end-systems, printers, plotters, router interfaces, switches, servers, firewalls, and other devices). All of these details can be extracted from the network design plan documentation that is usually provided by the decision-makers in the organization.
The third step is to determine the addressing needs for each individual location, including the following:
- Which devices in each location will use static IP addressing (e.g., servers)?
- Which devices will use dynamic addressing (through DHCP)?
- Which areas will use private addresses?
- Which areas will use public addresses, and how many of these will you need to get from the ISP?
- Which class of addresses will be used?
- How many networks need to be obtained from the public authority (i.e., the IANA)?
If you start this analysis process with the headquarters location, you can calculate the number of IP addresses needed for routers, switches, workstations, servers, firewalls, and phones. After calculating the total number of addresses needed, you should always plan for growth and reserve an additional 20 to 30% for future use.
This process is repeated for each location in the topology above. Table 3.2 below shows the results for each location, giving you a clear picture of the number of IP addresses needed overall:
Table 3.2 – Number of IP Addresses Needed for Individual Components
Location | Router
Interfaces |
Switches | PCs | Servers | Firewalls | Phones | Total | Total + Growth (20%) |
HQ | 20 | 35 | 650 | 40 | 10 | 650 | 1405 | 1686 |
Regional 1 | 10 | 5 | 200 | 5 | 2 | 200 | 422 | 506 |
Regional 2 | 10 | 5 | 200 | 5 | 2 | 200 | 422 | 506 |
Branch 1 | 2 | 1 | 5 | 0 | 0 | 5 | 13 | 15 |
Branch 2 | 2 | 1 | 5 | 0 | 0 | 5 | 13 | 15 |
Home 1 | 2 | 1 | 2 | 0 | 0 | 0 | 5 | 6 |
Home 2 | 2 | 1 | 2 | 0 | 0 | 0 | 5 | 6 |
The result is 2740 IP addresses for the entire network topology, including 20% for estimated growth.
Once you determine the number of IP addresses needed, the next big decision is whether private, public, or a combination of private and public addresses will be used. Private internetwork addresses are defined in RFC 1918 and are used internally within the network. From a real-world standpoint, because of the limitation of the number of public IP addresses, a service called Network Address Translation (NAT) is usually used to translate the private internal addresses to external public (routable) addresses. Internally, you can use one of the following three ranges of addresses:
- 0.0.0/8 (10.0.0.0 to 10.255.255.255), usually used in large organizations
- 16.0.0/12 (172.16.0.0 to 172.31.255.255), usually used in medium organizations
- 168.0.0/16 (192.168.0.0 to 192.168.255.255), usually used in small organizations
Any address that falls within the three private address ranges will not be routed on routers on the Internet. These devices have policies and access control lists configured to make sure that any packet containing a private address that arrives at an inbound interface will be dropped.
All of the other addresses are public addresses that are allocated by Internet Service Providers (ISPs) or other point-of-presence nodes on the Internet. ISPs can then assign Class A, B, or C addresses to customers so they can use them on devices that are exposed to the Internet, such as:
- Web servers
- DNS servers
- FTP servers
- Other servers that run publically accessible services
When you decide to use private, public, or a combination of private and public addresses, you will encounter one of the following four types of connections:
- No Internet connectivity
- Only one public address (or a few) for user Web access
- Web access for users and public access servers
- Every end system has a public IP address
Analyzing the topology in Figure 3.2 above, no Internet connectivity would imply that all the connections between the locations are private links and the enterprise is not connected to the Internet in any of its nodes. In this case, you do not need any public IP addresses because the entire address scheme can come from the private address ranges.
Another situation would be one in which you have Internet connectivity to all network locations but you do not have any servers that run publically accessible services (e.g., Web, FTP, and others). In this case, you need a public IP address that will allow users to access the Web. NAT can be used to translate traffic from the internal network to the outside network, so the internal networks might contain only private IP addresses, while the external link uses just one public address.
The third scenario is one of the most common, especially when considering the growth of enterprise networking. This implies having user Internet connectivity (just like in the previous scenario) but also having public access servers. Here, public IP addresses have to be used to connect to the Internet and to get to the specific servers (e.g., Web, FTP, DNS, and others). In this case, the internal network should use private IP addresses and NAT to translate them into public addresses.
The most highly unlikely scenario would be one in which every end-system is publicly accessible from the global Internet. This is a dangerous situation because the entire network is exposed to Internet access and this implies high security risks. To mitigate these risks you must implement strong firewall protection policies at every location. In addition to security issues, this scenario is also not very effective because many IP addresses are wasted and this is expensive. All of these factors result in a design that should not be used in modern networks.
The two most common solutions to the scenarios presented above are:
- Implement one or a few public addresses for user access to the Web
- Implement a few public addresses that provide Web access for both users and public access servers
Both of these solutions imply using private internal addressing and NAT to reach outside networks.
Note: Whenever you connect to the outside world through public addressing you should consider implementing efficient security features. |
Hierarchical Network Addressing
Hierarchical design involves address summarization techniques. After planning the IPv4 addressing scheme and determining the number and type of addresses needed, the next step is determining whether hierarchical design is necessary. A hierarchical design is useful when you need a scalable solution for a large enterprise.
After deciding to implement the hierarchical network addressing scheme, the next step is making sure that you understand the math behind it and how route summarization works. For example, you decide that you need to combine a group of Class C addresses into an aggregate address. Using summarization, you can find a single summarized route for several networks. In a real-world scenario, you can use a subnet calculator to automatically generate the most appropriate aggregate route from a group of addresses. Next, you connect the Campus Backbone module to several other buildings. In each building there are several networks in use:
- A network for the Server Farm module
- A network for the Network Management module
- A few networks for the Access Layer submodule (which serves several departments)
Your goal is to take all of these networks and aggregate them into one single address that can be stored at the Edge Distribution or Core Layer submodules of your network. The first thing to understand when implementing a hierarchical addressing structure is that you need to use continuous blocks of IP addresses, such as 192.100.168.0 through 192.100.175.0.
192.100.168.0 | 11000000.01100100.10101 | 000. | 00000000 |
192.100.169.0 | 11000000.01100100.10101 | 001. | 00000000 |
192.100.170.0 | 11000000.01100100.10101 | 010. | 00000000 |
192.100.171.0 | 11000000.01100100.10101 | 011. | 00000000 |
192.100.172.0 | 11000000.01100100.10101 | 100. | 00000000 |
192.100.173.0 | 11000000.01100100.10101 | 101. | 00000000 |
192.100.174.0 | 11000000.01100100.10101 | 110. | 00000000 |
192.100.175.0 | 11000000.01100100.10101 | 111. | 00000000 |
In this scenario, you will summarize based on a location where all of the uppermost bits are identical. Looking at the first address, the first 8 bits equal the decimal 192, the next 8 bits equal the decimal 100, and the last 8 bits represent 0. The only octet that changes is the third one, where only the last 3 bits in that octet change when going through the address range.
The summarization process implies writing the third octet in binary format and then looking for the common bits on the left side. In the block of IP addresses above, all the bits are identical up to the last 3 bits in the third octet, leaving you with 21 identical bits, so all of the addresses will be summarized to 192.100.168.0/21.
Once you decide to implement a hierarchical addressing design and understand the math involved in this process, the best approach would be to use a modular and scalable design and decide how you will break up the organization, keeping in mind the number of network modules, campus modules, and remote locations in terms of addressing. This includes the decision of whether to apply a hierarchical address model to each module or to the entire enterprise.
Another aspect to consider is the way summarization may affect the routing protocols used. Summarization usually affects routing because it reduces the size of the routing tables, the processor, and memory utilization and it offers a much faster convergence of the routed network. You also should decide on the number of nodes (including end-user stations) available per summarization group. The most important advantages of using route aggregation are:
- Lowering overhead
- Improving network stability
- Easing future growth
Next, we will use a popular design model and analyze another example of addressing for an enterprise campus with multiple buildings, as illustrated in Figure 3.3 below:
Figure 3.3 – Enterprise Campus with Multiple Buildings
For the internal private addressing, the popular 10.0.0.0/8 range is used. Within the organization domain, two separate building infrastructures (on the same campus or remote buildings) are aggregated using the 10.128.0.0/16 and 10.129.0.0/16 ranges.
Note: The 10.128.0.0 and 10.129.0.0 addresses are used instead of the 10.1.0.0 address or other lower second octet addresses because many organizations already use those lower range octets, and you would have problems if your company decided to buy another company that uses one of those ranges. This minimizes the chances of overlap when merging other infrastructures with your network. |
Going deeper within each building, you can break the addressing scheme within different departments using the 10.128.1.0, 10.128.2.0 or 10.129.1.0, 10.129.2.0 networks with a 24-bit mask. Because of the scalable design, you could include another tier above the departmental addresses that would include addresses in the 10.129.0.0/21 range, for example.
Moving beyond that point is the Enterprise Edge module, which contains various submodules (e.g., E-commerce or Internet Connectivity) that have point-to-point connections to different ISPs and that can be broken down further using Variable Length Subnet Masking (VLSM is where you extend the default subnet mask to create more networks, referred to as subnetworks).
In summary, it is very important to tie the addressing scheme to the modular enterprise network design.
The advantages of using route summarization and aggregation are numerous, but the most important advantages are as follows:
- Isolates changes to the topology to a particular module
- Isolates routing updates to a particular module
- Fewer updates need to be sent up the hierarchy (preventing all the updates from going through the entire network infrastructure)
- Lower overall recalculation of the entire network when links fail (a change in a routing table does not converge to the entire network); for example, route flapping (going up and down in rapid succession) in a particular department is constrained within that department, so it does not have a cascading effect on other modules (considering the example above)
- Narrow scope of route advertisement propagation
- Lowers frequency of routing updates (you can modify routing protocol metrics and timers)
- Summarized module is easier to troubleshoot
- Prevents routing loops and black holes
IPv6 Addressing
The IPv6 protocol is based on RFC 2460. The most important features offered by IP version 6 include the following:
- Offers 128-bit address space
- Supports hierarchical addressing and auto-configuration
- Every host can have a globally unique IPv6 address (no need for NAT)
- Hosts can have multiple addresses (i.e., multihoming)
- Efficient fixed header size for IPv6 packets
- Enhanced security and privacy headers
- Improved multicasting and QoS
- Dedicated IPv6 routing protocols: RIPng, EIGRPv6, OSPFv3, Integrated IS-ISv6, and BGP4+
- Every major vendor supports IPv6
IPv6 is a mechanism that was created to overcome the limitations of the current IP version 4 standard. One of the major shortcomings of IPv4 is that it uses a 32-bit address space. Because of the classful (when you can’t use varying length subnet masks) system and the growth of the Internet, the 32-bit address space has proven to be insufficient.
The key factors that led to the evolution of IPv6 were large institutions, enterprises, and service providers that demanded a larger pool of IP addresses for different applications and services as well as the huge explosion in mobile devices used by the general public.
Address Representation, Types, and Allocations
IPv4 uses a 32-bit address space, so it offers around 4.2 billion possible addresses, including the Multicast, experimental, and private ones. The IPv6 address space is 128 bits, so it offers around 3.4×1038 possible addressable nodes. The address space is so large that there are around 5×1028 addresses for every person in the world. IPv6 also gives every user multiple global addresses that can be used for a wide variety of devices (e.g., PDAs, cell phones, and other IP-enabled devices). Chances are that we are not going to run out of IPv6 addresses anytime soon.
The IPv4 header is important to know because a lot of the fields in the header are used for things like QoS (Quality of Service) or protocol type. The IPv6 header provides additional functionality, even though some fields from the IPv4 header have been eliminated, like the Fragment Offset field and the Flags field.
The Version field, as in the IPv4 header, provides information about the IP protocol version. The Traffic Class field is used to tag the packet with the class of traffic it uses in its DiffServ (how network traffic is managed and classified) mechanism. IPv6 also added a Flow Label field that can be used for Quality of Service mechanisms by tagging a flow. This can be used for multilayer switching techniques, and it offers faster packet switching on network devices. The Payload Length field is the same as the Total Length field in IPv4.
The Next Header field is important in IPv6. The value of this field determines the type of information that follows the basic IPv6 header. It can be a Transport Layer packet like TCP or UDP or it can designate an Extension Header field. The Next Header field is the equivalent of the Protocol field in IPv4. The next field is Hop Limit, which designates the maximum number of hops an IP packet can traverse. Each hop/router decrements this field by 1, so this is similar to the TTL field in IPv4. There is no Checksum field in the IPv6 header, so the router can decrement the Hop Limit field without recalculating the checksum. Next are the 128-bit Source Address field and the 128-bit Destination Address field.
In addition to these fields are a number of Extension Header fields. The Extension Header fields and the data portion of the packet follow the fields presented above. The total length of the Extension Header chain is variable because the number of Extension Header fields is not fixed. There are different types of Extension Header fields, including the following:
- Routing Header
- Fragmentation Header
- Authentication Header
- IPSec ESP Header
- Hop-by-Hop Options Header
As described previously, the IPv4 address is a string of 32 bits represented by 4 octets in dotted decimal format. The IPv6 address is comprised of 128 bits and is represented by eight groups of 16 bits each. IPv6 addresses are notated in hexadecimal format (i.e., 16 bits separated by colons), for example, 2001:43aa:0000:0000:11b4:0031:0000:c110.
Hexadecimal characters are in the range of 0 to 9 and A to F. Considering the total number of 16 possible characters, each one of them can be represented as a group of 4 bits. For example:
- 0 is 0000
- 1 is 0001
- 2 is 0010
- …
- A is equivalent to decimal number 10: 1010
- B is equivalent to decimal number 11: 1011
- C is equivalent to decimal number 12: 1100
- D is equivalent to decimal number 13: 1101
- E is equivalent to decimal number 14: 1110
- F is equivalent to decimal number 15: 1111
Considering the complex format of IPv6 addresses, some rules were developed to shorten them:
- One or more successive 16-bit groups that consist of all zeros can be omitted and represented by two colons (::)
- If a 16-bit group begins with one or more zeros, the leading zeros can be omitted
Considering the IPv6 example above (2001:43aa:0000:0000:11b4:0031:0000:c110), here are its shortened representations:
2001:43aa::11b4:0031:0000:c110
2001:43aa::11b4:0031:0:c110
2001:43aa::11b4:31:0:c110
Note: The double colon (::) notation can appear only one time in an IPv6 address. |
If you have a mixed IPv4 and IPv6 environment, the IPv4 address can be embedded in the IPv6 address, specifically in the last 32 bits.
The prefix portion in IPv6 is the number of contiguous bits that represent the network host. For example, the address 2001:0000:0000:0ABC:0000:0000:0000:0000/60 can be represented as 2001:0:0:ABC::/60.
Several types of IPv6 addresses are required for various applications. Compared to IPv4 address types (i.e., Unicast, Multicast, and Broadcast), IPv6 presents some differences: special Multicast addresses are used instead of Broadcast addressing and a new address type was defined (Anycast). Table 3.3 below describes the various IPv6 address types:
Table 3.3 – IPv6 Address Types
Address Type | Range | Description |
Aggregatable Global Unicast | 2000::/3 | Public addresses, host-to-host communication; equivalent to IPv4 Unicast |
Multicast | FF00::/8 | One-to-many and many-to-many communication; equivalent to IPv4 Multicast |
Anycast | Same as Unicast | Interfaces from a group of devices can be assigned the same Anycast address; the device closest to the source will respond; application-based, including load balancing, optimization traffic for a particular service, and redundancy |
Link-Local Unicast | FE80::/10 | Connected-link communication; assigned to all device interfaces and used only for local link traffic |
Solicited-Node Multicast | FF02::1:FF00:0/104 | Neighbor solicitation |
Anycast addresses are generally assigned to servers located in different geographical locations. By connecting to the Anycast address, users will reach the closest server, each server having the same Anycast IP address. Anycast addresses are also called one-to-nearest addresses. The IPv6 Multicast address is a one-to-many address that identifies a set of hosts that will receive the packet. This is similar to an IPv4 class D Multicast address. IPv6 Multicast addresses also supersede the broadcast function of IPv4 Broadcast addresses. IPv6 broadcast functionality is basically an all-nodes multicast behavior.
The following are well-known Multicast addresses that should be remembered:
- FF01::1 = all-nodes Multicast address (Broadcast)
- FF02::2 = all-routers Multicast address (used for Link-Local address mechanisms)
Another special IPv6 address is 0:0:0:0:0:0:0:1, which is the IPv6 Loopback address, equivalent to the 127.0.0.1 IPv4 Loopback address. This can also be represented as ::1/128.
The Link-Local addresses are significant only to individual nodes on a single link. Routers forward packets with a Link-Local source or destination address beyond the local link. Link-Local addresses can be configured automatically or manually. Global Unicast addresses are globally unique and routable. Global Unicast addresses are defined in RFC 2374 and RFC 3587.
Figure 3.4 – IPv6 Global Unicast Address Format
Examining the IPv6 global Unicast address format in Figure 3.4 above, you can see that the first 23 bits represents the registry, the first 32 bits represents the ISP prefix, the first 48 bits represents the site prefix, and /64 represents the subnet prefix. The remaining bits are allocated to the interface ID.
The global Unicast address and the Anycast address share the same format. The Unicast address space actually allocates the Anycast address. To devices that are not configured for Anycast, these addresses will appear as Unicast addresses.
IPv6 global Unicast addressing allows aggregation upward to the ISP. A single interface may be assigned multiple addresses of any type (i.e., Unicast, Anycast, or Multicast). However, every IPv6-enabled interface must have a Loopback address and a Link-Local address.
The IPv6 global Unicast address is structured as presented in Figure 3.4 above to facilitate aggregation and reduce their number in the global routing tables, just like in IPv4. Global Unicast addresses are defined by a global routing prefix, a subnet ID, and an interface ID. Typically, a global Unicast address is made up of a 48-bit global routing prefix and a 16-bit subnet identifier.
IPv6 Mechanisms
Just as there are different mechanisms and services that come with IPv4, there are different mechanisms available for IPv6. The most important mechanisms include the following:
-
- ICMPv6
- IPv6 ND (Neighbor Discovery)
- Name resolution
- Path MTU discovery;
- DHCPv6
- IPv6 security
- IPv6 routing protocols
Internet Control Message Protocol (ICMP) was modified to support IPv6 and it is one of the most important mechanisms that support IPv6 functionality. ICMPv6 uses a Next Header number of 58. ICMP provides informational messages like Echo Request and Echo Reply, and error messages like Destination Unreachable, Packet Too Big, and Time Exceeded.
IPv6 also uses ICMPv6 to determine important parameters, such as neighbor availability, path MTU, destination address, and port reachability.
IPv6 uses the Neighbor Discovery (ND) protocol (RFC 2461), unlike IPv4, which uses ARP. IPv6 hosts use ND to implement “plug and play” functionality and to discover all other nodes on the same link. ND is also used to check for duplicate addresses and to find routers on a specific link.
Network Discovery goes beyond the capabilities of ARP, as it also accomplishes the following:
- Address configuration (a host can find its full address without using DHCP)
- Duplicate Address Detection (DAD)
- Prefix discovery
- Link MTU discovery
- Hop count discovery
- Address resolution
- Router discovery
- Determines the next hop
- Neighbor reachability
- Redirection
IPv4 performs name resolution using A records in a Domain Name System (DNS). RFC 3596 offers a new DNS record type to support the transition to IPv6 name resolution. This new record type is AAAA (Quad A). The AAAA record will return an IPv6 address based on a given domain name.
IPv6 does not allow packet fragmentation through the network (except for the source of the packet), so the maximum transmission unit (MTU) of every link in an IPv6 implementation must be 1280 bytes or greater. The ICMPv6 Packet Too Big error message determines the path MTU because nodes along the path will send this message to the sending hosts if the packet is larger than the outgoing interface MTU.
DHCPv6 is an updated version of DHCP that offers dynamic address assignment for version 6 hosts. DHCPv6 is described in RFC 3315 as providing the same functionality as DHCP but offering more control, as it supports renumbering without numbers.
IP version 6 also has some security mechanisms. Unlike IPv4, IPv6 natively supports IP Security (IPSec) (an open security framework) with two mechanisms: Authentication Header (AH) and Encapsulating Security Payload (ESP).
New routing protocols were developed for IPv6, as follows:
- RIPng
- Integrated IS-IS
- EIGRP for IPv6
- OSPFv3
- BGP4 multiprotocol extensions for IPv6
IPv4-to-IPv6 Transition
Considering that IPv6 almost always comes as an upgrade to the existing IPv4 infrastructure, IPv6 design and implementation considerations must include different transition mechanisms between these two protocol suites. The IPv4-to-IPv6 transition can be very challenging, and during the transition period it is very likely that both protocols will coexist on the network.
The designers of the IPv6 protocol suite have suggested that IPv4 will not go away anytime soon; in addition, it will strongly coexist with IPv6 in combined addressing schemes.
One of the most important IPv4-to-IPv6 transition mechanisms involves tunneling and this can be implemented in different flavors:
- Static tunnels
- GRE (default tunnel mode)
- IPv6IP (less overhead, no CLNS transport)
- Automatic tunnels
- 6to4 (embeds an IPv4 address into an IPv6 prefix to provide automatic tunnel endpoint determination); automatically generates tunnels based on the addressing scheme utilized
- ISATAP (automatic host-to-router and host-to-host tunneling)
Figure 3.5 – IPv6 over IPv4 Tunneling
Analyzing Figure 3.5 above, the IPv4 island contains two dual-stack routers that run both the IPv4 and the IPv6 protocol stacks. These two routers will be able to support the transition mechanisms by tunneling IPv6 inside IPv4.
Next, the two routers are connected to a separate IPv6 island. In order to carry IPv6 traffic between the two edge islands, a tunnel is created between the two routers that encapsulates IPv6 packets inside IPv4 packets. These packets are sent through the IPv4 cloud as regular IPv4 packets and they are decapsulated when they reach the other end. In other words, an IPv6 packet generated in the left side of the network reaches a destination in the right side of the network through the tunneling mechanism and the dual-stack routers at the edge of the IPv4 infrastructure.
Static tunneling methods are generally used when dealing with point-to-point links, while dynamic tunneling methods are used for point-to-multipoint connections.
Network Address Translation–Protocol Translation (NAT-PT) is another technology that can be utilized for transitioning to an IPv6 network. NAT-PT is often confused with NAT but it is a completely different technology. Simple NAT can also be used in IPv6 but this is very rare because IPv6 offers a very large address space and private addresses are not necessary. NAT-PT is another translation mechanism that can dynamically convert IPv4 addresses to IPv6 addresses, and vice versa.
Another static tunneling technology is IPv6IP, which encapsulates IPv4 packets directly into IPv6. This is also called manual tunneling. Another type of static tunnel that can be used is a GRE tunnel, which encapsulates IPv6 packets within a GRE packet. GRE tunneling is necessary when using special applications and services, like the IS-IS routing protocol for IPv6.
The dynamic tunnel types include the 6to4 tunnel, which is appropriate when a group of destinations needs to be connected dynamically utilizing IPv6. ISATAP is a unique type of host-to-router dynamic tunnel, unlike the previously mentioned tunneling techniques, which are router-to-router. ISATAP allows hosts to dynamically reach their IPv6 default gateway.
Note: ISATAP is a protocol that will soon fade away because almost all modern hosts and routers now have native IPv6 support. |
IPv6 and IPv4 Comparison
The enhancements to IPv6 can be summarized as follows:
- Expanded address space, from 32 bits to 128 bits
- Uses hexadecimal notation instead of dotted-decimal notation (IPv4)
- Addresses are globally unique due to the extended address space, eliminating the need for NAT
- Has a fixed header length (40 bytes), allowing vendors to improve switching efficiency
- Supports enhanced options (that offer new features) by placing Extension Headers between the IPv6 header and the Transport Layer header
- Offers address auto-configuration, providing dynamic assignment of IP addresses even without a DHCP server
- Offers support for labeling traffic flows
- Has security capabilities built-in, including authentication and privacy via IPSec
- Offers MTU path discovery before sending packets to a destination, eliminating the need for fragmentation
- Supports site multihoming
- Uses the ND protocol instead of ARP (IPv4)
- Uses AAAA DNS records instead of A records (IPv4)
- Uses Site-Local addressing instead of RFC 1918 (IPv4)
- IPv4 and IPv6 use different routing protocols
- IPv6 provides for Anycast addressing
Summary
IPv4 addressing has the following characteristics:
- IPv4 addresses are 32 bits in length.
- IPv4 addresses are divided into various classes (e.g., Class A networks accommodate more than 16 million unique IP addresses, Class B networks support more than 65,000 IP addresses, and Class C networks permit 254 usable IP addresses). Originally, organizations applied for an entire network in one of these classes. Today, however, subnetting allows a service provider to give a customer just a portion of a network address space, in an attempt to conserve the depleting pool of IP addresses. Conversely, service providers can use supernetting (also known as classless interdomain routing [CIDR]) to aggregate the multiple network address spaces that they have. Aggregating multiple network address spaces into one reduces the amount of route entries a router must maintain.
- Devices such as PCs can be assigned a static IP address by hard coding the IP address in the device’s configuration. Alternatively, devices can dynamically obtain an address from, for example, a DHCP server.
- Because names are easier to remember than IP addresses, most publicly accessible Web resources are reachable by name. However, routers must determine the IP address with which the name is associated to route traffic to that destination. Therefore, a Domain Name System (DNS) server can perform the translation between domain names and their corresponding IP addresses.
- Some IP addresses are routable through the public Internet, whereas other IP addresses are considered private and are intended for use within an organization. Because these private IP addresses might need to communicate outside the local network, Network Address Translation (NAT) can translate a private IP address into a public IP address.
A major challenge with IPv4 is the limited number of addresses available. A newer version of IP, specifically IPv6, fixes this concern. An IPv6 address is 128 bits long, compared to the 32-bit length of an IPv4 address.
To make such a large address more readable, an IPv6 address uses hexadecimal numbers and the 128-bit address is divided into eight fields. Each field is separated by a colon, as opposed to the four fields in an IPv4 address, which are separated by a period. Consider some of the benefits offered by IPv6:
- IPv6 dramatically increases the number of addresses available.
- Hosts can have multiple IPv6 addresses, allowing those hosts to multihome to multiple Internet Service Providers (ISPs).
- Other benefits include enhancements relating to Quality of Service (QoS), security, mobility, and Multicast technologies.
Subnetting practice questions.
Practice IP subnetting with our 101 Labs – IP Subnetting workbook.