The final architectural component that we will discuss is a combination of addressing and routing. Although addressing and routing could be considered separate architectures, they are closely coupled in the network, so they will be considered here as parts of a single architecture. In this book the addressing and routing architecture is focused on the network (IP) layer. Addressing, however, does have elements at the link and physical layers (e.g., Ethernet and ATM addresses). Routing also has its counterparts, bridging and switching, which occur primarily at the physical, data-link, and network layers, but switching can occur at any layer in the protocol stack. Therefore, as you go through this chapter, remember that the concepts discussed can be applied at many layers in the network.
What are addressing and routing? Addressing is assigning local or global, private or public, temporary or persistent identifiers to devices. Routing consists of learning about the reachability within and between networks and applying this reachability information to forward IP packets toward their destinations. These two processes, in combination with the addressing element of the architecture, provide a complete picture of network connectivity.
In this section, we provide some fundamental concepts behind addressing and routing for your review. These fundamental concepts are necessary in understanding the rest of this chapter and are sometimes overlooked in texts on routing and routing protocols.
This chapter begins with a discussion on requirements for addressing and routing in the network architecture and then explains mechanisms (functional areas and boundaries) to establish routing flows for the network. A relationship between boundaries and routing flows is then developed, which leads to discussions on the characteristics of routing flows and how such characteristics may be manipulated. We then examine various addressing and routing mechanisms, including a comparison of popular routing protocols. This chapter then ends with the development of the addressing and routing architecture.
A network address is an identifier used to temporarily or persistently locate a device on a network to communicate with that device. For IP, addresses consist of an address identifier and an associated mask, usually presented in dotted-decimal notation (Figure 6.1). An address mask identifies which bits in the address are considered part of the network and (by default) which bits are considered part of the device.
Figure 6.1: IP Addresses consist of a unique identifier and mask.
The combination of an address and its mask allows the address to be separated into a network portion and a host portion. This is important in that it enables the device to determine when an address is on the local network and when it is on a remote network. This local/remote decision is discussed in Section 6.3.2.
In this book, addresses are sometimes shown in their binary formats so that we can better understand how some of the addressing and routing mechanisms work. In this form, each decimal address is represented by its binary equivalent. Figure 6.2 shows the IP address from the previous figure, presented in binary and dotted-decimal formats.
Figure 6.2: An IP address in binary and dotted-decimal formats.
Example 6.1: Address and Class Calculations
For a network address of 136.178.10.1, represent this address in binary form. The bits in each octet (byte) represent a power of 2, from 20 (i.e., 1) through 27 (128), as shown here.
To represent the first octet of this address, 136, in binary, we can successively subtract the largest possible power of 2, until we get to 0. In this case, the largest power of 2 is 27, or 128. Subtracting 128 from 136 leaves us with 8, which is 23. Thus, 136 in binary is 10001000, as shown here:
Continuing in this fashion, we get the following binary representation for 136.178.10.1:
The numbers can be shown together as 10001000 10110010 00001010 00000001.
Addresses can be local or global, private or public, temporary or persistent. Most networks implement both local and global addresses. Local addresses are those that are important in local communications, such as link-layer addresses like Ethernet. These addresses are not advertised outside of the local network. The isolation of link-layer addresses is an example of hierarchy in networking. However, for devices outside that network to communicate with devices in the network, global addresses that can be advertised outside of the local network are needed. IP addresses are used for this purpose.
IP addresses, which have traditionally been global in scope, can now be separated into public and private address spaces. Public IP addresses are those that can be advertised and forwarded by network devices in the public domain (i.e., the Internet). Private IP addresses are those that cannot be advertised and forwarded by network devices in the public domain. Private IP address space has been allocated out of previously public IP address space. Why and how this works will be explained later in this chapter.
Addresses may also be temporary or persistent. Link-layer addresses (e.g., Ethernet) are intended to be persistent for the life of the device (where device may be a network interface card). IP addresses can be either temporary or persistent, usually depending on how they are configured within the network. Temporary addresses are usually assigned using a dynamic addressing mechanism such as the Dynamic Host Configuration Protocol (DHCP). The degree to which addresses are temporary depends on how DHCP is configured for that network. Addresses may be updated each time a device becomes active on the network or may be updated periodically while a device is on the network, or an address may be assigned once (in which case it becomes persistent). Persistent addresses are usually assigned to devices as part of their overall configuration and are not updated unless changes in the network require new addresses be assigned (usually a painful process). Figure 6.3 lists these address terms and their meanings.
Address Type | Meaning |
---|---|
Local Addresses | Addresses that are recognized locally, at the LAN or subnet. Such addresses are usually at the data-link (e.g., Ethernet) layer. |
Global Addresses | Addresses that are recognized worldwide. Such addresses are usually at the network (IP) layer. |
Private Addresses | Network-layer addresses that are not routed through the public Internet. Private addresses are used in Network Address Translation (NAT). |
Public Addresses | Network-layer addresses that are routed through the public Internet. |
Temporary Addresses | Addresses that are assigned for a short duration of time, e.g., dynamically via the Dynamic Host Configuration Protocol (DHCP) |
Persistent Addresses | Addresses that are assigned for a long duration of time or permanently configured within the device. |
As mentioned earlier, routing is learning about reachability within and between networks and then applying this reachability information to forward IP packets toward their destinations. For routers to forward IP packets to their destinations, they first need to know what they are connected to, which networks are available, and how to get to them. This is reachability. Routers learn reachability either statically or dynamically. Routers can learn reachability statically by having this information configured into them by network personnel. Static routes, discussed later, are an example of how reachability is statically configured in a router. Typically, however, reachability is learned dynamically through the use of a routing protocol. Routing protocols, such as RIP/RIPv2, OSPF, and BGP4, provide the mechanism for routers to learn reachability.
Once routers learn about reachability within and between networks, this information is used to forward packets toward their destinations. Routers store reachability information and update it from time to time or upon a change in the state of routing in the network. A routing table, or list of routes, metrics, and how they can be reached, is a common mechanism routers use to keep such information.
Routers forward packets based on reachability. Traditionally, a router will look at the network portion of a packet's destination address to determine where it needs to be sent. The router will compare this destination to the contents of its routing table and choose the best route for that destination. If there are multiple possible routes, the best route is the one with the longest (or more explicit) match. Figure 6.4 gives an example of this.
Figure 6.4: Traffic is forwarded based on longest (most explicit) address match.
In this example, Company A has the address 129.29.0.0, with a network mask of 255.255.0.0, which is 16 bits in length. Company B has the address 129.99.10.0, with a network mask of 255.255.255.0, which is 24 bits in length. IP packets arriving from the Internet will be examined at ISP Z's router, where the destination addresses of these packets are compared to entries in the routing table.
In comparison of a packet's destination address to entries in a routing table, the longest match to the destination address is chosen. For example, an IP packet arriving at ISP Z with a destination address of 129.99.10.1 would match both entries in the routing table shown in Figure 6.4. When the network mask of the first entry in the routing table, 255.255.0.0, is applied to 129.99.0.0, we get 129.99 as the network. This matches the first two octets of the IP packet with 129.99.10.1 as its address. Likewise, when the network mask of the second entry in the routing table, 255.255.255.0, is applied to 129.99.10.0, we get 129.99.10 as the network. This also matches our IP packet with 129.99.10.1 as its address, but it matches the first three octets—a longer (more explicit) match. As a result, packets with a destination address of 129.99.10.1 are forwarded to ISP Y.
Usually there is also a default route, which is the route used when there is no other route for that destination. It is the route of last resort and is useful when a lot of traffic flows toward one upstream router or network (e.g., a home or business connection to an ISP).
Routers may also look at labels in a packet and use that information for routing. Multiprotocol label switching (MPLS), discussed later in this book, uses this mechanism.
Routing is converging with switching, and at times it is confusing to understand the differences between the two. A comparison of routing and switching is presented in Chapter 11.
Addressing and routing are used together to form an overall picture of connectivity for the network. An example of this is the local/remote decision to determine where to initially send packets. In the local/remote decision, a device (such as a user's computer) needs to decide whether the destination of a packet is local (on the same network) or remote. The destination IP address and mask (discussed earlier) are used to determine the network portion of the destination address. This is compared with the network portion of the sending device's IP address. If they are the same, the destination is on the same network (i.e., local). If the network portions of the IP addresses are different, they are on different networks (i.e., remote).
Why is this important? Part of the fundamental behavior of IP is in this local/ remote decision (Figure 6.5). IP requires that, if the destination address is local, then there is a lower-layer mechanism to directly transport that packet. As part of this requirement, every device on an IP network (or subnet, as we shall see later) must be able to directly communicate with every other device on that network. This means that the underlying network must have a mechanism to allow every device to communicate with every other device. This has implications on how address resolution at the lower layers is done, as we shall see later in this book.
Figure 6.5: Basic tenets of IP forwarding.
IP also requires that if the destination address is remote, then there is a router that can forward that packet toward its destination. Thus, a device on the network will need to know about which router or routers it can forward packets to. This can be learned by the device, through listening to routing protocol updates, or can be configured in the device. This router is termed the next-hop router for that network. In Figure 6.5, devices on the same subnet, 129.99.0.0, must be directly connected at the MAC/PHY layers. Devices are on the same subnet when they have the same network address, determined by applying the network mask to their addresses. Also in Figure 6.5, devices 129.99.0.1 and 129.99.0.2 are on the same network, as the network mask (/16 or 255.255.0.0) applied to each address resolves a network of 129.99.0.0. IP assumes this connectivity and passes IP datagrams down to the MAC and PHY layers for transport.
When devices are on different networks, there must be a router that can forward traffic between these networks. In the example in Figure 6.5, traffic between 129.99.0.0 and 136.178.0.0 passes through the adjoining router, which has interfaces on both networks.