The Active Bridge Scott Alexander, Marianne Shaw, Scott Nettles, and Jonathan Smith Distributed Systems Lab University of Pennsylvania The Active Bridge is a proof-of-concept experiment as part of the SwitchWare (www.cis.upenn.edu/~switchware) project at the University of Pennsylvania. The active loader permits dynamic loading of switchlets for execution on a per packet basis. The bridge makes the following transitions: learning bridge -> bridge using DEC based protocol with spanning tree -> bridge based on IEEE 802.1D algorithm (w/ error detection) -> if error detected: bridge using DEC based protocol with spanning tree For more details, see http://www.cis.upenn.edu/~switchware/papers/sigcom97.ps. The active loader is written in OCaml running in the Linux environment. (This release has been tested with Red Hat 5.0.) The Active Bridge is a series of OCaml switchlets that are dynamically downloaded into the loader to be executed. Files included for the active bridge: .depend Makefile README - this file auxiliary.ml - helper routines for the spanning tree implementations ccontrol.ml - color demo control routine; switches control from DEC to IEEE with automatic fallback if a state error is detected cdec.ml - color demo DEC bridge switchlet cdspan.ml - color demo DEC spanning tree switchlet cieee.ml - color demo IEEE bridge switchlet cispan.ml - color demo IEEE spanning tree switchlet ckilldec.ml - color demo switchlet to kill the color DEC switchlet ckillieee.ml - color demo switchlet to kill the color IEEE switchlet cmds.mly - parser for loader config.ml - host relative bridge configuration information control.ml - control routine; switches control from DEC to IEEE with automatic fallback if a state error is detected dec.ml - DEC bridge switchlet dspan.ml - DEC spanning tree switchlet ieee.ml - IEEE bridge switchlet ispan.ml - IEEE spanning tree switchlet killbridge.ml - switchlet to kill the basic bridge killdec.ml - switchlet to kill the DEC switchlet killieee.ml - switchlet to kill the IEEE switchlet ldbridge.ml - basic bridge switchlet lexcmd.mll loader.ml - loader source code log_priv.ml - routines to log messages log_priv.mli ocaml-patch - patch for ocaml-1.07 safe/condition.ml - safe implementation of conditions safe/condition.mli safe/demo.ml - safe implementation for the color demo safe/demo.mli safe/func.ml - safe functions to load and execution switchlets safe/func.mli in the loader safe/log.ml - safe message logging safe/log.mli safe/mutex.ml - safe implementation of mutexes safe/mutex.mli safe/safestd.ml - safe pervasives implementation safe/safestd.mli safe/safethread.ml - safe threads implementation safe/safethread.mli safe/safeunix.ml - safe unix implementation safe/safeunix.mli timer.ml - timer queue implementation for bridge expiry functions INSTALLATION To run the Active Bridge, Objective Caml needs to be installed on the test system. Documentation on OCaml can be obtained at the INRIA WWW site: http://pauillac.inria.fr/ocaml/ A copy of ocaml-1.07 distribution can be obtained through anonymous FTP at: host: ftp.inria.fr (192.93.2.54) directory: lang/caml-light or through a Web browser at ftp://ftp.inria.fr/lang/caml-light/. Unzip and untar the OCAML distribution: gunzip .tar.gz tar xvf .tar Update the OCAML distribution with the patch included with this file. In the ocaml-1.07 directory, apply the patch: patch -p1 < ocaml-patch Follow the installation procedures in the OCAML INSTALL file. To compile the bridge loader and switchlets, modify the Makefile in the active-bridge directory to reflect the location of the ocaml* executables. The defaults are /usr/local/lib/bin/ocaml*. The config.ml file contains the bridge configuration information. If you desire, modify this for your site. To generate the loader and .cmo files (switchlets), type: make loader make control.cmo -- all files up to the control switchlet make spew.cmo -- switchlet to transmit IEEE bpdu packets make killbridge.cmo -- to kill the basic bridge switchlet make killdec.cmo -- to kill the DEC bridge switchlet make killieee.cmo -- to kill the IEEE bridge switchlet The c.cmo files generate the corresponding switchlets for the color demo. This demo brings up an X window which displays the status of each port. To generate the color demo switchlets, type: make loader make ccontrol.cmo make cspew.cmo make killbridge.cmo make ckilldec.cmo make ckillieee.cmo The *kill*.cmo switchlets are a way of clean way of bringing the bridges down. It is not necessary to use them as soon as fallback occurs, but convenient when you are finished with yours experiments. To execute the loader and bridge, the following sequence should be followed. Root privileges are necessary on the machine. NOTE: As distributed, you must have at least 3 Ethernet interfaces in the machine that is to perform bridging. The bridge does not operate on interface 'eth0' so as to leave one port available for normal network communications (e.g., debugging). (This can be changed in safe/safeunix.ml.) Any other interfaces found will be bridged. (text following ';' on a line designate comments) [active-bridge]# ./loader load timer.cmo load auxiliary.cmo load ldbridge.cmo exec bridge foo ; begin executing basic bridge load config.cmo load dspan.cmo load dec.cmo exec decbridge bob ; begin executing DEC bridge as "bob" load ispan.cmo load ieee.cmo load control.cmo exec control foo ; begin executing control switchlet load spew.cmo exec spew foo ; generates IEEE packets to cause transition ; to IEEE bridge ; If the BUG is compiled in ispan.ml, then ; the control switchlet will "fallback" to ; the DEC bridge. This indicates the IEEE ; bridge is not functioning properly. ; if desired, kill the bridge load killdec.cmo exec killdec foo ; kill the DEC bridge An example run: [root@active-bridge]./loader load auxiliary.cmo loaded auxiliary.cmo load timer.cmo loaded timer.cmo load ldbridge.cmo loaded ldbridge.cmo exec bridge foo started bridge set_promisc eth3 set_promisc eth2 set_promisc eth1 load config.cmo loaded config.cmo load cdspan.cmo loaded cdspan.cmo load cdec.cmo loaded cdec.cmo exec decbridge switchlet started decbridge load cispan.cmo loaded cispan.cmo load cieee.cmo loaded cieee.cmo load ccontrol.cmo loaded ccontrol.cmo exec control foo started control