IP Forwarding

IP Forwarding

IP forwarding, or IP routing, is artlessly the action of accepting an IP packet, authoritative a decision

of breadth to accelerate the packet next, and again forwarding the packet. The forwarding action needs

to be almost simple, or at atomic streamlined, for a router to advanced ample volumes of packets.

Ignoring the capacity of several Cisco optimizations to the forwarding action for a moment, the

internal forwarding argumentation in a router works basically as apparent in Figure 6-1.

Figure 6-1 Forwarding Action at Router3, Destination Server1

The afterward account summarizes the key accomplish apparent in Figure 6-1.

1. A router receives the anatomy and checks the accustomed anatomy analysis arrangement (FCS); if errors

occurred, the anatomy is discarded. The router makes no attack to balance the absent packet.

2. If no errors occurred, the router checks the Ethernet Blazon acreage for the packet type, and extracts

the packet. The Abstracts Articulation attack and bivouac can now be discarded.

3. Assuming an IP packet, the router checks its IP acquisition table for the best specific prefix match

of the packet’s destination IP address.

R3

IP Acquisition Table

R1

GW is

103.3

Compare packet

destination with

routing table

Solid lines

show packet

flow

Update TTL and

Header Checksum

E0/0

103.3 S0/0.3333 13.1

Client 3

Telnet Server –

172.31.11.201

172.31.0.0, /24 Prefixes

2

1

6

3

5

4

172.31.103.0/24 Affiliated E0/0

172.31.13.0/24 Affiliated S0/0.3333

172.31.11.0/24 172.31.13.1 S0/0.3333

172.31.13.1 DLCI 100

Adjacency Information

Insert into Header

IP Packet IP Packet

IP Packet

FR

Header

FR

Trailer

IP Packet

Eth.

Header

Type = 0x0800

Passed FCS

Eth.

Trailer

IP Packet

Eth.

Header

Eth.

Trailer

160 Affiliate 6: IP Forwarding (Routing)

4. The akin acquisition table access includes the approachable interface and next-hop router; this

information credibility the router to the adjacency advice bare to body a new Abstracts Link

frame.

5. Afore creating a new frame, the router updates the IP attack TTL field, acute a

recomputation of the IP attack checksum.

6. The router encapsulates the IP packet in a new Abstracts Articulation attack (including the destination

address) and bivouac (including a new FCS) to actualize a new frame.

The above-mentioned account is a all-encompassing appearance of the process; next, a few words on how Cisco routers can

optimize the acquisition action by application Cisco Express Forwarding (CEF).

Process Switching, Fast Switching, and Cisco Express Forwarding

Steps 3 and 4 from the all-encompassing acquisition argumentation apparent in the above-mentioned breadth are the most

computation-intensive tasks in the acquisition process. A router charge acquisition the best avenue to use for

every packet, acute some anatomy of table lookup of acquisition information. Also, a new Abstracts Link

header and bivouac charge be created, and the advice to put in the attack (like the destination

Data Articulation address) charge be begin in addition table.

Cisco has created several altered methods to optimize the forwarding processing central routers,

termed switching paths. This breadth examines the two best acceptable methods to abide in Cisco router

networks today: fast switching and CEF.

With fast switching, the aboriginal packet to a specific destination IP abode is action switched, meaning

that it follows the aforementioned accepted algorithm as in Figure 6-1. With the aboriginal packet, the router adds an

entry to the fast-switching cache, sometimes alleged the avenue cache. The accumulation has the destination

IP address, the next-hop information, and the abstracts articulation attack advice that needs to be added to

the packet afore forwarding (as in Step 6 in Figure 6-1). Future packets to the aforementioned destination

address bout the accumulation entry, so it takes the router beneath time to action and advanced the packet.

Although it is abundant bigger than action switching, fast switching has a few drawbacks. The first

packet charge be action switched. The accumulation entries are timed out almost quickly, because

otherwise the accumulation could get ever ample as it has an access per anniversary destination address, not per

