Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Build SDN environment by Mininet+Opendaylight+Wireshark

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Build SDN environment by Mininet+Opendaylight+Wireshark

After a day of twists and turns, I finally finished setting up the SDN environment. I am most afraid of building an actual combat environment, and it takes a long time every time. Most of the instructions on the Internet are successful in one step. I admire them. Basically, I jump into every pit, sum up and share, and make fewer detours in the future. Finally, I would like to thank the great Google and the great gods for sharing, and look forward to the follow-up SDN trip.

The software used in this article and its version are as follows:

FVMware Workstation 12.5.5 build-5234757

F Mininet image: mininet-2.2.2-170321-ubuntu-14.04.4-server-amd64

FOpenDayLight (boron Boron version 0.5.2) is karaf-0.5.2-Boron-SR2

F Wireshark software: wireshark-2.2.5

FXmanager-Passive

FQT5:qt-opensource-linux-x64-5.8.0

FSecureCRT:8.1.1

F operating system: windows10

Installation of Mininet image

Mininet mainly virtualizes the OpenFlow switch and host host node, and can use Python language to customize the topology. the experimental platform also has some basic topologies built in, which can easily meet the needs of testing. There are two ways to install Mininet, one is to import the virtual machine image, and the other is to compile and install the source code. It is recommended that beginners use the former. The simplest installation method is also used this time.

In the windows 10 operating system, download the latest virtual machine file from mininet's official website http://mininet.org, extract it, import it to vmware workstation, and start the virtual machine. No more details on the configuration of the virtual machine, please solve it yourself. (the mininet installed in this way is a server version and has no graphical interface for the desktop, so it is difficult to operate. )

After entering the virtual machine, the username and password are both mininet (the password will not be displayed).

Installation of Opendaylight

(1) installation of lrzsz software

In order to facilitate the subsequent transfer of windows and ubuntu files, lrzsz software is installed here.

Mininet@mininet-vm:~$sudo rz

Sudo:rz: command not found

Mininet@mininet-vm:~$sudo apt-get install lrzsz-y

