Cheryl0605 / reinforcement-learning-SDN

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

reinforcement-learning-SDN

University of Bristol Masters Thesis, 2019

Read the full thesis here: https://github.com/franchiven/reinforcement-learning-SDN/blob/master/Thesis/FrancescoVenerandiThesis.pdf

This project investigated how Reinforcement Learning could be applied to different parts of a software defined network. The code included in this repository specifically looks at how Q-learning could be used for path finding in a SDN.

Table of Contents

Introduction

The primary aim of this project was to investigate how feasible a reinforcement learning, specifically a Q-learning algorithm, would be in finding the shortest paths within a network topology.

Below shows an example network (pan european network topology) which was used in the TensorFlow Q-learning.ipynb.

A nerual network trained on this topology managed to find the shortest path (by weight) from 0-10 (0 3 6 8 10) within a few thousand episodes (~5 seconds).

TensorFlow Q-learning.ipynb can be run on its own (put in your desired network topology) or in conjunction with a mininet virtual machine.

Run using Mininet

To run the entire SDN architecture:

  1. Install and open a virtual machine (VM) running Mininet.
  2. Install Ryu controller inside the virtual machine.
  3. Install all the necessary packages.
  4. Inside the VM open the folder: ryu/ryu/app. (This can be done with the command cd ryu/ryu/app once the machine has just started).
  5. Copy the following files in this repo into the new folder:
    • l2DestForwardStaticRyuNS.py
    • ShortestPathBridgeNet_NP.py
    • TensorFlow Q-learning.ipynb
    • NetRunnerNS.py
    • PanEuroNet.json
    • g_switchesOut.pickle
  6. Place your own IP address in NetRunnerNs line 71 and your own network topology (if desired) in NetRunnerNS line 70 and in ShortestPathBridgeNet_NP line 123.
  7. Follow the instructions in chapter 5 of the thesis to simulate the network.
  8. These are the two main commands to start the network:
    • sudo python NetRunnerNS.py -f PanEuroNet.json -ip (place ip here)
    • python l2DestForwardStaticRyuNS.py --netfile=PanEuroNet.json

About


Languages

Language:Jupyter Notebook 92.1%Language:Python 7.9%