ndnSIM learning - install ndnSIM stepping pit: a solution to git inaccessibility (connection timeout) when cloning ndnSIM

Keywords: git github

preface

Today, I installed the network simulation software ndnSIM. I used Ubuntu 20.04. The installed version is ndnSIM 2.8. Tell me all the pits I've stepped on.

Follow the official tutorial https://ndnsim.net/current/getting-started.html , the installation code of Ubuntu 20.04 should be

sudo apt install build-essential libsqlite3-dev libboost-all-dev libssl-dev git python3-setuptools castxml

sudo apt install gir1.2-goocanvas-2.0 gir1.2-gtk-3.0 libgirepository1.0-dev python3-dev python3-gi python3-gi-cairo python3-pip python3-pygraphviz python3-pygccxml
sudo pip3 install kiwi

mkdir ndnSIM
cd ndnSIM
git clone https://github.com/named-data-ndnSIM/ns-3-dev.git ns-3
git clone https://github.com/named-data-ndnSIM/pybindgen.git pybindgen
git clone --recursive https://github.com/named-data-ndnSIM/ndnSIM.git ns-3/src/ndnSIM

cd <ns-3-folder>
./waf configure --enable-examples
./waf

However, we have encountered many problems. Let's solve them step by step.

Download speed is too slow

apt install was slow to download at first because the image source was not used. Tsinghua image source is used here. Refer to the link https://blog.csdn.net/dou3516/article/details/108196179

git clone is too slow or even inaccessible

Solution: use the image of GitHub, such as image https://github.com.cnpmjs.org/ (or https://hub.fastgit.org/ )Replace https://github.com/ , example code:

sudo apt install build-essential libsqlite3-dev libboost-all-dev libssl-dev git python3-setuptools castxml

sudo apt install gir1.2-goocanvas-2.0 gir1.2-gtk-3.0 libgirepository1.0-dev python3-dev python3-gi python3-gi-cairo python3-pip python3-pygraphviz python3-pygccxml
sudo pip3 install kiwi

mkdir ndnSIM
cd ndnSIM
git clone https://github.com.cnpmjs.org/named-data-ndnSIM/ns-3-dev.git ns-3
git clone https://github.com.cnpmjs.org/named-data-ndnSIM/pybindgen.git pybindgen
git clone --recursive https://github.com.cnpmjs.org/named-data-ndnSIM/ndnSIM.git ns-3/src/ndnSIM

cd <ns-3-folder>
./waf configure --enable-examples
./waf

– the recursion parameter prevents the sub module from using git image

There is also a problem at this time, because the code git clone -- recursive at the penultimate line at the beginning of the article https://github.com/named-data-ndnSIM/ndnSIM.git Ns-3 / SRC / ndnsim uses -- recursive to download sub files recursively. However, in recursive download, it will be used again https://github.com/ If there is no image acceleration, such an error will be reported

Cloning to '/home/ndn/ndnSIM/ns-3/src/ndnSIM/NFD'...
fatal: cannot access 'https://github.com/named-data-ndnSIM/NFD/': GnuTLS recv error (-54): Error in the pull function.
fatal: Unable to clone 'https://GitHub. COM / named data ndnsim / NFD 'path to submodule' / home/ndn/ndnSIM/ns-3/src/ndnSIM/NFD '
clone 'NFD' Failed. Retry as scheduled
 Cloning to '/home/ndn/ndnSIM/ns-3/src/ndnSIM/ndn-cxx'...
fatal: cannot access 'https://GitHub. COM / named data ndnsim / NDN cxx / ': Failed to connect to github.com port 443: connection denied
fatal: Unable to clone 'https://GitHub. COM / named data ndnsim / NDN cxx 'path to submodule' / home / NDN / ndnsim / ns-3 / SRC / ndnsim / NDN cxx '
clone 'ndn-cxx' Failed. Retry as scheduled
 Cloning to '/home/ndn/ndnSIM/ns-3/src/ndnSIM/NFD'...
fatal: cannot access 'https://github.com/named-data-ndnSIM/NFD / ': Failed to connect to github.com port 443: connection denied
fatal: Unable to clone 'https://GitHub. COM / named data ndnsim / NFD 'path to submodule' / home/ndn/ndnSIM/ns-3/src/ndnSIM/NFD '
Second attempt to clone 'NFD' Failed, exit

