Home > Articles > Networking > Routing & Switching

This chapter is from the book

This chapter is from the book

Routing Mechanisms

How does a router learn about paths (routes) to destinations? There are several routing mechanisms that may be used as input sources to assist a router in building its route table. Typically, routers use a combination of the following routing methods to build a router's route table:

  • Directly connected interface

  • Static

  • Default

  • Dynamic

Although there are specific advantages and disadvantages for implementing them, they are not mutually exclusive.

Directly Connected Interface

Directly connected interfaces are routes that are local to the router. That is, the router has an interface directly connected to one or more networks or subnets. These networks are inherently known through the routers configured interface attached to that network. These networks are immediately recognizable and traffic directed to these networks can be forwarded without any help from routing protocols (see Figure 3.9).

In Figure 3.9 each of the routers shown is directly connected to three links. For instance, Router A connects to networks 199.10.1.0, 199.10.2.0, and 199.10.3.0. Because Router A has a direct connection to these networks and the interfaces attached are appropriately configured, they are immediately learned and placed within the router's local route table. Datagrams received by Router A destined for any of these attached networks will be forwarded without assistance.

However, datagrams destined for networks not directly connected to Router A, such as 192.10.4.0, 192.10.5.0, and 192.10.6.0 will not be forwarded as Router A has not learned about those networks (there is no route in the route table) and does not have a directly connected interface (see Figure 3.10). In this case the datagram will be discarded and an ICMP message will be sent back to the source indicating that the destination network or host is unreachable.

Figure 3.9 This network has three Routers (A, B, and C). Each router has three directly connected networks. For example, Router A is directly connected to networks 192.10.1.0, 192.10.2.0, and 192.10.3.0 through local interfaces.

Figure 3.10 Route table showing only networks directly connected (Indicated by A C in the leftmost column) to Router A. Routes to remote networks are not known.

Directly connected routes are always the best method of routing because the router knows the network this datagram is destined for firsthand and does not rely on some other means to learn this route, such as static or dynamic routing protocols. However, when traffic is destined to networks beyond a routers locally attached links help is needed.

Static Routing

Static routes are routes to destination hosts or networks that an administrator has manually entered into the router's route table. Static routes define the IP address of the next hop router and local interface to use when forwarding traffic to a particular destination.

Because this type of route has a static nature, it does not have the capability of adjusting to changes in the network. If the router or interface defined fails or becomes unavailable, the route to the destination fails.

This type of routing method has the advantage of eliminating all traffic related to routing updates. Static routing tends to be ideal where the link is temporary or bandwidth is an issue, so you want to use this method for dial-up networks or point-to-point WAN links. You can implement static routes in conjunction with other routing methods to provide routes to destinations across dial backup links when primary links implementing dynamic routing protocols have failed.

You would not want to design an entire network with only this method because you would have to enter a static route on every router for each network they are not directly attached to, thus highly impractical. In addition, if a link or a router within the internetwork fails or is added, you would have to reconfigure each router, removing the failed route or adding a new route. Meanwhile, routers obviously cannot forward traffic to that destination because the original path has become invalid. Static routing can have an extreme amount of overhead in the form of intense administrative hours spent getting the network up and keeping it going.

You want to implement static routes in very small to small networks, with perhaps as little as 10 to 15 links total. Even then, dynamic routes offer so much more versatility.

Note

Static routes conserve bandwidth because they do not cause routers to generate route update traffic; however, they tend to be time consuming because a system administrator has to manually update routes when changes occur in the network.

Static routes are also ideal for a stub network providing a single dedicated point-to-point WAN connection outside the network to an upstream ISP (Internet Service Provider) providing Internet access. Generally there is no reason to advertise your company's internal subnetworks out to the world through this connection, as most companies are concerned about having their network hacked into by intruders. The connection should only provide internal users access to Internet resources and traveling users with the capability to access network resources and e-mail via the Internet. Probably the only outsider entry you want is someone accessing the corporate Web site. This situation provides a perfect example of where static routing is needed. You can configure a "default route" directed at the upstream router, which keeps your company's internal subnetworks from being advertised while still providing inside users with a way out. Default routes are discussed later in this chapter.

Configuring Static Routing

The network diagram shown in Figure 3.11 shows the IP addresses of router interfaces connecting Routers B and C to A. It also shows Router A's interface types, such as S0 and S1 (Serial 0 and Serial 1), which indicates the specific interfaces on Router A connected to these links. Although the specific configuration of a router's interfaces is beyond the scope of this book, it's important to know which interface a Router must use to reach the next hop.

Note

Configuration examples in this book relate specifically to routing, not to interfaces or other router configurations.

Figure 3.11 Router A is connected to two routers through serial connections, one to Router B (Serial 0) and the other to Router C (Serial 1).

