(OK) running CORE—Common Open Research Emulator—docker

-----------------------INSTALL quagga
http://blog.chinaunix.net/uid-14735472-id-5595972.html

core-manual.pdf

[root@localhost quagga-0.99.24]# pwd
/opt/tools/network_simulators/quagga-0.99.24

[root@localhost quagga-0.99.24]#
cp pimd/pimd.conf.sample  /usr/local/etc/quagga/pimd.conf
cp isisd/isisd.conf.sample  /usr/local/etc/quagga/isisd.conf
cp babeld/babeld.conf.sample  /usr/local/etc/quagga/babeld.conf
cp ospf6d/ospf6d.conf.sample  /usr/local/etc/quagga/ospf6d.conf
cp ospfd/ospfd.conf.sample  /usr/local/etc/quagga/ospfd.conf
cp ripngd/ripngd.conf.sample  /usr/local/etc/quagga/ripngd.conf
cp ripd/ripd.conf.sample  /usr/local/etc/quagga/ripd.conf
cp bgpd/bgpd.conf.sample  /usr/local/etc/quagga/bgpd.conf
cp zebra/zebra.conf.sample  /usr/local/etc/quagga/zebra.conf
cp vtysh/vtysh.conf.sample  /usr/local/etc/quagga/vtysh.conf

ln -s /usr/local/etc/quagga/pimd.conf /etc/quagga/pimd.conf
ln -s /usr/local/etc/quagga/isisd.conf /etc/quagga/isisd.conf
ln -s /usr/local/etc/quagga/babeld.conf /etc/quagga/babeld.conf
ln -s /usr/local/etc/quagga/ospf6d.conf /etc/quagga/ospf6d.conf
ln -s /usr/local/etc/quagga/ospfd.conf /etc/quagga/ospfd.conf
ln -s /usr/local/etc/quagga/ripngd.conf /etc/quagga/ripngd.conf
ln -s /usr/local/etc/quagga/ripd.conf /etc/quagga/ripd.conf
ln -s /usr/local/etc/quagga/bgpd.conf /etc/quagga/bgpd.conf
ln -s /usr/local/etc/quagga/zebra.conf /etc/quagga/zebra.conf
ln -s /usr/local/etc/quagga/vtysh.conf /etc/quagga/vtysh.conf

[root@localhost core-4.8]# cp /usr/local/etc/quagga/zebra.conf /usr/local/etc/quagga/Quagga.conf

+++++++++++++++++++++++++ install docker etc.

# Fedora 23

    # dnf install openvswitch docker-io xterm wireshark-gnome ImageMagick tcl tcllib tk kernel-modules-extra util-linux

    # echo 'DOCKER_STORAGE_OPTIONS="-s overlay"' >> /etc/sysconfig/docker-storage
    # systemctl restart docker

----------
如果出现如下问题:
# systemctl start docker
Job for docker.service failed. See 'systemctl status docker.service' and 'journalctl -xn' for details.
解决方法:
# rm /var/lib/docker -rf
# systemctl daemon-reload
# systemctl start docker

//下面两条命令不用
# dnf remove docker
# dnf install docker
----------

----------
    Arch:
    # cp /usr/lib/systemd/system/docker.service /etc/systemd/system/docker.service
    ### add overlay to ExecStart
    ExecStart=/usr/bin/docker daemon -s overlay -H fd://
    ### reload systemd files and restart docker.service
    # systemctl daemon-reload
    # systemctl restart docker

    Check status with docker info:
    # docker info | grep Storage
    Storage Driver: overlay
----------
http://stackoverflow.com/questions/20994863/how-to-use-docker-or-linux-containers-for-network-emulation

点击(此处)折叠或打开

  1. CORE Network Emulator does have a Docker Service that I contributed and wrote an article about. The initial version that is in 4.8 is mostly broken but I have fixed and improved it. A pull request is on GitHub.

  2. The service allows you to tag Docker Images with 'core' and then they appear as an option in the services settings. You must select the Docker image which starts the docker service in the container. You then select the container or containers that you want to run in that node. It scales quite well and I have had over 2000 nodes on my 16Gb machine.

  3. You mentioned OVS as well. This is not yet built in to CORE but can be used manually. I just answered a question on the CORE mailing list on this. It gives a brief overview of switching out a standard CORE switch(bridge) with OVS. Text reproduced below if it is useful:




