]> git.proxmox.com Git - ovs.git/blame - INSTALL.Windows.md
OpenFlow 1.5 is final, so change OF1.5 draft references to just say OF1.5.
[ovs.git] / INSTALL.Windows.md
CommitLineData
542cc9bb
TG
1How to Build the Kernel module & userspace daemons for Windows
2==============================================================
c803536e
SS
3
4Autoconf, Automake and Visual C++:
5---------------------------------
6Open vSwitch on Linux uses autoconf and automake for generating Makefiles.
7It will be useful to maintain the same build system while compiling on Windows
8too. One approach is to compile Open vSwitch in a MinGW environment that
9contains autoconf and automake utilities and then use Visual C++ as a compiler
10and linker.
11
12The following explains the steps in some detail.
13
14* Install Mingw on a Windows machine by following the instructions at:
15http://www.mingw.org/wiki/Getting_Started
16
17This should install mingw at C:\Mingw and msys at C:\Mingw\msys.
18Add "C:\MinGW\bin" and "C:\Mingw\msys\1.0\bin" to PATH environment variable
19of Windows.
20
21You can either use the MinGW installer or the command line utility 'mingw-get'
22to install both the base packages and additional packages like automake and
23autoconf(version 2.68).
24
25Also make sure that /mingw mount point exists. If its not, please add/create
26the following entry in /etc/fstab - 'C:/MinGW /mingw'.
27
28* Install the latest Python 2.x from python.org and verify that its path is
29part of Windows' PATH environment variable.
30
31* You will need at least Visual Studio 2013 to compile userspace binaries. In
32addition to that, if you want to compile the kernel module you will also need to
33install Windows Driver Kit (WDK) 8.1 Update.
34
35It is important to get the Visual Studio related environment variables and to
36have the $PATH inside the bash to point to the proper compiler and linker. One
37easy way to achieve this is to get into the "Developer Command prompt for visual
38studio" and through it enter into the bash shell available from msys.
39
40If after the above step, a 'which link' inside MSYS's bash says,
41"/bin/link.exe", rename /bin/link.exe to something else so that the
42Visual studio's linker is used.
43
44* For pthread support, install the library, dll and includes of pthreads-win32
45project from
46ftp://sourceware.org/pub/pthreads-win32/prebuilt-dll-2-9-1-release to a
47directory (e.g.: C:/pthread).
48
49* Get the Open vSwitch sources from either cloning the repo using git
50or from a distribution tar ball.
51
52* If you pulled the sources directly from an Open vSwitch Git tree,
53 run boot.sh in the top source directory:
54
542cc9bb 55 % ./boot.sh
c803536e
SS
56
57* In the top source directory, configure the package by running the
58 configure script. You should provide some configure options to choose
59 the right compiler, linker, libraries, Open vSwitch component installation
60 directories, etc. For example,
61
542cc9bb
TG
62 % ./configure CC=./build-aux/cccl LD="`which link`" LIBS="-lws2_32" \
63 --prefix="C:/openvswitch/usr" --localstatedir="C:/openvswitch/var" \
64 --sysconfdir="C:/openvswitch/etc" --with-pthread="C:/pthread"
c803536e 65
b0e1bce5
GS
66 By default, the above enables compiler optimization for fast code.
67 For default compiler optimization, pass the "--with-debug" configure
68 option.
69
c803536e
SS
70* Run make for the ported executables in the top source directory, e.g.:
71
542cc9bb 72 % make
d9d8dbc8
NR
73
74* To run all the unit tests:
75
542cc9bb 76 % make check
c803536e
SS
77
78OpenSSL, Open vSwitch and Visual C++
79------------------------------------
80To get SSL support for Open vSwitch on Windows, do the following:
81
82* Install OpenSSL for Windows as suggested at
83http://www.openssl.org/related/binaries.html.
84The link as of this writing suggests to download it from
bb996e5b 85http://slproweb.com/products/Win32OpenSSL.html
c803536e
SS
86
87Note down the directory where OpenSSL is installed (e.g.: C:/OpenSSL-Win32).
88
89* While configuring the package, specify the OpenSSL directory path.
90For example,
91
542cc9bb
TG
92 % ./configure CC=./build-aux/cccl LD="`which link`" LIBS="-lws2_32" \
93 --prefix="C:/openvswitch/usr" --localstatedir="C:/openvswitch/var" \
94 --sysconfdir="C:/openvswitch/etc" --with-pthread="C:/pthread" \
95 --enable-ssl --with-openssl="C:/OpenSSL-Win32"
c803536e
SS
96
97* Run make for the ported executables.
98
978ce0e9
NR
99Building the Kernel datapath module
100-----------------------------------
101* We directly use the Visual Studio 2013 IDE to compile the kernel datapath.
102You can open the extensions.sln file in the IDE and build the solution.
103
104* The kernel datapath can be compiled from command line as well. The top
105level 'make' will invoke building the kernel datapath, if the
106'--with-vstudioddk' argument is specified while configuring the package.
107For example,
108
109 % ./configure CC=./build-aux/cccl LD="`which link`" LIBS="-lws2_32" \
110 --prefix="C:/openvswitch/usr" --localstatedir="C:/openvswitch/var" \
111 --sysconfdir="C:/openvswitch/etc" --with-pthread="C:/pthread" \
112 --enable-ssl --with-openssl="C:/OpenSSL-Win32" \
113 --with-vstudioddk="<WDK to use>"
114
115 Possible values for "<WDK to use>" are:
116 "Win8.1 Debug", "Win8.1 Release", "Win8 Debug" and "Win8 Release".
c803536e
SS
117
118Installing the Kernel module
119----------------------------
120Once you have built the solution, you can copy the following files to the
978ce0e9 121target Hyper-V machines.
c803536e
SS
122
123 ./datapath-windows/x64/Win8.1Debug/package/ovsext.inf
124 ./datapath-windows/x64/Win8.1Debug/package/OVSExt.sys
125 ./datapath-windows/x64/Win8.1Debug/package/ovsext.cat
126 ./datapath-windows/misc/install.cmd
127 ./datapath-windows/misc/uninstall.cmd
128
978ce0e9
NR
129The above path assumes that the kernel module has been built using Windows
130DDK 8.1 in Debug mode. Change the path appropriately, if a different WDK
131has been used.
132
c803536e
SS
133Steps to install the module
134---------------------------
135
13601> Run ./uninstall.cmd to remove the old extension.
13702> Run ./install.cmd to insert the new one. For this to work you will have to
138turn on TESTSIGNING boot option or 'Disable Driver Signature Enforcement'
139during boot.
14003> In the Virtual Switch Manager configuration you should now see "VMWare OVS
141Extension" under 'Virtual Switch Extensions'. Click the check box to enable the
142extension.
143
144Steps to run the user processes & configure VXLAN ports
145-------------------------------------------------------
146
14701> Create the conf db file.
148ovsdb\ovsdb-tool.exe create conf.db .\vswitchd\vswitch.ovsschema
149
15002> Run ovsdb-server
151ovsdb\ovsdb-server.exe -v --remote=ptcp:6632:127.0.0.1 conf.db
152
15303> Create integration bridge & pif bridge
154utilities\ovs-vsctl.exe --db=tcp:127.0.0.1:6632 add-br br-int
155utilities\ovs-vsctl.exe --db=tcp:127.0.0.1:6632 add-br br-pif
156
15704> Dump the ports
158utilities\ovs-dpctl.exe show
159
160* Sample output shows up like this. Currently it is not possible to figure out
161* the mapping between VIF and VM from the output.
162
163$ utilities\ovs-dpctl.exe show
1642014-06-27T01:55:32Z|00001|socket_util|ERR|4789:0.0.0.0:
165socket: Either the application has not called WSAStartup, or WSAStartup failed.
166 <<< Ignore this error, it is harmless.
167system@ovs-system:
168 lookups: hit:0 missed:0 lost:0
169 flows: 0
170 masks: hit:0 total:0 hit/pkt:0.00
171 port 16777216: internal <<< VTEP created by AllowManagementOS
172 setting
173 port 16777225: external.1 <<< Physical NIC
174 port 16777288: vmNICEmu.1000048 <<< VIF #1
175 port 16777289: vmNICSyn.1000049 <<< VIF #2
176
177
17805> Add the physical NIC and the internal port to br-pif
179utilities\ovs-vsctl.exe --db=tcp:127.0.0.1:6632 add-port br-pif <port name>
180
181Eg:
182utilities\ovs-vsctl.exe --db=tcp:127.0.0.1:6632 add-port br-pif external.1
183utilities\ovs-vsctl.exe --db=tcp:127.0.0.1:6632 add-port br-pif internal
184
18506> Add the VIFs to br-int
186utilities\ovs-vsctl.exe --db=tcp:127.0.0.1:6632 add-port br-int <port name>
187
188Eg:
189utilities\ovs-vsctl.exe --db=tcp:127.0.0.1:6632 add-port br-int vmNICEmu.1000048
190utilities\ovs-vsctl.exe --db=tcp:127.0.0.1:6632 add-port br-int vmNICSyn.1000049
191
19207> Verify the status
193utilities\ovs-vsctl.exe --db=tcp:127.0.0.1:6632 show
194
195Eg:
196$ utilities\ovs-vsctl.exe --db=tcp:127.0.0.1:6632 show
1974cd86499-74df-48bd-a64d-8d115b12a9f2
198 Bridge br-pif
199 Port internal
200 Interface internal
201 Port "external.1"
202 Interface "external.1"
203 Port br-pif
204 Interface br-pif
205 type: internal
206 Bridge br-int
207 Port br-int
208 Interface br-int
209 type: internal
210 Port "vmNICEmu.1000048"
211 Interface "vmNICEmu.1000048"
212 Port "vmNICSyn.1000049"
213 Interface "vmNICSyn.1000049"
214
215
21609> Run vswitchd
217vswitchd\ovs-vswitchd.exe -v tcp:127.0.0.1:6632
218
21910> You can figure out the port name to MAC address mapping now. (optional)
220utilities\ovs-vsctl.exe --db=tcp:127.0.0.1:6632 list interface
221
222//********** VXLAN PORT CONFIGURATION (Supports Multiple ports) ************//
d9d8dbc8 223(Remove all patch ports added to create VLAN networks.)
c803536e
SS
22411> Add the vxlan port between 172.168.201.101 <-> 172.168.201.102
225utilities\ovs-vsctl.exe --db=tcp:127.0.0.1:6632 add-port br-int vxlan-1
226utilities\ovs-vsctl.exe --db=tcp:127.0.0.1:6632 set Interface vxlan-1 type=vxlan
227utilities\ovs-vsctl.exe --db=tcp:127.0.0.1:6632 set Interface vxlan-1 options:local_ip=172.168.201.101
228utilities\ovs-vsctl.exe --db=tcp:127.0.0.1:6632 set Interface vxlan-1 options:remote_ip=172.168.201.102
229utilities\ovs-vsctl.exe --db=tcp:127.0.0.1:6632 set Interface vxlan-1 options:in_key=flow
230utilities\ovs-vsctl.exe --db=tcp:127.0.0.1:6632 set Interface vxlan-1 options:out_key=flow
231
23212> Add the vxlan port between 172.168.201.101 <-> 172.168.201.105
233utilities\ovs-vsctl.exe --db=tcp:127.0.0.1:6632 add-port br-int vxlan-2
234utilities\ovs-vsctl.exe --db=tcp:127.0.0.1:6632 set Interface vxlan-2 type=vxlan
235utilities\ovs-vsctl.exe --db=tcp:127.0.0.1:6632 set Interface vxlan-2 options:local_ip=172.168.201.102
236utilities\ovs-vsctl.exe --db=tcp:127.0.0.1:6632 set Interface vxlan-2 options:remote_ip=172.168.201.105
237utilities\ovs-vsctl.exe --db=tcp:127.0.0.1:6632 set Interface vxlan-2 options:in_key=flow
238utilities\ovs-vsctl.exe --db=tcp:127.0.0.1:6632 set Interface vxlan-2 options:out_key=flow
239
240
d9d8dbc8
NR
241//********** VLAN CONFIGURATION (Using patch ports) ************//
242(Remove all VXLAN ports from the configuration.)
24313> Add a patch port from br-int to br-pif
244utilities/ovs-vsctl.exe -- add-port br-int patch-to-pif
245utilities/ovs-vsctl.exe -- set interface patch-to-pif type=patch options:peer=patch-to-int
246
24714> Add a patch port from br-pif to br-int
248utilities/ovs-vsctl.exe -- add-port br-pif patch-to-int
249utilities/ovs-vsctl.exe -- set interface patch-to-int type=patch options:peer=patch-to-pif
250
25115> Re-Add the VIF ports with the VLAN tag
252utilities\ovs-vsctl.exe add-port br-int vmNICEmu.1000048 tag=900
253utilities\ovs-vsctl.exe add-port br-int vmNICSyn.1000049 tag=900
254
255
c803536e
SS
256Requirements
257------------
258
259* We require that you don't disable the "Allow management operating system to
260share this network adapter" under 'Virtual Switch Properties' > 'Connection
261type: External network', in the HyperV virtual network switch configuration.
262
263* Checksum Offloads
264 While there is some support for checksum/segmentation offloads in software,
265this is still a work in progress. Till the support is complete we recommend
266disabling TX/RX offloads for both the VM's as well as the HyperV.
267
d8a24927
GS
268Windows autobuild service
269-------------------------
270
271AppVeyor (appveyor.com) provides a free Windows autobuild service for
272opensource projects. Open vSwitch has integration with AppVeyor for
273continuous build. A developer can build test his changes for Windows by
274logging into appveyor.com using a github account, creating a new project
275by linking it to his development repository in github and triggering
276a new build.
c803536e 277
d9d8dbc8 278TODO
c803536e
SS
279----
280
c803536e
SS
281* Investigate the working of sFlow on Windows and re-enable the unit tests.
282
abe6d620
GS
283* Investigate and add the feature to provide QOS.
284
c803536e
SS
285* Sign the driver & create an MSI for installing the different OpenvSwitch
286components on windows.