[Xorp-hackers] FEA for Click

Pavlin Radoslavov pavlin@icir.org
Fri, 03 Dec 2004 14:17:23 -0800


> I saw in the cvsweb that the XORP team (more precisely Pavlin) is working on 
> the FEA for Click... when do you think there will be a working FEA for Click? 
> (Maybe the implementation is working at the moment, but I saw many changes in 
> the last days/hours).

Julian,

I just committed the last major Click-related missing piece, so
right now the FEA should work for both user-level and kernel-level
Click. There are still few things that need polishing, but those
will be addressed within few days or so.
If you decide to give it a try now, make sure that your
fea/click_socket.cc file is at least version 1.11, because the anon
CVS repository is updated approx. once an hour or so.

Currently, there is no documentation, but the sample config file
below can be a starting point to play with.
Basically, the model is:
 1. You enable either "kernel-click" or "user-click" in your XORP
     configuration file.
 2. If you want XORP to install the kernel-Click related stuff
    (the loading of the kernel modules, and the mounting of the
    Click file system), then make sure that "instal-on-startup" is
    set to true, that "kernel-click-modules" contains the list of
    ':' - separated  files with the kernel modules, and that
    "mount-directory" points to the right place.
    Otherwise, just make sure that "mount-directory" is set
    properly.
 3. If you want XORP to start the user-level binary for you
    (recommended), then make sure that "command-execute-on-startup"
    is set to true.
 4. In all cases, make sure that "click-config-generator-file"
    points to an executable that can be used to generate the Click
    configuration on-the-fly. This executable should take XORP
    configuration as an input, and should generate the Click
    configuration that the FEA will install into Click. File
    xorp/fea/xorp_fea_click_config_generator is a sample AWK script
    that does this already, so it can be a starting point.
    Note that currently the above script parses only the
    "interfaces" XORP configuraton section.
    Of course, you can use any other implementation you want.
    The only assumptions that the XORP FEA has about the result Click
    configuration are that:
    (a) the forwarding table element is named "_xorp_rt"
    (b) the above element has two handlers "add" and "remove"
        for adding and removing the forwarding entries, and the
	configuration format for those handers is:
        add/remove <network_address> <nexthop_address> <port>
        For example, see element LinearIPLookup.
    (c) The mapping between the network interface name to the
        corresponding outgoing port on the _xorp_rt element
        starts from 0, and is ordered by the interface name.
        E.g., eth0 -> _xorp_rt[0], eth5 -> _xorp_rt[1],
        tun1 -> _xorp_rt[2], and so-on.

Again, there are still few things that need polishing, and other
things may change a bit, but the basic stuff should work now.
If you give it a try, please let us know if you run into problems or
if you have any suggestions for improvements/etc.

Thanks,
Pavlin
 

interfaces {
    interface eth2 {
	description: "control interface"
	vif eth2 {
	    address 10.2.0.4 {
		prefix-length: 24
		broadcast: 10.255.255.255
	    }
	}
    }

    interface eth4 {
	description: "control interface"
	vif eth4 {
	    address 10.7.0.1 {
		prefix-length: 24
		broadcast: 10.255.255.255
	    }
	}
    }
}

fea {
    enable-unicast-forwarding4: true
    /* enable-unicast-forwarding6: true */

    click {
	enabled: true
	click-config-generator-file: "/user/local/xorp/fea/xorp_fea_click_config_generator"

	kernel-click {
	    enabled: true
	    install-on-startup:	true
	    kernel-click-modules: "/path/to/proclikefs.o:/path/to/click.o"
	    mount-directory: "/click"
	}

	user-click {
	    enabled: false
	    command-file: "/usr/local/bin/click"
	    command-extra-arguments: "-R"
	    command-execute-on-startup: true
	    control-address: 127.0.0.1
	    control-socket-port: 13000
	    startup-config-file: "/dev/null"
	}
    }
}

protocols {
    static {
	route4 10.10.0.0/16 {
	    nexthop: 10.2.0.2
	}

	route4 10.20.0.0/16 {
	    nexthop: 10.7.0.7
	}
    }
}