8.5 Data Structure Changes for Distribution

Recall the discussion about accessing global variables via access routines instead of pointers. This approach allows controlled access, in which mutual exclusion can be enforced.

When moving to a distributed environment, there are two options for accessing the variables:

  1. Maintain the access routine paradigm. Individual tasks will continue to call the access routines, but the routines will make a remote procedure call to obtain the information, assuming that the data structure is on a different card.

  2. Have a local copy of the data structure, and replicate the access routines on both cards. This requires synchronization of the two copies of the data structure.

Figure 8.5(a) details this access routine scenario. The data structure is stored on the control card, and the access routine is implemented in a separate task, so that all access to the data structure is through messages. For both control and line card tasks, the messaging infrastructure takes care of the abstraction.

Figure 8.5(b) details the local copy scenario. The data structures are replicated in both cards, and the access is completely local. This avoids the overhead of messaging across the backplane for basic access to the data structures. However, the data structures need to be synchronized; for every change in one data structure, there needs to be a corresponding change in the other data structure. This can be difficult to maintain when there is a large number of cards which replicate the data structure information.

click to expand
Figure 8.5: Access routine and local copy scenarios.

8.5.1 IPS Approach

In the IP Switch (IPS), note that the RTM-to-line card interaction falls in the replication category. Each line card has a copy of the FIB provided by the RTM, which keeps them synchronized. Early implementations of multi-board routers used a subset of the complete FIB on their line cards. The FIBs had only information about forwarding between the ports on the same line card. For all other packets, the line card required a lookup of the FIB maintained by the control card. The pseudocode in Listing 8.1 details the logic.

Listing 8.1: The IPS approach to accessing variables.

start example
Look up local copy of FIB If packet can be forwarded between ports on this card, perform forwarding; Else  Look up the destination card for the packet from the RTM FIB on the Control Card; Send the packet to the appropriate line card via the switch fabric
end example

This approach allowed the FIBs on the line cards to be much smaller in size as compared to the FIB on the RTM. However, overall performance suffered, since packets destined for other cards had to perform a remote lookup function call to get destination information. Recent implementations keep the complete FIB on the line card, so the forwarding can be done without any lookups to the control card.



Designing Embedded Communications Software
Designing Embedded Communications Software
ISBN: 157820125X
EAN: 2147483647
Year: 2003
Pages: 126
Authors: T. Sridhar

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net