In fact, the sub files are only NDN cxx and NFD, so we can download them manually with the image. Specifically, the code is git clone -- recursive https://github.com/named-data-ndnSIM/ndnSIM.git Ns-3 / SRC / ndnsim changed to

git clone https://github.com.cnpmjs.org/named-data-ndnSIM/ndnSIM.git ns-3/src/ndnSIM
git clone https://github.com.cnpmjs.org/named-data-ndnSIM/NFD ns-3/src/ndnSIM/NFD
git clone https://github.com.cnpmjs.org/named-data-ndnSIM/ndn-cxx ns-3/src/ndnSIM/ndn-cxx

Complete code——

sudo apt install build-essential libsqlite3-dev libboost-all-dev libssl-dev git python3-setuptools castxml

sudo apt install gir1.2-goocanvas-2.0 gir1.2-gtk-3.0 libgirepository1.0-dev python3-dev python3-gi python3-gi-cairo python3-pip python3-pygraphviz python3-pygccxml
sudo pip3 install kiwi

mkdir ndnSIM
cd ndnSIM
git clone https://github.com.cnpmjs.org/named-data-ndnSIM/ns-3-dev.git ns-3
git clone https://github.com.cnpmjs.org/named-data-ndnSIM/pybindgen.git pybindgen
git clone https://github.com.cnpmjs.org/named-data-ndnSIM/ndnSIM.git ns-3/src/ndnSIM
git clone https://github.com.cnpmjs.org/named-data-ndnSIM/NFD ns-3/src/ndnSIM/NFD
git clone https://github.com.cnpmjs.org/named-data-ndnSIM/ndn-cxx ns-3/src/ndnSIM/ndn-cxx

cd <ns-3-folder>
./waf configure --enable-examples
./waf

No module named 'openssl'

This problem is outrageous. There is no reliable solution on the Internet. Follow link http://www.04007.cn/article/478.html I tried. However, both import OpenSSL and import ssl are OK, but import OpenSSL is uncertain. Errors are reported as follows