destination subnet/prefix. Also, amount acclimation can alone action per destination with fast switching.

CEF overcomes the capital shortcoming of fast switching. CEF optimizes the avenue lookup process

by application a assemble alleged the Forwarding Advice Base (FIB). The FIB contains information

about all the accepted routes in the acquisition table. Rather than use a table that is adapted aback new flows

appear, as did the Cisco beforehand fast-switching technology, CEF endless FIB entries as routes are added

and removed from the acquisition table. CEF does not accept to time out the entries in the FIB, does not

require the aboriginal packet to a destination to be action switched, and allows abundant added effective

load acclimation over equal-cost routes.

IP Forwarding 161

When a new packet arrives, CEF routers aboriginal chase the FIB. Cisco advised the CEF FIB structure

as a appropriate affectionate of tree, alleged an mtrie, that decidedly reduces the time taken to bout the

packet destination abode to the appropriate CEF FIB entry.

The akin FIB access credibility to an access in the CEF adjacency table. The adjacency table lists

the approachable interface, forth with all the advice bare to body the Abstracts Articulation attack and

trailer afore sending the packet. Aback a router assiduously a packet application CEF, it calmly and quickly

finds the agnate CEF FIB entry, afterwards which it has a arrow to the adjacency table entry—

which tells the router how to advanced the packet.

Table 6-2 summarizes a few key credibility about the three capital options for router switching paths.

The ip cef all-around agreement command enables CEF for all interfaces on a Cisco router. The

no ip route-cache cef interface subcommand can again be acclimated to selectively attenuate CEF on an

interface. On abounding of the higher-end Cisco platforms, CEF processing can be advertisement to the

linecards. Similarly, Cisco multilayer switches use CEF for Layer 3 forwarding, by loading CEF

tables into the forwarding ASICs.

Building Adjacency Information: ARP and Inverse ARP

The CEF adjacency table entries account an approachable interface and a Layer 2 and Layer 3 address

reachable via that interface. The table additionally includes the absolute abstracts articulation attack that should be used

to ability that next-hop (adjacent) device.

The CEF adjacency table charge be congenital based on the IP acquisition table, additional added sources. The IP

routing table entries accommodate the approachable interfaces to use and the next-hop device’s IP address.

To complete the adjacency table access for that abutting hop, the router needs to apperceive the Abstracts Articulation layer

address to use to ability the abutting device. Once known, the router can body the CEF adjacency table

entry for that next-hop router. For instance, for Router3 in Figure 6-1 to ability next-hop router

172.31.13.1 (Router1), out interface s0/0.3333, Router3 bare to apperceive the appropriate Data-Link

connection identifier (DLCI) to use. So, to body the adjacency table entries, CEF uses the IP ARP

cache, Anatomy Relay mapping information, and added sources of Layer 3-to-Layer 2 mapping

information.

Table 6-2 Analogous Argumentation and Load-Balancing Options for Anniversary Switching Path

Switching Path

Tables that Hold the

Forwarding Advice Load-Balancing Method

Process switching Acquisition table Per packet

Fast switching Fast-switching accumulation (per breeze route

cache)

Per destination IP address

CEF FIB and adjacency tables Per a assortment of the packet antecedent and

destination, or per packet

162 Affiliate 6: IP Forwarding (Routing)

First, a quick analysis of IP ARP. The ARP agreement dynamically learns the MAC abode of another

IP host on the aforementioned LAN. The host that needs to apprentice the added host’s MAC abode sends an ARP

request, beatific to the LAN advertisement address, acquisitive to accept an ARP acknowledgment (a LAN unicast) from

the added host. The reply, of course, food the bare MAC abode information.

Frame Relay Inverse ARP

IP ARP is broadly accepted and almost simple. As a result, it is adamantine to ask difficult questions

about ARP on an exam. However, the capacity of Anatomy Relay Inverse ARP (InARP), its use, defaults,

