From ed976c4422af98e88167ca566701fc385fb1b1a8 Mon Sep 17 00:00:00 2001 From: Felix Date: Sat, 23 Nov 2019 21:20:52 +0000 Subject: [PATCH] major bir commit not sure 2 --- VSoRC | 2 +- cleaner.sh | 4 - clusterGRE.py | 35 -------- clustersetup.sh | 182 ------------------------------------------ cmdcluster.sh | 4 - data | 7 -- data_clean | 6 -- data_dirt | 1 - discover.sh | 6 -- ejecutarcontroller.sh | 5 -- fromwebstart.sh | 2 - id.sh | 2 - iplist | 14 ---- log.txt | 35 -------- multiscp.sh | 3 - multissh.sh | 4 - precompiler.py | 64 --------------- precompiler.pyc | Bin 1692 -> 0 bytes resetcluster.sh | 5 -- scripts/basic2.sh | 95 ---------------------- scripts/clusterGRE.py | 2 +- scripts/data | 11 +-- scripts/data_clean | 10 +-- scripts/data_dirt | 1 - scripts/iplist | 2 +- scripts/log.txt | 34 ++++---- scripts/showtemp.sh | 2 +- showtemp.sh | 2 - startvsorc.sh | 6 -- topotest.py | 33 -------- topotest.pyc | Bin 767 -> 0 bytes 31 files changed, 29 insertions(+), 550 deletions(-) delete mode 100755 cleaner.sh delete mode 100755 clusterGRE.py delete mode 100755 clustersetup.sh delete mode 100755 cmdcluster.sh delete mode 100644 data delete mode 100644 data_clean delete mode 100644 data_dirt delete mode 100755 discover.sh delete mode 100755 ejecutarcontroller.sh delete mode 100755 fromwebstart.sh delete mode 100755 id.sh delete mode 100644 iplist delete mode 100644 log.txt delete mode 100755 multiscp.sh delete mode 100755 multissh.sh delete mode 100755 precompiler.py delete mode 100644 precompiler.pyc delete mode 100755 resetcluster.sh delete mode 100755 scripts/basic2.sh delete mode 100755 showtemp.sh delete mode 100755 startvsorc.sh delete mode 100755 topotest.py delete mode 100644 topotest.pyc diff --git a/VSoRC b/VSoRC index 3253f87..0435950 160000 --- a/VSoRC +++ b/VSoRC @@ -1 +1 @@ -Subproject commit 3253f871623a1d1f767923771a593a42b121df0f +Subproject commit 0435950ac163f7cd63ba0bbd3d4882820d9f53fb diff --git a/cleaner.sh b/cleaner.sh deleted file mode 100755 index c19f589..0000000 --- a/cleaner.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -cat $1 | grep -E "[sh]+[0-9]{1,3}:[sh]+[0-9]{1,3}" > $1_clean -cat $1 | grep -vE "[sh]+[0-9]{1,3}:[sh]+[0-9]{1,3}" > $1_dirt - diff --git a/clusterGRE.py b/clusterGRE.py deleted file mode 100755 index 81abb63..0000000 --- a/clusterGRE.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/python -"clusterGRE.py: Mininet Raspberry Pi Cluster" -from mininet.examples.cluster import MininetCluster, SwitchBinPlacer, RemoteGRELink -from mininet.topolib import TreeTopo -from mininet.log import setLogLevel -from mininet.examples.clustercli import ClusterCLI as CLI -from mininet.node import RemoteController -from topotest import MiTopo -from precompiler import TopoFromCompiler - -def inicia(): - IPs = '/home/pi/iplist' - c = RemoteController('c1', ip='192.168.25.10', port=6633) - servers = readIPs(IPs) - #servers = ['192.168.25.2', '192.168.25.3', '192.168.25.4','192.168.25.5','192.168.25.6'] - topo1 = TreeTopo(depth=2, fanout=2) # Topologia basica - topo2 = MiTopo() # Topologia desde el archivo topotest - topo3 = TopoFromCompiler() # Topologia creada a partir del archivo data - topo4 = TreeTopo(depth=3, fanout=3) # Topologia grande en arbol - net = MininetCluster(topo=topo3, servers=servers, link=RemoteGRELink, placement=SwitchBinPlacer, controller=c) - net.start() - CLI(net) - net.stop() - - -def readIPs(path): - file = open(path, "r") #abre el archivo en read - if file.mode == "r": - servers = file.read().splitlines() #lee el archivo y lo divide por lineas - return servers - - -if __name__ == '__main__': - setLogLevel('info') - inicia() diff --git a/clustersetup.sh b/clustersetup.sh deleted file mode 100755 index e8ad928..0000000 --- a/clustersetup.sh +++ /dev/null @@ -1,182 +0,0 @@ -#!/usr/bin/env bash - -# SSH authentication script for cluster edition -# This script will create a single key pair, which is then -# propagated throughout the entire cluster. -# There are two options for setup; temporary setup -# persistent setup. If no options are specified, and the script -# is only given ip addresses or host names, it will default to -# the temporary setup. An ssh directory is then created in -# /tmp/mn/ssh on each node, and mounted with the keys over the -# user's ssh directory. This setup can easily be torn down by running -# clustersetup with the -c option. -# If the -p option is used, the setup will be persistent. In this -# case, the key pair will be be distributed directly to each node's -# ssh directory, but will be called cluster_key. An option to -# specify this key for use will be added to the config file in each -# user's ssh directory. - - -set -e -num_options=0 -persistent=false -showHelp=false -clean=false -declare -a hosts=() -user=$(whoami) -SSHDIR=/tmp/mn/ssh -USERDIR=$HOME/.ssh -usage="./clustersetup.sh [ -p|h|c ] [ host1 ] [ host2 ] ...\n - Authenticate yourself and other cluster nodes to each other - via ssh for mininet cluster edition. By default, we use a - temporary ssh setup. An ssh directory is mounted over - $USERDIR on each machine in the cluster. - - -h: display this help - -p: create a persistent ssh setup. This will add - new ssh keys and known_hosts to each nodes - $USERDIR directory - -c: method to clean up a temporary ssh setup. - Any hosts taken as arguments will be cleaned - " - -persistentSetup() { - echo "***creating key pair" - ssh-keygen -t rsa -C "Cluster_Edition_Key" -f $USERDIR/cluster_key -N '' # &> /dev/null - cat $USERDIR/cluster_key.pub >> $USERDIR/authorized_keys - echo "***configuring ssh" - echo "IdentityFile $USERDIR/cluster_key" >> $USERDIR/config - echo "IdentityFile $USERDIR/id_rsa" >> $USERDIR/config - - for host in $hosts; do - echo "***copying public key to $host" - ssh-copy-id -i $USERDIR/cluster_key.pub $user@$host &> /dev/null - echo "***copying key pair to remote host" - scp $USERDIR/cluster_key $user@$host:$USERDIR - scp $USERDIR/cluster_key.pub $user@$host:$USERDIR - echo "***configuring remote host" - ssh -o ForwardAgent=yes $user@$host " - echo 'IdentityFile $USERDIR/cluster_key' >> $USERDIR/config - echo 'IdentityFile $USERDIR/id_rsa' >> $USERDIR/config" - done - - for host in $hosts; do - echo "***copying known_hosts to $host" - scp $USERDIR/known_hosts $user@$host:$USERDIR/cluster_known_hosts - ssh $user@$host " - cat $USERDIR/cluster_known_hosts >> $USERDIR/known_hosts - rm $USERDIR/cluster_known_hosts" - done -} - -tempSetup() { - - echo "***creating temporary ssh directory" - mkdir -p $SSHDIR - echo "***creating key pair" - ssh-keygen -t rsa -C "Cluster_Edition_Key" -f $SSHDIR/id_rsa -N '' &> /dev/null - - echo "***mounting temporary ssh directory" - sudo mount --bind $SSHDIR $USERDIR - cp $SSHDIR/id_rsa.pub $SSHDIR/authorized_keys - - for host in $hosts; do - echo "***copying public key to $host" - ssh-copy-id $user@$host &> /dev/null - echo "***mounting remote temporary ssh directory for $host" - ssh -o ForwardAgent=yes $user@$host " - mkdir -p $SSHDIR - cp $USERDIR/authorized_keys $SSHDIR/authorized_keys - sudo mount --bind $SSHDIR $USERDIR" - echo "***copying key pair to $host" - scp $SSHDIR/{id_rsa,id_rsa.pub} $user@$host:$SSHDIR - done - - for host in $hosts; do - echo "***copying known_hosts to $host" - scp $SSHDIR/known_hosts $user@$host:$SSHDIR - done -} - -cleanup() { - - for host in $hosts; do - echo "***cleaning up $host" - ssh $user@$host "sudo umount $USERDIR - sudo rm -rf $SSHDIR" - done - - echo "**unmounting local directories" - sudo umount $USERDIR - echo "***removing temporary ssh directory" - sudo rm -rf $SSHDIR - echo "done!" - -} - - -if [ $# -eq 0 ]; then - echo "ERROR: No Arguments" - echo "$usage" - exit -else - while getopts 'hpc' OPTION - do - ((num_options+=1)) - case $OPTION in - h) showHelp=true;; - p) persistent=true;; - c) clean=true;; - ?) showHelp=true;; - esac - done - shift $(($OPTIND - 1)) -fi - -if [ "$num_options" -gt 1 ]; then - echo "ERROR: Too Many Options" - echo "$usage" - exit -fi - -if $showHelp; then - echo "$usage" - exit -fi - -for i in "$@"; do - output=$(getent ahostsv4 "$i") - if [ -z "$output" ]; then - echo '***WARNING: could not find hostname "$i"' - echo "" - else - hosts+="$i " - fi -done - -if $clean; then - cleanup - exit -fi - -echo "***authenticating to:" -for host in $hosts; do - echo "$host" -done - -echo - -if $persistent; then - echo '***Setting up persistent SSH configuration between all nodes' - persistentSetup - echo $'\n*** Sucessfully set up ssh throughout the cluster!' - -else - echo '*** Setting up temporary SSH configuration between all nodes' - tempSetup - echo $'\n***Finished temporary setup. When you are done with your cluster' - echo $' session, tear down the SSH connections with' - echo $' ./clustersetup.sh -c '$hosts'' -fi - -echo diff --git a/cmdcluster.sh b/cmdcluster.sh deleted file mode 100755 index ff513f1..0000000 --- a/cmdcluster.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -#sudo -E mn --controller=remote,ip=192.168.25.10 --custom ~/topotest.py --topo TopoMia --cluster $(awk 'BEGIN { ORS="" } { print p$0; p="," } END { print "\n" }' iplist) -v debug -sudo -E mn --controller=remote,ip=192.168.25.10 --topo tree,2,2 --cluster $(awk 'BEGIN { ORS="" } { print p$0; p="," } END { print "\n" }' iplist) -v debug - diff --git a/data b/data deleted file mode 100644 index 306bf05..0000000 --- a/data +++ /dev/null @@ -1,7 +0,0 @@ -s1:h1 -s1:h2 -s2:s1 -s2:h3 -s3:s2 -s3:h4 - diff --git a/data_clean b/data_clean deleted file mode 100644 index 4f1fcb6..0000000 --- a/data_clean +++ /dev/null @@ -1,6 +0,0 @@ -s1:h1 -s1:h2 -s2:s1 -s2:h3 -s3:s2 -s3:h4 diff --git a/data_dirt b/data_dirt deleted file mode 100644 index 8b13789..0000000 --- a/data_dirt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/discover.sh b/discover.sh deleted file mode 100755 index e7122db..0000000 --- a/discover.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -#nmap -sn 192.168.18.83/25 | grep 192 > log.txt && awk '{print $5}' log.txt | grep 192 | tee log.txt -#for HOST in $(cat log.txt ) ; do ssh $HOST "uname -a" ; done -nmap -sn $1 > log.txt -grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}" log.txt > iplist diff --git a/ejecutarcontroller.sh b/ejecutarcontroller.sh deleted file mode 100755 index 2258687..0000000 --- a/ejecutarcontroller.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -cd ryu -sudo ./bin/ryu-manager --observe-links /home/pi/flowmanager/flowmanager/flowmanager.py ryu/app/simple_switch_13.py -#./ejecutarcontroller.sh > /dev/null 2>&1 & Para ejecutarlo en segundo plano - diff --git a/fromwebstart.sh b/fromwebstart.sh deleted file mode 100755 index 0fcea68..0000000 --- a/fromwebstart.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -sudo ./home/pi/clusterGRE.py > aichivo 2>&1 diff --git a/id.sh b/id.sh deleted file mode 100755 index bde7df4..0000000 --- a/id.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -echo $(ifconfig | grep inet | grep -v inet6 | grep -v 127.0.0.7) | awk '{print $2}' | awk -F "." '{print $4}' diff --git a/iplist b/iplist deleted file mode 100644 index 7e668cd..0000000 --- a/iplist +++ /dev/null @@ -1,14 +0,0 @@ -192.168.25.2 -192.168.25.3 -192.168.25.4 -192.168.25.5 -192.168.25.6 -192.168.25.7 -192.168.25.8 -192.168.25.9 -192.168.25.11 -192.168.25.12 -192.168.25.13 -192.168.25.14 -192.168.25.15 -192.168.25.16 diff --git a/log.txt b/log.txt deleted file mode 100644 index 3ac7cd3..0000000 --- a/log.txt +++ /dev/null @@ -1,35 +0,0 @@ - -Starting Nmap 7.40 ( https://nmap.org ) at 2019-11-14 23:07 GMT -Nmap scan report for 192.168.25.1 -Host is up (0.0091s latency). -Nmap scan report for 192.168.25.2 -Host is up (0.0030s latency). -Nmap scan report for 192.168.25.3 -Host is up (0.0028s latency). -Nmap scan report for 192.168.25.4 -Host is up (0.0027s latency). -Nmap scan report for 192.168.25.5 -Host is up (0.0026s latency). -Nmap scan report for 192.168.25.6 -Host is up (0.0024s latency). -Nmap scan report for 192.168.25.7 -Host is up (0.0023s latency). -Nmap scan report for 192.168.25.8 -Host is up (0.0058s latency). -Nmap scan report for 192.168.25.9 -Host is up (0.0046s latency). -Nmap scan report for 192.168.25.10 -Host is up (0.00073s latency). -Nmap scan report for 192.168.25.11 -Host is up (0.0021s latency). -Nmap scan report for 192.168.25.12 -Host is up (0.0018s latency). -Nmap scan report for 192.168.25.13 -Host is up (0.0029s latency). -Nmap scan report for 192.168.25.14 -Host is up (0.0027s latency). -Nmap scan report for 192.168.25.15 -Host is up (0.0026s latency). -Nmap scan report for 192.168.25.16 -Host is up (0.0025s latency). -Nmap done: 128 IP addresses (16 hosts up) scanned in 1.93 seconds diff --git a/multiscp.sh b/multiscp.sh deleted file mode 100755 index 9e81bfb..0000000 --- a/multiscp.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -pscp -h iplist -A -l pi "$@" diff --git a/multissh.sh b/multissh.sh deleted file mode 100755 index 037bea5..0000000 --- a/multissh.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -#Ingresar el comando por parametro y se ejecuta abriendo una sesion ssh -#con las Ip del archivo iplist(todas las pi) -pssh -h iplist -i -l pi "$@" diff --git a/precompiler.py b/precompiler.py deleted file mode 100755 index 2b495cb..0000000 --- a/precompiler.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/python -import sys -import os -import time -from mininet.topo import Topo -from mininet.log import setLogLevel, info - -""" -Este precompilador transforma el lenguaje VSORC a la API de topologias de -Mininet -""" -links = [] -devices = [] -hosts = [] -switches = [] -#Lists - -#cmd = './cleaner.sh '+sys.argv[1] -cmd2 = './cleaner.sh data' -os.system(cmd2) -time.sleep(.300) -#document = open(sys.argv[1] + "_clean" ,"r+") -document = open("data" + "_clean" ,"r+") -links = document.readlines() -document.close -#"data" is the file with the topo vsorc script - -#clean the \n in the colected data -a = 0 -for linkline in links: - links[a] = linkline.rstrip() - a+=1 - - -# get a list of non repeating devices -for value in links: - value_split = value.split(':') - devices.append(value_split[0]) - devices.append(value_split[1]) -devices = list(dict.fromkeys(devices)) - - -class TopoFromCompiler(Topo): -#This class is for create the custom topology from the data collected. -#Here we also process the data to make the topo - def build(self): - for device in devices: - if device.startswith("h"): - host = device - host = self.addHost(host) #Create a host with the data collected from the list - hosts.append(host) - - elif device.startswith("s"): - switch = device - switch = self.addSwitch(switch) #Create a switch - switches.append(switch) - - print ("Devices: " + str(devices) + "\n" + "Links: " + str(links) + "\n" + "Hosts: " + str(hosts) + "\n" + "Switches: " + str(switches) + "\n") - - #Create links - for pair in links: - split = pair.split(":") - self.addLink(split[0],split[1]) - diff --git a/precompiler.pyc b/precompiler.pyc deleted file mode 100644 index 3068fd60652f9d58b5da612e53f9407efad33749..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1692 zcmb7EOK;mo5S}F^%95p6PHZbqAMjB?5IJa31PFpAX^cDoBL}*GQ38g*kZWrhQlzs!Rxi2r!iW=7cBtX@IWd~*oM=zv0kz5-yj#~T!(`bTQn>TMSeqf)yqerwrjuvHrQDQ7m0c!8jRa=e% zzxV)nq)z`p0R&VTxA%@GGZSiU7yO<+H;J}ScP#JpYzK7T%s;Y*`M0HY%=f?_{Aye> zW8;tq`vo?MjfQZQnsAQIt&3}C;WLx1I88a2W7io+m4gshm7b@LOMyX?0X@R|CK*8B zP__8wT$ymT%8gsb<$}kIw;VF7^J9tK6eBuLD7q%B=&IP%;azx*u^M7W;C5$ap?52@ zTh%(bIenArQqq1nGkH3Jk$u2UYM|CsfHm}*_lEb*XWf{qmOiG_d0gn}R7NtL7G-*t zLkzcJ@FlTu|CK%D_8wx%oe6vi$JeR3N#k!hpN#6#I=)tDnD4DKg?4=~g_)bVb`ytt z6+&(<@=}|ZCm|nzkX=K*$st1$vS-NO0|}NC>37W(kwg~_5V_Ws?3O@MT29O4tN<^l z);dlBn{HrB@)F+;&J>F&1IoJ+wFbV}iIZr@ z_+EU}msW=LKZYyL&l+fc aichivo 2>&1 & -exec 3>fifo - - diff --git a/topotest.py b/topotest.py deleted file mode 100755 index 3c6de24..0000000 --- a/topotest.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/python - -from mininet.topo import Topo -# from mininet.log import setLogLevel, info -# 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.link import TCLink, Intf -# from subprocess import call - - -class MiTopo(Topo): - - def build(self): - # Contructor de topologia custom - s1 = self.addSwitch('s1') - s2 = self.addSwitch('s2') - s3 = self.addSwitch('s3') - h1 = self.addHost('h1') - h2 = self.addHost('h2') - h3 = self.addHost('h3') - - self.addLink(s1, s2) - self.addLink(s2, s3) - self.addLink(s3, s1) - self.addLink(s1, h1) - self.addLink(s2, h2) - self.addLink(s3, h3) - # info('llegue al final de mitopo\n') - -# topos = { 'TopoMia': ( lambda: MiTopo() ) } diff --git a/topotest.pyc b/topotest.pyc deleted file mode 100644 index 169cc86b23d9953118e7cbf3562abe7a5b758aec..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 767 zcma)(O-sW-5Qb+rY1H~v!Gk{`cxcgHMMN(iw1>2Z zcQ&T+BA8@m=SgPYnaO$|o8A2L{bou(mxuKPX7=F{Jc4qfLeN-{NF=3#W`YurUWpb& z*JDYEPf^%Gy8gly3Pje2yQ=1u4G>&v4wof3;S^?e;8J2`6oMYKROI$gIcEjN?VQ2P z8{9L|o$F{J=tVRriBUG_IrJPt*mvkR*m2ltFmM<+gaS07CP{E5FdoRY3{~-)kq`a$ zJMvMWW#pp*81qFT&oi=;r#YyX!+IIIC97X%^~-D+^6YjEZjvO?qqft`vIOY7GPa2? zbb0Tj-9I;JK2uym@ovS(p!jGMpM&DgS>AE`p!1}M z!0f@1+!o7Q_C#~nO|Bv#j>}1r#D5~Tk2dWKVThm2<7FK-hTQI{T1aef%vqYgw cU8c6rZ7MLi-2Vz&?(nGY>6rhFE6`j22JanzT>t<8 -- 2.25.1