Interrupt Context Switching

Interrupt context switching is much faster than process switching. The increase in speed is largely due to the fact that the ip_input process is rarely called. Interrupt context switching instead interrupts the process currently running on the router to switch the packet. Interrupt context switching usually bypasses the RIB, and works with parallel tables, which are built more efficiently (the details of these tables differ according to the switching path in use). You also save a considerable amount of time because the processor no longer has to wait for a process to complete.

The general steps for interrupt context switching are shown in Figure 15-3.

Interrupt context switching is a broad description that encompasses various switching paths—fast switching, optimum switching, and CEF—and includes the following steps:

  1. The interface processor detects a packet and moves the packet into input/output memory.

  2. The interface processor generates a receive interrupt. During this time, the central processor (CPU) determines the packet type (IP) and begins to switch the packet.

  3. The processor searches the route cache for the following information and uses it to rewrite the packet’s MAC header:

    1. Is the destination reachable?

    2. What should the output interface be?

    3. What is the next hop?

    4. What should the MAC addresses be converted to?

  4. The packet is copied to either the transmit queue or the output queue of the outbound interface. The receive interrupt is ended, and the originally ...

Get Network Warrior, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.