+++++++++++++++++++++++++++++
[root@localhost quagga]# ll
总用量 6612
-rw-r--r--.  1 root root 2471193 1月  13 21:57 quagga-0.99.21mr2.2.tar.gz
-rw-r--r--.  1 root root 1680796 1月  12 15:36 quagga-0.99.24.tar.xz
-rw-r--r--.  1 root root 2560375 1月  14 14:27 quagga-svnsnap.tgz   // 最 新版
[root@localhost quagga]#


-------------------Fedora 23, Installing Quagga

# tar xzf quagga-svnsnap.tgz
# cd quagga
[root@localhost quagga]# ./bootstrap.sh
[root@localhost quagga]# ./configure --enable-user=root --enable-group=root --with-cflags=-ggdb --sysconfdir=/usr/local/etc/quagga --enable-vtysh --localstatedir=/var/run/quagga

// copy basic.texi, ipv6.texi in quagga-0.99.24/doc   to   quagga-0.99.21mr2.2/doc
[root@localhost quagga]# cp ../quagga-0.99.24/doc/basic.texi ../quagga-0.99.24/doc/ipv6.texi doc/

[root@localhost quagga]# make -j4
[root@localhost quagga]# make install
[root@localhost quagga]# systemctl cat zebra.service

[root@localhost quagga]# systemctl start zebra.service
Job for zebra.service failed because a configured resource limit was exceeded. See "systemctl status zebra.service" and "journalctl -xe" for details.
[root@localhost quagga]# mkdir /run/quagga/

[root@localhost quagga]# systemctl start zebra.service
[root@localhost quagga]# systemctl status zebra.service
[root@localhost quagga]# systemctl stop zebra.service

[root@localhost quagga]# vtysh
[root@localhost quagga]# telnet localhost 2601

+++++++++++++++++++++++++++++

[root@localhost core]# systemctl start squid.service
[root@localhost core]# systemctl status squid.service

+++++++++++++++++++++++++++++

# tar xzf core-network_4.8.orig.tar.gz
# cd core-4.8

-----------------------INSTALL CORE --- OK OK

Fedora 23:
dnf install bash bridge-utils ebtables iproute libev python procps-ng net-tools tcl tk tkimg autoconf automake make libev-devel python-devel ImageMagick help2man

CentOS 7 :
yum install bash bridge-utils ebtables iproute libev python procps-ng net-tools tcl tk tkimg autoconf automake make libev-devel python-devel ImageMagick help2man


You can obtain the CORE source from the CORE source page. Choose either a stable release version or the development snapshot available in the nightly_snapshots directory. The -j8 argument to make will run eight simultaneous jobs, to speed up builds on multi-core systems. Notice the configure flag to tell the build system that a systemd service file should be installed under Fedora.

[root@localhost core-4.8]# ./bootstrap.sh
[root@localhost core-4.8]# ./configure --with-startup=systemd
[root@localhost core-4.8]# make -j4
[root@localhost core-4.8]# make install

Note that the Linux RPM and Debian packages do not use the /usr/local prefix, and files are instead installed to /usr/sbin, and /usr/lib. This difference is a result of aligning with the directory structure of Linux packaging systems and FreeBSD ports packaging.

Another note is that the Python distutils in Fedora Linux will install the CORE Python modules to /usr/lib/python2.7/site-packages/core, instead of using the dist-packages directory.

The CORE Manual documentation is built separately from the doc/ sub-directory in the source. It requires Sphinx:

 
sudo yum install python-sphinx 

cd core-4.8/doc
make html
make latexpdf
-----------------------INSTALL CORE --- OK OK



----------------------- Tes t CORE

To test that the CORE Network Emulator is working, start the CORE daemon and the GUI.

[root@localhost core-4.8]# pwd
/opt/tools/network_simulators/core/core-4.8

[root@localhost core-4.8]# /etc/init.d/core-daemon start
[root@localhost core-4.8]# core-gui

[root@localhost core-4.8]# ls /tmp/pycore.56386/
n1                    n1.xy                 n3.pid                n5.log                n7.conf/              n9
n10                   n2                    n3.xy                 n5.pid                n7.log                n9.conf/
n10.conf/             n2.conf/              n4                    n5.xy                 n7.pid                n9.log
n10.log               n2.log                n4.conf/              n6                    n7.xy                 n9.pid
n10.pid               n2.pid                n4.log                n6.conf/              n8                    n9.xy
n10.xy                n2.xy                 n4.pid                n6.log                n8.conf/              nodes
n1.conf/              n3                    n4.xy                 n6.pid                n8.log                servers
n1.log                n3.conf/              n5                    n6.xy                 n8.pid                session-deployed.xml
n1.pid                n3.log                n5.conf/              n7                    n8.xy                 state

