
10
Figure 2-6: Basic Packet Flow Through Click
In order to implement packet routing, Click breaks the processing and packet classification
operations down into elements, which are defined in a configuration file. This configuration file
is what defines the operation of a Click router. The programming language for the configuration
file uses declaration constructs to define which elements to include in the router and connection
constructs to define how packets flow between them. This creates a directed graph similar to the
one shown above, where packets flow along the edges to the elements at the vertices for
processing.
In some instances information about a packet that is determined by one element is needed by
another at a later time. This information is added to the annotation space in the packet’s header. It
is ignored once the packet leaves the click router. This is used most often to set a packet’s
destination IP address.
The click programming language allows the creation of compound elements. This is a collection
of connected elements that can be viewed as one element from the outside. They will accept
input, process the packets in some way, and produce them at an output. This simplifies the
configuration file, as the elements in the middle of the compound element do not need to be
declared in advance.
The Click Modular Router can be run in two different modes under the Linux operating system,
as a user-level driver, or as a kernel module. As a user-level driver it receives packets after they
have been handled by the Linux kernel. As a kernel module, it allows the router to receive
packets before they are processed by the Linux kernel, and thus packets can be redirected without
Comentários a estes Manuais