In Figure 3.11, Router A has three directly connected networks. Because they are directly connected to this router, they are immediately known to Router A. The other three networks in this diagram (199.10.4.0, 199.10.5.0, and 199.10.6.0) are remote and therefore unknown to Router A. For Router A to forward datagrams to these remote networks, it must be configured with routes to these networks. Three static route entries must be added to Router A's route table—for example, one route entry pointing to Router B as the next hop router en route to networks 199.10.4.0 and 199.10.5.0 and one route entry pointing to Router C as the next hop to 199.10.6.0. The purpose of these entries is to inform Router A of each remote network (see Figure 3.12).

Figure 3.12 Three static routes have been added to Router A.

The output in Figure 3.12 is a view of the configuration of Router A (a Cisco router). As you can see Router A has been configured with three static routes using the ip route command. The first two statements indicate that to get to network 199.10.4.0 and 199.10.5.0 with the mask 255.255.255.0, use 199.10.2.2 as the next hop router. The last statement says that to get to network 199.10.6.0, mask 255.255.255.0 use 199.10.6.2 as the next hop router. After configuration, Router A now has a path to each of these networks. To verify the routes were entered properly we will view the route table (see Figure 3.13).

Keep in mind that communication is two way. That is, for two devices to have a conversation there must be a path in both directions (forward and reverse). Therefore to complete the configuration each of the other routers (B and C) in the diagram would need to also be configured with static routes to all networks they are not directly connected to. For example, Router B would need three static routes—one each to network 199.10.1.0, 199.10.3.0, and 199.10.6.0—and Router C would need routes to 199.10.1.0, 199.10.2.0, and 199.10.4.0. After all routers are configured with specific paths to all remote networks they would be able to forward traffic to and between them. In addition, as new routes become available or routes fail adjustments to each router would need to be made adding or removing routes to reflect these changes.

Figure 3.13 Three static routes have been added to the router's route table (indicated by an S in the leftmost column).

Default Routing

Every IP host needs to have a default route either manually configured or dynamically learned. Default routes provide end hosts a way out of their local subnet and routers with a router of last resort if no other route (specifically relating to the destination) exists in the routers route table.

End hosts, although capable, do not usually maintain their own local route tables, they rely on local routers to forward traffic to remote hosts. For an end host to communicate with hosts beyond their local segment, an administrator at a minimum must configure it with an IP address of a router (known as the Default Router). You can, depending on the vendor implementation, configure end hosts to send datagrams to an alternate router if the first one on the list becomes unavailable. If an end host does not have a default router configured, it limits this host to communicating to hosts on its local segment only.

Routers use default routing as a last resort when all other methods (directly connected, static, or dynamic) have been exhausted. Routers inspect received datagrams to identify the logical Network layer address of the ultimate destination. If a directly connected static or dynamic route exists within the router's route table, it forwards the datagram.

If the destination remains unknown, that is, no method of routing has resulted in a learned route, it forces the router to use a default route. Typically, administrators implement default routes on point-to-point (a link with only two routers) or dial-up connections, linking a company's network to the outside work.

You may implement dynamic or static routes within the company's network to facilitate the learning of route information of local links. You could then use a default route to direct all traffic outside your network regardless of destination. This provides a good method because somewhere near 80,000 plus routes exist on the Internet and it would overwhelm routers if they had to learn and maintain each one of these routes. By implementing a default route the router simply directs all traffic to unknown destinations through the default path, typically serviced by an ISP.

Default routes are static routes that are used to define a route to an unknown destination. Typically you won't need to configure a default route on a router because the router should already know how to route a frame to a destination by consulting their route table for a known path. However, if the router has no learned path, it uses the default route statement (also known as the router of last resort).

Figure 3.14 shows the configuration of a default route on a Cisco router.

Figure 3.14 The values for the destination network and subnet mask fields are all zeros. The zeros represent any unknown destination.

In Figure 3.14 a default route statement has been added to a router. The default route specifies that to get to any unknown network, with any mask, the router should use 199.10.2.1 as its Default Router. Figure 3.15 shows a router's route table with a default route.

Figure 3.15 An output screen of a router's route table with a default route configured.

Router output screens vary from vendor to vendor, figure 3.15 shows a sample route table taken from a Cisco router. In this example, the S (in the leftmost column) indicates the route has been statically entered. The * signifies that this route is a candidate for default routing. Also note that the Gateway of last resort is now set, indicating this route will be used when no other route exists in the table.

Interior Versus Exterior Routing Protocols

Routing protocols fall into two categories, Interior and Exterior. Interior protocols called IGPs (Interior Gateway Protocols), refer to any routing protocol used exclusively within an Autonomous System, providing Intra-AS routing. Each IGP represents a single routing domain within the AS. Multiple IGPS may exist within an AS. Exterior protocols called EGPs (Exterior Gateway Protocols) are routing protocols that facilitate routing between and across different AS'. EGPs provide Inter-AS routing. IGP and EGP are discussed later in this chapter.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020