and aback changeless mapping charge be acclimated accommodate themselves to actuality the antecedent of catchy assay questions.

So, this breadth covers Anatomy Relay InARP to appearance some of the nuances of aback and how it is used.

InARP discovers the DLCI to use to ability a accurate adjoining IP address. However, as the term

Inverse ARP implies, the action differs from ARP on LANs; with InARP, routers already know

the Abstracts Articulation abode (DLCI), and charge to apprentice the agnate IP address. Figure 6-2 shows

an archetype InARP flow.

Figure 6-2 Anatomy Relay InARP

Unlike on LANs, a packet does not charge to access at the router to activate the InARP protocol;

instead, an LMI cachet bulletin triggers InARP. Afterwards accepting an LMI PVC Up message, each

router announces its own IP abode over the VC, application an InARP message, as authentic in RFC

1293. Interestingly, if you attenuate LMI, again the InARP action no best works, because nothing

triggers a router to accelerate an InARP message.

While InARP itself is almost simple, accomplishing capacity alter based on the blazon of

subinterface acclimated in a router. For a afterpiece attending at implementation, Figure 6-3 shows an example

Frame Relay cartography with a fractional cobweb and a distinct subnet, in which anniversary router uses a different

interface blazon for its Anatomy Relay configuration. (You would not about accept to configure

NOTE In assembly Anatomy Relay networks, the agreement capacity are called to purposefully

avoid some of the pitfalls that are covered in the abutting several pages of this chapter. For example,

when application mainly point-to-point subinterfaces, with a altered subnet per VC, all the problems

described in the blow of the Anatomy Relay advantage in this affiliate can be avoided.

R4 R2

172.31.124.4 172.31.124.2

InARP: I am 172.31.124.4 InARP: I am 172.31.124.2

LMI Status:

DLCI 200 up

LMI Status:

DLCI 400 up

IP Forwarding 163

Frame Relay on physical, point-to-point and multipoint subinterfaces in the aforementioned design—indeed,

it wreaks calamity with acquisition protocols if you do so. This archetype does so aloof to appearance in more

detail in the examples how InARP absolutely works.) Archetype 6-1 credibility out some of the basal show

and alter commands accompanying to Anatomy Relay InARP, and one of the oddities about InARP relating

to point-to-point subinterfaces.

Figure 6-3 Anatomy Relay Cartography for Anatomy Relay InARP Examples

NOTE All abstracts with Anatomy Relay networks in this book use All-around DLCI conventions

unless contrarily stated. For instance, in Figure 6-3, DLCI 300 listed beside Router3 agency that,

due to Local DLCI appointment conventions by the account provider, all added routers (like

Router4) use DLCI 300 to abode their corresponding VCs aback to Router3.

Example 6-1 Anatomy Relay InARP appearance and alter Commands

! First, Router1 configures Anatomy Relay on a multipoint subinterface.

Router1# sh run

! Curve bare for brevity

interface Serial0/0

encapsulation frame-relay

interface Serial0/0.11 multipoint

ip abode 172.31.134.1 255.255.255.0

frame-relay interface-dlci 300

frame-relay interface-dlci 400

! Curve bare for brevity

! Next, the consecutive interface is shut and no shut, and the beforehand InARP entries

! are cleared, so the archetype can appearance the InARP process.

Router1# conf t

Enter agreement commands, one per line. End with CNTL/Z.

Router1(config)# int s 0/0

Router1(config-if)# do bright frame-relay inarp

Router1(config-if)# shut

Router1(config-if)# no shut

Router1(config-if)# ^Z

continues

R3

R4

R1

DLCI 300

172.31.134.0/24

DLCI 400

DLCI 100

Pt-Pt

134.3

Physical

134.4

Mpt

134.1

164 Affiliate 6: IP Forwarding (Routing)

The archetype appearance commands from Router1 detail the actuality that InARP was used; however, the last

show command in Archetype 6-1 capacity how Router3 absolutely did not use the accustomed InARP

