Verify in fwd_port_input() that we are not passed packets that are shared.
[sliver-openvswitch.git] / INSTALL
1        Installation Instructions for OpenFlow Reference Release
2
3 This document describes how to build, install, and execute the
4 reference implementation of OpenFlow.  Please send any comments to:
5
6                       <info@openflowswitch.org>
7
8 Contents
9 ========
10
11 The OpenFlow reference implementation includes three separate
12 OpenFlow switch implementations:
13
14         - The "userspace switch": This implements an OpenFlow switch
15           as a single user program (built as switch/switch).  The
16           userspace switch is the easiest to build and use but it is
17           much less featureful than the other switch implementations.
18
19         - The "kernel-based switch": This divides the switch into a
20           "datapath" Linux kernel module (openflow_mod.o for Linux 2.4
21           or openflow_mod.ko for Linux 2.6) and a userspace program
22           (secchan).  The kernel-based switch is faster than either of
23           the other two implementations but requires building and
24           installing a kernel module, which can sometimes be
25           challenging.
26
27         - The "userspace datapath-based switch": This divides the
28           switch into a userspace "datapath" (built as
29           udatapath/udatapath) and the same userspace program used by
30           the kernel-based switch (secchan).  The userspace
31           datapath-based switch is as featureful as the kernel-based
32           switch and it does not require building a kernel module, but
33           it is not as fast as the kernel-based switch and it is part
34           of the OpenFlow extensions distribution, not the main
35           OpenFlow distribution.
36
37 The reference implementation also contains a simple OpenFlow
38 controller (built as controller/controller) and a number of related
39 utilities.
40
41 Build Methods
42 =============
43
44 There are two principal ways to build and install this distribution:
45
46         - Using "configure" and "make" in the ordinary way.  See
47           Building Conventionally below for detailed instructions.
48
49         - As a set of Debian packages.  Refer to Building Debian
50           Packages, below, for instructions.
51
52 Base Prerequisites
53 ------------------
54
55 Regardless of how it is built, OpenFlow has a common set of
56 prerequisites.  To compile the userspace programs in the OpenFlow
57 reference distribution, you will need the following software:
58
59     - A make program, e.g. GNU make
60       (http://www.gnu.org/software/make/).  BSD make should also work.
61
62     - The GNU C compiler (http://gcc.gnu.org/).  We generally test
63       with version 4.1 or 4.2.
64
65     - libssl, from OpenSSL (http://www.openssl.org/), is optional but
66       recommended.  libssl is required to establish confidentiality
67       and authenticity in the connections among OpenFlow switches and
68       controllers.  To enable, configure with --enable-ssl=yes
69
70 If you are working from a Git tree or snapshot (instead of from a
71 distribution tarball), or if you modify the OpenFlow build system, you
72 will also need the following software:
73
74     - Autoconf version 2.59 or later (http://www.gnu.org/software/autoconf).
75
76     - Automake version 1.10 or later (http://www.gnu.org/software/automake).  
77
78     - pkg-config (http://pkg-config.freedesktop.org/wiki/).  We test
79       with version 0.22.
80
81 Debian Prerequisites
82 --------------------
83
84 To build Debian packages from the OpenFlow distribution, you will need
85 to install a number of Debian packages in addition to the base
86 prerequisites listed above.  These additional prerequisites may be
87 found listed as "Build-Depends" in debian/control in the source tree.
88 To check that they are installed, first install the dpkg-dev package,
89 then run dpkg-checkbuilddeps from the top level of the OpenFlow source
90 tree.
91
92 To build Debian packages without being root, also install the
93 "fakeroot" package.
94
95 Kernel-Based Switch Prerequisites
96 ---------------------------------
97
98 The OpenFlow distribution also includes a Linux kernel module that can
99 be used to achieve higher switching performance.  To compile the
100 kernel module, you must install the following in addition to the
101 software listed in the "Base Prerequisites" section above:
102
103     - A supported Linux kernel version.  Please refer to README for a
104       list of supported versions.
105
106       The OpenFlow datapath requires bridging support (CONFIG_BRIDGE)
107       to be built as a kernel module.  (This is common in kernels
108       provided by Linux distributions.)  The bridge module must not be
109       loaded or in use.  If the bridge module is running (check with
110       "lsmod | grep bridge"), you must remove it ("rmmod bridge")
111       before starting the datapath.
112
113       In kernels prior to 2.6.9, VLAN support (CONFIG_VLAN_8021Q) must 
114       be compiled either directly or as a module.  Failure to do this
115       will cause an error on module insertion due to the 
116       "dev_change_flags" symbol being undefined.
117
118     - The correct version of GCC for the kernel that you are building
119       the module against:
120
121         * To build a kernel module for a Linux 2.6 kernel, you need
122           the same version of GCC that was used to build that kernel
123           (usually version 4.0 or later).
124
125         * To build a kernel module for a Linux 2.4 kernel, you need an
126           earlier version of GCC, typically GCC 2.95, 3.3, or 3.4.
127
128     - A kernel build directory corresponding to the Linux kernel image
129       the module is to run on.  Under Debian and Ubuntu, for example,
130       each linux-image package containing a kernel binary has a
131       corresponding linux-headers package with the required build
132       infrastructure.
133
134 Building Conventionally
135 =======================
136
137 This section explains how to build and install the OpenFlow
138 distribution in the ordinary way using "configure" and "make".
139
140 0. Check that you have installed all the prerequisites listed above in
141    the Base Prerequisites section.  If you want to compile the Linux
142    kernel module, also check that the prequisites listed under
143    Kernel-Based Switch Prequisites are installed.
144
145 1. In the top source directory, configure the package by running the
146    configure script.  You can usually invoke configure without any
147    arguments:
148
149       % ./configure
150
151    To use a specific C compiler for compiling OpenFlow user programs,
152    also specify it on the configure command line, like so:
153
154       % ./configure CC=gcc-4.2
155
156    To build the Linux kernel module, so that you can run the
157    kernel-based switch, add --with-l26 or --with-l24 option, or both,
158    to the configure script's command line.  Refer to Building the
159    Linux Kernel-Based Switch, below, for more information.
160
161    The configure script accepts a number of other options and honors
162    additional environment variables.  For a full list, invoke
163    configure with the --help option.
164
165 2. Run make in the top source directory: 
166
167       % make
168
169    The following binaries will be built:
170
171       - Switch executable: switch/switch.
172
173       - Secure channel executable: secchan/secchan.
174
175       - Controller executable: controller/controller.
176
177       - Datapath administration utility: utilities/dpctl.
178
179       - Runtime logging configuration utility: utilities/vlogconf.
180
181       - Miscellaneous utilities: utilities/ofp-discover,
182         utilities/ofp-kill.
183
184       - Tests: various binaries in tests/.
185
186    If your distribution includes the OpenFlow extensions, the
187    following additional binaries will be built:
188
189       - Userspace datapath: ext/udatapath/udatapath.
190
191       - ANSI terminal support for EZIO 16x2 LCD panel:
192         ext/ezio/ezio-term.
193
194       - Switch monitoring UI for small text displays:
195         ext/ezio/ofp-switchui.
196
197    If you passed --with-l26 to configure, "make" will also build the
198    following kernel modules:
199
200       - datapath/linux-2.6/openflow_mod.ko
201
202       - datapath/linux-2.6/hwtable_<table>_mod.ko for each <table>
203         specified on --enable-hw-tables (if any).
204
205    If you passed --with-l24 to configure, "make" will also build the
206    following kernel modules:
207
208       - datapath/linux-2.4/openflow_mod.o      
209
210       - datapath/linux-2.6/hwtable_<table>_mod.o for each <table>
211         specified on --enable-hw-tables (if any).
212
213 3. Run "make install" to install the executables and manpages into the
214    running system, by default under /usr/local.
215
216 4. If you built kernel modules, you may load them with "insmod", e.g.:
217
218       (Linux 2.6)
219       % insmod datapath/linux-2.6/openflow_mod.ko
220
221       (Linux 2.4)
222       % insmod datapath/linux-2.4/compat24_mod.o
223       % insmod datapath/linux-2.4/openflow_mod.o
224
225    After you load the openflow module, you may load one hardware switch
226    table module (if any were built) to enable support for that hardware
227    switching table.
228
229    The insmod program must be run as root.  You may need to specify a
230    full path to insmod, e.g. /sbin/insmod.  To verify that the modules
231    have been loaded, run "/sbin/lsmod" and check that openflow_mod is
232    listed.
233
234 4. Test the userspace programs, as described under Testing Userspace
235    Programs below.
236
237 5. If you built the kernel module, test the kernel-based switch, as
238    described under Testing the Kernel-Based Implementation below.
239
240 Building the Linux Kernel-Based Switch
241 --------------------------------------
242
243 To build the kernel module, follow the build process described above,
244 but pass the location of the kernel build directory as an additional
245 argument to the configure script, as described under step 1 in that
246 section.  Specify the location on --with-l26 for Linux 2.6, --with-l24
247 for Linux 2.4.  For example, to build for a running instance of Linux
248 2.6:
249
250       % ./configure --with-l26=/lib/modules/`uname -r`/build
251
252 To build for a running instance of Linux 2.4:
253
254       % ./configure --with-l24=/lib/modules/`uname -r`/build
255
256 If you wish to build OpenFlow for an architecture other than the
257 architecture used for compilation, you may specify the kernel
258 architecture string using the KARCH variable when invoking the
259 configure script. For example, to build OpenFlow for MIPS with Linux
260 2.4:
261
262       % ./configure --with-l24=/path/to/linux-2.4 KARCH=mips
263
264 If you have hardware that supports accelerated OpenFlow switching, and
265 you have obtained a hardware table module for your hardware and
266 extracted it into the OpenFlow reference distribution source tree,
267 then you may also enable building support for the hardware switching
268 table with --enable-hw-tables.  For example, if your hardware
269 switching table is in a directory named datapath/hwtable-foomatic, you
270 could compile support for it with the running Linux 2.6 kernel like
271 so:
272
273       % ./configure --with-l26=/lib/modules/`uname -r`/build \
274                     --enable-hw-tables=foomatic
275
276 For more information about hardware table modules, please read
277 README.hwtables at the root of the OpenFlow distribution tree.
278
279 Building Debian Packages
280 ========================
281
282 Follow these instructions to build Debian packages for OpenFlow.
283
284 0. Check that you have installed all the prerequisites listed above in
285    the Base Prerequisites and Debian Prerequisites sections above.
286
287 1. In the top source directory, run the following command, as root:
288
289       % dpkg-buildpackage
290
291    Alternatively, if you installed the "fakeroot" package, you may run
292    dpkg-buildpackage as an ordinary user with the following syntax:
293
294       % dpkg-buildpackage -rfakeroot
295
296    The following packages will be built in the directory above the
297    source tree:
298
299       - openflow-controller: The OpenFlow controller.  Depends on
300         openflow-pki (see below).
301
302       - openflow-switch: Install this package on a machine that acts
303         as an OpenFlow userspace or kernel switch.
304
305       - openflow-datapath-source: Source code for OpenFlow's Linux
306         kernel module.
307
308       - openflow-pki: Public-key infrastructure for OpenFlow.  Install
309         this package on a machine that acts as an OpenFlow PKI server
310         (see "Establishing a Public Key Infrastructure" below).
311
312       - openflow-common: Files and utilities required by more than one
313         of the above packages.
314
315 2. To set up an OpenFlow controller, install the openflow-controller
316    package and its dependencies.  You may configure it by editing
317    /etc/default/openflow-controller, e.g. to enable non-SSL
318    connections, which are disabled by default.  If you change the
319    default settings, you will need to restart the controller by
320    running:
321
322       % /etc/init.d/openflow-controller restart
323
324 3. To set up an OpenFlow switch, install the openflow-switch package
325    and its dependencies.  If it is to be a kernel-based switch, also
326    install openflow-datapath-source, then follow the instructions in
327    /usr/share/doc/openflow-datapath-source/README.Debian to build and
328    install the kernel module.
329
330    You may configure the switch one of the following ways:
331
332       - Completely by hand, as described under the Testing section
333         below.
334
335         For the userspace switch, this is the only supported form of
336         configuration.
337
338       - By editing /etc/default/openflow-switch.  You must at least
339         configure some network devices, by uncommenting NETDEVS and
340         adding the appropriate devices to the list, e.g. NETDEVS="eth0
341         eth1".
342
343         After you edit this file, you will need to start the switch by
344         running:
345
346            % /etc/init.d/openflow-switch restart
347
348         This form of configuration is not supported for the userspace
349         switch.
350
351       - By running the ofp-switch-setup program.  This interactive
352         program will walk you through all the steps of configuring an
353         OpenFlow switch, including configuration of SSL certificates.
354         Run it without arguments, as root:
355
356            % ofp-switch-setup
357
358         This form of configuration is not supported for the userspace
359         switch.
360
361 Testing
362 =======
363
364 The following sets of instructions show how to use the OpenFlow
365 reference implementation as a switch on a single machine.  This can be
366 used to verify that the distribution built properly.  For full
367 installation instructions, refer to the Installation section below.
368
369 Userspace Switch
370 ----------------
371
372 These instructions use the OpenFlow userspace switch that runs as an
373 integrated userspace program.
374
375 1. Start the OpenFlow controller running in the background, by running
376    the "controller" program with a command like the following:
377
378       # controller ptcp: &
379
380    This command causes the controller to bind to port 6633 (the
381    default) awaiting connections from OpenFlow switches.  See
382    controller(8) for details.
383
384    The "controller" program does not require any special privilege, so
385    you do not need to run it as root.
386    
387 2. The "switch" program must run as root, so log in as root, or use a
388    program such as "su" to become root temporarily.
389
390 3. On the same machine, use the "switch" program to start an OpenFlow
391    switch, specifying network devices to use as switch ports on the -i
392    option as a comma-separated list, like so:
393
394       # switch tcp:127.0.0.1 -i eth1,eth2
395    
396    The network devices that you specify should not have configured IP
397    addresses.
398
399 4. The controller causes each switch that connects to it to act like a
400    learning Ethernet switch.  Thus, devices plugged into the specified
401    network ports should now be able to send packets to each other, as
402    if they were plugged into ports on a conventional Ethernet switch.
403
404 Troubleshooting: if the commands above do not work, try using the -v
405 or --verbose option on the controller or switch commands, which will
406 cause a large amount of debug output from each program.
407
408 Userspace Datapath
409 ------------------
410
411 These instructions use the OpenFlow userspace datapath ("udatapath").
412 The udatapath program is part of the OpenFlow extensions repository,
413 which is not included in every OpenFlow distribution.
414
415 1. Start the OpenFlow controller running in the background, by running
416    the "controller" program with a command like the following:
417
418       # controller punix:/var/run/controller.sock &
419
420    This command causes the controller to bind to the specified Unix
421    domain socket, awaiting connections from OpenFlow switches.  See
422    controller(8) for details.
423
424    The "controller" program does not require any special privilege, so
425    you do not need to run it as root.
426    
427 2. The commands below must run as root, so log in as root, or use a
428    program such as "su" to become root temporarily.
429
430 3. Create a datapath instance running in the background.  The command
431    below creates a datapath that listens for connections from secchan
432    on a Unix domain socket located in /var/run and services physical
433    ports eth1 and eth2:
434
435       # udatapath punix:/var/run/dp0.sock -i eth1,eth2 &
436
437 4. Run secchan to start the secure channel connecting the datapath and
438    the controller:
439
440       # secchan unix:/var/run/controller.sock unix:/var/run/dp0.sock &
441    
442 5. Devices plugged into the network ports specified in step 2 should
443    now be able to send packets to each other, as if they were plugged
444    into ports on a conventional Ethernet switch.
445
446 Installation
447 ============
448
449 This section explains how to install OpenFlow in a network with one
450 controller and one or more switches, each of which runs on a separate
451 machine.  Before you begin, you must decide on one of two ways for
452 each switch to reach the controller over the network:
453
454       - Use a "control network" that is completely separate from the
455         "data network" to be controlled ("out-of-band control").  The
456         location of the controller must be configured manually in this
457         case.
458
459         All three switch implementations support only out-of-band
460         control.
461
462       - Use the same network for control and for data ("in-band
463         control").  When in-band control is used, the location of the
464         controller may be configured manually or discovered
465         automatically.  We will assume manual configuration here;
466         please refer to secchan(8) for instructions on setting up
467         controller discovery.  
468
469         The userspace datapath-based and kernel-based switch
470         implementations support in-band control.  The userspace switch
471         does not.
472
473 Controller Setup
474 ----------------
475
476 On the machine that is to be the OpenFlow controller, start the
477 "controller" program listening for connections from switches on TCP
478 port 6633 (the default), as shown below.
479
480    # controller -v ptcp:
481
482 (See controller(8) for more details)
483
484 Make sure the machine hosting the controller is reachable by the
485 switch.
486
487 Userspace Switch-Based Setup
488 ----------------------------
489
490 To set up an OpenFlow switch using the userspace switch, follow this
491 procedure.  The userspace switch must be connected to the controller
492 over a "control network" that is physically separate from the one that
493 the switch and controller are controlling.  (The kernel-based and
494 userspace datapath-based switches do not have this limitation.)
495
496 0. The commands below must run as root, so log in as root, or use a
497    program such as "su" to become root temporarily.
498
499 1. Use the "switch" program to start an OpenFlow switch, specifying
500    the IP address of the controller as the first argument to the
501    switch program, and the network devices to include in the switch as
502    arguments to the -i option.  For example, if the controller is
503    running on host 192.168.1.2 port 6633 (the default port), and eth1
504    and eth2 are to be the switch ports, the switch invocation would
505    look like this:
506
507       # switch tcp:127.0.0.1 -i eth1,eth2
508    
509    The network devices that you specify should not have configured IP
510    addresses.
511
512 2. The controller causes each switch that connects to it to act like a
513    learning Ethernet switch.  Thus, devices plugged into the specified
514    network ports should now be able to send packets to each other, as
515    if they were plugged into ports on a conventional Ethernet switch.
516
517 Userspace Datapath-Based Setup
518 ------------------------------
519
520 On a machine that is to host an OpenFlow userspace datapath-based
521 switch, follow the procedure below.  These instructions require the
522 OpenFlow userspace datapath ("udatapath").  The udatapath program is
523 part of the OpenFlow extensions repository, which is not included in
524 every OpenFlow distribution.
525
526 0. The commands below must run as root, so log in as root, or use a
527    program such as "su" to become root temporarily.
528
529 1. Create a datapath instance running in the background.  The command
530    below creates a datapath that listens for connections from secchan
531    on a Unix domain socket located in /var/run, services physical
532    ports eth1 and eth2, and creates a TAP network device named "tap0"
533    for use in in-band control:
534
535       # udatapath punix:/var/run/dp0.sock -i eth1,eth2 --local-port=tap:tap0 &
536
537    (See udatapath(8) for details.)
538
539    If the switch will connect to the controller out-of-band, then the
540    --local-port option may be omitted, or --no-local-port may be
541    substituted.
542
543 3. Arrange so that the switch can reach the controller over the
544    network.
545
546       - If you are using out-of-band control, at this point make sure
547         that the switch machine can reach the controller over the
548         network.
549
550       - If you are using in-band control with manual configuration, at
551         this point the TAP network device created in step 1 is not
552         bridged to any physical network, so the next step depends on
553         whether connectivity is required to configure the device's IP
554         address:
555
556            * If the switch has a static IP address, you may configure
557              its IP address now, e.g.:
558
559                 # ifconfig tap0 192.168.1.1
560
561            * If the switch does not have a static IP address, e.g. its
562              IP address is obtained dynamically via DHCP, then proceed
563              to step 4.  The DHCP client will not be able to contact
564              the DHCP server until the secure channel has started up.
565
566       - If you are using in-band control with controller discovery, no
567         configuration is required at this point.  You may proceed to
568         step 4.
569
570 4. Run secchan to start the secure channel connecting the datapath to
571    a remote controller.  If the controller is running on host
572    192.168.1.2 port 6633 (the default port), the secchan invocation
573    would look like this:
574
575       # secchan unix:/var/run/dp0.sock tcp:192.168.1.2
576
577    - If you are using in-band control with controller discovery, omit
578      the second argument to the secchan command.
579
580    - If you are using out-of-band control, add --out-of-band to the
581      command line.
582
583 5. If you are using in-band control with manual configuration, and the
584    switch obtains its IP address dynamically, then you may now obtain
585    the switch's IP address, e.g. by invoking a DHCP client.  The
586    secure channel will only be able to connect to the controller after
587    an IP address has been obtained.
588
589 6. The secure channel should connect to the controller within a few
590    seconds.  It may take a little longer if controller discovery is in
591    use, because the switch must then also obtain its own IP address
592    and the controller's location via DHCP.
593
594 Testing the Kernel-Based Implementation
595 ---------------------------------------
596
597 The OpenFlow kernel module must be loaded, as described under
598 "Building Conventionally", before it may be used.
599
600 0. The commands below must run as root, so log in as root, or use a
601    program such as "su" to become root temporarily.
602
603 1. Create a datapath instance.  The command below creates a datapath
604    identified as nl:0 (see dpctl(8) for more detailed usage
605    information).
606
607       # dpctl adddp nl:0
608    
609    (In principle, openflow_mod supports multiple datapaths within the
610    same host which would be identified as nl:1, nl:2, etc., but this
611    is rarely useful in practice.)
612
613    Creating datapath nl:0 also creates a new network device named of0.
614    This network device, called the datapath's "local port", will be
615    bridged to the physical switch ports by the secchan, for use in
616    in-band control.
617
618    If you built a support module for hardware accelerated OpenFlow
619    switching and you want to use it, you must load it before creating
620    the datapath with "dpctl adddp".
621
622 2. Use dpctl to attach the datapath to physical interfaces on the
623    machine.  Say, for example, you want to create a trivial 2-port
624    switch using interfaces eth1 and eth2, you would issue the following
625    commands:
626
627       # dpctl addif nl:0 eth1
628       # dpctl addif nl:0 eth2
629
630    You can verify that the interfaces were successfully added by asking
631    dpctl to print the current status of datapath nl:0:
632
633       # dpctl show nl:0
634
635 3. Arrange so that the switch can reach the controller over the
636    network.
637
638       - If you are using out-of-band control, at this point make sure
639         that the switch machine can reach the controller over the
640         network.
641
642       - If you are using in-band control, then at this point you must
643         configure the of0 network device created in step 1.  This
644         device is not yet bridged to any physical network (because
645         secchan does that, and it is not yet running), so the next
646         step depends on whether connectivity is required to configure
647         the device's IP address:
648
649            * If the switch has a static IP address, you may configure
650              its IP address now, e.g.:
651
652                 # ifconfig of0 192.168.1.1
653
654            * If the switch does not have a static IP address, e.g. its
655              IP address is obtained dynamically via DHCP, then proceed
656              to step 4.  The DHCP client will not be able to contact
657              the DHCP server until the secure channel has started up.
658
659       - If you are using in-band control with controller discovery, no
660         configuration is required at this point.  You may proceed to
661         step 4.
662
663 4. Run secchan to start the secure channel connecting the datapath to
664    a remote controller.  If the controller is running on host
665    192.168.1.2 port 6633 (the default port), the secchan invocation
666    would look like this:
667
668       # secchan nl:0 tcp:192.168.1.2
669
670    - If you are using in-band control with controller discovery, omit
671      the second argument to the secchan command.
672
673    - If you are using out-of-band control, add --out-of-band to the
674      command line.
675
676 5. If you are using in-band control with manual configuration, and the
677    switch obtains its IP address dynamically, then you may now obtain
678    the switch's IP address, e.g. by invoking a DHCP client.  The
679    secure channel will only be able to connect to the controller after
680    an IP address has been obtained.
681
682 6. The secure channel should connect to the controller within a few
683    seconds.  It may take a little longer if controller discovery is in
684    use, because the switch must then also obtain its own IP address
685    and the controller's location via DHCP.
686
687 Configuration
688 =============
689
690 Secure operation over SSL
691 -------------------------
692
693 The instructions above set up OpenFlow for operation over a plaintext
694 TCP connection.  Production use of OpenFlow should use SSL[*] to
695 ensure confidentiality and authenticity of traffic among switches and
696 controllers.  The source must be configured with --enable-ssl=yes to
697 build with SSL support.
698
699 To use SSL with OpenFlow, you must set up a public-key infrastructure
700 (PKI) including a pair of certificate authorities (CAs), one for
701 controllers and one for switches.  If you have an established PKI,
702 OpenFlow can use it directly.  Otherwise, refer to "Establishing a
703 Public Key Infrastructure" below.
704
705 To configure the controller to listen for SSL connections on port 6633
706 (the default), invoke it as follows:
707
708       # controller -v pssl: --private-key=PRIVKEY --certificate=CERT \
709             --ca-cert=CACERT
710
711 where PRIVKEY is a file containing the controller's private key, CERT
712 is a file containing the controller CA's certificate for the
713 controller's public key, and CACERT is a file containing the root
714 certificate for the switch CA.  If, for example, your PKI was created
715 with the instructions below, then the invocation would look like:
716
717       # controller -v pssl: --private-key=ctl-privkey.pem \
718             --certificate=ctl-cert.pem --ca-cert=pki/switchca/cacert.pem
719
720 To configure a switch to connect to a controller running on port 6633
721 (the default) on host 192.168.1.2 over SSL, invoke secchan as follows:
722
723       # secchan -v DATAPATH ssl:192.168.1.2 --private-key=PRIVKEY \
724             --certificate=CERT --ca-cert=CACERT
725
726 where DATAPATH is the datapath to connect to (e.g. nl:0 or
727 unix:/var/run/dp0.sock), PRIVKEY is a file containing the switch's
728 private key, CERT is a file containing the switch CA's certificate for
729 the switch's public key, and CACERT is a file containing the root
730 certificate for the controller CA.  If, for example, your PKI was
731 created with the instructions below, then the invocation would look
732 like:
733
734       # secchan -v DATAPATH ssl:192.168.1.2 --private-key=sc-privkey.pem \
735             --certificate=sc-cert.pem --ca-cert=pki/controllerca/cacert.pem
736
737 [*] To be specific, OpenFlow uses TLS version 1.0 or later (TLSv1), as
738     specified by RFC 2246, which is very similar to SSL version 3.0.
739     TLSv1 was released in January 1999, so all current software and
740     hardware should implement it.
741
742 Establishing a Public Key Infrastructure
743 ----------------------------------------
744
745 If you do not have a PKI, the ofp-pki script included with OpenFlow
746 can help.  To create an initial PKI structure, invoke it as:
747       % ofp-pki init
748 which will create and populate a new PKI directory.  The default
749 location for the PKI directory depends on how the OpenFlow tree was
750 configured (to see the configured default, look for the --dir option
751 description in the output of "ofp-pki --help").
752
753 The pki directory contains two important subdirectories.  The
754 controllerca subdirectory contains controller certificate authority
755 related files, including the following:
756
757     - cacert.pem: Root certificate for the controller certificate
758       authority.  This file must be provided to the switch or secchan
759       program with the --ca-cert option to enable it to authenticate
760       valid controllers.
761
762     - private/cakey.pem: Private signing key for the controller
763       certificate authority.  This file must be kept secret.  There is
764       no need for switches or controllers to have a copy of it.
765
766 The switchca subdirectory contains switch certificate authority
767 related files, analogous to those in the controllerca subdirectory:
768
769     - cacert.pem: Root certificate for the switch certificate
770       authority.  This file must be provided to the controller program
771       with the --ca-cert option to enable it to authenticate valid
772       switches.
773
774     - private/cakey.pem: Private signing key for the switch
775       certificate authority.  This file must be kept secret.  There is
776       no need for switches or controllers to have a copy of it.
777
778 After you create the initial structure, you can create keys and
779 certificates for switches and controllers with ofp-pki.  To create a
780 controller private key and certificate in files named ctl-privkey.pem
781 and ctl-cert.pem, for example, you could run:
782       % ofp-pki req+sign ctl controller
783 ctl-privkey.pem and ctl-cert.pem would need to be copied to the
784 controller for its use at runtime (they could then be deleted from
785 their original locations).  The --private-key and --certificate
786 options of controller, respectively, would point to these files.
787
788 Analogously, to create a switch private key and certificate in files
789 named sc-privkey.pem and sc-cert.pem, for example, you could run: 
790       % ofp-pki req+sign sc switch
791 sc-privkey.pem and sc-cert.pem would need to be copied to the switch
792 for its use at runtime (they could then be deleted from their original
793 locations).  The --private-key and --certificate options,
794 respectively, of switch and secchan would point to these files.
795
796 Bug Reporting
797 -------------
798
799 Please report problems to: 
800 info@openflowswitch.org