Traceback (most recent call last):
  File "/home/ndn/ndnSIM/ns-3/.waf3-2.0.18-ff4ae9f5cc05353d3dc3aeff8854ae69/waflib/Scripting.py", line 119, in waf_entry_point
    run_commands()
  File "/home/ndn/ndnSIM/ns-3/.waf3-2.0.18-ff4ae9f5cc05353d3dc3aeff8854ae69/waflib/Scripting.py", line 178, in run_commands
    parse_options()
  File "/home/ndn/ndnSIM/ns-3/.waf3-2.0.18-ff4ae9f5cc05353d3dc3aeff8854ae69/waflib/Scripting.py", line 158, in parse_options
    ctx.execute()
  File "/home/ndn/ndnSIM/ns-3/.waf3-2.0.18-ff4ae9f5cc05353d3dc3aeff8854ae69/waflib/Options.py", line 198, in execute
    super(OptionsContext,self).execute()
  File "/home/ndn/ndnSIM/ns-3/.waf3-2.0.18-ff4ae9f5cc05353d3dc3aeff8854ae69/waflib/Context.py", line 85, in execute
    self.recurse([os.path.dirname(g_module.root_path)])
  File "/home/ndn/ndnSIM/ns-3/.waf3-2.0.18-ff4ae9f5cc05353d3dc3aeff8854ae69/waflib/Context.py", line 126, in recurse
    user_function(self)
  File "/home/ndn/ndnSIM/ns-3/wscript", line 256, in options
    opt.recurse('src')
  File "/home/ndn/ndnSIM/ns-3/.waf3-2.0.18-ff4ae9f5cc05353d3dc3aeff8854ae69/waflib/Context.py", line 126, in recurse
    user_function(self)
  File "/home/ndn/ndnSIM/ns-3/src/wscript", line 51, in options
    opt.recurse(module, mandatory=False)
  File "/home/ndn/ndnSIM/ns-3/.waf3-2.0.18-ff4ae9f5cc05353d3dc3aeff8854ae69/waflib/Context.py", line 126, in recurse
    user_function(self)
  File "/home/ndn/ndnSIM/ns-3/src/ndnSIM/wscript", line 20, in options
    opt.load(['doxygen', 'sphinx_build', 'compiler-features', 'sqlite3', 'openssl'],
  File "/home/ndn/ndnSIM/ns-3/.waf3-2.0.18-ff4ae9f5cc05353d3dc3aeff8854ae69/waflib/Context.py", line 80, in load
    module=load_tool(t,path,with_sys_path=with_sys_path)
  File "/home/ndn/ndnSIM/ns-3/.waf3-2.0.18-ff4ae9f5cc05353d3dc3aeff8854ae69/waflib/Context.py", line 373, in load_tool
    __import__(tool)
ModuleNotFoundError: No module named 'openssl'

Check the location of OpenSSL. It was originally at ~ / anaconda3 / lib / Python 3.8/site-packages/openssl. Although I don't know if OpenSSL and OpenSSL are the same thing, there is really no other way. I can only deceive myself and change my name.

cp -r ~/anaconda3/lib/python3.8/site-packages/OpenSSL ~/anaconda3/lib/python3.8/site-packages/openssl

Then it still fails. The error information is as follows

Traceback (most recent call last):
  File "/home/ndn/ndnSIM/ns-3/.waf3-2.0.18-ff4ae9f5cc05353d3dc3aeff8854ae69/waflib/Scripting.py", line 119, in waf_entry_point
    run_commands()
  File "/home/ndn/ndnSIM/ns-3/.waf3-2.0.18-ff4ae9f5cc05353d3dc3aeff8854ae69/waflib/Scripting.py", line 182, in run_commands
    ctx=run_command(cmd_name)
  File "/home/ndn/ndnSIM/ns-3/.waf3-2.0.18-ff4ae9f5cc05353d3dc3aeff8854ae69/waflib/Scripting.py", line 173, in run_command
    ctx.execute()
  File "/home/ndn/ndnSIM/ns-3/.waf3-2.0.18-ff4ae9f5cc05353d3dc3aeff8854ae69/waflib/Configure.py", line 85, in execute
    super(ConfigurationContext,self).execute()
  File "/home/ndn/ndnSIM/ns-3/.waf3-2.0.18-ff4ae9f5cc05353d3dc3aeff8854ae69/waflib/Context.py", line 85, in execute
    self.recurse([os.path.dirname(g_module.root_path)])
  File "/home/ndn/ndnSIM/ns-3/.waf3-2.0.18-ff4ae9f5cc05353d3dc3aeff8854ae69/waflib/Context.py", line 126, in recurse
    user_function(self)
  File "/home/ndn/ndnSIM/ns-3/wscript", line 491, in configure
    conf.recurse('src')
  File "/home/ndn/ndnSIM/ns-3/.waf3-2.0.18-ff4ae9f5cc05353d3dc3aeff8854ae69/waflib/Context.py", line 126, in recurse
    user_function(self)
  File "/home/ndn/ndnSIM/ns-3/src/wscript", line 59, in configure
    conf.recurse(module, mandatory=False)
  File "/home/ndn/ndnSIM/ns-3/.waf3-2.0.18-ff4ae9f5cc05353d3dc3aeff8854ae69/waflib/Context.py", line 126, in recurse
    user_function(self)
  File "/home/ndn/ndnSIM/ns-3/src/ndnSIM/wscript", line 33, in configure
    conf.check_openssl(mandatory=True, use='OPENSSL', atleast_version=0x10001000)
AttributeError: 'ConfigurationContext' object has no attribute 'check_openssl'

Execute grep -rl "check_openssl". / "under the root user directory, and the check cannot be found_ Where is the OpenSSL function? I have no choice but to hide my ears and steal the bell and comment out the conf.check of / home/ndn/ndnSIM/ns-3/src/ndnSIM/wscript_ openssl(mandatory=True, use='OPENSSL', atleast_version=0x10001000) .

Then I encountered a problem. I chose to give up. According to the above process, I created a new folder called newndnSIM, re executed the string of GIT clones, and inexplicably compiled successfully. I'm too lazy to worry about the reason. Just use it.

Posted by Bizzle on Fri, 01 Oct 2021 16:57:25 -0700