+++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++ ++++++
关键点
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

core-svnsnap.tgz

[root@localhost core]# pwd
/opt/tools/network_simulators/core/core

[root@localhost core]# gedit ./daemon/core/mobility.py
-------------------------------------设置节点移动的时间间隔
    def runround(self):
        ''' Advance script time and move nodes.
        '''
        #ztg add
        time.sleep(6)
------------------------------------- 设置节点移动的间距
        #ztg add
        #wp = self.WayPoint(time, nodenum, coords=(x,y,z), speed=speed)
        wp = self.WayPoint(time, nodenum, coords=(x,y,z), speed=3)
-------------------------------------
[root@localhost core]# systemctl start squid.service
[root@localhost core]# systemctl start docker

[root@localhost core]# /etc/init.d/core-daemon stop
[root@localhost core]# make uninstall ;  make clean
[root@localhost core]# make -j4
[root@localhost core]# make install
[root@localhost core]# systemctl enable core-daemon
Created symlink from /etc/systemd/system/multi-user.target.wants/core-daemon.service to /etc/systemd/system/core-daemon.service.

probl em :
[root@n6 n6.conf]# docker info
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
resol ve :
[root@localhost core]# i p t ables -F
[root@localhost core]# ip 6 tables -F

[root@localhost 桌面]# service core-daemon status
Redirecting to /bin/systemctl status  core-daemon.service
core-daemon.service - Common Open Research Emulator Service
   Loaded: loaded (/etc/systemd/system/core-daemon.service; disabled)
   Active: inactive (dead)

[root@localhost 桌面]# cat /etc/systemd/system/core-daemon.service

点击(此处)折叠或打开

  1. [Unit]
  2. Description=Common Open Research Emulator Service
  3. After=network.target

  4. [Service]
  5. Type=forking
  6. PIDFile=/var/run/core-daemon.pid
  7. ExecStart=/usr/bin/python /usr/local/sbin/core-daemon -d

  8. [Install]
  9. WantedBy=multi-user.target
Here maybe what is installed with 'make install':

