Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.
/ HY436 Public archive

Software Defined Networks (HY436) [winter semester of 2022].

Notifications You must be signed in to change notification settings

papastam/HY436

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Software Defined Networks (HY436)

In this repository you can find the assignments and my solutions of the course Software Defined Networks (HY436) during the winter semester of year 2022.

Assignment 1 (Simple Load Balancer)

Overview

In this assignment we had to implement a simple load balancer using the OpenFlow protocol. The load balancer had to be implemented using the POX controller. The topology of the network was the following: Assignment 1 topology

Files Structure (from assignmen1 foler)

How to run

  1. Requirements:
  2. Run the following commands:
    • sudo mn --topo single,8 --controller remote --mac --switch ovsk (to create the topology)
    • ./pox.py SimpleLoadBalancer --configuration_json_file=ext/SimpleLoadBalancer_conf.json (to run the load balancer) (This command needs to be run from the pox folder)

Assignment 2 (Clos topology)

Overview

In this assignment we had to implement a Clos topology for data centers using the OpenFlow protocol. The topology had to be implemented using the POX. The topology is created using the following two parameters:

  • c or --core : The number of core switches.
  • f or --fanout : The number of child nodes each node has.

The Clos topology has the following three layers:

  • Core layer: The core layer is the top layer of the topology. It contains the c number of core switches.
  • Aggregation layer: The aggregation layer is the middle layer of the topology. It contains the c*f number of aggregation switches.
  • Edge layer: The edge layer is the bottom layer of the topology. It contains the c*f*f number of edge switches. Each edge switch is connected to f hosts.

The topology of a network with parametes c=1 and f=2 is the following: Assignment 2 topology

Files Structure (from assignmen2 foler)

How to run

  1. Requirements:
  2. Run the following commands:
    • sudo python clos_topo.py -c <# of core switches> -f <# of fanout> (to create the topology)
    • /pox.py openflow.discovery CloudNetController --firewall_capability=<True|False> --migration_capability=<True|False> (to run the load balancer) (This command needs to be run from the pox folder)

Assignment 3 (Simple load balancer using P4 Switch programming language)

Overview

In this assignment we had to implement the same load balancer we implemented in the first assignment using the P4 Switch programming language instead of a POX controller.

The topology of the network is the following: Assignment 3 topology

Files Structure (from assignment3 foler)

How to run

  1. Requirements:

  2. Run the following commands (in the new directory with the files above):

    • make stop ; make clean (to stop and clean the last topology)
    • make run (to run the mininet and the load balancer)

Assignment 4 (Artemis Implementation)

Overview

For the fourt assignment I ran an instance of Artemis using a custom configutation file (code can be found below) to suit the assignment’s needs. In the config file there is a prefix watched (snd_assignment4) which is requested from the assignment. The source AS (sdn_assignment4_asn) and the neighbor AS (sdn_assignment4_neighbor) are also set up and a rule connecting ASes and prefixes is present too. Also a monitor is setup according to the basic config file from the git repository

Configuration File:

#
# ARTEMIS Configuration File (HY436 Assignment4)
#
# Start of Prefix Definitions
prefixes:
  sdn_assignment4: &sdn_assignment4
  - 184.164.247.0/24
# End of Prefix Definitions

# Start of ASN Definitions
asns:
  sdn_assignment4_asn: &sdn_assignment4_asn
  - 61574
  sdn_assignment4_neighbor: &sdn_assignment4_neighbor
  - 47065
# End of ASN Definitions

# Start of Monitor Definitions
monitors:
  riperis: ['']
  bgpstreamlive:
  - routeviews
  - ris
  bgpstreamkafka:
    host: bmp.bgpstream.caida.org
    port: 9092
    topic: '^openbmp\.router--.+\.peer-as--.+\.bmp_raw'
  bgpstreamhist: '/etc/artemis/'
# End of Monitor Definitions

# Start of Rule Definitions
rules:
- prefixes:
  - *sdn_assignment4
  origin_asns:
  - *sdn_assignment4_asn
  neighbors:
  - *sdn_assignment4_neighbor
  mitigation: manual
# End of Rule Definitions 

Results

In the screenshots included below are the hijacks found by Artemis. In total two types of hijacks were picked up by my implementation, E|0|-|- and E|1|-|-. E|0|-|- means that there was a hijack for the exact prefix (sdn_assignment4) with an illegal origin. E|1|-|- means that there was a hijack for the exact prefix (sdn_assignment4) with a legal origin but an illegal first hop. In the second screenshot an ongoing hijack can also be noticed!

  • E|0|-|- hijacks: E|0|-|- hijacks

  • E|1|-|- hijacks: E|1|-|- hijacks