4

Click here to load reader

Packet Switching Architecture

Embed Size (px)

Citation preview

Page 1: Packet Switching Architecture

When IOS was first developed, there was only one switching method, known today as process switching.

• Process switching • Fast switching• Autonomous switching• Silicon switching engine (SSE) switching• Optimum switching• Distributed fast switching• Cisco Express Forwarding (CEF)• Distributed Cisco Express Forwarding (dCEF)

Process Switching:- It consume large amounts of CPU time.- provides some traffic load sharing capabilities not found in most of the other switching methods. ie., It has per-packet load sharing capability.- This begins with the network interface on the router sensing there is a packet on the wire that needs to be processed.

Step1: The interface hardware receives the packet and transfers it into input/output (I/O) memory. Step2: The network interface interrupts the main processor, telling it there is a received packet waiting in I/O memory that needs to be processed; this is called the receive interrupt. The IOS interrupt software inspects the packet's header information (encapsulation type, network layer header, and so on), determines that it is an IP packet, and places the packet on the input queue for the appropriate switching process.

Note: For IP packets, the switching process is named ip_input. Step3: Once the packet is in the input queue of the ip_input process, ip_input (switching process) becomes eligible to run. Step4: The actual packet-forwarding operation will begin. ip_input looks in the routing table to see whether a route exists to the destination IP address. If one is found, it retrieves the address of the next hop. The ip_input process builds a new MAC header with the help of ARP cache, writing over the old one in the input packet. Step5: Finally, the packet is queued for transmission out the outbound network interface. Step6: When the outbound interface hardware senses a packet waiting for output, it dequeues the packet from I/O memory and transmits it on to the network. Step7: After the outbound interface hardware finishes transmitting the packet, it interrupts the main processor to indicate that the packet has been transmitted. IOS then updates its outbound packet counters and frees the space in I/O memory formerly occupied by the packet. Disadvantages:

- a key disadvantage of process switching is its speed. It requires a routing table lookup for every packet. As the size of the routing table grows, so does the time required to perform a lookup. Recursive routes consumes more length of lookup time.

Looking back at the IP process switching example, the ip_input process needs thr

Page 2: Packet Switching Architecture

ee key pieces of data to switch the packet:• Reachability—Is this destination reachable? If so, what is the IP network address of the next hop toward this destination? This data is in the routing table (also called the forwarding table).• Interface—Which interface should this packet be transmitted on to reach its destination? This data is also stored in the routing table.• MAC layer header—What MAC header needs to be placed on the packet to correctly address the next hop? MAC header data comes from the ARP table for IP or other mapping tables, such as the Frame Relay map table.

Fast Switching: Caching to the Rescue

- caching means storing some frequently used data with very fast access properties.- Fast switching keeps a copy of the reachability/interface/MAC-header combinations learned while process switching packets.- Unlike process switching, fast switching does not support load sharing on a per-packet basis. Load sharing occurs based strictly on the destination address.- Fast Cache is accessed using a hash table in earlier releases, and is accessed via a two-way radix tree in later releases.

Step1: Consider the process switching method again—only this time the newly built Fast Cache is introduced. Again, the switching process begins with the interface hardware sensing there is a packet on the wire. It receives the packet and transfers it to I/O memory Step2: interface hardware tells the main processor about the new packet. Step3: Now, instead of placing the packet in the input queue for ip_input as before, the interrupt software consults the Fast Cache directly to determine whether an outbound interface and a MAC header have been cached for this destination. If there's one, the interrupt software reads the MAC header from the entry and writes it into the packet. It also reads a pointer to the appropriate outbound interface from the cache entry Step4: The main processor then notifies the outbound interface hardware that a packet in I/O memory is ready to transmit and dismisses the interrupt so other processes can continue. Step5: The interface hardware dequeues the packet from I/O memory and transmits. Step6: outbound interface hardware then interrupts the main processor to update its counters and release the I/O memory Thus, fast switching introduced the concept of "route once, forward many times." But This lack of a deterministic load-balancing scheme is an area of concern for many network designers. In response, newer switching methods now support load-balancing schemes that help overcome this problem. One such method, Cisco Express Forwarding (CEF). Optimum Switching:

- Optimum switching is essentially fast switching with some caching optimizations.The primary difference between optimum and fast switching is in the way the route cache is accessed. Unlike fast switching, optimum switching is available only for the IP protocol. The optimum cache is accessed via a 256-way multiway tree

Page 3: Packet Switching Architecture

(mtree) Cisco Express Forwarding:

Cisco Express Forwarding (CEF) is the newest, and fastest, switching method available in IOS. CEF was invented to help overcome the major deficiencies of the fast switching method. Reviewing the description of fast switching for a moment, the major deficiencies noted were:• Lack of support for overlapping cache entries.• Any change in the routing table or ARP cache results in the invalidation of large sections of the route cache, because there is little or no correlation between the route cache and the tables on which the cache is based.• The first packet to any given destination must be process switched to build a route cache entry.• Inefficient load balancing in some situations (primarily in cases where many hosts are transacting with one server). CEF builds its own structures that mirror the entire routing and MAC address tables,• CEF table• Adjacency table

CEF Table: The CEF table is a "stripped-down" version of the routing table, implemented as a 256-way mtrie data structure for optimum retrieval performance.Adjacency Table: The adjacency table contains the MAC-layer packet-header data for directly connected next hops.

There are several types of adjacency entries you might see in the Address column of show adjacency:• Cached adjacency— A prebuilt MAC header for the next hop toward this destination.• Punt— Packets destined to this address must be passed up to the next switching path to be switched.• Host-route— This destination is a directly connected host.• Drop— Packets destined to this address are dropped.• Incomplete— The MAC-layer header for this destination is incomplete; typically, this means the ARP cache entry for this destination is incomplete or otherwise malformed.• Glean— This is a directly attached destination, but there is no pre-built MAC-layer header; an ARP request needs to be sent so a MAC-layer header can be built.

While fast switching requires the first packet to any given destination be process switched to build a cache entry, CEF does not. Instead, the CEF table is built directly from the routing table and the adjacency table is built directly from the ARP cache. These CEF structures are built before any packets are switched.

Entries in the CEF structures never age out. Any changes in the routing table or the ARP cache can be easily reflected in the CEF structures. Also, with CEF there is no longer any need to invalidate a large number of entries when the routing table or the ARP cache change.

Traffic load sharing with CEF switching can be either per source/destination pair (the default)--> Also called as per flow or per packet.

Summary:

• Process switching doesn't cache any information, and switches packets in the context of a process.• Fast switching caches reachability information and the MAC headers needed to forward packets in a radix tree and switches packets during interrupts.• Optimum switching caches reachability and the MAC headers in a multiway tree (mt

Page 4: Packet Switching Architecture

ree), and switches packets during interrupts.• CEF switching caches reachability information in an mtrie, and the MAC headers needed to forward packets within an adjacency table. CEF switches packets during interrupts.