Click here to Skip to main content
15,867,704 members
Articles / DevOps
Tip/Trick

Build Your Own SDN Network

Rate me:
Please Sign up or sign in to vote.
5.00/5 (5 votes)
10 Dec 2015CPOL1 min read 23.2K   7   8
Get started with your own SDN (Software Defined Network) simulation network

Introduction

This tip is for helping you build your own network and SDN simulation system. So you could apply your own applications on SDN network to redistribute network resources and to control the whole net. SDN is an innovation of network structure. It spilts the data panel and control panel. Due to this, the network administrators could do their job easier and more efficiently. There will be another post that tells about SDN in detail. And this tip would focus on how to build an SDN network.

Needed Tools and Software

For fulfilling the requirements of SDN environment, we need tools and software which are listed as follows:

  1. Ubuntu System (recommended) or Windows System
  2. JDK1.7 or higher versions
  3. "Ant"
  4. Mininet (Get sources codes on github)
  5. Floodlight Controller(Get sources codes on github)

Start Floodlight

Step 1. Rebuild Floodlight

Check out if it was built successfully. Make sure you have finished this step and then you can go on.

Image 1

Step 2. Start Floodlight

Image 2

If you have started it successfully, you could see the following debug information. Also some log information.

Image 3

Image 4

The Log and debug information show modules which are founded and started. It also shows switches which are connected to this Controller using TCP connection.

Start Mininet

Step 1. INSTALL and Get Sources Code

git clone git://github.com/mininet/mininet

mininet/util/install.sh[options]

options: -a (install all) -nfv(install openflow switches)

Step 2. Write Your Own Network Topology

Taking my topology for example. Mininet topology codes are using python language. And I set Controller IP address 172.23.22.75 (floodlight Controller) This Mininet Topology file was named TESY.py.

Python
#!/usr/bin/python

from mininet.net import Mininet
from mininet.node import Controller, RemoteController, OVSController
from mininet.node import CPULimitedHost, Host, Node
from mininet.node import OVSKernelSwitch, UserSwitch
from mininet.node import IVSSwitch
from mininet.cli import CLI
from mininet.log import setLogLevel, info
from mininet.link import TCLink, Intf
from subprocess import call

def myNetwork():

    net = Mininet( topo=None,
                   build=False,
                   ipBase='172.23.0.0/16')

    info( '*** Adding controller\n' )
    c0=net.addController(name='c0',
                      controller=RemoteController,
                      ip='172.23.22.75',
                      protocol='tcp',
                      port=6633)

    info( '*** Add switches\n')
    s1 = net.addSwitch('s1', cls=OVSKernelSwitch)
    s3 = net.addSwitch('s3', cls=OVSKernelSwitch)
    s2 = net.addSwitch('s2', cls=OVSKernelSwitch)

    info( '*** Add hosts\n')
    h2 = net.addHost('h2', cls=Host, ip='172.23.22.167', defaultRoute=None)
    h1 = net.addHost('h1', cls=Host, ip='172.23.22.168', defaultRoute=None)

    info( '*** Add links\n')
    net.addLink(h1, s2)
    net.addLink(s2, s3)
    net.addLink(h2, s3)
    net.addLink(s3, s1)
    net.addLink(s2, s1)

    info( '*** Starting network\n')
    net.build()
    info( '*** Starting controllers\n')
    for controller in net.controllers:
        controller.start()

    info( '*** Starting switches\n')
    net.get('s1').start([c0])
    net.get('s3').start([c0])
    net.get('s2').start([c0])

    info( '*** Post configure switches and hosts\n')

    CLI(net)
    net.stop()

if __name__ == '__main__':
    setLogLevel( 'info' )
    myNetwork()

Step 3. Start mininet

Image 5

Ping Test to check the link states.

Image 6

View Network Topology on Floodlight Controller

Image 7

Topology Graph

Image 8

Any Comments or Suggestions would be Embraced

Please leave your messages and comments.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Engineer
China China
WenQiang Jin received his B.A in Information and Telecommunication Engineering from CQUPT, China. He is currently a Masters student in Telecommunication at CQUPT. He received network engineering certificate from China Government. His research interest is SDN, wireless network programming,Network Calculus,Network Computing,and software testing.

HE IS CONSIDERING TO APPLY A Ph.D DEGREE IN ENGLISH-SPEAKING COUNTRIES. PLEASE CONTACT HIM.

Comments and Discussions

 
Question哈哈, 不错的样子 Pin
Member 1227218918-Jan-16 15:20
Member 1227218918-Jan-16 15:20 
AnswerRe: 哈哈, 不错的样子 Pin
JinWenQiang19-Jan-16 15:06
JinWenQiang19-Jan-16 15:06 
Questionteach Pin
Member 122408062-Jan-16 20:28
Member 122408062-Jan-16 20:28 
AnswerRe: teach Pin
JinWenQiang3-Jan-16 0:24
JinWenQiang3-Jan-16 0:24 
Questionis this work with java code ? Pin
Marwan Jabbour31-Dec-15 4:32
Marwan Jabbour31-Dec-15 4:32 
AnswerRe: is this work with java code ? Pin
JinWenQiang2-Jan-16 14:17
JinWenQiang2-Jan-16 14:17 
GeneralMy vote of 5 Pin
PVX00713-Dec-15 7:27
PVX00713-Dec-15 7:27 
GeneralRe: My vote of 5 Pin
JinWenQiang13-Dec-15 13:26
JinWenQiang13-Dec-15 13:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.