{"id":21020516,"url":"https://github.com/fishercoder1534/viro","last_synced_at":"2026-04-29T02:34:11.581Z","repository":{"id":16433286,"uuid":"19184751","full_name":"fishercoder1534/VIRO","owner":"fishercoder1534","description":"A shared repo for a class project 2","archived":false,"fork":false,"pushed_at":"2014-05-12T04:04:38.000Z","size":7684,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-01-20T12:46:32.359Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fishercoder1534.png","metadata":{"files":{"readme":"READMEv1.txt","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-26T18:16:04.000Z","updated_at":"2017-09-16T15:55:02.000Z","dependencies_parsed_at":"2022-09-17T00:40:13.152Z","dependency_job_id":null,"html_url":"https://github.com/fishercoder1534/VIRO","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fishercoder1534%2FVIRO","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fishercoder1534%2FVIRO/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fishercoder1534%2FVIRO/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fishercoder1534%2FVIRO/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fishercoder1534","download_url":"https://codeload.github.com/fishercoder1534/VIRO/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243450733,"owners_count":20293001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T10:41:34.973Z","updated_at":"2025-12-30T03:04:36.866Z","avatar_url":"https://github.com/fishercoder1534.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"README v1.0\n-------------------------------------------------\n1. Directory structure\n--------------------------------------------------\n\n+ viro_sim_py (root folder)\n-+ topology_workloads           // folder that contains various topologies and run files\n--+ topologies \t\t\t\t\t\t\t\t  // contains two topologies (fat-tree-k2 and isp-level3) along with *.run.sh files\n---+ small topologies\t\t\t\t\t  // contains four small topologies (4 node, 7 node, 8 node, 20 node)\n--+ workloads_for_report\t\t\t\t// contains *run.sh files based on \"--+ topologies\" folder, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t these files can be used for performance measurements, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t however not mandatory\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n-- compile_all.py\t\t\t\t\t\t\t\t// use this file to compile all python code files to generate (bytecode) *.pyc files\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t remember once compiled, add execute permission to all bytecode files by executing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"chmod 755 *.pyc\" from the folder where you executed compile_all.py\n-- constants.py\t\t\t\t\t\t\t\t\t// contains variable declarations for packet type, etc., \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t For this project, along with RDV_PUBLISH, RDV_QUERY, etc. \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t you may want to add a new operation/packet type like DATA = 0x0000\n\n-- plotTopo.py\t\t\t\t\t\t\t\t\t// use this file to generate the graphical topology of the network \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t using *.adlist and *.vid files (see section 3 below)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n-- traffic-gen.py\t\t\t\t\t\t\t  // *.run.sh file use the byte-code version of this file (ie. traffic-gen.pyc)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t to insert data packets into the network as defined by the *.workload file\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t (see section 4) However most of the *workload.run.sh files include this. \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t Hence unless you are writing your own topology or wanting to try some custom\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t pattern, you may not run this file separately. \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n-- veil.py\t\t\t\t\t\t\t\t\t\t\t// contains various helper functions to support veil_switch.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t Your project will require you to make some changes to this file \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t (e.g. function createRDV_REPLY)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n-- veil_switch.py\t\t\t\t\t\t\t\t// contains code for various algorithms like routing table construction, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t process packet, etc. Your project will require majority of the code \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t additions/modifications to this file. \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n-- veil_switch_skeleton.txt\t\t\t// provides details (pseudo-code) about several functions in veil_switch.py at a very high level\n\n-- vid-assignment.py\t\t\t\t\t  // this file uses *.adlist file to assign vid to hosts. (see section 2 below)\n\n\nNOTE: *.run.sh files:\nThese are shell executable files that help you run a number of commands together rather than you writing them one by one in the terminal.\nThe name of all such files will tell you a lot about its purpose. \n\nFor example: \n\t4.no.workload.run.sh - says it runs topology \"4\" with no workload (ie. no data packets in the network, only control packets)\n\tfat-tree-k2.test1.run - says it runs topology \"fat-tree-k2\" with \n\t\t\t\t\t\t\t\t\t\t\t\t\tworkload defined by \"fat-tree-k2-test1.workload\" file\n\t\nDO NOT CHANGE ANY OF THE FOLDER NAMES PROVIDED TO YOU IN THE BASE VERSION UNLESS YOU KNOW WHAT YOU ARE DOING!\nSince many of the *.run.sh files have relative paths defined in them that are based on these folder names, changing any of them may produce errors while execution.\n\n\n-------------------------------------------------\n2. How to Generate Vids for a Network\n--------------------------------------------------\n\nGiven the adjacency list of a network, use the script \"vid-assignment.py\" to generate the vids for each node. For example, the following command takes file \"4.adlist\" as input and generate file \"4.vid\" which stores the vid mapping, assuming your current directory is \"TOPOLOADS\":\n\npython ../vid-assignment.py 4.adlist 4.vid\n\n-------------------------------------------------\n3. Graphically Plot a Topology\n--------------------------------------------------\n\nOnce you assign vids, you can use the script \"plotTopo.py\" to visualize the network. \nFor example, use command \"python plotTopo.py 4.adlist 4.vid\" to generate \"4.adlist.png\". \nVisualization is not mandatory for the veil_switch to function, it just aides the user to view the topology.\n\nNOTE #1: if plotTopo.py script gives you some errors, make sure you have installed graphviz package.\nNOTE #2: use appropriate path while running this script\n\n--------------------------------------------------\n4. How to Test Your Code on Topologies with Workloads\n--------------------------------------------------\n\nFirst, please compile all Python source code to bytecode by executing \"python compile_all.py\", assuming you are using the Python emulator. If you are using Java, make sure to at least compile \"traffic-gen.py\", the traffic generator.\n\nAfter compiling it is necessary to add execute permission to all the byte-code generated (*.pyc) files. Hence once you run compile_all.py, please execute on the terminal from the same folder \"chmod 755 *.pyc\".\n\nThere are two sets of scripts for each topology: one without workloads and one with workloads, e.g. \"4.no.workload.run.sh\" and \"4.test1.run.sh\" for the 4-node topology. Please open the two files, look for the differences, and run each of them. Change the scripts accordingly if you use Java. \n\nNote #1: The \"veil_switch\" emulator provided, although capable of routing DATA packets, does not generate data traffic. Instead, a separate script \"traffic-gen.py\" is provided to do this job. The script scans the input workload file (with extension \"*.workload\"), and keeps injecting data packets to its attached switch; and the data packets then get routed in the switch network. Don't try to rewrite this traffic generator in Java, just run this provided script.\n\nNote #2: Each workload file (with extension \"*.workload\") has a 3-tuple schema: \u003csource, destination, rate\u003e. Open these files and see what is inside. File \"fat-tree-k2.test1.workload\" and file \"isp-level3.test1.workload\" contain only several Origin-Destination pairs for you to test/debug your code on the Fat-Tree topology and the Level-3 ISP topology respectively. The final workload files may contain much more O-D pairs.\n\n\n--------------------------------------------------\n5. How to Simulate Failures\n--------------------------------------------------\n\nTo simulate the failures which would trigger fast re-routing, for simplicity let us only simulate \"fatal\" failures on a set of pre-specified nodes: i.e. (1) we consider only node failures, instead of link failures; (2) we specify which nodes to fail, at what times, in an additional argument for \"veil_switch\"; (3) once failed, a node will never come back.\n\nTo do this, first you have to add an additional argument for your \"veil_switch\" program. Suppose your command line is \"veil_switch \u003cadlist_file\u003e \u003cvid_file\u003e \u003cip:port\u003e\", then you want to add an integer argument \u003cfail_time\u003e to the end:\n\nveil_switch.pyc \u003cadlist_file\u003e \u003cvid_file\u003e \u003cip:port\u003e \u003cfail_time\u003e\n\nIf fail_time==0, this switch never fails; if fail_time==15, it fails 15 seconds after it starts running.\n\nIn your \"veil_switch\" program, you may want to start a separate thread as a timer if fail_time\u003e0: sleep(fail_time), and then terminate the current process for the switch. You may need to handle some exceptions because of the termination. Don't forget to save those statistics (useful in your report) before the switch fails.\n\n--------------------------------------------------\n6. Some useful tips (For Ubuntu users)\n--------------------------------------------------\n\n1. Terminate all running instances of veil_switches\n\t\tuse command on terminal \"pkill -f veil_switch\"\n\t\t\n2. To check open ports \n\t  use command on terminal \"netstat -ntlp | grep LISTEN\"\n\t  \n3. When you run any of the topology_run (.sh) files, and would like to record all the terminal output to a file, use the following command.\n   Assuming you are in the folder where *run*.sh file is located, \n    use command \"./fat-tree-k2.set1.run.sh \u003e fat-tree-k2.set1.output \u0026\n    \n    This will create a file \"fat-tree-k2.set1.output\" which will have all the terminal output given out by various veil_switch(es). After sometime, you can terminate all instances of veil_switches, thereby opening all the ports. You can now use this file to analyze several details.\n    \n\n================================================\n- Last updated by Arvind (csci5221-s14-TA) on April 2, 2014\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffishercoder1534%2Fviro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffishercoder1534%2Fviro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffishercoder1534%2Fviro/lists"}