Skip to content
Tom Barbette edited this page Aug 6, 2018 · 1 revision

click-combine

combines two or more Click configurations into one

Synopsis

click-combine [options] name=file ... \
        name1.element1=name2.element2 ...

Description

The click-combine tool combines two or more Click router configurations into a single virtual configuration representing the network. Special RouterLink elements represent links between routers. For example, say there is a point-to-point link from router A’s eth0 interface to router B’s eth1 interface. Then in the combined configuration, A’s ToDevice(eth0) element and B’s PollDevice(eth1) element will be replaced with a new RouterLink element; packets will flow from A to B via the RouterLink element.

Click drivers can’t execute the resulting virtual configuration since the RouterLink "element class" has no definition. If you want to execute a combined configuration, edit the configuration to replace the RouterLinks with real elements representing the relevant link properties. For example, this definition gives point-to-point links 10 microsecond latency and 1 MBps bandwidth:

   elementclass RouterLink { $srcclass, $srcargs, $dstclass, $dstargs |
       input -> LinkUnqueue(10us, 1MBps) -> output
   }

You can edit the combined configuration with tools, which are effectively able to consider the whole network. For example, they can check cross-router properties or perform cross-router optimizations. Use the click-uncombine tool to extract a component router configuration from the combination.

Component routers are identified by name. This name must be a legal Click identifier (see click) that does not contain a slash. To add a router component named N whose configuration is in the file f, supply the option ‘N=f’. You will generally supply at least two such options.

A link says that packets leaving one router via one element will arrive at another router via another element. The routers are specified by component name, and the elements can be specified by element name or by device name. To connect the e1 element from router component A to the e2 element from router component B, supply the option ‘A.e1=B.e2’. If e1 is a ToDevice element, then you can use its device name argument instead of its name. Similarly, if e2 is a PollDevice or FromDevice element, you can use its device name argument instead of its name.

Link options are one-way, so if there is a duplex connection, you will need to give two arguments: ‘A.eth0=B.eth1 B.eth1=A.eth0’, for example. You can also support more than two routers sharing a link; for example, ‘A.eth0=B.eth1 A.eth0=C.eth2’.

Options

If any filename argument is a single dash "-", click-combine will use the standard input or output instead, as appropriate.

  • -o, --output file

    Write the output router configuration to file. The default is the standard output.

  • -n, --name name

    The next router component will be named name. This option and the --file provide an alternative to the name=file syntax.

  • -f, --file file

    Read a router configuration from file. Together with the --name option, the --file and --expression options provide an alternative to the name=file syntax.

  • -e, --expression expr

    Use expr, a string in the Click language, as the next router configuration.

  • -l, --link component1.element1=component2.element2

    Add a link specification as described above.

  • -c, --config

    Output new configuration only (not an archive with extra information).

  • --help

    Print usage information and exit.

  • --version

    Print the version number and some quickie warranty information and exit.

See Also

click-uncombine, click-xform, click, PollDevice, FromDevice, ToDevice

Author

Eddie Kohler, [email protected]
https://github.com/tbarbette/fastclick

Clone this wiki locally