After the installation is completed, download the latest version (distribution-karaf-0.5.2-Boron-SR2.zip) from the Opendaylight official website (https://www.opendaylight.org/downloads) on windows10 and transfer it to ubuntu through the following operations. Some of the subsequent software installations are also downloaded from windows and then uploaded to ubuntu in this way, which is no longer cumbersome.

Mininet@mininet-vm:~$sudo rz

Rzwaiting to receive.

Startingzmodem transfer. Press Ctrl+C to cancel.

Transferringdistribution-karaf-0.5.2-Boron-SR2.zip...

417012 KB 10692 KB/sec 00:00:39 0 Errors

(2) install unzip software to extract files

Mininet@mininet-vm:~$ sudo apt-get install unzip

Mininet@mininet-vm:~$sudo unzip distribution-karaf-0.5.2-Boron-SR2.zip-d / opt/

Mininet@mininet-vm:~$cd / opt/mininet/distribution-karaf-0.5.2-Boron-SR2/bin$

When I was cheerfully preparing for the installation, I found that the nightmare had just begun and a series of problems followed.

Mininet@mininet-vm:~/distribution-karaf-0.5.2-Boron-SR2/bin$sudo. / karaf

Karaf:JAVA_HOME not set; results may vary

. / karaf:line 221: type: java: not found

Karaf:java command not found

Well, according to online parlance, OpenDayLight (boron Boron version 0.5.2) requires a version above jdk8

(3) install JDK8

Mininet@mininet-vm:/$ sudo apt-get install openjdk-8-jdk

Readingpackage lists... Done

Buildingdependency tree

Readingstate information... Done

E: Unableto locate package openjdk-8-jdk

As the above installation failed in accordance with the conventional way, the update software found that only the version of jdk7, well, can only be compiled through the source code.

Mininet@mininet-vm:/$sudo apt-get update

Mininet@mininet-vm:/$sudo apt-cache search jdk

Download the latest java version (jdk-8u121-linux-x64.tar.gz) from the official website (http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)

Mininet@mininet-vm:~$sudo tar zxvf jdk-8u121-linux-x64.tar.gz-C / opt/

Modify environment variabl

Mininet@mininet-vm:~$sudo vim / etc/profile adds the following four lines at the end.

Export JAVA_HOME=/opt/jdk1.8.0_1219 (here is the location where the jdk is decompressed and stored)

Export JRE_HOME=$ {JAVA_HOME} / jre

Export CLASSPATH=.:$ {JAVA_HOME} / lib:$ {JRE_HOME} / lib

Export PATH=$ {JAVA_HOME} / bin:$PATH

Verification results:

Mininet@mininet-vm:~$source / etc/profile

Mininet@mininet-vm:~$echo $JAVA_HOME

/ opt/jdk1.8.0_121

Mininet@mininet-vm:~$java-version

Javaversion "1.8.0mm 121"

Java (TM) SE Runtime Environment (build 1.8.0_121-b13)

JavaHotSpot (TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

Mininet@mininet-vm:~$echo $CLASSPATH

.: / opt/jdk1.8.0_121/lib:/opt/jdk1.8.0_121/jre/lib

Mininet@mininet-vm:~$echo $PATH

/ opt/jdk1.8.0_121/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

(4) restart the installation of Opendaylight

Enter the decompression directory

Mininet@mininet-vm:~$cd / opt/distribution-karaf-0.5.2-Boron-SR2/etc/

Modify parameter configuration and save backup

Mininet@mininet-vm:/opt/distribution-karaf-0.5.2-Boron-SR2/etc$vim org.apache.karaf.management.cfg

RmiRegistryHost= 0.0.0.0 changed to rmiRegistryHost= 127.0.0.1

RmiServerHost= 0.0.0.0 changed to rmiServerHost= 127.0.0.1

Mininet@mininet-vm:/opt/distribution-karaf-0.5.2-Boron-SR2 $cd. / bin/

Start the opendaylight container karaf, and the result is as follows:

List installed feature. If-I parameter is not added, all installed and uninstalled feature are enumerated.

Install feature through the command line and pay attention to the installation order, otherwise there will be errors when opening opendaylight on subsequent web pages

Opendaylight-user@root > feature:install odl-restconf

Opendaylight-user@root > feature:install odl-l2switch-switch-ui

Opendaylight-user@root > feature:install odl-openflowplugin-flow-services-ui

Opendaylight-user@root > feature:installodl-openflowplugin-all-he (there is a saying on the Internet that this is installed, but the novice is not sure what the difference is, but the installation of the Times is wrong, so I use the above one)

Opendaylight-user@root > feature:install odl-mdsal-all

Opendaylight-user@root > feature:install odl-dlux-all

Opendaylight-user@root > feature:install odl-dlux-node

Opendaylight-user@root > feature:install odl-dlux-yangman

(5) Interface access:

Enter http://192.168.135.128:8181/index.html% in the browser my ip is 192.168.135.128, the port defaults to 8181, and the initial username and password is admin.

Note:

1) when installing odl-openflowplugin-all-he, there will be a warning prompt service or overlapping functions, which will not affect the use.

2) Please install in a certain order. If the installation order is unreasonable, the Web interface will not be accessible! And record a problem encountered: unable to log in to the ODL main interface without installing the components sequentially. The solution is to exit the karaf platform through logout, enter the parent directory, delete the data directory: rm-r data, enter the bin directory: cd bin, execute. / karafclean, and repeat the above installation component operation

The first experience of SDN

(1) the first try of Mininet

Accustomed to using SecureCRT for remote operation, experience Mininet for the first time

(2) initial experience of the combination of Opendaylight and Mininet

We will find that there are only three switches without Host hosts, so we can execute pingall on Mininet at this time.

Test whether H2, h3 and h4 can communicate with ping properly on mininet, as shown in Shantu. At this time, you will find that opendaylight can find hosts hosts normally.

(3) the first experience of Mininet custom graphical interface

The graphical interface cannot be called through SecureCRT. At this time, you need to manually install Xmanager5 software on windows. After installation, enable Xmanager-Passive, and modify the session session settings of SecureCRT software as follows.

Finally, modify the / etc/profile file on mininet and add the following command to the last line:

Mininet@mininet-vm:~$sudo vim / etc/profile

Export DISPLAY=192.168.135.1:0.0 (% my windows10 ip is 192.168.135.1)

Mininet@mininet-vm:~$source / etc/profile

Witness the miracle moment, mininet can make a graphical interface to customize the topology

(4) Popularization of basic knowledge

This symbol means that you are now under the shell interaction of Linux, and you need to use the Linux command.

The symbol mininet > indicates that you are now in Mininet interaction, and you need to use the Mininet command.

The # symbol means that you are under the root permission of Linux, but the virtual machine image downloaded officially by mininet cannot be imported directly and cannot be imported using su-switch to root mode. I don't know what the password is. You can only use sudo to act as a proxy for root permissions.

The symbol opendaylight-user@root > indicates that you are now in Opendaylight interaction, and you need to use the command of Mininet.

Note: due to space, wireshark installation can refer to the next blog post

Install Wireshark 2.2.5 in SDN environment (problem summary)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report