点击(此处)折叠或打开

  1. /usr/local/bin/core-gui
  2. /usr/local/sbin/core-daemon
  3. /usr/local/sbin/[vcmd, vnoded, coresendmsg, core-cleanup.sh]
  4. /usr/local/lib/core/*
  5. /usr/local/share/core/*
  6. /usr/local/lib/python2.6/dist-packages/core/*
  7. /usr/local/lib/python2.6/dist-packages/[netns,vcmd].so
  8. /etc/core/*
  9. /etc/init.d/core

[root@localhost core]# /usr/share/openvswitch/scripts/ovs-ctl --system-id=random start
Starting ovsdb-server                                      [  OK  ]
Configuring Open vSwitch system IDs                        [  OK  ]
Starting ovs-vswitchd                                      [  OK  ]
Enabling remote OVSDB managers                             [  OK  ]


//Fedora 23 & C entOS 7

[root@localhost core]# systemctl daemon-reload
[root@localhost core]# systemctl start core-daemon.service
[root@localhost core]# core-gui



----------------
NOTE: first to run the following command if using docker.
# systemctl start docker.service
----------------

NOTE: /root/.core/configs/ m-MPE-manet.imn


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
----------------
error:
----------------
  File "/usr/lib/python2.7/site-packages/docker/client.py", line 142, in _raise_for_status
    raise errors.APIError(e, response, explanation=explanation)
APIError: 400 Client Error: Bad Request ("client version 1.10 is too old. Minimum supported API version is 1.21, please upgrade your client to a newer version")
----------------

solution:
----------------
# gedit /opt/tools/network_simulators/core/core/daemon/core/services/dockersvc.py
----------------
if 'Client' in globals():
    client = Client( version='1.21')
----------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

docker.sh

#!/bin/sh
# auto-generated by Docker (docker.py)
echo "nameserver 8.8.8.8" > /run/resolvconf/resolv.conf
service docker start
# you could add a command to start a image here eg:
# docker run -d --net host --name coreDock

[root@localhost 桌面]# ls /var/lib/docker/containers/
[root@localhost 桌面]# ls /run/shm
[root@localhost 桌面]# ls /run/resolvconf

---------------------------
[root@n6 n6.conf]# ls /run/shm
[root@n6 n6.conf]# cat /run/resolvconf/resolv.conf
nameserver 8.8.8.8
[root@n6 n6.conf]# ls /var/lib/docker/containers/
[root@n6 n6.conf]#


+++++++++++++++++++++++++++++
http://www.segurancaremota.com.br/2014/01/simular-roteamentos-no-linux-com-core.html

If you are looking for an environment light, practical and efficient to simulate networks, this environment is the core.

Best of all is that if all goes well, it 's just save the configuration files (default quagga) and up to its routers.

With this system, you can train your skills with networks in an environment totally safe.

So we go to the "hands - on" and install the system. I made a "compiled" after reading the documentation in the official site - http://www.nrl.navy.mil/itd/ncs/products/core

The instructions will follow shortly after the video, but remember, I did this article in a Linux Kali (Debian), so if you'll do in other distribution there may be some variation. In the Fedora also worked perfectly.

-------------------Downloads:

Core - http://downloads.pf.itd.nrl.navy.mil/core/source/core-4.6.tar.gz  

Quagga - http://downloads.sourceforge.net/project/quagga/quagga-0.99.20.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fquagga%2F&ts=1390603600&use_mirror=ufpr

Installing pre requirements # apt-get install bash bridge-utils ebtables iproute  libev-dev python tcl8.5 tk8.5 libtk-img autoconf  automake gcc libev-dev make python-dev  libreadline-dev pkg-config imagemagick help2man node gawk quagga  

-------------------Install CORE
# tar xzf core-4.6.tar.gz
# cd core-4.6
# ./bootstrap.sh
# ./configure
# make -j8
# make install

------------------- Inst alling Quagga
# yum group install 'Development Tools'        [on CentOS/RHEL 7/6]
# dnf group install 'Development Tools'        [on Fedora 22+ Versions]

/opt/tools/network_simulators/quagga/ quagga -svnsnap.tgz
-rw-r--r--. 1 root root 2560375 1月  14 14:27 ../quagga-svnsnap.tgz

# tar xzf quagga-0.99.21mr2.2.tar.gz
# cd quagga-0.99.21mr2.2


configure.ac:217: error: possibly undefined macro: AC_PROG_LIBTOOL
[root@localhost quagga]# dnf install libtool
[root@localhost quagga]# dnf install autoconf-archive

//automake: You are advised to start using 'subdir-objects' option throughout your
[root@localhost quagga]# gedit configure.ac
dnl AM_INIT_AUTOMAKE(1.6)
AM_INIT_AUTOMAKE([subdir-objects])

[root@localhost quagga]# ./bootstrap.sh

[root@localhost quagga]# dnf install gcc-c++

[root@localhost quagga]# ./configure --enable-user=root --enable-group=root --with-cflags=-ggdb --sysconfdir=/usr/local/etc/quagga --enable-vtysh --localstatedir=/var/run/quagga

//下面一行暂不需要
// copy basic.texi, ipv6.texi in quagga-0.99.24/doc   to   quagga-0.99.21mr2.2/doc

// makeinfo: command not found
[root@localhost quagga]# dnf install texinfo


# make -j4
# make install

------------------- Te sting the environment
# core-gui


<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
阅读(106) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~
评论热议
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
当我们在开发过程中使用模拟器设备时,可能会遇到“start debugging error by emulator device open”的错误。这个错误通常发生在我们尝试在模拟器设备上进行调试时。 首先,我们需要检查几个可能的原因。首先,确保您的模拟器设备已经正确安装并且可以正常工作。您可以尝试重新启动模拟器设备,以确保没有任何临时问题。另外,确保您的开发环境与模拟器设备的版本兼容。如果您的开发环境版本过低或过高,可能会导致无法正常调试。 其次,检查您的调试设置是否正确。您可以打开您的开发环境中的调试设置并确保已正确配置模拟器设备作为调试目标。一些开发环境也允许您选择将调试目标设置为实际的物理设备,这取决于您的需求。 另外,确保您的开发环境与模拟器设备之间建立了正确的连接。这可能需要您在开发环境中配置一些网络设置,以便能够与模拟器设备进行通信。 最后,如果以上解决方法都没有成功,请考虑尝试使用其他的开发环境或调试工具。有时,不同的工具可能会有不同的兼容性和性能。在尝试其他解决方案之前,您还可以尝试重新安装您的开发环境,以确保它没有任何损坏或错误。 总结来说,当我们遇到“start debugging error by emulator device open”错误时,我们应该首先检查设备和开发环境之间的兼容性,确保正确配置调试设置并建立正确的连接。如果问题仍然存在,可以尝试使用其他的开发环境或调试工具。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值