OMNeT++ for Windows installation guide
INSTALLATION GUIDE FOR USING OMNeT++ UNDER WINDOWS PLATFORM By: SAIFUL FADZLI BIN SALIAN B.Eng(Hons),M.Sc(Eng) Liverpool PhD Candidate School of Electrical Engineering & Electronics USM Transkrian Nibong Tebal Seberang Prai Selatan
1. Prerequisites: You must do the followings before performing the OMNeT++ installation:
Install Microsoft Visual C++. Use the recommended installation (not Custom). Download the binary release of OMNeT++ codes and the Plove bugfix from its web page as shown in Figure 1 below.
Figure 1: Web site of OMNeT++ downloads 2. OMNeT++ installation steps: After Visual C++ has been installed in your PC, follow the following steps:
1
OMNeT++ for Windows installation guide
(i)
Double click the OMNeT++ installation program (omnetpp-2.1.exe). The following dialog box will appear as shown in Figure 2 below. Click the “NEXT” button.
Figure 2: Setup first dialog box (ii)
Then, the following installation options’ dialog box will appear. By default, it is shown as Figure 3 below. Click “NEXT”.
Figure 3: Installation options
2
OMNeT++ for Windows installation guide (iii)
The installation program will then ask you to enter the location where the OMNeT++ directory should be and the name of the directory. The default is shown below. Click “NEXT”.
Figure 4: Installation directory (iv)
The OMNeT++ files will be compiled and installed. The following status windows will show the progress of your installation and compilation. You can click the “Show Details” button to see the status in detail. There will also an MS-DOS windows appearing (not shown here) at the background. Just ignore it. After completed, click “NEXT”.
Figure 5: Installation progress
3
OMNeT++ for Windows installation guide (v)
The dialog box in Figure 6 will then appear. Click “yes” if you want the Plove, GNED and the OMNeT++ user manual to appear on your desktop.
Figure 6 (vi)
Then, the dialog box in Figure 7 appear. Just click “Yes”.
Figure 7 (vii) Now, your OMNeT++ has been installed. The following windows will appear showing what to do for the post installation of OMNeT++. Its fine if you don’t understand the messages. You will be guided in the next section. Just click “OK”.
Figure 8: Post installation guide
4
OMNeT++ for Windows installation guide (viii) You will then be asked whether to view the README file as shown in Figure 9. The README file contains instructions for configuration of OMNeT++ under Visual C++ IDE. Its fine if you don’t understand the instructions. You will be guided in the next section.
Figure 9: README file 3. Post installation and configuration of OMNeT++ under Visual C++ IDE: You are going to develop all your OMNeT++ programs in Visual C++. In order for OMNeT++ to run correctly, some post installation procedure must be followed. Follow the following instructions: (i)
You must write the text PATH=C:\OMNeT++\bin in AUTOEXEC.BAT file. You can find your AUTOEXEC.BAT file in C:\ directory. If you don’t have, create one using Notepad. If the file is there, open the file using Notepad. Put the above text at the bottom of the file as shown in Figure 10 below. Then, save.
5
OMNeT++ for Windows installation guide
Figure 10: AUTOEXEC.BAT file (ii)
Shut down your Windows and restart. This is for the above setting to take effect.
(iii)
Now, we are going to perform configuration of OMNeT++ under Visual C++ IDE. Please check the Macros directory of Visual C++ (C:\Program Files\Microsoft Visual Studio\Common\MSDev\Macros) for the omnetpp.dsm file. It should be in that location (done automatically by OMNeT++ installation).
(iv)
Then, open Visual C++. We are going to add an icon on the Visual C++ IDE for adding NED files automatically to our OMNeT++ project. By referring to Figure 11, click “Customize…”. A customization window will be opened.
6
OMNeT++ for Windows installation guide
Figure 11: Customizing Visual C++ IDE (v)
At the customization window as shown in Figure 12, click the “Add-ins and Macro Files”. Select “omnetpp”.
Figure 12: Customization window
7
OMNeT++ for Windows installation guide
(vi)
At the same customization window, click at the “Commands” tab. Choose the “Macros” at the Category combo box. Drag and drop the command text “addNEDfileToProject” command to the toolbar as shown in Figure 13 below. Visual C++ will prompt you to choose an icon for it.
Figure 13: Creating icons for adding NED files to projects (vii) We have ended our post installation process. Now, we are ready to use our OMNeT++ for Windows. In the next section we will try to compile and run one of the OMNeT++ samples.
8
OMNeT++ for Windows installation guide
4. Compiling and running OMNeT++ samples We are going to compile and run the token ring network sample available at the C:\OMNeT++\samples directory. If it works, your installation of OMNeT++ is correct and you are ready to build your own project codes. Follow the following steps: (i)
From the Visual C++ IDE, click File → Open to open the Token Ring sample project. As shown in the OPEN dialog box in Figure 14 below, make sure you are at C:\OMNeT++\samples\token. Then, at the “Files of type” combo box, change to “Workspaces(.dsw,.mdp)”. Choose “token.dsw” and click “Open” button.
Figure 14: Opening The Token Ring Network Sample (ii)
Now, the token ring project files are opened. Click at the “FileView” tab as shown in Figure 15 below. You can see all the project files. If you click to any one of the files, you can view the code listings.
9
OMNeT++ for Windows installation guide
Figure 15: The Token Ring project is opened (iii)
From the Visual C++ menu, click at Build → Set Active Configuration. The Set Active Project Configuration window will appear as shown in Figure 16 below. Here, you can choose what interface the token ring program should run. For graphical animation, choose Win32 Debug Tkenv.
Figure 16: Setting active project configuration (iv)
Then, from the Visual C++ menu, click at Build → Build token.exe. This will compile and link automatically all the token ring program files. If there is no error,
10
OMNeT++ for Windows installation guide the following result will appear at the Build status frame at the bottom of the Visual C++ IDE as shown below. There is neither an error nor a warning. So, our compilation is successful. The token ring program is now ready to be executed.
Figure 17: Build status bar indicating a successful compilation of the token program (v)
In order to run the token.exe, click the Build → Execute token.exe from the Visual C++ menu. A Tkenv, some dialog boxes and a topology window will pop up showing the token ring network as shown in Figure 18 and Figure 19 below. However, there are some error messages appear when OMNeT++ attempts to open the topology window. The error messages are about the icons that OMNeT++ try to load but it fails to find its location. So, OMNeT++ will use default icons. Just ignore the error messages, anyway. However, if you don’t want these error messages to appear every time you execute token.exe, you can copy the icons from C:\OMNeT++\bitmaps to the token project directory (i.e. C:\OMNeT++\samples\token). The icon that the token program used is “pc”.
11
OMNeT++ for Windows installation guide
Figure 18: Tkenv window
Figure 19: topology window (vi)
Finally, at the Tkenv window above, click at the RUN button. The token ring program will run and you can now see some animations at the topology window. Therefore, your OMNeT++ installation has been successfully done. You can now start to develop your own OMNeT++ project under Visual C++.
12