Skip to content
Tom Barbette edited this page Oct 3, 2018 · 2 revisions

Bypass Element Documentation

NAME

Bypass — Click element; sends packet stream through optional bypass with zero overhead

SYNOPSIS

Bypass([ACTIVE])

Batching: Batching natively supported
Ports: 1-2 inputs, 1-2 outputs
Processing: agnostic

DESCRIPTION

Bypass adds zero-overhead path switching to a configuration.

Normally, a Bypass element emits received packets on its first output, like Null. However, when ACTIVE is true, a push Bypass element emits packets onto output port 1. An active pull Bypass forwards pull requests to input port 1.

Here's a typical use of a push Bypass:

  ... source -> print_bypass :: Bypass -> sink ...;
  print_bypass [1] -> Print(Debug) -> sink;

To turn on the Print, write print_bypass.active to true.

You could implement this functionality multiple ways, for instance by using Switch or Print's "active" handler, but Bypass is special because an inactive Bypass has zero overhead. Bypass modifies its neighboring elements so that packets skip over the Bypass itself. In other words, the above configuration behaves like one of the following two lines:

  ... source -> sink ...;
  ... source -> Print(Debug) -> sink ...;

Bypass can have two inputs and outputs. The additional push input (pull output) reconnects the bypass path to the normal path, and makes it easier to use Bypass in agnostic contexts. On a push Bypass, packets received on input port 1 are forwarded to output port 0; on a pull Bypass, pull requests received on output port 1 are forwarded to input port 0. The above configuration could also be written this way:

  source :: TimedSource -> print_bypass :: Bypass -> sink ...;
  print_bypass [1] -> Print(Debug) -> [1] print_bypass;

And here is a pull version of Bypass in a related configuration:

  source :: Queue -> print_bypass :: Bypass -> sink ...;
  print_bypass [1] -> Print(Debug) -> [1] print_bypass;

Note that the bypass path is exactly the same in both cases.

Keyword arguments are:

  • INLINE — Boolean. If true, then Bypass remains inline: it does not modify its neighbors' ports, and it will introduce overhead. Default is false.

NOTES

Bypass modifies Click internals at run time, which can be dangerous. Elements that test their neighbors' classes should not be used next to Bypass. (Elements should not test their neighbors' classes, however.) Bypass should not be used in a devirtualized configuration unless its INLINE argument is set to true.

SEE ALSO

Switch, PullSwitch, Null, click-devirtualize

Generated by click-elem2man from ../elements/standard/bypass.hh:7 on 2018/10/03.

Clone this wiki locally