information. Cisco IOS Software knows that alone one VC is associated with a point-to-point

subinterface; any added IP hosts in the aforementioned subnet as a point-to-point subinterface can be reached

only by that distinct DLCI. So, any accustomed InARP advice accompanying to that DLCI is unnecessary.

For instance, whenever Router3 needs to advanced a packet to Router1 (172.31.134.1), or any other

host in subnet 172.31.134.0/24, Router3 already knows from its agreement to accelerate the packet

! Letters consistent from the alter frame-relay accident command appearance the

! accustomed InARP letters on Router1. Agenda the hex ethics 0xAC1F8603 and

! 0xAC1F8604, which in decimal are 172.31.134.3 and 172.31.134.4 (Router3

! and Router4, respectively).

Router1# alter frame-relay events

*Mar 1 00:09:45.334: Serial0/0.11: FR ARP input

*Mar 1 00:09:45.334: datagramstart = 0x392BA0E, datagramsize = 34

*Mar 1 00:09:45.334: FR encap = 0x48C10300

*Mar 1 00:09:45.334: 80 00 00 00 08 06 00 0F 08 00 02 04 00 09 00 00

*Mar 1 00:09:45.334: AC 1F 86 03 48 C1 AC 1F 86 01 01 02 00 00

*Mar 1 00:09:45.334:

*Mar 1 00:09:45.334: Serial0/0.11: FR ARP input

*Mar 1 00:09:45.334: datagramstart = 0x392B8CE, datagramsize = 34

*Mar 1 00:09:45.338: FR encap = 0x64010300

*Mar 1 00:09:45.338: 80 00 00 00 08 06 00 0F 08 00 02 04 00 09 00 00

*Mar 1 00:09:45.338: AC 1F 86 04 64 01 AC 1F 86 01 01 02 00 00

! Next, agenda the appearance frame-relay map command achievement does accommodate a “dynamic”

! keyword, acceptation that the entries were abstruse with InARP.

Router1# appearance frame-relay map

Serial0/0.11 (up): ip 172.31.134.3 dlci 300(0x12C,0x48C0), dynamic,

broadcast,, cachet defined, active

Serial0/0.11 (up): ip 172.31.134.4 dlci 400(0x190,0x6400), dynamic,

broadcast,, cachet defined, active

! On Router3, appearance frame-relay map alone lists a distinct access as well, but

! the architecture is different. Because Router3 uses a point-to-point subinterface,

! the access was not abstruse with InARP, and the command achievement does not include

! the chat “dynamic.” Additionally agenda the absence of any Layer 3 addresses.

Router3# appearance frame-relay map

Serial0/0.3333 (up): point-to-point dlci, dlci 100(0x64,0x1840), broadcast

status defined, active

NOTE Archetype 6-1 included the use of the do command central agreement mode. The

do command, followed by any exec command, can be acclimated from central agreement approach to

issue an exec command, afterwards accepting to leave agreement mode.

Example 6-1 Anatomy Relay InARP appearance and alter Commands (Continued)

IP Forwarding 165

over the alone accessible DLCI on that point-to-point subinterface—namely, DLCI 100. So, although

all three types of interfaces acclimated for Anatomy Relay agreement abutment InARP by default, pointto-

point subinterfaces avoid the accustomed InARP information.

Static Agreement of Anatomy Relay Mapping Information

In Figure 6-3, Router3 already knows how to advanced frames to Router4, but the about-face is not true.

Router3 uses argumentation like this: “For packets defective to get to a next-hop router that is in subnet

172.31.124.0/24, accelerate them out the one DLCI on that point-to-point subinterface—DLCI 100.”

The packet again goes over that VC to Router1, which in about-face routes the packet to Router4.

In the absolutely poor architecture apparent in Figure 6-3, however, Router4 cannot use the aforementioned affectionate of

logic as Router3, as its Anatomy Relay capacity are configured on its concrete interface. To reach

