dlinknctu / OpenNet

A Simulator for Software-Defined Wireless Local Area Network
GNU General Public License v2.0
72 stars 44 forks source link

problem with binding python #93

Open nasrin-seifi opened 8 years ago

nasrin-seifi commented 8 years ago

Hi, Could you do me a favor? I'm beginner in ns3 and opennet, first i read tutorial and step by step installed every requirements after that by using tarball downloaded and build and configure ns3.25. when bind pygccxml, I receive this message:

mininet@ubuntu:~/ns-allinone-3.25/ns-3.25$ ./waf --pyrun examples/wireless/mixed-wireless.py Waf: Entering directory `/home/mininet/ns-allinone-3.25/ns-3.25/build' [ 296/1851] Processing command (${PYTHON}): ../bindings/python/ns3modulegen-modular.py ../src/internet/bindings/modulegen__gcc_ILP32.py -> src/internet/bindings/ns3module.cc src/internet/bindings/ns3module.h src/internet/bindings/ns3modulegen.log

Waf: Leaving directory `/home/mininet/ns-allinone-3.25/ns-3.25/build' Build failed -> task in 'pybindgen(ns3 module internet)' failed (exit status 1): {task 3064338124L: command_task ns3modulegen-modular.py,modulegen__gcc_ILP32.py -> ns3module.cc,ns3module.h,ns3modulegen.log} ''

when I use opennet again there is problem:

root@ubuntu:~/OpenNet/mininet-patch/examples/opennet# python wifiroaming.py Traceback (most recent call last): File "wifiroaming.py", line 14, in import mininet.ns3 File "build/bdist.linux-i686/egg/mininet/ns3.py", line 40, in ImportError: No module named ns.core

"mininet" and after that "mininet-ns3 integration" was installed.

Thanks in advance.

kansokusha commented 8 years ago

The example script, wifiroaming.py, only works with complete OpenNet installation.

It seems that your OpenNet have not be installed properly. Please follow instructions in README to install OpenNet.

Current OpenNet only support NS-3.22. So, we will not give comments about other version of NS-3.

kansokusha commented 8 years ago

It seems that you have still not completed the installation yet. If you use our installation script, the parent directory of ns-allinone-3.22 should be OpenNet.

There is a quick work-around for your environment:

  1. cd ~/ns-allinone-3.22/ns-3.22
  2. ./waf install Above instructions should can solve import error of ns.core.

But without complete installation, there may be other issues.

kansokusha commented 8 years ago

This is the main repository of OpenNet.

Please type follow command in directory of ns-3.22: ./waf configure This command will configure the building target of ns-3.22.

Please ensure the status of following options are enabled. Python Bindings : enabled Python API Scanning Support : enabled

One major purpose of our installation script is make sure above options are enabled.

If these options can not be enabled, means your environment have not be configured correctly.

Please follow below steps to setup OpenNet:

  1. Remove all files and directories under /tmp
  2. Remove directory of OpenNet
  3. Remove directories of NS-3 and Mininet
  4. Open a new terminal and type: sudo su -
  5. apt-get install git ssh
  6. git clone https://github.com/dlinknctu/OpenNet.git
  7. cd OpenNet
  8. ./configure.sh
  9. ./install.sh master
  10. Wait until the terminal prints "OpenNet installation has completed."
  11. git clone https://github.com/noxrepo/pox.git
  12. cd pox
  13. ./pox.py forwarding.l2_learning &
  14. cd ../mininet/examples/opennet
  15. python wifiroaming.py

Please do not try to run the example script without complete installation. And please run the example script under mininet/examples, not mininet-patch/examples.

If still encounter issues, please screen-shot the error message. Error messages without proper composing are difficult to understand.

kansokusha commented 8 years ago

It seems that the problem is at SSH key deployment.

Below screen-shot shows SSH key deployment progress of OpenNet, on a new Ubuntu VM: ssh-deployment

At the step of "***copying public key to master", there should not acquire password from user.

Please switch to root via "sudo su -", then type the following commands:

  1. ssh-keyscan -H master >> /root/.ssh/known_hosts
  2. ssh-copy-id -i /root/.ssh/cluster_key.pub root@master &> /dev/null

Then change the directory to OpenNet and try to run "./install.sh master" again. The installation script should work.

nismyi commented 7 years ago

Hi there, Are all theses NS3 and mininet source codes should be inside the OpenNet Directory? Which one I should install first NS3 or Mininet?

Thank you

kansokusha commented 7 years ago

"Directory of source code" and "sequence of installation" are not matter, both NS-3 and Mininet should be installed in Linux libraries.

For NS-3, in ns-allinone-3.22/ns-3.22:

./waf build
./waf install

For Mininet, in mininet/util:

./install.sh -n
nismyi commented 7 years ago

Thank you, but I don't understand why I am having this hangout. When I try to use this command in ns-allinone-3.22: ./build.py --enable-example --enable-tests ns3_build

I am having this same problem at the same location on ubuntu16.04 in NS-3.25 version also.

kansokusha commented 7 years ago

Building NS-3 LTE module is very time-consuming. Please give your environment more CPU thread and RAM.