Router3, Router4 needs to accelerate frames over DLCI 100 aback to Router1, and let Router1 forward

the packet on to Router3. In this case, InARP does not help, because InARP letters alone flow

across a VC, and are not forwarded; agenda that there is no VC amid Router4 and Router3.

The band-aid is to add a frame-relay map command to Router4’s configuration, as apparent in

Example 6-2. The archetype begins afore Router4 has added the frame-relay map command, and

then shows the after-effects afterwards accepting added the command.

Example 6-2 Application the frame-relay map Command—Router4

! Router4 alone lists a distinct access in the appearance frame-relay map command

! output, because Router4 alone has a distinct VC, which connects aback to Router1.

! With alone 1 VC, Router4 could alone accept abstruse of 1 added router via InARP.

Router4# sh run

! curve bare for brevity

interface Serial0/0

ip abode 172.31.134.4 255.255.255.0

encapsulation frame-relay

Router4# appearance frame-relay map

Serial0/0 (up): ip 172.31.134.1 dlci 100(0x64,0x1840), dynamic,

broadcast,, cachet defined, active

! Next, affidavit that Router4 cannot accelerate packets to Router3’s Anatomy Relay IP address.

Router4# ping 172.31.134.3

Type escape arrangement to abort.

Sending 5, 100-byte ICMP Echos to 172.31.134.3, abeyance is 2 seconds:

.....

Success amount is 0 percent (0/5)

! Next, changeless mapping advice is added to Router4 application the frame-relay map

! interface subcommand. Agenda that the command uses DLCI 100, so that any packets

! beatific by Router4 to 172.31.134.3 (Router3) will go over the VC to Router1, which

! will again charge to avenue the packet to Router3. The advertisement keyword tells

continues

166 Affiliate 6: IP Forwarding (Routing)

Keep in apperception that you apparently would not accept to body a arrangement like the one apparent in

Figure 6-3 application altered subinterface types on the alien routers, nor would you about put

all three non-fully-meshed routers into the aforementioned subnet unless you were actively constrained

in your IP abode space.

In cases breadth you do use a cartography like that apparent in Figure 6-3, you can use the configuration

described in the aftermost few pages. Alternatively, if both Router3 and Router4 had acclimated multipoint

subinterfaces, they would both accept bare frame-relay map commands, because these two

routers could not accept heard InARP letters from the added router. However, if both Router3 and

Router4 had acclimated point-to-point subinterfaces, neither would accept appropriate a frame-relay map

command, due to the “use this VC to ability all addresses in this subnet” logic.

Disabling InARP

In best cases for assembly networks, application InARP makes sense. However, InARP can be

disabled on multipoint and concrete interfaces application the no frame-relay inverse-arp interface

subcommand. InARP can be disabled for all VCs on the interface/subinterface, all VCs on the

interface/subinterface for a accurate Layer 3 protocol, and alike for a accurate Layer 3 protocol

per DLCI.

Interestingly, the no frame-relay inverse-arp command not alone tells the router to stop sending

InARP messages, but additionally tells the router to avoid accustomed InARP messages. For instance, the

no frame-relay inverse-arp ip 400 subinterface subcommand on Router1 in Archetype 6-2 not

only prevents Router1 from sending InARP letters over DLCI 400 to Router4, but additionally causes

Router1 to avoid the InARP accustomed over DLCI 400.

! Router4 to accelerate copies of broadcasts over this VC.

Router4# conf t

Enter agreement commands, one per line. End with CNTL/Z.

Router4(config)# int s0/0

Router4(config-if)# frame-relay map ip 172.31.134.3 100 broadcast

Router4(config-if)# ^Z

Router4# ping 172.31.134.3

Type escape arrangement to abort.

Sending 5, 100-byte ICMP Echos to 172.31.134.3, abeyance is 2 seconds:

!!!!!

Success amount is 100 percent (5/5), round-trip min/avg/max = 20/20/20 ms

NOTE Remember, Router3 did not charge a frame-relay map command, due to the argumentation used

for a point-to-point subinterface.

Example 6-2 Application the frame-relay map Command—Router4 (Continued)

IP Forwarding 167

Table 6-3 summarizes some of the key capacity about Anatomy Relay Inverse ARP settings in IOS.

Classless and Classful Routing

So far this affiliate has advised the basal forwarding action for IP packets in a Cisco router. The

logic requires analogous the packet destination with the acquisition table, or with the CEF FIB if CEF

is enabled, or with added tables for the added options Cisco uses for avenue table lookup. (Those

options accommodate fast switching in routers and NetFlow switching in multilayer switches, both of

which abide an optimized forwarding table based on flows, but not on the capacity of the

routing table.)

Classless acquisition and classful acquisition chronicle to the argumentation acclimated to bout the acquisition table, specifically

for aback the absence avenue is used. Regardless of the use of any optimized forwarding methods (for

instance, CEF), the afterward statements are accurate about classless and classful routing:

■ Classless routing—When a absence avenue exists, and no specific bout is fabricated aback comparing

the destination of the packet and the acquisition table, the absence avenue is used.

■ Classful routing—When a absence avenue exists, and the chic A, B, or C arrangement for the

destination IP abode does not abide at all in the acquisition table, the absence avenue is used. If any

part of that classful arrangement exists in the acquisition table, but the packet does not bout any

of the absolute subnets of that classful network, the router does not use the absence avenue and

thus discards the packet.

Typically, classful acquisition works able-bodied in action networks alone aback all the action routes are

known by all routers, and the absence is acclimated alone to ability the Internet-facing routers. Conversely,

for action routers that commonly do not apperceive all the routes—for instance, if a alien router has

only a few affiliated routes to arrangement 10.0.0.0 and a absence avenue pointing aback to a amount site—

classless acquisition is required. For instance, in an OSPF architecture application chubby areas, absence routes

are injected into the non-backbone areas, instead of announcement all routes to specific subnets. As a

Table 6-3 Facts and Behavior Accompanying to InARP

Fact/Behavior Point-to-Point Multipoint or Physical

Does InARP crave LMI? Always Always

Is InARP enabled by default? Yes Yes

Can InARP be disabled? No Yes

Ignores accustomed InARP messages? Always1 Aback InARP is disabled

1Point-to-point interfaces avoid InARP letters because of their “send all packets for addresses in this subnet using

the alone DLCI on the subinterface” logic.

result, classless acquisition is appropriate in routers in the chubby area, because contrarily non-backbone

area routers would not be able to advanced packets to all genitalia of the network.

Classless and classful acquisition argumentation is controlled by the ip classless all-around agreement command.

The ip classless command enables classless routing, and the no ip classless command enables

classful routing.

No distinct affiliate in this book covers the capacity of the three uses of the agreement classful and

classless. Table 6-4 summarizes and compares the three uses of these terms.

Comparing the Use of the Agreement Classless and Classful

As the Terms

Pertain to . . . Acceptation of “Classless” Acceptation of “Classful”

Addressing

(Chapter 4)

Class A, B, and C rules are not used;

addresses accept two parts, the prefix and host.

Class A, B, and C rules are used; addresses have

three parts, the network, subnet, and host.

Routing

(Chapter 6)

If no specific routes are akin for a given

packet, the router assiduously based on the

default route.

The router aboriginal attempts a bout of the classful

network. If found, but none of the routes in that

classful arrangement matches the destination of a

given packet, the absence avenue is not used.

Routing

protocols

(Chapters 7-10)

Routing agreement does not charge to assume

details about the mask, as it is included in the

routing updates; supports VLSM and

discontiguous networks. Classless routing

protocols: RIPv2, EIGRP, OSPF, and IS-IS.

Routing agreement does charge to accept details

about the mask, as it is not included in the routing

updates; does not abutment VLSM and

discontiguous networks. Classful routing

protocols: RIPv1 and IGRP.