├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md ├── Vagrantfile ├── arproxy ├── README.md ├── __init__.py ├── arproxy.py └── utils.py ├── bin ├── color_log ├── dumpRIBs.sh ├── of_show_flows ├── of_show_groups ├── of_show_port_stats └── pretty_log.py ├── examples ├── README.md ├── test-ms │ ├── README.md │ ├── arp_bgp.pcap │ ├── config │ │ ├── bgp.conf │ │ ├── gauge-dp1.yaml │ │ ├── gauge-dp2.yaml │ │ ├── gauge-dp3.yaml │ │ ├── gauge-dp4.yaml │ │ ├── gauge.conf │ │ ├── sdx_global.cfg │ │ └── sdx_policies.cfg │ ├── flow_mods.log │ ├── mininet │ │ ├── mininet.cfg │ │ ├── sdnip.py │ │ ├── sdx_mininet.py │ │ └── simple_sdx.py │ ├── ofdpa │ │ ├── README.md │ │ ├── logs │ │ │ ├── inbound.flows │ │ │ ├── inbound.groups │ │ │ ├── main.flows │ │ │ ├── main.groups │ │ │ ├── outbound.flows │ │ │ └── outbound.groups │ │ ├── scripts │ │ │ ├── flowlog2cmd │ │ │ ├── ofdpa_add_flow │ │ │ ├── ofdpa_add_flow_basic │ │ │ ├── ofdpa_add_group_intf │ │ │ ├── ofdpa_add_group_rewrite │ │ │ ├── ofdpa_delete_flow_by_cookie │ │ │ ├── ofdpa_delete_flows │ │ │ ├── ofdpa_delete_groups │ │ │ ├── physint-docker │ │ │ ├── sdx_kill_docker │ │ │ ├── sdx_start_docker │ │ │ └── setup_torch_for_docker.sh │ │ └── test │ │ │ ├── AS_config │ │ │ ├── bgp-tst │ │ │ │ ├── Dockerfile │ │ │ │ └── quagga │ │ │ │ │ ├── a1 │ │ │ │ │ ├── bgpd.conf │ │ │ │ │ ├── daemons │ │ │ │ │ ├── debian.conf │ │ │ │ │ └── zebra.conf │ │ │ │ │ ├── b1 │ │ │ │ │ ├── bgpd.conf │ │ │ │ │ ├── daemons │ │ │ │ │ ├── debian.conf │ │ │ │ │ └── zebra.conf │ │ │ │ │ ├── c1 │ │ │ │ │ ├── bgpd.conf │ │ │ │ │ ├── daemons │ │ │ │ │ ├── debian.conf │ │ │ │ │ └── zebra.conf │ │ │ │ │ └── c2 │ │ │ │ │ ├── bgpd.conf │ │ │ │ │ ├── daemons │ │ │ │ │ ├── debian.conf │ │ │ │ │ └── zebra.conf │ │ │ └── test_containers │ │ │ ├── Vagrantfile │ │ │ ├── Vagrantfile-acs │ │ │ ├── config │ │ │ ├── bgp.conf │ │ │ ├── gauge-dp1.yaml │ │ │ ├── gauge-dp4.yaml │ │ │ ├── gauge.conf │ │ │ ├── sdx_global.cfg │ │ │ ├── sdx_global_multiswitch.cfg │ │ │ ├── sdx_global_oneswitch-acs.cfg │ │ │ ├── sdx_global_oneswitch-lts.cfg │ │ │ └── sdx_policies.cfg │ │ │ ├── init_arp_switch.sh │ │ │ ├── output │ │ │ └── flows │ │ │ ├── policies │ │ │ ├── participant_1.py │ │ │ ├── participant_2.py │ │ │ └── participant_3.py │ │ │ └── torch.cfg │ └── policies │ │ ├── participant_1.py │ │ ├── participant_2.py │ │ └── participant_3.py ├── test-mt │ ├── README.md │ ├── config │ │ ├── bgp.conf │ │ ├── sdx_global.cfg │ │ └── sdx_policies.cfg │ ├── flow_mods.log │ ├── mininet │ │ ├── mininet.cfg │ │ ├── sdnip.py │ │ ├── sdx_mininet.py │ │ └── simple_sdx.py │ └── policies │ │ ├── participant_1.py │ │ ├── participant_2.py │ │ └── participant_3.py └── test-os │ ├── README.md │ ├── config │ ├── bgp.conf │ ├── sdx_global.cfg │ ├── sdx_policies.cfg │ └── test.cfg │ ├── mininet │ ├── mininet.cfg │ ├── sdnip.py │ └── sdx_mininet.py │ └── policies │ ├── participant_1.py │ ├── participant_2.py │ └── participant_3.py ├── flanc ├── README.md ├── lib.py ├── log_client.py ├── ofdpa20.py ├── ofp10.py ├── ofp13.py ├── refmon.py ├── refmon_ms.cfg ├── refmon_mt.cfg ├── rest.py ├── server.py └── stats │ ├── dp.py │ ├── faucet_util.py │ ├── gauge.py │ ├── port.py │ ├── ryu-faucet.conf │ └── vlan.py ├── launch.sh ├── logServer.py ├── logmsg.py ├── pctrl ├── README.md ├── __init__.py ├── clean.sh ├── clean_mongo.py ├── decision_process.py ├── example_dynamic_policy_in.cfg ├── example_dynamic_policy_out.cfg ├── globs.py ├── lib.py ├── mds_lib.py ├── mds_lib_old.py ├── participant_controller.py ├── participant_server.py ├── peer.py ├── policy_loader.py ├── rib.py ├── ribm.py ├── run_pctrlr.sh ├── ss_lib.py ├── ss_rule_scheme.py └── supersets.py ├── setup ├── .vimrc ├── basic-setup.sh ├── cleanup.sh ├── grafana-init.sql ├── grafana-setup.sh ├── mininet-setup.sh ├── ovs-setup.sh ├── pip-basic-requires ├── pip-ryu-requires ├── pip-sdx-requires ├── ryu-flags.py ├── ryu-setup.sh └── sdx-setup.sh ├── test ├── README.md ├── buildall.sh ├── example_grafana_config │ ├── gauge-dp1.yaml │ ├── gauge-dp2.yaml │ ├── gauge-dp3.yaml │ ├── gauge-dp4.yaml │ └── gauge.conf ├── gen_big.py ├── gen_test.py ├── genlib.py ├── specs │ ├── README.md │ ├── test0-ms.spec │ ├── test0-mt.spec │ ├── test1-ms.spec │ ├── test1-mt.spec │ ├── test100-ms.spec │ ├── test2-ms.spec │ ├── test3-ms.spec │ ├── test30-ms.spec │ ├── test4-ms.spec │ ├── test5-ms.spec │ ├── test50-ms.spec │ ├── test6-ms.spec │ ├── test7-ms.spec │ ├── test7a-ms.spec │ ├── test8-ms.spec │ └── test99-ms.spec ├── startup.sh ├── templates │ ├── exabgp-bgp.conf │ ├── multi-switch-sdx_global.cfg │ ├── multi-switch-sdx_mininet.py │ ├── multi-table-sdx_global.cfg │ ├── multi-table-sdx_mininet.py │ ├── quagga-bgpd.conf │ ├── quagga-daemons │ ├── quagga-debian.conf │ ├── quagga-zebra.conf │ ├── sdnip.py │ └── test-README.md ├── tlib.py ├── tmgr.py └── tnode.py ├── util ├── __init__.py └── log.py ├── visualization ├── README.md ├── dockers │ ├── README.md │ ├── apache │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── apache_default │ │ ├── run │ │ └── web-interface │ │ │ ├── Princeton_shield.png │ │ │ ├── css │ │ │ ├── agency.css │ │ │ ├── animate-custom.css │ │ │ ├── app.css │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.min.css │ │ │ ├── bootstrap0.css │ │ │ ├── demo.css │ │ │ ├── detail.css │ │ │ ├── extension.css │ │ │ ├── font-awesome.css │ │ │ ├── fonts │ │ │ │ ├── BebasNeue-webfont.eot │ │ │ │ ├── BebasNeue-webfont.svg │ │ │ │ ├── BebasNeue-webfont.ttf │ │ │ │ ├── BebasNeue-webfont.woff │ │ │ │ ├── Dharma Type Font License.txt │ │ │ │ ├── fontomas-webfont.eot │ │ │ │ ├── fontomas-webfont.svg │ │ │ │ ├── fontomas-webfont.ttf │ │ │ │ ├── fontomas-webfont.woff │ │ │ │ ├── franchise-bold-webfont.eot │ │ │ │ ├── franchise-bold-webfont.svg │ │ │ │ ├── franchise-bold-webfont.ttf │ │ │ │ └── franchise-bold-webfont.woff │ │ │ ├── graph.css │ │ │ ├── jquery-ui.css │ │ │ ├── legend.css │ │ │ ├── line.css │ │ │ ├── main.css │ │ │ ├── normalize.css │ │ │ └── style.css │ │ │ ├── fonts │ │ │ ├── BebasNeue-webfont.eot │ │ │ ├── BebasNeue-webfont.svg │ │ │ ├── BebasNeue-webfont.ttf │ │ │ ├── BebasNeue-webfont.woff │ │ │ ├── Dharma Type Font License.txt │ │ │ ├── fontomas-webfont.eot │ │ │ ├── fontomas-webfont.svg │ │ │ ├── fontomas-webfont.ttf │ │ │ ├── fontomas-webfont.woff │ │ │ ├── franchise-bold-webfont.eot │ │ │ ├── franchise-bold-webfont.svg │ │ │ ├── franchise-bold-webfont.ttf │ │ │ └── franchise-bold-webfont.woff │ │ │ ├── force.csv │ │ │ ├── functioncalling.php │ │ │ ├── iSDX-nsdi-demo.png │ │ │ ├── index.html │ │ │ ├── isdx-demo-image.jpg │ │ │ ├── js │ │ │ ├── angular-route │ │ │ │ ├── README.md │ │ │ │ ├── angular-route.js │ │ │ │ ├── angular-route.min.js │ │ │ │ └── angular-route.min.js.map │ │ │ ├── angular │ │ │ │ ├── README.md │ │ │ │ ├── angular-csp.css │ │ │ │ ├── angular.js │ │ │ │ ├── angular.min.js │ │ │ │ ├── angular.min.js.gzip │ │ │ │ └── angular.min.js.map │ │ │ ├── animatedGraph.js │ │ │ ├── app.js │ │ │ ├── bootstrap.min.js │ │ │ ├── capacity-donut.js │ │ │ ├── controllers.js │ │ │ ├── create_lun.js │ │ │ ├── d3.min.js │ │ │ ├── d3 │ │ │ │ ├── CONTRIBUTING.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── d3.js │ │ │ │ └── d3.min.js │ │ │ ├── directives.js │ │ │ ├── directives │ │ │ │ ├── breadcrumb.js │ │ │ │ ├── sunburst-perspective.js │ │ │ │ └── sunburst.js │ │ │ ├── dropdownmenu.js │ │ │ ├── dynamicTable.js │ │ │ ├── filters.js │ │ │ ├── fixedduration-movable.js │ │ │ ├── gauge-render.js │ │ │ ├── gauge.js │ │ │ ├── globals.js │ │ │ ├── graphBiGraph.js │ │ │ ├── graphLink.js │ │ │ ├── health-check.js │ │ │ ├── jquery-1.9.0.js │ │ │ ├── liquidFillGauge.js │ │ │ ├── list_requests.js │ │ │ ├── list_serial.js │ │ │ ├── login.js │ │ │ ├── logout.js │ │ │ ├── main.js │ │ │ ├── predict-capacity.js │ │ │ ├── register.js │ │ │ ├── rickshaw.min.js │ │ │ ├── routes.js │ │ │ ├── series.back │ │ │ ├── services.js │ │ │ ├── socket.io.js │ │ │ ├── tabs.js │ │ │ ├── time-series1.js │ │ │ ├── time-series2.js │ │ │ ├── tooltip.js │ │ │ ├── underscore │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ └── underscore.js │ │ │ ├── updateBarChart.js │ │ │ ├── updateBarChart2.js │ │ │ └── vendor │ │ │ │ ├── cal-heatmap.min.js │ │ │ │ ├── d3.tip.index.js │ │ │ │ ├── d3.v3.min.js │ │ │ │ ├── modernizr-2.6.2.min.js │ │ │ │ ├── queue.v1.min.js │ │ │ │ ├── sankey.js │ │ │ │ └── topojson.v1.min.js │ │ │ ├── php │ │ │ ├── createLUNs.php │ │ │ ├── dbinit.php │ │ │ ├── dbproperties.php │ │ │ ├── executeCommand.php │ │ │ ├── getCPUHistory.php │ │ │ ├── getLastCapacity.php │ │ │ ├── getLastHealth.php │ │ │ ├── getRequestsStatus.php │ │ │ ├── getSerialNumbers.php │ │ │ ├── include │ │ │ │ ├── db_connect.php │ │ │ │ └── util.inc │ │ │ ├── kafka.so │ │ │ ├── lib │ │ │ │ └── kafka.so │ │ │ ├── login.php │ │ │ ├── rabbitmq_info.php │ │ │ ├── register.php │ │ │ └── updateRequests.php │ │ │ ├── profile.html │ │ │ └── us.png │ ├── docker-compose.yml │ ├── node │ │ ├── Dockerfile │ │ ├── index.js │ │ └── package.json │ └── redis-service │ │ ├── Dockerfile │ │ └── pub-sub │ │ ├── pub.py │ │ ├── settings.py │ │ └── sub.py ├── gen_sdx_viz ├── log_replay │ ├── README.md │ └── replay.py ├── lts-data-1 │ ├── README.md │ ├── dot │ │ ├── 000.dot │ │ ├── 001.dot │ │ ├── 002.dot │ │ ├── 003.dot │ │ ├── 004.dot │ │ ├── 005.dot │ │ ├── 006.dot │ │ ├── 007.dot │ │ ├── 008.dot │ │ ├── 009.dot │ │ ├── 010.dot │ │ ├── 011.dot │ │ ├── 012.dot │ │ ├── 013.dot │ │ ├── 014.dot │ │ ├── 015.dot │ │ ├── 016.dot │ │ ├── 017.dot │ │ ├── 018.dot │ │ ├── 019.dot │ │ ├── 020.dot │ │ ├── 021.dot │ │ ├── 022.dot │ │ ├── 023.dot │ │ ├── 024.dot │ │ ├── 025.dot │ │ ├── 026.dot │ │ ├── 027.dot │ │ ├── 028.dot │ │ ├── 029.dot │ │ ├── 030.dot │ │ ├── 031.dot │ │ ├── 032.dot │ │ ├── 033.dot │ │ ├── 034.dot │ │ ├── 035.dot │ │ ├── 036.dot │ │ ├── 037.dot │ │ ├── 038.dot │ │ ├── 039.dot │ │ ├── 040.dot │ │ ├── 041.dot │ │ ├── 042.dot │ │ ├── 043.dot │ │ ├── 044.dot │ │ ├── 045.dot │ │ ├── 046.dot │ │ ├── 047.dot │ │ ├── 048.dot │ │ ├── 049.dot │ │ ├── 050.dot │ │ ├── 051.dot │ │ ├── 052.dot │ │ ├── 053.dot │ │ └── 054.dot │ ├── flows │ │ ├── 000.flow │ │ ├── 001.flow │ │ ├── 002.flow │ │ ├── 003.flow │ │ ├── 004.flow │ │ ├── 005.flow │ │ ├── 006.flow │ │ ├── 007.flow │ │ ├── 008.flow │ │ ├── 009.flow │ │ ├── 010.flow │ │ ├── 011.flow │ │ ├── 012.flow │ │ ├── 013.flow │ │ ├── 014.flow │ │ ├── 015.flow │ │ ├── 016.flow │ │ ├── 017.flow │ │ ├── 018.flow │ │ ├── 019.flow │ │ ├── 020.flow │ │ ├── 021.flow │ │ ├── 022.flow │ │ ├── 023.flow │ │ ├── 024.flow │ │ ├── 025.flow │ │ ├── 026.flow │ │ ├── 027.flow │ │ ├── 028.flow │ │ ├── 029.flow │ │ ├── 030.flow │ │ ├── 031.flow │ │ ├── 032.flow │ │ ├── 033.flow │ │ ├── 034.flow │ │ ├── 035.flow │ │ ├── 036.flow │ │ ├── 037.flow │ │ ├── 038.flow │ │ ├── 039.flow │ │ ├── 040.flow │ │ ├── 041.flow │ │ ├── 042.flow │ │ ├── 043.flow │ │ ├── 044.flow │ │ ├── 045.flow │ │ ├── 046.flow │ │ ├── 047.flow │ │ ├── 048.flow │ │ ├── 049.flow │ │ ├── 050.flow │ │ ├── 051.flow │ │ ├── 052.flow │ │ ├── 053.flow │ │ ├── 054.flow │ │ └── 055.flow │ ├── png │ │ ├── 000.png │ │ ├── 001.png │ │ ├── 002.png │ │ ├── 003.png │ │ ├── 004.png │ │ ├── 005.png │ │ ├── 006.png │ │ ├── 007.png │ │ ├── 008.png │ │ ├── 009.png │ │ ├── 010.png │ │ ├── 011.png │ │ ├── 012.png │ │ ├── 013.png │ │ ├── 014.png │ │ ├── 015.png │ │ ├── 016.png │ │ ├── 017.png │ │ ├── 018.png │ │ ├── 019.png │ │ ├── 020.png │ │ ├── 021.png │ │ ├── 022.png │ │ ├── 023.png │ │ ├── 024.png │ │ ├── 025.png │ │ ├── 026.png │ │ ├── 027.png │ │ ├── 028.png │ │ ├── 029.png │ │ ├── 030.png │ │ ├── 031.png │ │ ├── 032.png │ │ ├── 033.png │ │ ├── 034.png │ │ ├── 035.png │ │ ├── 036.png │ │ ├── 037.png │ │ ├── 038.png │ │ ├── 039.png │ │ ├── 040.png │ │ ├── 041.png │ │ ├── 042.png │ │ ├── 043.png │ │ ├── 044.png │ │ ├── 045.png │ │ ├── 046.png │ │ ├── 047.png │ │ ├── 048.png │ │ ├── 049.png │ │ ├── 050.png │ │ ├── 051.png │ │ ├── 052.png │ │ ├── 053.png │ │ └── 054.png │ └── ports │ │ ├── 000.ports │ │ ├── 001.ports │ │ ├── 002.ports │ │ ├── 003.ports │ │ ├── 004.ports │ │ ├── 005.ports │ │ ├── 006.ports │ │ ├── 007.ports │ │ ├── 008.ports │ │ ├── 009.ports │ │ ├── 010.ports │ │ ├── 011.ports │ │ ├── 012.ports │ │ ├── 013.ports │ │ ├── 014.ports │ │ ├── 015.ports │ │ ├── 016.ports │ │ ├── 017.ports │ │ ├── 018.ports │ │ ├── 019.ports │ │ ├── 020.ports │ │ ├── 021.ports │ │ ├── 022.ports │ │ ├── 023.ports │ │ ├── 024.ports │ │ ├── 025.ports │ │ ├── 026.ports │ │ ├── 027.ports │ │ ├── 028.ports │ │ ├── 029.ports │ │ ├── 030.ports │ │ ├── 031.ports │ │ ├── 032.ports │ │ ├── 033.ports │ │ ├── 034.ports │ │ ├── 035.ports │ │ ├── 036.ports │ │ ├── 037.ports │ │ ├── 038.ports │ │ ├── 039.ports │ │ ├── 040.ports │ │ ├── 041.ports │ │ ├── 042.ports │ │ ├── 043.ports │ │ ├── 044.ports │ │ ├── 045.ports │ │ ├── 046.ports │ │ ├── 047.ports │ │ ├── 048.ports │ │ ├── 049.ports │ │ ├── 050.ports │ │ ├── 051.ports │ │ ├── 052.ports │ │ ├── 053.ports │ │ └── 054.ports ├── lts-data │ ├── dot │ │ ├── 000.dot │ │ ├── 001.dot │ │ ├── 002.dot │ │ ├── 003.dot │ │ ├── 004.dot │ │ ├── 005.dot │ │ ├── 006.dot │ │ ├── 007.dot │ │ ├── 008.dot │ │ ├── 009.dot │ │ ├── 010.dot │ │ ├── 011.dot │ │ ├── 012.dot │ │ ├── 013.dot │ │ ├── 014.dot │ │ ├── 015.dot │ │ ├── 016.dot │ │ ├── 017.dot │ │ ├── 018.dot │ │ ├── 019.dot │ │ ├── 020.dot │ │ ├── 021.dot │ │ ├── 022.dot │ │ ├── 023.dot │ │ ├── 024.dot │ │ ├── 025.dot │ │ ├── 026.dot │ │ ├── 027.dot │ │ ├── 028.dot │ │ ├── 029.dot │ │ ├── 030.dot │ │ ├── 031.dot │ │ ├── 032.dot │ │ ├── 033.dot │ │ ├── 034.dot │ │ ├── 035.dot │ │ ├── 036.dot │ │ ├── 037.dot │ │ ├── 038.dot │ │ ├── 039.dot │ │ ├── 040.dot │ │ ├── 041.dot │ │ ├── 042.dot │ │ ├── 043.dot │ │ ├── 044.dot │ │ ├── 045.dot │ │ ├── 046.dot │ │ ├── 047.dot │ │ ├── 048.dot │ │ ├── 049.dot │ │ ├── 050.dot │ │ ├── 051.dot │ │ ├── 052.dot │ │ ├── 053.dot │ │ ├── 054.dot │ │ ├── 055.dot │ │ ├── 056.dot │ │ ├── 057.dot │ │ ├── 058.dot │ │ ├── 059.dot │ │ ├── 060.dot │ │ ├── 061.dot │ │ ├── 062.dot │ │ ├── 063.dot │ │ ├── 064.dot │ │ ├── 065.dot │ │ ├── 066.dot │ │ ├── 067.dot │ │ ├── 068.dot │ │ ├── 069.dot │ │ ├── 070.dot │ │ ├── 071.dot │ │ ├── 072.dot │ │ ├── 073.dot │ │ ├── 074.dot │ │ ├── 075.dot │ │ ├── 076.dot │ │ ├── 077.dot │ │ ├── 078.dot │ │ ├── 079.dot │ │ ├── 080.dot │ │ ├── 081.dot │ │ ├── 082.dot │ │ └── 083.dot │ ├── flows │ │ ├── 000.flow │ │ ├── 001.flow │ │ ├── 002.flow │ │ ├── 003.flow │ │ ├── 004.flow │ │ ├── 005.flow │ │ ├── 006.flow │ │ ├── 007.flow │ │ ├── 008.flow │ │ ├── 009.flow │ │ ├── 010.flow │ │ ├── 011.flow │ │ ├── 012.flow │ │ ├── 013.flow │ │ ├── 014.flow │ │ ├── 015.flow │ │ ├── 016.flow │ │ ├── 017.flow │ │ ├── 018.flow │ │ ├── 019.flow │ │ ├── 020.flow │ │ ├── 021.flow │ │ ├── 022.flow │ │ ├── 023.flow │ │ ├── 024.flow │ │ ├── 025.flow │ │ ├── 026.flow │ │ ├── 027.flow │ │ ├── 028.flow │ │ ├── 029.flow │ │ ├── 030.flow │ │ ├── 031.flow │ │ ├── 032.flow │ │ ├── 033.flow │ │ ├── 034.flow │ │ ├── 035.flow │ │ ├── 036.flow │ │ ├── 037.flow │ │ ├── 038.flow │ │ ├── 039.flow │ │ ├── 040.flow │ │ ├── 041.flow │ │ ├── 042.flow │ │ ├── 043.flow │ │ ├── 044.flow │ │ ├── 045.flow │ │ ├── 046.flow │ │ ├── 047.flow │ │ ├── 048.flow │ │ ├── 049.flow │ │ ├── 050.flow │ │ ├── 051.flow │ │ ├── 052.flow │ │ ├── 053.flow │ │ ├── 054.flow │ │ ├── 055.flow │ │ ├── 056.flow │ │ ├── 057.flow │ │ ├── 058.flow │ │ ├── 059.flow │ │ ├── 060.flow │ │ ├── 061.flow │ │ ├── 062.flow │ │ ├── 063.flow │ │ ├── 064.flow │ │ ├── 065.flow │ │ ├── 066.flow │ │ ├── 067.flow │ │ ├── 068.flow │ │ ├── 069.flow │ │ ├── 070.flow │ │ ├── 071.flow │ │ ├── 072.flow │ │ ├── 073.flow │ │ ├── 074.flow │ │ ├── 075.flow │ │ ├── 076.flow │ │ ├── 077.flow │ │ ├── 078.flow │ │ ├── 079.flow │ │ ├── 080.flow │ │ ├── 081.flow │ │ ├── 082.flow │ │ └── 083.flow │ ├── png │ │ ├── 000.png │ │ ├── 001.png │ │ ├── 002.png │ │ ├── 003.png │ │ ├── 004.png │ │ ├── 005.png │ │ ├── 006.png │ │ ├── 007.png │ │ ├── 008.png │ │ ├── 009.png │ │ ├── 010.png │ │ ├── 011.png │ │ ├── 012.png │ │ ├── 013.png │ │ ├── 014.png │ │ ├── 015.png │ │ ├── 016.png │ │ ├── 017.png │ │ ├── 018.png │ │ ├── 019.png │ │ ├── 020.png │ │ ├── 021.png │ │ ├── 022.png │ │ ├── 023.png │ │ ├── 024.png │ │ ├── 025.png │ │ ├── 026.png │ │ ├── 027.png │ │ ├── 028.png │ │ ├── 029.png │ │ ├── 030.png │ │ ├── 031.png │ │ ├── 032.png │ │ ├── 033.png │ │ ├── 034.png │ │ ├── 035.png │ │ ├── 036.png │ │ ├── 037.png │ │ ├── 038.png │ │ ├── 039.png │ │ ├── 040.png │ │ ├── 041.png │ │ ├── 042.png │ │ ├── 043.png │ │ ├── 044.png │ │ ├── 045.png │ │ ├── 046.png │ │ ├── 047.png │ │ ├── 048.png │ │ ├── 049.png │ │ ├── 050.png │ │ ├── 051.png │ │ ├── 052.png │ │ ├── 053.png │ │ ├── 054.png │ │ ├── 055.png │ │ ├── 056.png │ │ ├── 057.png │ │ ├── 058.png │ │ ├── 059.png │ │ ├── 060.png │ │ ├── 061.png │ │ ├── 062.png │ │ ├── 063.png │ │ ├── 064.png │ │ ├── 065.png │ │ ├── 066.png │ │ ├── 067.png │ │ ├── 068.png │ │ ├── 069.png │ │ ├── 070.png │ │ ├── 071.png │ │ ├── 072.png │ │ ├── 073.png │ │ ├── 074.png │ │ ├── 075.png │ │ ├── 076.png │ │ ├── 077.png │ │ ├── 078.png │ │ ├── 079.png │ │ ├── 080.png │ │ ├── 081.png │ │ ├── 082.png │ │ └── 083.png │ └── ports │ │ ├── 000.ports │ │ ├── 001.ports │ │ ├── 002.ports │ │ ├── 003.ports │ │ ├── 004.ports │ │ ├── 005.ports │ │ ├── 006.ports │ │ ├── 007.ports │ │ ├── 008.ports │ │ ├── 009.ports │ │ ├── 010.ports │ │ ├── 011.ports │ │ ├── 012.ports │ │ ├── 013.ports │ │ ├── 014.ports │ │ ├── 015.ports │ │ ├── 016.ports │ │ ├── 017.ports │ │ ├── 018.ports │ │ ├── 019.ports │ │ ├── 020.ports │ │ ├── 021.ports │ │ ├── 022.ports │ │ ├── 023.ports │ │ ├── 024.ports │ │ ├── 025.ports │ │ ├── 026.ports │ │ ├── 027.ports │ │ ├── 028.ports │ │ ├── 029.ports │ │ ├── 030.ports │ │ ├── 031.ports │ │ ├── 032.ports │ │ ├── 033.ports │ │ ├── 034.ports │ │ ├── 035.ports │ │ ├── 036.ports │ │ ├── 037.ports │ │ ├── 038.ports │ │ ├── 039.ports │ │ ├── 040.ports │ │ ├── 041.ports │ │ ├── 042.ports │ │ ├── 043.ports │ │ ├── 044.ports │ │ ├── 045.ports │ │ ├── 046.ports │ │ ├── 047.ports │ │ ├── 048.ports │ │ ├── 049.ports │ │ ├── 050.ports │ │ ├── 051.ports │ │ ├── 052.ports │ │ ├── 053.ports │ │ ├── 054.ports │ │ ├── 055.ports │ │ ├── 056.ports │ │ ├── 057.ports │ │ ├── 058.ports │ │ ├── 059.ports │ │ ├── 060.ports │ │ ├── 061.ports │ │ ├── 062.ports │ │ ├── 063.ports │ │ ├── 064.ports │ │ ├── 065.ports │ │ ├── 066.ports │ │ ├── 067.ports │ │ ├── 068.ports │ │ ├── 069.ports │ │ ├── 070.ports │ │ ├── 071.ports │ │ ├── 072.ports │ │ ├── 073.ports │ │ ├── 074.ports │ │ ├── 075.ports │ │ ├── 076.ports │ │ ├── 077.ports │ │ ├── 078.ports │ │ ├── 079.ports │ │ ├── 080.ports │ │ ├── 081.ports │ │ ├── 082.ports │ │ └── 083.ports ├── quickviz ├── test-ms-lts.cfg ├── test-ms.cfg └── test-ms.dot ├── xctrl ├── README.md ├── __init__.py ├── client.py ├── flowmodmsg.py ├── flowmodsender.py ├── gss.py ├── lib.py ├── mds.py ├── vmac_lib.py ├── xctrl-gss.cfg ├── xctrl-mds.cfg └── xctrl.py └── xrs ├── README.md ├── __init__.py ├── client.py ├── core.py ├── route_server.py └── server.py /.gitignore: -------------------------------------------------------------------------------- 1 | tags 2 | *.pyc 3 | *.json 4 | *.bak 5 | *.DS_Store 6 | .vagrant 7 | *.pdf 8 | *.bbl 9 | *.brf 10 | *.blg 11 | *.aux 12 | *.out 13 | *.log 14 | *.swp 15 | *~ 16 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # This is the base Vagrantfile used to create the iSDX box. 2 | 3 | #Vagrant.configure("1") do |config| 4 | #config.vm.boot_mode = :gui 5 | #end 6 | 7 | Vagrant.configure("2") do |config| 8 | config.vm.box = "ubuntu/trusty64" 9 | #config.vm.box = "ubuntu/trusty32" 10 | 11 | config.vm.provider "virtualbox" do |v| 12 | v.customize ["modifyvm", :id, "--cpuexecutioncap", "80"] 13 | v.customize ["modifyvm", :id, "--memory", "2048"] 14 | end 15 | 16 | ## Guest Config 17 | config.vm.hostname = "iSDX" 18 | config.vm.network :private_network, ip: "172.28.128.3" 19 | #config.vm.network :private_network, type: "dhcp" 20 | #config.vm.network :private_network, ip: "192.168.0.300" 21 | config.vm.network :forwarded_port, guest:6633, host:6637 # open flow controller 22 | config.vm.network :forwarded_port, guest:3000, host:3000 # grafana 23 | 24 | ## Provisioning 25 | config.vm.provision :shell, privileged: false, :path => "setup/basic-setup.sh" 26 | config.vm.provision :shell, privileged: false, :path => "setup/ovs-setup.sh" 27 | config.vm.provision :shell, privileged: false, :path => "setup/mininet-setup.sh" 28 | config.vm.provision :shell, privileged: false, :path => "setup/ryu-setup.sh" 29 | config.vm.provision :shell, privileged: false, :path => "setup/grafana-setup.sh" 30 | config.vm.provision :shell, privileged: false, :path => "setup/sdx-setup.sh" 31 | 32 | ## SSH config 33 | config.ssh.forward_x11 = true 34 | 35 | 36 | #config.vm.synced_folder ".", "/home/vagrant/iSDX", type: "rsync", 37 | #rsync__exclude: ".git/" 38 | config.vm.synced_folder ".", "/home/vagrant/iSDX" 39 | #config.vm.synced_folder ".", "/home/vagrant/iSDX", owner: "quagga", group: "quaggavty" 40 | 41 | end 42 | -------------------------------------------------------------------------------- /arproxy/README.md: -------------------------------------------------------------------------------- 1 | # arproxy - ARP Proxy 2 | 3 | This controller is in charge of pushing all the flow rules to the SDX fabric that are necessary to get the SDX running. 4 | 5 | See examples/test-ms/README.md for an example of how to run xrs along with everything else. 6 | -------------------------------------------------------------------------------- /arproxy/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/arproxy/__init__.py -------------------------------------------------------------------------------- /bin/dumpRIBs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for rib in 'input' 'local' 'output'; do 4 | echo RIB: $rib 5 | for i in {100,200,300} 6 | do 7 | echo == AS $i 8 | mongoexport -db demo -c ${rib}_$i -f as_path,prefix,next_hop 9 | done 10 | echo 11 | done 12 | -------------------------------------------------------------------------------- /bin/of_show_flows: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | HOST=localhost 4 | PORT=8080 5 | 6 | if [ $# -eq 2 -a $1 = '-b' ]; then 7 | DO_BYTES=1 8 | shift 9 | fi 10 | 11 | if [ $# -ne 1 ]; then 12 | CMD=`basename $0` 13 | echo "usage: $CMD [-b] [-n] [-p] " 14 | exit 1 15 | fi 16 | DPID=$1 17 | 18 | FILTER=cat 19 | while getopts "p:n" opt; do 20 | case $opt in 21 | p) FILTER="grep in_port...$OPTARG\}" 22 | ;; 23 | n) FILTER="grep -v packet_count...0" 24 | ;; 25 | \?) echo "Unknown arg: $OPTARG" >&2 26 | exit 1; 27 | ;; 28 | esac 29 | done 30 | 31 | if [ -z "$DO_BYTES" ]; then 32 | curl -X GET http://$HOST:$PORT/stats/flow/$DPID 2> /dev/null| 33 | perl -ne 'while (s/("actions[^]]*?\]).*?cookie...(\d+).*?("packet_count.. (\d+)).*?("priority.. \d+).*?("match": {[^}]*})//) { $part = $2 >> 16; $pcookie = ""; $pcookie = ("(P_$part/" . ($2 & 0xffff) . ")") if $part; printf "$2 $pcookie $6, $1, $5, $3\n";}' | $FILTER 34 | else 35 | curl -X GET http://$HOST:$PORT/stats/flow/$DPID 2> /dev/null| 36 | perl -ne 'while (s/("actions[^]]*?\]).*?cookie...(\d+).*?("byte_count.. (\d+)).*?("priority.. \d+).*?("match": {[^}]*})//) { $part = $2 >> 16; $pcookie = ""; $pcookie = ("(P_$part/" . ($2 & 0xffff) . ")") if $part; printf "$2 $pcookie $6, $1, $5, $3\n";}' | $FILTER 37 | fi 38 | -------------------------------------------------------------------------------- /bin/of_show_groups: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | HOST=localhost 4 | PORT=8080 5 | 6 | if [ $# -ne 1 ]; then 7 | CMD=`basename $0` 8 | echo "usage: $CMD " 9 | exit 1 10 | fi 11 | DPID=$1 12 | 13 | curl -X GET http://$HOST:$PORT/stats/groupdesc/$DPID 2> /dev/null| 14 | perl -ne 's/.*?buckets//; @a = split("buckets"); foreach (@a) {my @b; while (s/"actions[^]]*?\]//) {push(@b,$&)} print "$& " if /"group_id.. (\d+)/; print join(" ", @b) . "\n"}' 15 | 16 | # perl -ne 'while (s/("actions[^]]*?\]).*?("group_id.. (\d+))//) { printf "$2\t(0x%x)\t$1\n", $3;}' 17 | 18 | -------------------------------------------------------------------------------- /bin/of_show_port_stats: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | HOST=localhost 4 | PORT=8080 5 | DPID=1 6 | 7 | if [ $# -gt 0 ]; then 8 | DPID=$1 9 | fi 10 | 11 | FILTER=cat 12 | while getopts "p:n" opt; do 13 | case $opt in 14 | p) FILTER="grep port_no...$OPTARG.\" " 15 | ;; 16 | n) FILTER="grep -v rx_packets...0..tx_packets...0" 17 | ;; 18 | \?) echo "Unknown arg: $OPTARG" >&2 19 | exit 1; 20 | ;; 21 | esac 22 | done 23 | 24 | curl -X GET http://$HOST:$PORT/stats/port/$DPID 2> /dev/null| 25 | perl -ne '@a = split(/}\s*,\s*{/); foreach (@a) {$line=$_; $port = $& if $line =~ /"port_no.. [^,]*+/; $rx = $& if $line =~ /"rx_packets.. \d+/; $tx = $& if $line =~ /"tx_packets.. \d+/; print "$port $rx $tx\n";}' | $FILTER 26 | 27 | #perl -ne 'while (s/(("rx_packets.. \d+)|("port_no.. [^,]*+)|("tx_packets.. \d+))//) { print "$1\n";}' | $FILTER 28 | #perl -ne 'while (s/("rx_packets.. \d+).*?("port_no.. \d+).*?("tx_packets.. \d+)//) { print "$2 $1 $3\n";}' | $FILTER 29 | 30 | -------------------------------------------------------------------------------- /bin/pretty_log.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Script for pretty printing the SDXlog file. 4 | # This will pretty print any json in the log that was formatted using the util.log.pformat() function 5 | # (so long as the json string is at the end of the line). 6 | 7 | import pprint 8 | import json 9 | import fileinput 10 | 11 | for line in fileinput.input(): 12 | s = line.rstrip("\r\n") 13 | i = s.find('{') 14 | if i == -1: 15 | print s 16 | continue 17 | # looks like it might be json 18 | try: 19 | # load it and pretty print it 20 | msg = json.loads(s[i:]) 21 | print s[:i] + "\n" + pprint.pformat(msg) 22 | except: 23 | # it was't json after all. Just print it. 24 | print s 25 | -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | # iSDX - Examples 2 | 3 | The sub-directories here correspond to the three switch modes of iSDX: 4 | * `test-mt` - are examples using the *multi-table* configuration. These can 5 | be used on switches that support multiple tables, such as Open 6 | vSwitch which is used by Mininet. 7 | * `test-ms` - are examples using the *multi-switch* configuration. When 8 | switches don't support multiple tables, the effect of multiple 9 | tables can be achieved by using multiple switches. 10 | * `test-os` - are examples using the *one-switch-with-loopbacks* 11 | configuration. This is like the multi-switch configuration, but 12 | rather than using multiple switches, it uses a single switch with some of 13 | the output ports looped back to input ports so that packets can 14 | make multiple passes through the same switch. 15 | 16 | -------------------------------------------------------------------------------- /examples/test-ms/arp_bgp.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/examples/test-ms/arp_bgp.pcap -------------------------------------------------------------------------------- /examples/test-ms/config/bgp.conf: -------------------------------------------------------------------------------- 1 | group rs { 2 | process parsed-route-backend { 3 | run /home/vagrant/iSDX/xrs/client.py; 4 | encoder json; 5 | receive-routes; 6 | } 7 | 8 | neighbor 172.0.0.1 { 9 | description "Virtual AS A"; 10 | router-id 172.0.255.254; 11 | local-address 172.0.255.254; 12 | local-as 65000; 13 | peer-as 100; 14 | hold-time 180; 15 | } 16 | 17 | neighbor 172.0.0.11 { 18 | description "Virtual AS B"; 19 | router-id 172.0.255.254; 20 | local-address 172.0.255.254; 21 | local-as 65000; 22 | peer-as 200; 23 | hold-time 180; 24 | } 25 | 26 | neighbor 172.0.0.21 { 27 | description "Virtual AS C Router C1"; 28 | router-id 172.0.255.254; 29 | local-address 172.0.255.254; 30 | local-as 65000; 31 | peer-as 300; 32 | hold-time 180; 33 | } 34 | neighbor 172.0.0.22 { 35 | description "Virtual AS C Router C2"; 36 | router-id 172.0.255.254; 37 | local-address 172.0.255.254; 38 | local-as 65000; 39 | peer-as 300; 40 | hold-time 180; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /examples/test-ms/config/gauge-dp1.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | dp_id: 0x0000000000000001 # The id of the datapath to be controlled 3 | name: "Main-1" # The name of the datapath for use with logging 4 | description: "SDX Main Switch" # Purely informational 5 | hardware: "??" 6 | monitor_ports: True # whether gauge should monitor stats for ports 7 | monitor_ports_file: "ports.out" # The file to record ports statistics 8 | monitor_ports_interval: 10 # the polling interval for port stats in seconds 9 | monitor_flow_table: True # whether gauge should take periodic flow table dumps 10 | monitor_flow_table_file: "ft.out" # the file to record flow table dumps 11 | monitor_flow_table_interval: 10 # the polling interval for flow table monitoring 12 | influxdb_stats: True 13 | interfaces: 14 | 2: 15 | name: "Outbound" # name for this port, used for logging/monitoring 16 | 1: 17 | name: "Inbound" 18 | 4: 19 | name: "Route Server" 20 | 3: 21 | name: "ARP" 22 | 5: 23 | name: "A" 24 | 6: 25 | name: "B" 26 | 7: 27 | name: "C1" 28 | 8: 29 | name: "C2" 30 | -------------------------------------------------------------------------------- /examples/test-ms/config/gauge-dp2.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | dp_id: 0x0000000000000002 # The id of the datapath to be controlled 3 | name: "Inbound-1" # The name of the datapath for use with logging 4 | description: "SDX Inbound Switch" # Purely informational 5 | hardware: "??" 6 | monitor_ports: True # whether gauge should monitor stats for ports 7 | monitor_ports_file: "ports.out" # The file to record ports statistics 8 | monitor_ports_interval: 10 # the polling interval for port stats in seconds 9 | monitor_flow_table: True # whether gauge should take periodic flow table dumps 10 | monitor_flow_table_file: "ft.out" # the file to record flow table dumps 11 | monitor_flow_table_interval: 10 # the polling interval for flow table monitoring 12 | influxdb_stats: True 13 | interfaces: 14 | 1: 15 | name: "Main" 16 | 2: 17 | name: "Outbound" 18 | -------------------------------------------------------------------------------- /examples/test-ms/config/gauge-dp3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | dp_id: 0x0000000000000003 # The id of the datapath to be controlled 3 | name: "Outbound-1" # The name of the datapath for use with logging 4 | description: "SDX Outbound Switch" # Purely informational 5 | hardware: "??" 6 | monitor_ports: True # whether gauge should monitor stats for ports 7 | monitor_ports_file: "ports.out" # The file to record ports statistics 8 | monitor_ports_interval: 10 # the polling interval for port stats in seconds 9 | monitor_flow_table: True # whether gauge should take periodic flow table dumps 10 | monitor_flow_table_file: "ft.out" # the file to record flow table dumps 11 | monitor_flow_table_interval: 10 # the polling interval for flow table monitoring 12 | influxdb_stats: True 13 | interfaces: 14 | 1: 15 | name: "Main" 16 | 2: 17 | name: "Inbound" 18 | -------------------------------------------------------------------------------- /examples/test-ms/config/gauge-dp4.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | dp_id: 0x0000000000000004 # The id of the datapath to be controlled 3 | name: "ARP-1" # The name of the datapath for use with logging 4 | description: "SDX ARP Switch" # Purely informational 5 | hardware: "??" 6 | monitor_ports: True # whether gauge should monitor stats for ports 7 | monitor_ports_file: "ports.out" # The file to record ports statistics 8 | monitor_ports_interval: 10 # the polling interval for port stats in seconds 9 | monitor_flow_table: True # whether gauge should take periodic flow table dumps 10 | monitor_flow_table_file: "ft.out" # the file to record flow table dumps 11 | monitor_flow_table_interval: 10 # the polling interval for flow table monitoring 12 | influxdb_stats: True 13 | interfaces: 14 | 1: 15 | name: "Main" 16 | 2: 17 | name: "ARP Proxy" 18 | -------------------------------------------------------------------------------- /examples/test-ms/config/gauge.conf: -------------------------------------------------------------------------------- 1 | gauge-dp1.yaml 2 | gauge-dp2.yaml 3 | gauge-dp3.yaml 4 | gauge-dp4.yaml 5 | -------------------------------------------------------------------------------- /examples/test-ms/config/sdx_policies.cfg: -------------------------------------------------------------------------------- 1 | { 2 | "1": "participant_1.py", 3 | "2": "participant_2.py", 4 | "3": "participant_3.py" 5 | } 6 | -------------------------------------------------------------------------------- /examples/test-ms/mininet/mininet.cfg: -------------------------------------------------------------------------------- 1 | { 2 | "a1": { 3 | "asn": 100, 4 | "ip": "172.0.0.1/16", 5 | "mac": "08:00:27:89:3b:9f", 6 | "netnames": [ 7 | "h1_a1", 8 | "h2_a1" 9 | ], 10 | "networks": [ 11 | "100.0.0.0/24", 12 | "110.0.0.0/24" 13 | ], 14 | "port": 5 15 | }, 16 | "b1": { 17 | "asn": 200, 18 | "ip": "172.0.0.11/16", 19 | "mac": "08:00:27:92:18:1f", 20 | "netnames": [ 21 | "h1_b1", 22 | "h2_b1" 23 | ], 24 | "networks": [ 25 | "140.0.0.0/24", 26 | "150.0.0.0/24" 27 | ], 28 | "port": 6 29 | }, 30 | "c1": { 31 | "asn": 300, 32 | "ip": "172.0.0.21/16", 33 | "mac": "08:00:27:54:56:ea", 34 | "netnames": [ 35 | "h1_c1", 36 | "h2_c1" 37 | ], 38 | "networks": [ 39 | "140.0.0.0/24", 40 | "150.0.0.0/24" 41 | ], 42 | "port": 7 43 | }, 44 | "c2": { 45 | "asn": 300, 46 | "ip": "172.0.0.22/16", 47 | "mac": "08:00:27:bd:f8:b2", 48 | "netnames": [ 49 | "h1_c2", 50 | "h2_c2" 51 | ], 52 | "networks": [ 53 | "140.0.0.0/24", 54 | "150.0.0.0/24" 55 | ], 56 | "port": 8 57 | } 58 | } -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/logs/inbound.flows: -------------------------------------------------------------------------------- 1 | "match": {"dl_dst": "00:00:00:00:00:03/00:00:00:00:ff:ff", "dl_vlan": "1"}, "actions": ["GROUP:278115731"], "priority": 3, "packet_count": 0 2 | "match": {"dl_vlan": "1"}, "actions": ["GROUP:65537"], "priority": 1, "packet_count": 0 3 | "match": {"dl_dst": "00:00:00:00:00:03/00:00:00:00:ff:ff", "dl_vlan": "1", "nw_proto": 6, "tp_dst": 4321}, "actions": ["GROUP:278115731"], "priority": 4, "packet_count": 0 4 | "match": {"dl_dst": "00:00:00:00:00:03/00:00:00:00:ff:ff", "dl_vlan": "1", "nw_proto": 6, "tp_dst": 4322}, "actions": ["GROUP:271958682"], "priority": 4, "packet_count": 0 5 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/logs/inbound.groups: -------------------------------------------------------------------------------- 1 | "group_id": 65537 "actions": ["OUTPUT:1", "POP_VLAN"] 2 | "group_id": 271958682 "actions": ["GROUP:65537", "SET_FIELD: {eth_dst:00:00:00:01:00:03}"] 3 | "group_id": 278115731 "actions": ["GROUP:65537", "SET_FIELD: {eth_dst:00:00:00:00:00:03}"] 4 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/logs/main.groups: -------------------------------------------------------------------------------- 1 | "group_id": 65542 "actions": ["OUTPUT:6", "POP_VLAN"] 2 | "group_id": 65540 "actions": ["OUTPUT:4", "POP_VLAN"] 3 | "group_id": 281698536 "actions": ["GROUP:65542", "SET_FIELD: {eth_dst:ff:ff:ff:ff:ff:ff}"] 4 | "group_id": 65538 "actions": ["OUTPUT:2", "POP_VLAN"] 5 | "group_id": 270000787 "actions": ["GROUP:65544", "SET_FIELD: {eth_dst:08:00:27:bd:f8:b2}"] 6 | "group_id": 281698538 "actions": ["GROUP:65544", "SET_FIELD: {eth_dst:ff:ff:ff:ff:ff:ff}"] 7 | "group_id": 271058998 "actions": ["GROUP:65542", "SET_FIELD: {eth_dst:08:00:27:92:18:1f}"] 8 | "group_id": 284167252 "actions": ["GROUP:65538", "SET_FIELD: {eth_src:08:00:27:89:3b:9f}"] 9 | "group_id": 281698535 "actions": ["GROUP:65541", "SET_FIELD: {eth_dst:ff:ff:ff:ff:ff:ff}"] 10 | "group_id": 281698537 "actions": ["GROUP:65543", "SET_FIELD: {eth_dst:ff:ff:ff:ff:ff:ff}"] 11 | "group_id": 65544 "actions": ["OUTPUT:8", "POP_VLAN"] 12 | "group_id": 65556 "actions": ["OUTPUT:20", "POP_VLAN"] 13 | "group_id": 284167255 "actions": ["GROUP:65541", "SET_FIELD: {eth_dst:08:00:27:89:3b:9f}"] 14 | "group_id": 65541 "actions": ["OUTPUT:5", "POP_VLAN"] 15 | "group_id": 273259475 "actions": ["GROUP:65543", "SET_FIELD: {eth_dst:08:00:27:54:56:ea}"] 16 | "group_id": 65543 "actions": ["OUTPUT:7", "POP_VLAN"] 17 | "group_id": 805396355 "actions": ["GROUP:65541"] "actions": ["GROUP:65542"] "actions": ["GROUP:65543"] "actions": ["GROUP:65544"] "actions": ["GROUP:65540"] 18 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/logs/outbound.flows: -------------------------------------------------------------------------------- 1 | "match": {"dl_vlan": "1"}, "actions": ["GROUP:65539"], "priority": 1, "packet_count": 0 2 | "match": {"tp_dst": 80, "dl_dst": "20:00:00:00:00:00/60:00:00:00:00:00", "dl_vlan": "1", "dl_src": "08:00:27:89:3b:9f", "nw_proto": 6}, "actions": ["GROUP:268608240"], "priority": 2, "packet_count": 0 3 | "match": {"tp_dst": 4321, "dl_dst": "10:00:00:00:00:00/50:00:00:00:00:00", "dl_vlan": "1", "dl_src": "08:00:27:89:3b:9f", "nw_proto": 6}, "actions": ["GROUP:276145632"], "priority": 2, "packet_count": 0 4 | "match": {"tp_dst": 4322, "dl_dst": "10:00:00:00:00:00/50:00:00:00:00:00", "dl_vlan": "1", "dl_src": "08:00:27:89:3b:9f", "nw_proto": 6}, "actions": ["GROUP:276145632"], "priority": 2, "packet_count": 0 5 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/logs/outbound.groups: -------------------------------------------------------------------------------- 1 | "group_id": 65539 "actions": ["OUTPUT:3", "POP_VLAN"] 2 | "group_id": 268608240 "actions": ["GROUP:65539", "SET_FIELD: {eth_dst:80:00:00:00:00:02}"] 3 | "group_id": 276145632 "actions": ["GROUP:65539", "SET_FIELD: {eth_dst:80:00:00:00:00:03}"] 4 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/scripts/flowlog2cmd: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # Translate flowlog format into ofdpa-add-flow commands 4 | 5 | use strict; 6 | 7 | while (<>) { 8 | next if !/rule_type/; 9 | next if /4294967288/; 10 | 11 | my $args = ''; 12 | 13 | # preprocessing to simplify parsing 14 | s/: / /g; 15 | s/[,"{}]//g; 16 | die('parse failed') if !/rule_type (\S+).*mod_type (\S+).*priority (\d+)/; 17 | my($rule_type,$mod_type,$priority) = ($1,$2,$3); 18 | $args .= " --priority $priority"; 19 | 20 | next if $mod_type ne 'insert'; 21 | 22 | my $outport = $1 if /fwd \[(.*?)\]/; 23 | $args .= " --eth_dst_out $1" if /set_eth_dst (\S+)/; 24 | $args .= " --eth_src_out $1" if /set_eth_src (\S+)/; 25 | 26 | while (s/\[(\S{17}) (\S{17})\]/$1\/$2/) {} 27 | # print; 28 | $args .= " --eth_src_in $1" if / eth_src (\S+)/; 29 | $args .= " --eth_dst_in $1" if / eth_dst (\S+)/; 30 | $args .= " --eth_type_arp" if /eth_type 2054/; 31 | 32 | s/arp proxy/arp_proxy/; 33 | my $in_port = $1 if /in_port (\S+)/; 34 | if ($in_port) { 35 | $in_port =~ s/main/19/; # not sure of this 36 | $in_port =~ s/arp_proxy/0/; # ?? 37 | $in_port =~ s/arp/20/; 38 | $args .= " --port_in $in_port"; 39 | } 40 | 41 | $rule_type =~ s/main-in/1/; 42 | $rule_type =~ s/outbound/2/; 43 | $rule_type =~ s/inbound/3/; 44 | $rule_type =~ s/arp/4/; 45 | $args = "--dpid $rule_type $args"; 46 | 47 | if ($outport) { 48 | $outport =~ s/inbound/3/; 49 | $outport =~ s/outbound/2/; 50 | $outport =~ s/main-in/1/; 51 | $outport =~ s/main/1/; 52 | $outport =~ s/arp/20/; 53 | } else { 54 | print "Ignoring rule -- no fwd port specified\n"; 55 | next; 56 | } 57 | 58 | $args .= " --tcp_src $1" if /tcp_src (\d+)/; 59 | $args .= " --tcp_dst $1" if /tcp_dst (\d+)/; 60 | 61 | print "ofdpa_add_flow $args $outport\n"; 62 | } 63 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/scripts/ofdpa_add_flow_basic: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | VLAN=1 4 | 5 | HOST=localhost 6 | PORT=8080 7 | DPID=1 8 | 9 | 10 | if [ $# -ne 2 ]; then 11 | echo usage: "$0 " 12 | exit 1 13 | fi 14 | 15 | INPORT=$1 16 | OUTPORT=$2 17 | let "GROUP_ID = ($VLAN << 16) + $OUTPORT" 18 | 19 | MSG="{ 20 | 'dpid': $DPID, 21 | 'table_id': 60, 22 | 'priority': 4, 23 | 'match':{ 24 | 'in_port': $INPORT, 25 | 'dl_vlan': 1 26 | }, 27 | 'actions':[ 28 | { 29 | 'type':'GROUP', 30 | 'group_id': $GROUP_ID 31 | } 32 | ] 33 | }" 34 | 35 | echo $MSG 36 | 37 | curl -X POST -d "$MSG" \ 38 | http://$HOST:$PORT/stats/flowentry/add 39 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/scripts/ofdpa_add_group_intf: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | VLAN=1 4 | 5 | HOST=localhost 6 | PORT=8080 7 | DPID=1 8 | 9 | if [ $# -ne 1 ]; then 10 | echo usage: "$0 " 11 | exit 1 12 | fi 13 | 14 | OPORT=$1 15 | let "GROUP_ID = ($VLAN << 16) + $OPORT" 16 | 17 | MSG="{ 18 | 'dpid': $DPID, 19 | 'type': 'INDIRECT', 20 | 'group_id': $GROUP_ID, 21 | 'buckets':[ 22 | { 23 | 'actions': [ 24 | { 25 | 'type': 'OUTPUT', 26 | 'port': $OPORT 27 | }, 28 | { 29 | 'type': 'POP_VLAN' 30 | } 31 | ] 32 | } 33 | ] 34 | }" 35 | 36 | echo "adding $GROUP_ID" 37 | 38 | curl -X POST -d "$MSG" \ 39 | http://$HOST:$PORT/stats/groupentry/add 40 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/scripts/ofdpa_add_group_rewrite: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | VLAN=1 4 | 5 | HOST=localhost 6 | PORT=8080 7 | DPID=1 8 | 9 | 10 | if [ $# -ne 1 -a $# -ne 2 ]; then 11 | echo usage: "$0 []" 12 | exit 1 13 | fi 14 | 15 | OPORT=$1 16 | if [ $# -eq 1 ]; then 17 | if [ $OPORT -eq 7 ]; then MAC="44:a8:42:32:5d:59"; fi 18 | if [ $OPORT -eq 8 ]; then MAC="44:a8:42:32:5d:5b"; fi 19 | else 20 | MAC=$2 21 | fi 22 | 23 | let "GROUP_ID = (1 << 28) + $OPORT" 24 | let "REF_GROUP_ID = ($VLAN << 16) + $OPORT" 25 | 26 | MSG="{ 27 | 'dpid': $DPID, 28 | 'type': 'INDIRECT', 29 | 'group_id': $GROUP_ID, 30 | 'buckets':[ 31 | { 32 | 'actions': [ 33 | { 34 | 'type': 'GROUP', 35 | 'group_id': $REF_GROUP_ID 36 | }, 37 | { 38 | 'type': 'SET_FIELD', 39 | 'field': 'eth_dst', 40 | 'value': \"$MAC\" 41 | } 42 | 43 | ] 44 | } 45 | ] 46 | }" 47 | 48 | echo "adding $GROUP_ID" 49 | echo $MSG 50 | 51 | curl -X POST -d "$MSG" \ 52 | http://$HOST:$PORT/stats/groupentry/add 53 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/scripts/ofdpa_delete_flow_by_cookie: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | VLAN=1 4 | 5 | HOST=localhost 6 | PORT=8080 7 | 8 | if [ $# -ne 2 ]; then 9 | echo usage: "$0 " 10 | exit 1 11 | fi 12 | 13 | DPID=$1 14 | COOKIE=$2 15 | 16 | MSG="{ 17 | 'dpid': $DPID, 18 | 'table_id': 60, 19 | 'cookie': $COOKIE, 20 | 'cookie_mask': 4095 21 | }" 22 | 23 | #echo $MSG 24 | 25 | curl -X POST -d "$MSG" \ 26 | http://$HOST:$PORT/stats/flowentry/delete 27 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/scripts/ofdpa_delete_flows: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | HOST=localhost 4 | PORT=8080 5 | 6 | if [ $# -ne 1 ]; then 7 | CMD=`basename $0` 8 | echo "usage: $CMD " 9 | exit 1 10 | fi 11 | curl -X DELETE http://$HOST:$PORT/stats/flowentry/clear/$1 12 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/scripts/ofdpa_delete_groups: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | HOST=localhost 4 | PORT=8080 5 | 6 | if [ $# -ne 1 ]; then 7 | CMD=`basename $0` 8 | echo "usage: $CMD " 9 | exit 1 10 | fi 11 | DPID=$1 12 | 13 | GROUP_IDS=`curl -s -X GET http://$HOST:$PORT/stats/groupdesc/$DPID | 14 | perl -ne 'while (s/group_id...(\d+)//) {print "$1\n"}'` 15 | 16 | for g in $GROUP_IDS; do 17 | echo "deleting $g" 18 | curl -X POST -d "{'dpid': $DPID,'group_id': $g}" \ 19 | http://$HOST:$PORT/stats/groupentry/delete 20 | done 21 | 22 | # do it again, since some may not have been removed the first time due to refs 23 | GROUP_IDS=`curl -s -X GET http://$HOST:$PORT/stats/groupdesc/$DPID | 24 | perl -ne 'while (s/group_id...(\d+)//) {print "$1\n"}'` 25 | 26 | for g in $GROUP_IDS; do 27 | echo "deleting $g" 28 | curl -X POST -d "{'dpid': $DPID,'group_id': $g}" \ 29 | http://$HOST:$PORT/stats/groupentry/delete 30 | done 31 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/scripts/sdx_kill_docker: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function usage { 4 | echo "usage: $0 " 5 | exit 1 6 | } 7 | 8 | if [ $# -ne 1 ]; then usage; fi 9 | 10 | CONTAINERS=$1 11 | 12 | SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 13 | 14 | if [ ! -f $CONTAINERS ]; then 15 | echo "No such file: $CONTAINERS" 16 | usage 17 | fi 18 | 19 | sed -e 's/\#.*//' -e '/^[ \t]*$/d' $CONTAINERS | 20 | while read NAME HOST DEV MAC; do 21 | sudo docker stop $NAME 2> /dev/null 22 | sudo docker rm $NAME 2> /dev/null 23 | done 24 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/scripts/sdx_start_docker: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function usage { 4 | echo "usage: $0 " 5 | exit 1 6 | } 7 | 8 | if [ $# -ne 2 ]; then usage; fi 9 | 10 | PARENT_DIR=$1 11 | CONTAINERS=$2 12 | 13 | SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 14 | 15 | if [ ! -d $PARENT_DIR ]; then 16 | echo "Not a directory: $PARENT_DIR" 17 | usage 18 | fi 19 | 20 | if [ ! -f $CONTAINERS ]; then 21 | echo "No such file: $CONTAINERS" 22 | usage 23 | fi 24 | 25 | sed -e 's/\#.*//' -e '/^[ \t]*$/d' $CONTAINERS | 26 | while read NAME HOST DEV MAC TNODE_PORT; do 27 | if [ -z "$TNODE_PORT" ]; then 28 | echo "TNODE_PORT not specified in containers file. Update file" 29 | exit 1 30 | fi 31 | DIR="$PARENT_DIR/$NAME" 32 | if [ ! -d $DIR ]; then 33 | echo "No such directory: $DIR" 34 | usage 35 | fi 36 | DIR=`realpath $DIR` 37 | IP=`grep 'router-id' $DIR/bgpd.conf | \ 38 | perl -ne 'chomp; print "$&" if /\d+\.\d+\.\d+\.\d+/'` 39 | if [ -z "$IP" ]; then 40 | echo "Failed to get IP from $DIR. Exiting." 41 | exit 1 42 | fi 43 | #sudo docker run --net=none -d -v /tmp/share:/tmp/share -v $DIR:/etc/quagga --privileged --name $NAME bgp-tst 44 | sudo docker run -p ${TNODE_PORT}:${TNODE_PORT} -d -v /tmp/share:/tmp/share -v $DIR:/etc/quagga --privileged --name $NAME bgp-tst 45 | if ! ifconfig -a|grep $DEV; then 46 | echo "No such device: $DEV" 47 | exit 1 48 | fi 49 | sudo docker exec -d $NAME python /tmp/share/tnode.py /tmp/share/torch.cfg local_${NAME} 50 | perl -ne 'chomp; if (/network\s+(\d+\.\d+\.\d+\.\S+)/) {++$i; print "$1 $i\n"}' $DIR/bgpd.conf | \ 51 | while read ADDR INDEX; do 52 | sudo docker exec $NAME ifconfig lo:$INDEX $ADDR 53 | done 54 | sudo $SCRIPT_DIR/physint-docker add-port eth1 $DEV $NAME $IP/16 '' $MAC 55 | done 56 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/scripts/setup_torch_for_docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Script simply copies files needed for torch to the directory shared with 4 | # the docker containers. 5 | 6 | if [ $# -ne 2 ]; then 7 | echo "usage: $0 " 8 | exit 1 9 | fi 10 | 11 | BASE=$1 12 | TORCH=$2 13 | 14 | SHARE='/tmp/share' 15 | mkdir -p $SHARE 16 | 17 | cp $BASE/test/{tnode,tlib}.py $SHARE 18 | cp $TORCH $SHARE 19 | 20 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/AS_config/bgp-tst/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alectolytic/quagga-bgp-tutorial 2 | RUN yum install -y net-tools 3 | RUN yum install -y iperf 4 | RUN yum install -y tcpdump 5 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/AS_config/bgp-tst/quagga/a1/bgpd.conf: -------------------------------------------------------------------------------- 1 | ! 2 | ! Zebra configuration saved from vty 3 | ! 2013/10/02 20:47:51 4 | ! 5 | hostname Virtual-AS-A 6 | password sdnip 7 | log stdout 8 | ! 9 | router bgp 100 10 | bgp router-id 172.0.0.1 11 | neighbor 172.0.255.254 remote-as 65000 12 | neighbor 172.0.255.254 next-hop-self 13 | network 100.0.0.0/24 14 | network 110.0.0.0/24 15 | redistribute static 16 | ! 17 | line vty 18 | ! 19 | 20 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/AS_config/bgp-tst/quagga/a1/daemons: -------------------------------------------------------------------------------- 1 | # This file tells the quagga package which daemons to start. 2 | # 3 | # Entries are in the format: =(yes|no|priority) 4 | # 0, "no" = disabled 5 | # 1, "yes" = highest priority 6 | # 2 .. 10 = lower priorities 7 | # Read /usr/share/doc/quagga/README.Debian for details. 8 | # 9 | # Sample configurations for these daemons can be found in 10 | # /usr/share/doc/quagga/examples/. 11 | # 12 | # ATTENTION: 13 | # 14 | # When activation a daemon at the first time, a config file, even if it is 15 | # empty, has to be present *and* be owned by the user and group "quagga", else 16 | # the daemon will not be started by /etc/init.d/quagga. The permissions should 17 | # be u=rw,g=r,o=. 18 | # When using "vtysh" such a config file is also needed. It should be owned by 19 | # group "quaggavty" and set to ug=rw,o= though. Check /etc/pam.d/quagga, too. 20 | # 21 | zebra=yes 22 | bgpd=yes 23 | ospfd=no 24 | ospf6d=no 25 | ripd=no 26 | ripngd=no 27 | isisd=no 28 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/AS_config/bgp-tst/quagga/a1/debian.conf: -------------------------------------------------------------------------------- 1 | # 2 | # If this option is set the /etc/init.d/quagga script automatically loads 3 | # the config via "vtysh -b" when the servers are started. 4 | # Check /etc/pam.d/quagga if you intend to use "vtysh"! 5 | # 6 | vtysh_enable=yes 7 | zebra_options=" --daemon -A 127.0.0.1" 8 | bgpd_options=" --daemon -A 127.0.0.1" 9 | ospfd_options=" --daemon -A 127.0.0.1" 10 | ospf6d_options="--daemon -A ::1" 11 | ripd_options=" --daemon -A 127.0.0.1" 12 | ripngd_options="--daemon -A ::1" 13 | isisd_options=" --daemon -A 127.0.0.1" 14 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/AS_config/bgp-tst/quagga/a1/zebra.conf: -------------------------------------------------------------------------------- 1 | ! 2 | ! Zebra configuration saved from vty 3 | ! 2013/10/02 20:47:51 4 | ! 5 | hostname Virtual-AS-A 6 | password sdnip 7 | enable password sdnip 8 | ! 9 | !interface eth0 10 | ! ipv6 nd suppress-ra 11 | ! 12 | !interface eth1 13 | ! ipv6 nd suppress-ra 14 | ! 15 | interface a1-eth0 16 | ipv6 nd suppress-ra 17 | ip forwarding 18 | ! 19 | !interface eth3 20 | ! ipv6 nd suppress-ra 21 | ! 22 | !interface lo 23 | ! 24 | line vty 25 | ! 26 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/AS_config/bgp-tst/quagga/b1/bgpd.conf: -------------------------------------------------------------------------------- 1 | ! 2 | ! Zebra configuration saved from vty 3 | ! 2013/10/02 20:47:51 4 | ! 5 | hostname Virtual-AS-B 6 | password sdnip 7 | log stdout 8 | ! 9 | router bgp 200 10 | bgp router-id 172.0.0.11 11 | neighbor 172.0.255.254 remote-as 65000 12 | neighbor 172.0.255.254 next-hop-self 13 | network 140.0.0.0/24 14 | network 150.0.0.0/24 15 | ! 16 | line vty 17 | ! 18 | 19 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/AS_config/bgp-tst/quagga/b1/daemons: -------------------------------------------------------------------------------- 1 | # This file tells the quagga package which daemons to start. 2 | # 3 | # Entries are in the format: =(yes|no|priority) 4 | # 0, "no" = disabled 5 | # 1, "yes" = highest priority 6 | # 2 .. 10 = lower priorities 7 | # Read /usr/share/doc/quagga/README.Debian for details. 8 | # 9 | # Sample configurations for these daemons can be found in 10 | # /usr/share/doc/quagga/examples/. 11 | # 12 | # ATTENTION: 13 | # 14 | # When activation a daemon at the first time, a config file, even if it is 15 | # empty, has to be present *and* be owned by the user and group "quagga", else 16 | # the daemon will not be started by /etc/init.d/quagga. The permissions should 17 | # be u=rw,g=r,o=. 18 | # When using "vtysh" such a config file is also needed. It should be owned by 19 | # group "quaggavty" and set to ug=rw,o= though. Check /etc/pam.d/quagga, too. 20 | # 21 | zebra=yes 22 | bgpd=yes 23 | ospfd=no 24 | ospf6d=no 25 | ripd=no 26 | ripngd=no 27 | isisd=no 28 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/AS_config/bgp-tst/quagga/b1/debian.conf: -------------------------------------------------------------------------------- 1 | # 2 | # If this option is set the /etc/init.d/quagga script automatically loads 3 | # the config via "vtysh -b" when the servers are started. 4 | # Check /etc/pam.d/quagga if you intend to use "vtysh"! 5 | # 6 | vtysh_enable=yes 7 | zebra_options=" --daemon -A 127.0.0.1" 8 | bgpd_options=" --daemon -A 127.0.0.1" 9 | ospfd_options=" --daemon -A 127.0.0.1" 10 | ospf6d_options="--daemon -A ::1" 11 | ripd_options=" --daemon -A 127.0.0.1" 12 | ripngd_options="--daemon -A ::1" 13 | isisd_options=" --daemon -A 127.0.0.1" 14 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/AS_config/bgp-tst/quagga/b1/zebra.conf: -------------------------------------------------------------------------------- 1 | ! 2 | ! Zebra configuration saved from vty 3 | ! 2013/10/02 20:47:51 4 | ! 5 | hostname Virtual-AS-B 6 | password sdnip 7 | enable password sdnip 8 | ! 9 | !interface eth0 10 | ! ipv6 nd suppress-ra 11 | ! 12 | !interface eth1 13 | ! ipv6 nd suppress-ra 14 | ! 15 | interface b1-eth0 16 | ipv6 nd suppress-ra 17 | ip forwarding 18 | ! 19 | !interface eth3 20 | ! ipv6 nd suppress-ra 21 | ! 22 | !interface lo 23 | ! 24 | line vty 25 | ! 26 | 27 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/AS_config/bgp-tst/quagga/c1/bgpd.conf: -------------------------------------------------------------------------------- 1 | ! 2 | ! Zebra configuration saved from vty 3 | ! 2013/10/02 20:47:51 4 | ! 5 | hostname Virtual-AS-C1 6 | password sdnip 7 | log stdout 8 | ! 9 | router bgp 300 10 | bgp router-id 172.0.0.21 11 | neighbor 172.0.255.254 remote-as 65000 12 | neighbor 172.0.255.254 next-hop-self 13 | network 140.0.0.0/24 14 | network 150.0.0.0/24 15 | redistribute static 16 | ! 17 | line vty 18 | ! 19 | 20 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/AS_config/bgp-tst/quagga/c1/daemons: -------------------------------------------------------------------------------- 1 | # This file tells the quagga package which daemons to start. 2 | # 3 | # Entries are in the format: =(yes|no|priority) 4 | # 0, "no" = disabled 5 | # 1, "yes" = highest priority 6 | # 2 .. 10 = lower priorities 7 | # Read /usr/share/doc/quagga/README.Debian for details. 8 | # 9 | # Sample configurations for these daemons can be found in 10 | # /usr/share/doc/quagga/examples/. 11 | # 12 | # ATTENTION: 13 | # 14 | # When activation a daemon at the first time, a config file, even if it is 15 | # empty, has to be present *and* be owned by the user and group "quagga", else 16 | # the daemon will not be started by /etc/init.d/quagga. The permissions should 17 | # be u=rw,g=r,o=. 18 | # When using "vtysh" such a config file is also needed. It should be owned by 19 | # group "quaggavty" and set to ug=rw,o= though. Check /etc/pam.d/quagga, too. 20 | # 21 | zebra=yes 22 | bgpd=yes 23 | ospfd=no 24 | ospf6d=no 25 | ripd=no 26 | ripngd=no 27 | isisd=no 28 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/AS_config/bgp-tst/quagga/c1/debian.conf: -------------------------------------------------------------------------------- 1 | # 2 | # If this option is set the /etc/init.d/quagga script automatically loads 3 | # the config via "vtysh -b" when the servers are started. 4 | # Check /etc/pam.d/quagga if you intend to use "vtysh"! 5 | # 6 | vtysh_enable=yes 7 | zebra_options=" --daemon -A 127.0.0.1" 8 | bgpd_options=" --daemon -A 127.0.0.1" 9 | ospfd_options=" --daemon -A 127.0.0.1" 10 | ospf6d_options="--daemon -A ::1" 11 | ripd_options=" --daemon -A 127.0.0.1" 12 | ripngd_options="--daemon -A ::1" 13 | isisd_options=" --daemon -A 127.0.0.1" 14 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/AS_config/bgp-tst/quagga/c1/zebra.conf: -------------------------------------------------------------------------------- 1 | ! 2 | ! Zebra configuration saved from vty 3 | ! 2013/10/02 20:47:51 4 | ! 5 | hostname Virtual-AS-C 6 | password sdnip 7 | enable password sdnip 8 | ! 9 | !interface eth0 10 | ! ipv6 nd suppress-ra 11 | ! 12 | !interface eth1 13 | ! ipv6 nd suppress-ra 14 | ! 15 | interface c1-eth0 16 | ipv6 nd suppress-ra 17 | ip forwarding 18 | ! 19 | !interface eth3 20 | ! ipv6 nd suppress-ra 21 | ! 22 | !interface lo 23 | ! 24 | line vty 25 | ! 26 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/AS_config/bgp-tst/quagga/c2/bgpd.conf: -------------------------------------------------------------------------------- 1 | ! 2 | ! Zebra configuration saved from vty 3 | ! 2013/10/02 20:47:51 4 | ! 5 | hostname Virtual-AS-C2 6 | password sdnip 7 | log stdout 8 | ! 9 | router bgp 300 10 | bgp router-id 172.0.0.22 11 | neighbor 172.0.255.254 remote-as 65000 12 | neighbor 172.0.255.254 next-hop-self 13 | network 140.0.0.0/24 14 | network 150.0.0.0/24 15 | redistribute static 16 | ! 17 | line vty 18 | ! 19 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/AS_config/bgp-tst/quagga/c2/daemons: -------------------------------------------------------------------------------- 1 | # This file tells the quagga package which daemons to start. 2 | # 3 | # Entries are in the format: =(yes|no|priority) 4 | # 0, "no" = disabled 5 | # 1, "yes" = highest priority 6 | # 2 .. 10 = lower priorities 7 | # Read /usr/share/doc/quagga/README.Debian for details. 8 | # 9 | # Sample configurations for these daemons can be found in 10 | # /usr/share/doc/quagga/examples/. 11 | # 12 | # ATTENTION: 13 | # 14 | # When activation a daemon at the first time, a config file, even if it is 15 | # empty, has to be present *and* be owned by the user and group "quagga", else 16 | # the daemon will not be started by /etc/init.d/quagga. The permissions should 17 | # be u=rw,g=r,o=. 18 | # When using "vtysh" such a config file is also needed. It should be owned by 19 | # group "quaggavty" and set to ug=rw,o= though. Check /etc/pam.d/quagga, too. 20 | # 21 | zebra=yes 22 | bgpd=yes 23 | ospfd=no 24 | ospf6d=no 25 | ripd=no 26 | ripngd=no 27 | isisd=no 28 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/AS_config/bgp-tst/quagga/c2/debian.conf: -------------------------------------------------------------------------------- 1 | # 2 | # If this option is set the /etc/init.d/quagga script automatically loads 3 | # the config via "vtysh -b" when the servers are started. 4 | # Check /etc/pam.d/quagga if you intend to use "vtysh"! 5 | # 6 | vtysh_enable=yes 7 | zebra_options=" --daemon -A 127.0.0.1" 8 | bgpd_options=" --daemon -A 127.0.0.1" 9 | ospfd_options=" --daemon -A 127.0.0.1" 10 | ospf6d_options="--daemon -A ::1" 11 | ripd_options=" --daemon -A 127.0.0.1" 12 | ripngd_options="--daemon -A ::1" 13 | isisd_options=" --daemon -A 127.0.0.1" 14 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/AS_config/bgp-tst/quagga/c2/zebra.conf: -------------------------------------------------------------------------------- 1 | ! 2 | ! Zebra configuration saved from vty 3 | ! 2013/10/02 20:47:51 4 | ! 5 | hostname Virtual-AS-C2 6 | password sdnip 7 | enable password sdnip 8 | ! 9 | !interface eth0 10 | ! ipv6 nd suppress-ra 11 | ! 12 | !interface eth1 13 | ! ipv6 nd suppress-ra 14 | ! 15 | interface c2-eth0 16 | ipv6 nd suppress-ra 17 | ip forwarding 18 | ! 19 | !interface eth3 20 | ! ipv6 nd suppress-ra 21 | ! 22 | !interface lo 23 | ! 24 | line vty 25 | ! 26 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/AS_config/test_containers: -------------------------------------------------------------------------------- 1 | # This file contains one line per edge router in the physical test network. 2 | # Currently host field is ignored and localhost is assumed. 3 | 4 | # Config Host Dev MAC TNODE_PORT 5 | a1 localhost em1 08:00:27:89:3b:9f 4401 6 | b1 localhost em2 08:00:27:92:18:1f 4402 7 | c1 localhost dev8 08:00:27:54:56:ea 4403 8 | c2 localhost p1p2 08:00:27:bd:f8:b2 4404 9 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/Vagrantfile-acs: -------------------------------------------------------------------------------- 1 | # This is the base Vagrantfile used to create the iSDX box. 2 | 3 | #Vagrant.configure("1") do |config| 4 | #config.vm.boot_mode = :gui 5 | #end 6 | 7 | Vagrant.configure("2") do |config| 8 | config.vm.box = "ubuntu/trusty64" 9 | #config.vm.box = "ubuntu/trusty32" 10 | 11 | config.vm.provider "virtualbox" do |v| 12 | v.customize ["modifyvm", :id, "--cpuexecutioncap", "80"] 13 | v.customize ["modifyvm", :id, "--memory", "2048"] 14 | end 15 | 16 | ## Guest Config 17 | config.vm.hostname = "iSDXVM" 18 | config.vm.network :private_network, ip: "172.28.128.3" 19 | # config.vm.network :forwarded_port, guest:6633, host:6637 # forwarding of port 20 | config.vm.network :public_network, ip: "192.168.22.202", :bridge => 'isdx_openflow' 21 | config.vm.network :public_network, :bridge => 'isdx_arp', auto_config: false # ARP (expected to come up as eth3) 22 | config.vm.network :public_network, ip: "172.0.255.254", :netmask => "255.255.0.0", :bridge => 'isdx_bgp', :mac => "080027893BFF" # BGP 23 | 24 | ## Provisioning 25 | config.vm.provision :shell, privileged: false, :path => "../../../../setup/basic-setup.sh", :args => "--no-mininet" 26 | config.vm.provision :shell, privileged: false, :path => "../../../../setup/ovs-setup.sh" 27 | # config.vm.provision :shell, privileged: false, :path => "../../../../setup/mininet-setup.sh" 28 | config.vm.provision :shell, privileged: false, :path => "../../../../setup/ryu-setup.sh" 29 | config.vm.provision :shell, privileged: false, :path => "../../../../setup/sdx-setup.sh", :args => "--no-mininet" 30 | config.vm.provision :shell, privileged: false, :path => "./init_arp_switch.sh" 31 | 32 | ## SSH config 33 | config.ssh.forward_x11 = true 34 | 35 | #config.vm.synced_folder ".", "/home/vagrant/iSDX", type: "rsync", 36 | #rsync__exclude: ".git/" 37 | config.vm.synced_folder "../../../..", "/home/vagrant/iSDX" 38 | 39 | end 40 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/config/bgp.conf: -------------------------------------------------------------------------------- 1 | group rs { 2 | process parsed-route-backend { 3 | run /home/vagrant/iSDX/xrs/client.py; 4 | encoder json; 5 | receive-routes; 6 | } 7 | 8 | neighbor 172.0.0.1 { 9 | description "Virtual AS A"; 10 | router-id 172.0.255.254; 11 | local-address 172.0.255.254; 12 | local-as 65000; 13 | peer-as 100; 14 | hold-time 180; 15 | } 16 | 17 | neighbor 172.0.0.11 { 18 | description "Virtual AS B"; 19 | router-id 172.0.255.254; 20 | local-address 172.0.255.254; 21 | local-as 65000; 22 | peer-as 200; 23 | hold-time 180; 24 | } 25 | 26 | neighbor 172.0.0.21 { 27 | description "Virtual AS C Router C1"; 28 | router-id 172.0.255.254; 29 | local-address 172.0.255.254; 30 | local-as 65000; 31 | peer-as 300; 32 | hold-time 180; 33 | } 34 | neighbor 172.0.0.22 { 35 | description "Virtual AS C Router C2"; 36 | router-id 172.0.255.254; 37 | local-address 172.0.255.254; 38 | local-as 65000; 39 | peer-as 300; 40 | hold-time 180; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/config/gauge-dp1.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | dp_id: 0x0000000000000001 # The id of the datapath to be controlled 3 | name: "Main-1" # The name of the datapath for use with logging 4 | description: "SDX Main Switch" # Purely informational 5 | hardware: "??" 6 | monitor_ports: True # whether gauge should monitor stats for ports 7 | monitor_ports_file: "ports.out" # The file to record ports statistics 8 | monitor_ports_interval: 10 # the polling interval for port stats in seconds 9 | monitor_flow_table: True # whether gauge should take periodic flow table dumps 10 | monitor_flow_table_file: "ft.out" # the file to record flow table dumps 11 | monitor_flow_table_interval: 10 # the polling interval for flow table monitoring 12 | influxdb_stats: True 13 | interfaces: 14 | 49: 15 | name: "Outbound" # name for this port, used for logging/monitoring 16 | 50: 17 | name: "Inbound" 18 | 19: 19 | name: "Route Server" 20 | 20: 21 | name: "ARP" 22 | 7: 23 | name: "A" 24 | 8: 25 | name: "B" 26 | 11: 27 | name: "C1" 28 | 12: 29 | name: "C2" 30 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/config/gauge-dp4.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | dp_id: 0x0000000000000004 # The id of the datapath to be controlled 3 | name: "ARP-1" # The name of the datapath for use with logging 4 | description: "SDX ARP Switch" # Purely informational 5 | hardware: "??" 6 | monitor_ports: True # whether gauge should monitor stats for ports 7 | monitor_ports_file: "ports.out" # The file to record ports statistics 8 | monitor_ports_interval: 10 # the polling interval for port stats in seconds 9 | monitor_flow_table: True # whether gauge should take periodic flow table dumps 10 | monitor_flow_table_file: "ft.out" # the file to record flow table dumps 11 | monitor_flow_table_interval: 10 # the polling interval for flow table monitoring 12 | influxdb_stats: True 13 | interfaces: 14 | 1: 15 | name: "Main" 16 | 2: 17 | name: "ARP Proxy" 18 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/config/gauge.conf: -------------------------------------------------------------------------------- 1 | gauge-dp1.yaml 2 | gauge-dp4.yaml 3 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/config/sdx_policies.cfg: -------------------------------------------------------------------------------- 1 | { 2 | "1": "participant_1.py", 3 | "2": "participant_2.py", 4 | "3": "participant_3.py" 5 | } 6 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/init_arp_switch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sudo ovs-vsctl del-br arp-switch 2> /dev/null 4 | sudo ip link del arp-ifc type veth peer name arp-ifc-ovs 2> /dev/null 5 | 6 | sudo ovs-vsctl add-br arp-switch 7 | sudo ovs-vsctl set-fail-mode arp-switch secure 8 | sudo ovs-vsctl set bridge arp-switch protocols=OpenFlow13 9 | sudo ovs-vsctl set-controller arp-switch tcp:127.0.0.1:6633 10 | sudo ovs-vsctl set bridge arp-switch other-config:datapath-id=0000000000000004 11 | 12 | # connect switch to physical switch 13 | sudo ovs-vsctl add-port arp-switch eth3 14 | sudo ovs-ofctl -O OpenFlow13 mod-port arp-switch 1 up 15 | 16 | # create a switch port 17 | # (could just use 'arp-switch', but would rather not deal with negative port #) 18 | sudo ip link add arp-ifc type veth peer name arp-ifc-ovs 19 | sudo ifconfig arp-ifc 172.0.255.253 20 | sudo ifconfig arp-ifc hw ether 08:00:27:89:33:ff 21 | sudo ovs-vsctl add-port arp-switch arp-ifc-ovs 22 | sudo ovs-ofctl -O OpenFlow13 mod-port arp-switch 2 up 23 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/policies/participant_1.py: -------------------------------------------------------------------------------- 1 | { 2 | "outbound": [ 3 | { 4 | "cookie": 1, 5 | "match": 6 | { 7 | "tcp_dst": 80 8 | }, 9 | "action": 10 | { 11 | "fwd": 2 12 | } 13 | }, 14 | { 15 | "cookie": 2, 16 | "match": 17 | { 18 | "tcp_dst": 4321 19 | }, 20 | "action": 21 | { 22 | "fwd": 3 23 | } 24 | }, 25 | { 26 | "cookie": 3, 27 | "match": 28 | { 29 | "tcp_dst": 4322 30 | }, 31 | "action": 32 | { 33 | "fwd": 3 34 | } 35 | } 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/policies/participant_2.py: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/policies/participant_3.py: -------------------------------------------------------------------------------- 1 | { 2 | "inbound": [ 3 | { 4 | "cookie": 1, 5 | "match": 6 | { 7 | "tcp_dst": 4321 8 | }, 9 | "action": 10 | { 11 | "fwd": 0 12 | } 13 | }, 14 | { 15 | "cookie": 2, 16 | "match": 17 | { 18 | "tcp_dst": 4322 19 | }, 20 | "action": 21 | { 22 | "fwd": 1 23 | } 24 | } 25 | ] 26 | } -------------------------------------------------------------------------------- /examples/test-ms/ofdpa/test/torch.cfg: -------------------------------------------------------------------------------- 1 | 2 | 3 | bgprouters { 4 | a1 goldenmhost:4401 5 | b1 goldenmhost:4402 6 | c1 goldenmhost:4403 7 | c2 goldenmhost:4404 8 | 9 | # tnode in router Docker containers listens on these 10 | local_a1 0.0.0.0:4401 11 | local_b1 0.0.0.0:4402 12 | local_c1 0.0.0.0:4403 13 | local_c2 0.0.0.0:4404 14 | } 15 | 16 | hosts { 17 | h1_a1 goldenmhost:4401 100.0.0.1 80 4321 4322 8888 18 | h2_a1 goldenmhost:4401 110.0.0.1 80 4321 4322 8888 19 | h1_b1 goldenmhost:4402 140.0.0.1 80 4321 4322 8888 20 | h2_b1 goldenmhost:4402 150.0.0.1 80 4321 4322 8888 21 | h1_c1 goldenmhost:4403 140.0.0.1 80 4321 4322 8888 22 | h2_c1 goldenmhost:4403 150.0.0.1 80 4321 4322 8888 23 | h1_c2 goldenmhost:4404 140.0.0.1 80 4321 4322 8888 24 | h2_c2 goldenmhost:4404 150.0.0.1 80 4321 4322 8888 25 | } 26 | 27 | participants { 28 | a localhost:5551 29 | b localhost:5552 30 | c localhost:5553 31 | } 32 | 33 | test regress { 34 | test xfer 35 | } 36 | 37 | test info { 38 | local ovs-ofctl dump-flows S1 39 | local ovs-ofctl dump-flows S2 40 | local ovs-ofctl dump-flows S3 41 | local ovs-ofctl dump-flows S4 42 | exec a1 ip route 43 | bgp a1 44 | exec b1 ip route 45 | bgp b1 46 | exec c1 ip route 47 | bgp c1 48 | exec c2 ip route 49 | bgp c2 50 | } 51 | 52 | test init { 53 | listener 54 | } 55 | 56 | test xfer { 57 | comment h1_a1 to h1_b1:80 58 | verify h1_a1 h1_b1 80 59 | comment h1_a1 to h1_c1:4321 60 | verify h1_a1 h1_c1 4321 61 | comment h1_a1 to h1_c2:4322 62 | verify h1_a1 h1_c2 4322 63 | comment h1_a1 to h1_b1:8888 64 | verify h1_a1 h1_b1 8888 65 | } 66 | 67 | -------------------------------------------------------------------------------- /examples/test-ms/policies/participant_1.py: -------------------------------------------------------------------------------- 1 | { 2 | "outbound": [ 3 | { 4 | "cookie": 1, 5 | "match": 6 | { 7 | "tcp_dst": 80 8 | }, 9 | "action": 10 | { 11 | "fwd": 2 12 | } 13 | }, 14 | { 15 | "cookie": 2, 16 | "match": 17 | { 18 | "tcp_dst": 4321 19 | }, 20 | "action": 21 | { 22 | "fwd": 3 23 | } 24 | }, 25 | { 26 | "cookie": 3, 27 | "match": 28 | { 29 | "tcp_dst": 4322 30 | }, 31 | "action": 32 | { 33 | "fwd": 3 34 | } 35 | } 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /examples/test-ms/policies/participant_2.py: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/test-ms/policies/participant_3.py: -------------------------------------------------------------------------------- 1 | { 2 | "inbound": [ 3 | { 4 | "cookie": 1, 5 | "match": 6 | { 7 | "tcp_dst": 4321 8 | }, 9 | "action": 10 | { 11 | "fwd": 0 12 | } 13 | }, 14 | { 15 | "cookie": 2, 16 | "match": 17 | { 18 | "tcp_dst": 4322 19 | }, 20 | "action": 21 | { 22 | "fwd": 1 23 | } 24 | } 25 | ] 26 | } -------------------------------------------------------------------------------- /examples/test-mt/config/bgp.conf: -------------------------------------------------------------------------------- 1 | group rs { 2 | process parsed-route-backend { 3 | run /home/vagrant/iSDX/xrs/client.py; 4 | encoder json; 5 | receive-routes; 6 | } 7 | 8 | neighbor 172.0.0.1 { 9 | description "Virtual AS A"; 10 | router-id 172.0.255.254; 11 | local-address 172.0.255.254; 12 | local-as 65000; 13 | peer-as 100; 14 | hold-time 180; 15 | } 16 | 17 | neighbor 172.0.0.11 { 18 | description "Virtual AS B"; 19 | router-id 172.0.255.254; 20 | local-address 172.0.255.254; 21 | local-as 65000; 22 | peer-as 200; 23 | hold-time 180; 24 | } 25 | 26 | neighbor 172.0.0.21 { 27 | description "Virtual AS C Router C1"; 28 | router-id 172.0.255.254; 29 | local-address 172.0.255.254; 30 | local-as 65000; 31 | peer-as 300; 32 | hold-time 180; 33 | } 34 | neighbor 172.0.0.22 { 35 | description "Virtual AS C Router C2"; 36 | router-id 172.0.255.254; 37 | local-address 172.0.255.254; 38 | local-as 65000; 39 | peer-as 300; 40 | hold-time 180; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /examples/test-mt/config/sdx_policies.cfg: -------------------------------------------------------------------------------- 1 | { 2 | "1": "participant_1.py", 3 | "2": "participant_2.py", 4 | "3": "participant_3.py" 5 | } 6 | -------------------------------------------------------------------------------- /examples/test-mt/mininet/mininet.cfg: -------------------------------------------------------------------------------- 1 | { 2 | "a1": { 3 | "asn": 100, 4 | "ip": "172.0.0.1/16", 5 | "mac": "08:00:27:89:3b:9f", 6 | "netnames": [ 7 | "h1_a1", 8 | "h2_a1" 9 | ], 10 | "networks": [ 11 | "100.0.0.0/24", 12 | "110.0.0.0/24" 13 | ], 14 | "port": 3 15 | }, 16 | "b1": { 17 | "asn": 200, 18 | "ip": "172.0.0.11/16", 19 | "mac": "08:00:27:92:18:1f", 20 | "netnames": [ 21 | "h1_b1", 22 | "h2_b1" 23 | ], 24 | "networks": [ 25 | "140.0.0.0/24", 26 | "150.0.0.0/24" 27 | ], 28 | "port": 4 29 | }, 30 | "c1": { 31 | "asn": 300, 32 | "ip": "172.0.0.21/16", 33 | "mac": "08:00:27:54:56:ea", 34 | "netnames": [ 35 | "h1_c1", 36 | "h2_c1" 37 | ], 38 | "networks": [ 39 | "140.0.0.0/24", 40 | "150.0.0.0/24" 41 | ], 42 | "port": 5 43 | }, 44 | "c2": { 45 | "asn": 300, 46 | "ip": "172.0.0.22/16", 47 | "mac": "08:00:27:bd:f8:b2", 48 | "netnames": [ 49 | "h1_c2", 50 | "h2_c2" 51 | ], 52 | "networks": [ 53 | "140.0.0.0/24", 54 | "150.0.0.0/24" 55 | ], 56 | "port": 6 57 | } 58 | } -------------------------------------------------------------------------------- /examples/test-mt/policies/participant_1.py: -------------------------------------------------------------------------------- 1 | { 2 | "outbound": [ 3 | { 4 | "cookie": 1, 5 | "match": 6 | { 7 | "tcp_dst": 80 8 | }, 9 | "action": 10 | { 11 | "fwd": 2 12 | } 13 | }, 14 | { 15 | "cookie": 2, 16 | "match": 17 | { 18 | "tcp_dst": 4321 19 | }, 20 | "action": 21 | { 22 | "fwd": 3 23 | } 24 | }, 25 | { 26 | "cookie": 3, 27 | "match": 28 | { 29 | "tcp_dst": 4322 30 | }, 31 | "action": 32 | { 33 | "fwd": 3 34 | } 35 | } 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /examples/test-mt/policies/participant_2.py: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/test-mt/policies/participant_3.py: -------------------------------------------------------------------------------- 1 | { 2 | "inbound": [ 3 | { 4 | "cookie": 1, 5 | "match": 6 | { 7 | "tcp_dst": 4321 8 | }, 9 | "action": 10 | { 11 | "fwd": 0 12 | } 13 | }, 14 | { 15 | "cookie": 2, 16 | "match": 17 | { 18 | "tcp_dst": 4322 19 | }, 20 | "action": 21 | { 22 | "fwd": 1 23 | } 24 | } 25 | ] 26 | } -------------------------------------------------------------------------------- /examples/test-os/config/bgp.conf: -------------------------------------------------------------------------------- 1 | group rs { 2 | process parsed-route-backend { 3 | run /home/vagrant/iSDX/xrs/client.py; 4 | encoder json; 5 | receive-routes; 6 | } 7 | 8 | neighbor 172.0.0.1 { 9 | description "Virtual AS A"; 10 | router-id 172.0.255.254; 11 | local-address 172.0.255.254; 12 | local-as 65000; 13 | peer-as 100; 14 | hold-time 180; 15 | } 16 | 17 | neighbor 172.0.0.11 { 18 | description "Virtual AS B"; 19 | router-id 172.0.255.254; 20 | local-address 172.0.255.254; 21 | local-as 65000; 22 | peer-as 200; 23 | hold-time 180; 24 | } 25 | 26 | neighbor 172.0.0.21 { 27 | description "Virtual AS C Router C1"; 28 | router-id 172.0.255.254; 29 | local-address 172.0.255.254; 30 | local-as 65000; 31 | peer-as 300; 32 | hold-time 180; 33 | } 34 | neighbor 172.0.0.22 { 35 | description "Virtual AS C Router C2"; 36 | router-id 172.0.255.254; 37 | local-address 172.0.255.254; 38 | local-as 65000; 39 | peer-as 300; 40 | hold-time 180; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /examples/test-os/config/sdx_policies.cfg: -------------------------------------------------------------------------------- 1 | { 2 | "1": "participant_1.py", 3 | "2": "participant_2.py", 4 | "3": "participant_3.py" 5 | } 6 | -------------------------------------------------------------------------------- /examples/test-os/mininet/mininet.cfg: -------------------------------------------------------------------------------- 1 | { 2 | "a1": { 3 | "asn": 100, 4 | "ip": "172.0.0.1/16", 5 | "mac": "08:00:27:89:3b:9f", 6 | "netnames": [ 7 | "h1_a1", 8 | "h2_a1" 9 | ], 10 | "networks": [ 11 | "100.0.0.0/24", 12 | "110.0.0.0/24" 13 | ], 14 | "port": 3 15 | }, 16 | "b1": { 17 | "asn": 200, 18 | "ip": "172.0.0.11/16", 19 | "mac": "08:00:27:92:18:1f", 20 | "netnames": [ 21 | "h1_b1", 22 | "h2_b1" 23 | ], 24 | "networks": [ 25 | "140.0.0.0/24", 26 | "150.0.0.0/24" 27 | ], 28 | "port": 4 29 | }, 30 | "c1": { 31 | "asn": 300, 32 | "ip": "172.0.0.21/16", 33 | "mac": "08:00:27:54:56:ea", 34 | "netnames": [ 35 | "h1_c1", 36 | "h2_c1" 37 | ], 38 | "networks": [ 39 | "140.0.0.0/24", 40 | "150.0.0.0/24" 41 | ], 42 | "port": 5 43 | }, 44 | "c2": { 45 | "asn": 300, 46 | "ip": "172.0.0.22/16", 47 | "mac": "08:00:27:bd:f8:b2", 48 | "netnames": [ 49 | "h1_c2", 50 | "h2_c2" 51 | ], 52 | "networks": [ 53 | "140.0.0.0/24", 54 | "150.0.0.0/24" 55 | ], 56 | "port": 6 57 | } 58 | } -------------------------------------------------------------------------------- /examples/test-os/policies/participant_1.py: -------------------------------------------------------------------------------- 1 | { 2 | "outbound": [ 3 | { 4 | "cookie": 1, 5 | "match": 6 | { 7 | "tcp_dst": 80 8 | }, 9 | "action": 10 | { 11 | "fwd": 2 12 | } 13 | }, 14 | { 15 | "cookie": 2, 16 | "match": 17 | { 18 | "tcp_dst": 4321 19 | }, 20 | "action": 21 | { 22 | "fwd": 3 23 | } 24 | }, 25 | { 26 | "cookie": 3, 27 | "match": 28 | { 29 | "tcp_dst": 4322 30 | }, 31 | "action": 32 | { 33 | "fwd": 3 34 | } 35 | } 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /examples/test-os/policies/participant_2.py: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/test-os/policies/participant_3.py: -------------------------------------------------------------------------------- 1 | { 2 | "inbound": [ 3 | { 4 | "cookie": 1, 5 | "match": 6 | { 7 | "tcp_dst": 4321 8 | }, 9 | "action": 10 | { 11 | "fwd": 0 12 | } 13 | }, 14 | { 15 | "cookie": 2, 16 | "match": 17 | { 18 | "tcp_dst": 4322 19 | }, 20 | "action": 21 | { 22 | "fwd": 1 23 | } 24 | } 25 | ] 26 | } -------------------------------------------------------------------------------- /flanc/README.md: -------------------------------------------------------------------------------- 1 | # FLANC - Reference Monitor 2 | 3 | The reference monitor (refmon.py) is a ryu module and requires [Ryu](http://osrg.github.io/ryu/) to be installed. 4 | 5 | See the main README.md for instructions on how to install and run everything, including ryu. 6 | -------------------------------------------------------------------------------- /flanc/refmon_ms.cfg: -------------------------------------------------------------------------------- 1 | { 2 | "fabric mode": "multi-switch", 3 | "fabric options": { 4 | "dpids": { 5 | "main": 1, 6 | "inbound": 2, 7 | "outbound": 3 8 | }, 9 | "dp alias": { 10 | "main-in": "main", 11 | "main-out": "main" 12 | }, 13 | "OF version": "1.3" 14 | }, 15 | "fabric connections": { 16 | "main": { 17 | "outbound": 1, 18 | "inbound": 2, 19 | "refmon": 3, 20 | "route server": 4, 21 | "arp proxy": 5, 22 | "1": 6, 23 | "2": 7, 24 | "3": [8,9] 25 | }, 26 | "inbound": { 27 | "main": 1, 28 | "outbound": 2, 29 | "refmon": 3 30 | }, 31 | "outbound": { 32 | "main": 1, 33 | "inbound": 2, 34 | "refmon": 3 35 | } 36 | }, 37 | "server" : { 38 | "address" : "localhost", 39 | "port" : 5555, 40 | "key" : "sdx" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /flanc/refmon_mt.cfg: -------------------------------------------------------------------------------- 1 | { 2 | "fabric mode": "multi-table", 3 | "fabric options": { 4 | "tables": { 5 | "main-in": 0, 6 | "outbound": 1, 7 | "inbound": 2, 8 | "main-out": 3 9 | }, 10 | "OF version": "1.3" 11 | }, 12 | "fabric connections": { 13 | "main": { 14 | "refmon": 1, 15 | "route server": 2, 16 | "arp proxy": 3, 17 | "1": 4, 18 | "2": 5, 19 | "3": 6 20 | } 21 | }, 22 | "server" : { 23 | "address" : "localhost", 24 | "port" : 5555, 25 | "key" : "sdx" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /flanc/rest.py: -------------------------------------------------------------------------------- 1 | # Author: 2 | # Rudiger Birkner (Networked Systems Group ETH Zurich) 3 | 4 | import httplib 5 | 6 | import json 7 | from webob import Response 8 | 9 | from ryu.app.wsgi import ControllerBase, route 10 | 11 | 12 | url = '/refmon/flowmod' 13 | 14 | class FlowModReceiver(ControllerBase): 15 | def __init__(self, req, link, data, **config): 16 | super(FlowModReceiver, self).__init__(req, link, data, **config) 17 | self.refmon = data 18 | 19 | @route('refmon', url, methods=['POST']) 20 | def supersets_changed(self, req, **kwargs): 21 | try: 22 | data = json.loads(req.body) 23 | except SyntaxError: 24 | return Response(status=400) 25 | 26 | msgs = self.refmon.process_flow_mods(data) 27 | 28 | body = json.dumps(msgs) 29 | return Response(content_type='application/json', body=body) 30 | -------------------------------------------------------------------------------- /flanc/stats/port.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer. 2 | # Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | class Port(object): 17 | 18 | number = None 19 | 20 | def __init__(self, number, conf=None): 21 | if conf is None: 22 | conf = {} 23 | self.number = number 24 | self.name = conf.setdefault('name', str(number)) 25 | self.description = conf.setdefault('description', self.name) 26 | self.enabled = conf.setdefault('enabled', True) 27 | self.phys_up = False 28 | self.permanent_learn = conf.setdefault('permanent_learn', False) 29 | self.unicast_flood = conf.setdefault('unicast_flood', True) 30 | 31 | def running(self): 32 | return self.enabled and self.phys_up 33 | 34 | def __eq__(self, other): 35 | return hash(self) == hash(other) 36 | 37 | def __hash__(self): 38 | return hash(('Port', self.number)) 39 | 40 | def __ne__(self, other): 41 | return not self.__eq__(other) 42 | 43 | def __str__(self): 44 | return self.name 45 | -------------------------------------------------------------------------------- /flanc/stats/ryu-faucet.conf: -------------------------------------------------------------------------------- 1 | # Requires Ryu 4.0 or above, and allows quick detection of a down OpenFlow channel. 2 | [DEFAULT] 3 | echo_request_interval=3 4 | maximum_unreplied_echo_requests=5 5 | -------------------------------------------------------------------------------- /launch.sh: -------------------------------------------------------------------------------- 1 | if [ $1 = '--stats' ]; then 2 | shift 3 | STATS=1 4 | fi 5 | 6 | RUN_DIR=~/iSDX 7 | RIBS_DIR=$RUN_DIR/xrs/ribs 8 | TEST_DIR=$1 9 | LOG_FILE=SDXLog.log 10 | 11 | set -x 12 | 13 | case $2 in 14 | (1) 15 | if [ ! -d $RIBS_DIR ] 16 | then 17 | mkdir $RIBS_DIR 18 | fi 19 | 20 | cd $RUN_DIR 21 | sh pctrl/clean.sh 22 | 23 | rm -f $LOG_FILE 24 | python logServer.py $LOG_FILE 25 | ;; 26 | 27 | (2) 28 | # the following gets around issues with vagrant direct mount 29 | cd ~ 30 | sudo python $RUN_DIR/examples/$TEST_DIR/mininet/sdx_mininet.py $RUN_DIR/examples/$TEST_DIR/mininet/mininet.cfg 31 | 32 | #cd $RUN_DIR/examples/$TEST_DIR/mininext 33 | #sudo ./sdx_mininext.py 34 | ;; 35 | 36 | (3) 37 | cd $RUN_DIR/flanc 38 | if [ -n "$STATS" ]; then 39 | export GAUGE_CONFIG=$RUN_DIR/examples/$TEST_DIR/config/gauge.conf 40 | STATS_APP=stats/gauge.py 41 | fi 42 | ryu-manager $STATS_APP ryu.app.ofctl_rest refmon.py --refmon-config $RUN_DIR/examples/$TEST_DIR/config/sdx_global.cfg & 43 | sleep 1 44 | 45 | cd $RUN_DIR/xctrl 46 | python xctrl.py $RUN_DIR/examples/$TEST_DIR/config/sdx_global.cfg 47 | 48 | cd $RUN_DIR/arproxy 49 | sudo python arproxy.py $TEST_DIR & 50 | sleep 1 51 | 52 | cd $RUN_DIR/xrs 53 | sudo python route_server.py $TEST_DIR & 54 | sleep 1 55 | 56 | cd $RUN_DIR/pctrl 57 | sudo python participant_controller.py $TEST_DIR 1 & 58 | sudo python participant_controller.py $TEST_DIR 2 & 59 | sudo python participant_controller.py $TEST_DIR 3 & 60 | sleep 1 61 | 62 | cd $RUN_DIR 63 | exabgp examples/$TEST_DIR/config/bgp.conf 64 | ;; 65 | esac 66 | -------------------------------------------------------------------------------- /logmsg.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ''' 4 | Send a single message at INFO level to log server. 5 | ''' 6 | 7 | import argparse 8 | import sys 9 | import util.log 10 | 11 | logger = util.log.getLogger('NOTE') 12 | logger.info(' '.join(sys.argv[1:])) 13 | -------------------------------------------------------------------------------- /pctrl/README.md: -------------------------------------------------------------------------------- 1 | # pctrl - Participants' SDX Controller 2 | 3 | This module is in charge of running an `event handler` for each SDX participant. This `event handler` 4 | receives network events from `xrs` module (BGP updates), `arproxy` module (ARP requests), and participants's 5 | control interface (high-level policy changes). It processes incoming network events to generate new 6 | BGP announcements and data plane updates. It sends the BGP announcements to the `xrs` module and 7 | dp updates to the `flanc` module. 8 | 9 | See examples/test-ms/README.md for an example of how to run pctrl along with everything else. 10 | -------------------------------------------------------------------------------- /pctrl/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/pctrl/__init__.py -------------------------------------------------------------------------------- /pctrl/clean.sh: -------------------------------------------------------------------------------- 1 | pgrep -fa mininet > /dev/null && sudo mn -c 2 | sudo rm -f ~/iSDX/xrs/ribs/*.db 3 | sudo killall python 4 | sudo killall exabgp 5 | sudo fuser -k 6633/tcp 6 | python ~/iSDX/pctrl/clean_mongo.py 7 | -------------------------------------------------------------------------------- /pctrl/clean_mongo.py: -------------------------------------------------------------------------------- 1 | from pymongo import MongoClient 2 | 3 | import globs 4 | 5 | client = MongoClient(globs.MONGODB_HOST, globs.MONGODB_PORT) 6 | client.drop_database('demo') 7 | -------------------------------------------------------------------------------- /pctrl/example_dynamic_policy_in.cfg: -------------------------------------------------------------------------------- 1 | { 2 | "new_policies": { 3 | "inbound": [ 4 | { 5 | "action": { 6 | "fwd": 1 7 | }, 8 | "cookie": 56, 9 | "match": { 10 | "ipv4_src": [ 11 | "110.0.0.0", 12 | "255.255.255.0" 13 | ] 14 | } 15 | } 16 | ] 17 | }, 18 | "removal_cookies": [ 19 | 55 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /pctrl/example_dynamic_policy_out.cfg: -------------------------------------------------------------------------------- 1 | { 2 | "new_policies": { 3 | "outbound": [ 4 | { 5 | "action": { 6 | "fwd": 3 7 | }, 8 | "cookie": 34, 9 | "match": { 10 | "ipv4_src": [ 11 | "110.0.0.0", 12 | "255.255.255.0" 13 | ] 14 | } 15 | } 16 | ] 17 | }, 18 | "removal_cookies": [ 19 | 11 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /pctrl/globs.py: -------------------------------------------------------------------------------- 1 | CASSANDRA_HOST=["localhost"] 2 | CASSANDRA_SPACE="demo" 3 | MONGODB_HOST="localhost" 4 | MONGODB_PORT=27017 5 | -------------------------------------------------------------------------------- /pctrl/participant_server.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # Author: 3 | # Florian Kaufmann (DE-CIX) 4 | 5 | import json 6 | from multiprocessing.connection import Listener 7 | from threading import Thread 8 | 9 | import os 10 | import sys 11 | 12 | ''' server for participants to handle policy updates ''' 13 | class ParticipantServer(object): 14 | 15 | def __init__(self, address, port, logger): 16 | self.logger = logger 17 | self.listener = Listener((address, port), backlog=100) 18 | 19 | def start(self, participant_controller): 20 | self.receive = True 21 | self.controller = participant_controller 22 | 23 | self.id = self.controller.id 24 | self.logger.debug('participant_server(%s): start server' % self.id) 25 | 26 | self.receiver = Thread(target=self.receiver) 27 | self.receiver.start() 28 | 29 | def receiver(self): 30 | while self.receive: 31 | conn = self.listener.accept() 32 | self.logger.debug('participant_server(%s) accepted connection from %s' % (self.id, self.listener.last_accepted)) 33 | 34 | msg = None 35 | while msg is None: 36 | try: 37 | msg = conn.recv() 38 | except: 39 | pass 40 | self.logger.debug('participant_server(%s): received policy message %s' % (self.id, msg)) 41 | self.controller.process_policy_changes(json.loads(msg)) 42 | 43 | conn.close() 44 | self.logger.debug('participant_server(%s): closed connection' % self.id) 45 | 46 | def stop(self): 47 | self.receive = False 48 | self.receiver.join(1) 49 | -------------------------------------------------------------------------------- /pctrl/run_pctrlr.sh: -------------------------------------------------------------------------------- 1 | sudo python participant_controller.py $1 1 & 2 | sudo python participant_controller.py $1 2 & 3 | sudo python participant_controller.py $1 3 & 4 | -------------------------------------------------------------------------------- /setup/basic-setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | while [ "$1" != "" ]; do 4 | if [ $1 = "--no-mininet" ]; then 5 | NO_MININET=1 6 | fi 7 | shift 8 | done 9 | 10 | # install packages 11 | sudo apt-get update 12 | 13 | sudo DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential fakeroot debhelper autoconf \ 14 | automake libssl-dev graphviz python-all python-qt4 \ 15 | python-twisted-conch libtool git tmux vim python-pip python-paramiko \ 16 | python-netaddr \ 17 | python-sphinx mongodb dos2unix wireshark 18 | 19 | sudo pip install -U pip 20 | 21 | sudo pip install -r ~/iSDX/setup/pip-basic-requires 22 | 23 | sudo apt-get install -y ssh git sshfs graphviz feh 24 | sudo apt-get install -y libstring-crc32-perl 25 | 26 | echo 'PATH=$PATH:~/iSDX/bin' >> ~/.profile 27 | 28 | if [ -z "$NO_MININET" ]; then 29 | # set up some shortcuts 30 | mkdir ~/bin/ 31 | echo "sudo mn -c; sudo mn --topo single,3 --mac --switch ovsk --controller remote" > ~/bin/mininet.sh 32 | chmod 755 ~/bin/mininet.sh 33 | fi 34 | -------------------------------------------------------------------------------- /setup/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Reference: https://scotch.io/tutorials/how-to-create-a-vagrant-base-box-from-an-existing-one 3 | 4 | sudo apt-get clean 5 | 6 | # Compact disk space 7 | sudo dd if=/dev/zero of=/EMPTY bs=1M 8 | sudo rm -f /EMPTY 9 | 10 | # Clear bash history & exit 11 | cat /dev/null > ~/.bash_history && history -c && exit 12 | 13 | 14 | -------------------------------------------------------------------------------- /setup/grafana-setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # download and install influxdb 4 | wget https://dl.influxdata.com/influxdb/releases/influxdb_0.13.0_amd64.deb 5 | sudo dpkg -i influxdb_0.13.0_amd64.deb 6 | rm -f influxdb_0.13.0_amd64.deb 7 | 8 | sudo service influxdb start 9 | sleep 2 10 | influx -execute 'create database sdx' 11 | 12 | # download and install grafana 13 | wget https://grafanarel.s3.amazonaws.com/builds/grafana_3.0.4-1464167696_amd64.deb 14 | sudo apt-get install -y adduser libfontconfig sqlite 15 | sudo dpkg -i grafana_3.0.4-1464167696_amd64.deb 16 | rm -f grafana_3.0.4-1464167696_amd64.deb 17 | 18 | # configure to start at boot 19 | sudo update-rc.d grafana-server defaults 95 10 20 | 21 | sudo service grafana-server stop 22 | sleep 2 23 | 24 | # configure grafana 25 | #curl -X POST -d @/home/vagrant/iSDX/setup/grafanaDataSource.json http://admin:admin@localhost:3000/api/datasources --header "Content-Type:application/json" 26 | sudo bash -c '> /var/lib/grafana/grafana.db' 27 | sudo sqlite3 /var/lib/grafana/grafana.db '.read /home/vagrant/iSDX/setup/grafana-init.sql' 28 | sudo chown grafana:grafana /var/lib/grafana/grafana.db 29 | sudo rm -rf /var/lib/grafana/sessions/* 30 | sudo service grafana-server start 31 | 32 | # configure directories for stats 33 | sudo mkdir -p /var/log/sdx 34 | sudo chmod og+w /var/log/sdx 35 | -------------------------------------------------------------------------------- /setup/mininet-setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | sudo apt-get install -y mininet 4 | -------------------------------------------------------------------------------- /setup/ovs-setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cd ~ 4 | wget http://openvswitch.org/releases/openvswitch-2.3.2.tar.gz 5 | tar xf openvswitch-2.3.2.tar.gz 6 | pushd openvswitch-2.3.2 7 | DEB_BUILD_OPTIONS='parallel=8 nocheck' fakeroot debian/rules binary 8 | popd 9 | sudo dpkg -i openvswitch-common*.deb openvswitch-datapath-dkms*.deb python-openvswitch*.deb openvswitch-pki*.deb openvswitch-switch*.deb 10 | rm -rf *openvswitch* 11 | cd ~ 12 | -------------------------------------------------------------------------------- /setup/pip-basic-requires: -------------------------------------------------------------------------------- 1 | alabaster==0.7.7 2 | pymongo==3.2.1 3 | -------------------------------------------------------------------------------- /setup/pip-ryu-requires: -------------------------------------------------------------------------------- 1 | eventlet==0.18.4 2 | msgpack-python==0.4.7 3 | oslo.config==3.8.0 4 | ovs==2.6.0 5 | -------------------------------------------------------------------------------- /setup/pip-sdx-requires: -------------------------------------------------------------------------------- 1 | exabgp==3.4.13 2 | requests==2.2.1 3 | ipaddr==2.1.11 4 | influxdb==2.12.0 5 | -------------------------------------------------------------------------------- /setup/ryu-flags.py: -------------------------------------------------------------------------------- 1 | 2 | CONF.register_cli_opts([ 3 | # refmon 4 | cfg.StrOpt('config', default=None, 5 | help='path of config file'), 6 | cfg.StrOpt('flowmodlog', default=None, 7 | help='path of flowmod log file'), 8 | cfg.StrOpt('input', default=None, 9 | help='path of input file'), 10 | cfg.StrOpt('log', default=None, 11 | help='path of log file'), 12 | cfg.BoolOpt('always_ready', default=False, 13 | help='assume all switches are up and registered with Ryu'), 14 | ], group='refmon') 15 | -------------------------------------------------------------------------------- /setup/ryu-setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | RYU_VERSION="v4.7" 4 | 5 | cd ~ 6 | 7 | # Dependencies for ryu 8 | sudo apt-get install -y python-routes python-dev 9 | 10 | sudo pip install -r ~/iSDX/setup/pip-ryu-requires 11 | 12 | # Ryu install 13 | cd ~ 14 | git clone -b $RYU_VERSION git://github.com/osrg/ryu.git 15 | sudo cat iSDX/setup/ryu-flags.py >>ryu/ryu/flags.py 16 | cd ryu 17 | 18 | # Below should be temporary until ryu's pip-requires file is fixed 19 | sed -i "s/python_version < '2.7'/(python_version != '2.7' and python_version != '3.0')/" tools/pip-requires 20 | sed -i "s/python_version >= '2.7'/(python_version == '2.7' or python_version == '3.0')/" tools/pip-requires 21 | 22 | sudo python ./setup.py install 23 | -------------------------------------------------------------------------------- /setup/sdx-setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | while [ "$1" != "" ]; do 4 | if [ $1 = "--no-mininet" ]; then 5 | NO_MININET=1 6 | fi 7 | shift 8 | done 9 | 10 | cd ~ 11 | 12 | # Install Quagga 13 | sudo apt-get install -y quagga 14 | 15 | sudo pip install -r ~/iSDX/setup/pip-sdx-requires 16 | 17 | # Install SDX 18 | # use existing iSDX that is mounted by Vagrant 19 | #git clone https://github.com/sdn-ixp/iSDX.git 20 | cd iSDX 21 | sudo chmod 755 xrs/client.py xrs/route_server.py 22 | mkdir xrs/ribs 23 | dos2unix launch.sh xrs/client.py pctrl/clean.sh 24 | cd ~ 25 | 26 | sudo mkdir -p /var/log/sdx 27 | sudo chown vagrant:vagrant /var/log/sdx 28 | -------------------------------------------------------------------------------- /test/buildall.sh: -------------------------------------------------------------------------------- 1 | mkdir output 2 | for i in specs/*.spec 3 | do 4 | echo "####################################" $i "########################################################" 5 | file=`basename $i .spec` 6 | rm -rf ../examples/$file 7 | rm -rf output/$file 8 | python gen_test.py $i 9 | mv output/$file ../examples 10 | done 11 | -------------------------------------------------------------------------------- /test/example_grafana_config/gauge-dp1.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | dp_id: 0x0000000000000001 # The id of the datapath to be controlled 3 | name: "Main-1" # The name of the datapath for use with logging 4 | description: "SDX Main Switch" # Purely informational 5 | hardware: "??" 6 | monitor_ports: True # whether gauge should monitor stats for ports 7 | monitor_ports_file: "ports.out" # The file to record ports statistics 8 | monitor_ports_interval: 10 # the polling interval for port stats in seconds 9 | monitor_flow_table: True # whether gauge should take periodic flow table dumps 10 | monitor_flow_table_file: "ft.out" # the file to record flow table dumps 11 | monitor_flow_table_interval: 10 # the polling interval for flow table monitoring 12 | influxdb_stats: True 13 | interfaces: 14 | 2: 15 | name: "Outbound" # name for this port, used for logging/monitoring 16 | 1: 17 | name: "Inbound" 18 | 4: 19 | name: "Route Server" 20 | 3: 21 | name: "ARP" 22 | 5: 23 | name: "A" 24 | 6: 25 | name: "B" 26 | 7: 27 | name: "C1" 28 | 8: 29 | name: "C2" 30 | -------------------------------------------------------------------------------- /test/example_grafana_config/gauge-dp2.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | dp_id: 0x0000000000000002 # The id of the datapath to be controlled 3 | name: "Inbound-1" # The name of the datapath for use with logging 4 | description: "SDX Inbound Switch" # Purely informational 5 | hardware: "??" 6 | monitor_ports: True # whether gauge should monitor stats for ports 7 | monitor_ports_file: "ports.out" # The file to record ports statistics 8 | monitor_ports_interval: 10 # the polling interval for port stats in seconds 9 | monitor_flow_table: True # whether gauge should take periodic flow table dumps 10 | monitor_flow_table_file: "ft.out" # the file to record flow table dumps 11 | monitor_flow_table_interval: 10 # the polling interval for flow table monitoring 12 | influxdb_stats: True 13 | interfaces: 14 | 1: 15 | name: "Main" 16 | 2: 17 | name: "Outbound" 18 | -------------------------------------------------------------------------------- /test/example_grafana_config/gauge-dp3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | dp_id: 0x0000000000000003 # The id of the datapath to be controlled 3 | name: "Outbound-1" # The name of the datapath for use with logging 4 | description: "SDX Outbound Switch" # Purely informational 5 | hardware: "??" 6 | monitor_ports: True # whether gauge should monitor stats for ports 7 | monitor_ports_file: "ports.out" # The file to record ports statistics 8 | monitor_ports_interval: 10 # the polling interval for port stats in seconds 9 | monitor_flow_table: True # whether gauge should take periodic flow table dumps 10 | monitor_flow_table_file: "ft.out" # the file to record flow table dumps 11 | monitor_flow_table_interval: 10 # the polling interval for flow table monitoring 12 | influxdb_stats: True 13 | interfaces: 14 | 1: 15 | name: "Main" 16 | 2: 17 | name: "Inbound" 18 | -------------------------------------------------------------------------------- /test/example_grafana_config/gauge-dp4.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | dp_id: 0x0000000000000004 # The id of the datapath to be controlled 3 | name: "ARP-1" # The name of the datapath for use with logging 4 | description: "SDX ARP Switch" # Purely informational 5 | hardware: "??" 6 | monitor_ports: True # whether gauge should monitor stats for ports 7 | monitor_ports_file: "ports.out" # The file to record ports statistics 8 | monitor_ports_interval: 10 # the polling interval for port stats in seconds 9 | monitor_flow_table: True # whether gauge should take periodic flow table dumps 10 | monitor_flow_table_file: "ft.out" # the file to record flow table dumps 11 | monitor_flow_table_interval: 10 # the polling interval for flow table monitoring 12 | influxdb_stats: True 13 | interfaces: 14 | 1: 15 | name: "Main" 16 | 2: 17 | name: "ARP Proxy" 18 | -------------------------------------------------------------------------------- /test/example_grafana_config/gauge.conf: -------------------------------------------------------------------------------- 1 | gauge-dp1.yaml 2 | gauge-dp2.yaml 3 | gauge-dp3.yaml 4 | gauge-dp4.yaml 5 | -------------------------------------------------------------------------------- /test/specs/README.md: -------------------------------------------------------------------------------- 1 | # Configuration Specifications 2 | 3 | This directory includes the specifications for representative test configurations. 4 | Refer to the README in the test directory for details. -------------------------------------------------------------------------------- /test/specs/test0-ms.spec: -------------------------------------------------------------------------------- 1 | # generate network equivalent to generic test-ms 2 | # 3 participants 3 | # combination of inbound and outbound rules 4 | # additional test for unmatched traffic on port 8888 5 | 6 | mode multi-switch 7 | participants 3 8 | peers 1 2 3 9 | 10 | participant 1 100 5 08:00:27:89:3b:9f 172.0.0.1/16 11 | participant 2 200 6 08:00:27:92:18:1f 172.0.0.11/16 12 | participant 3 300 7 08:00:27:54:56:ea 172.0.0.21/16 8 08:00:27:bd:f8:b2 172.0.0.22/16 13 | 14 | #host AS ROUTER _ IP # host names of form a1_100 a1_110 15 | host h NETNUMB _ AS ROUTER # host names of the form h1_a1 h2_a1 16 | 17 | announce 1 100.0.0.0/24 110.0.0.0/24 18 | announce 2 140.0.0.0/24 150.0.0.0/24 19 | announce 3 140.0.0.0/24 150.0.0.0/24 20 | 21 | outflow a1 -c 11 -t 80 > b 22 | outflow a1 -c 22 -t 4321 > c 23 | outflow a1 -c 33 -t 4322 > c 24 | inflow -c 44 -t 4321 > c1 25 | inflow -c 55 -t 4322 > c2 26 | 27 | listener AUTOGEN 80 4321 4322 8888 28 | 29 | test regress { 30 | test xfer 31 | } 32 | 33 | test init { 34 | listener 35 | } 36 | 37 | test xfer { 38 | verify h1_a1 h1_b1 80 39 | verify h1_a1 h1_c1 4321 40 | verify h1_a1 h1_c2 4322 41 | verify h1_a1 h1_b1 8888 42 | } 43 | 44 | test info { 45 | local ovs-ofctl dump-flows S1 46 | local ovs-ofctl dump-flows S2 47 | local ovs-ofctl dump-flows S3 48 | local ovs-ofctl dump-flows S4 49 | exec a1 ip route 50 | bgp a1 51 | exec b1 ip route 52 | bgp b1 53 | exec c1 ip route 54 | bgp c1 55 | exec c2 ip route 56 | bgp c2 57 | } 58 | -------------------------------------------------------------------------------- /test/specs/test0-mt.spec: -------------------------------------------------------------------------------- 1 | # generate network equivalent to generic test-mt 2 | # 3 participants 3 | # combination of inbound and outbound rules 4 | # additional test for unmatched traffic on port 8888 5 | 6 | mode multi-table 7 | participants 3 8 | peers 1 2 3 9 | 10 | participant 1 100 3 08:00:27:89:3b:9f 172.0.0.1/16 11 | participant 2 200 4 08:00:27:92:18:1f 172.0.0.11/16 12 | participant 3 300 5 08:00:27:54:56:ea 172.0.0.21/16 6 08:00:27:bd:f8:b2 172.0.0.22/16 13 | 14 | host h NETNUMB _ AS ROUTER # node names of the form h1_a1 h2_a1 15 | 16 | announce 1 100.0.0.0/24 110.0.0.0/24 17 | announce 2 140.0.0.0/24 150.0.0.0/24 18 | announce 3 140.0.0.0/24 150.0.0.0/24 19 | 20 | outflow a1 -t 80 > b 21 | outflow a1 -t 4321 > c 22 | outflow a1 -t 4322 > c 23 | 24 | inflow -t 4321 > c1 25 | inflow -t 4322 > c2 26 | 27 | listener AUTOGEN 80 4321 4322 8888 28 | 29 | test regress { 30 | test xfer 31 | } 32 | 33 | test init { 34 | listener 35 | } 36 | 37 | test xfer { 38 | verify h1_a1 h1_b1 80 39 | verify h1_a1 h1_c1 4321 40 | verify h1_a1 h1_c2 4322 41 | verify h1_a1 h1_b1 8888 42 | } 43 | 44 | test info { 45 | local ovs-ofctl dump-flows S1 46 | exec a1 ip route 47 | bgp a1 48 | exec b1 ip route 49 | bgp b1 50 | exec c1 ip route 51 | bgp c1 52 | exec c2 ip route 53 | bgp c2 54 | } 55 | -------------------------------------------------------------------------------- /test/specs/test1-ms.spec: -------------------------------------------------------------------------------- 1 | # generate network equivalent to generic test-ms 2 | # 3 participants 3 | # combination of inbound and outbound rules 4 | # additional test for unmatched traffic on port 8888 5 | 6 | mode multi-switch 7 | participants 3 8 | peers 1 2 3 9 | 10 | participant 1 100 PORT MAC 172.0.0.1/16 11 | participant 2 200 PORT MAC 172.0.0.11/16 12 | participant 3 300 PORT MAC 172.0.0.21/16 PORT MAC 172.0.0.22/16 13 | 14 | host AS ROUTER _ IP # testnode names of form a1_100 a1_110 15 | 16 | announce 1 100.0.0.0/24 -110.0.0.0/24 17 | announce 2 140.0.0.0/24 150.0.0.0/24 18 | announce 3 140.0.0.0/24 150.0.0.0/24 19 | 20 | outflow a1 -t 80 > b 21 | outflow a1 -t 4321 > c 22 | outflow a1 -t 4322 > c 23 | 24 | inflow -t 4321 > c1 25 | inflow -t 4322 > c2 26 | 27 | 28 | listener AUTOGEN 80 4321 4322 8888 29 | 30 | test regress { 31 | test xfer 32 | withdraw b1 140.0.0.0/24 33 | exec a1 ip -s -s neigh flush all 34 | delay 4 35 | test xfer2 36 | announce b1 140.0.0.0/24 37 | exec a1 ip -s -s neigh flush all 38 | delay 4 39 | test xfer 40 | } 41 | 42 | test init { 43 | listener 44 | } 45 | 46 | test xfer { 47 | verify a1_100 b1_140 80 48 | verify a1_100 c1_140 4321 49 | verify a1_100 c2_140 4322 50 | verify a1_100 b1_140 8888 51 | } 52 | 53 | test xfer2 { 54 | verify a1_100 c1_140 80 55 | verify a1_100 c1_140 4321 56 | verify a1_100 c2_140 4322 57 | verify a1_100 c1_140 8888 58 | } 59 | 60 | test info { 61 | local ovs-ofctl dump-flows S1 62 | local ovs-ofctl dump-flows S2 63 | local ovs-ofctl dump-flows S3 64 | local ovs-ofctl dump-flows S4 65 | exec a1 ip route 66 | bgp a1 67 | exec b1 ip route 68 | bgp b1 69 | exec c1 ip route 70 | bgp c1 71 | exec c2 ip route 72 | bgp c2 73 | } 74 | -------------------------------------------------------------------------------- /test/specs/test1-mt.spec: -------------------------------------------------------------------------------- 1 | # generate network equivalent to generic test-mt 2 | # 3 participants 3 | # combination of inbound and outbound rules 4 | # additional test for unmatched traffic on port 8888 5 | 6 | mode multi-table 7 | participants 3 8 | peers 1 2 3 9 | 10 | participant 1 100 PORT MAC 172.0.0.1/16 11 | participant 2 200 PORT MAC 172.0.0.11/16 12 | participant 3 300 PORT MAC 172.0.0.21/16 PORT MAC 172.0.0.22/16 13 | 14 | host AS ROUTER _ IP # host names of form a1_100 a1_110 15 | 16 | announce 1 100.0.0.0/24 110.0.0.0/24 17 | announce 2 140.0.0.0/24 150.0.0.0/24 18 | announce 3 140.0.0.0/24 150.0.0.0/24 19 | 20 | outflow a1 -t 80 > b 21 | outflow a1 -t 4321 > c 22 | outflow a1 -t 4322 > c 23 | 24 | inflow -t 4321 > c1 25 | inflow -t 4322 > c2 26 | 27 | listener AUTOGEN 80 4321 4322 8888 28 | 29 | test regress { 30 | test xfer 31 | withdraw b1 140.0.0.0/24 32 | exec a1 ip -s -s neigh flush all 33 | delay 4 34 | test xfer2 35 | announce b1 140.0.0.0/24 36 | exec a1 ip -s -s neigh flush all 37 | delay 4 38 | test xfer 39 | } 40 | 41 | test init { 42 | listener 43 | } 44 | 45 | test xfer { 46 | verify a1_100 b1_140 80 47 | verify a1_100 c1_140 4321 48 | verify a1_100 c2_140 4322 49 | verify a1_100 b1_140 8888 50 | } 51 | 52 | test xfer2 { 53 | verify a1_100 c1_140 80 54 | verify a1_100 c1_140 4321 55 | verify a1_100 c2_140 4322 56 | verify a1_100 c1_140 8888 57 | } 58 | 59 | test info { 60 | local ovs-ofctl dump-flows S1 61 | exec a1 ip route 62 | bgp a1 63 | exec b1 ip route 64 | bgp b1 65 | exec c1 ip route 66 | bgp c1 67 | exec c2 ip route 68 | bgp c2 69 | } 70 | -------------------------------------------------------------------------------- /test/specs/test2-ms.spec: -------------------------------------------------------------------------------- 1 | # generate slightly more complex case than test-ms 2 | # 5 participants 3 | # extra flows from a second sourcing node 4 | # be careful if specifying duplicate advertised routes from both sources (100.0.0.1) 5 | # as there are no return path rules 6 | 7 | mode multi-switch 8 | participants 5 9 | peers 1 2 3 4 5 10 | 11 | #participant ID ASN PORT MAC IP PORT MAC IP 12 | participant 1 100 PORT MAC 172.0.0.1/16 13 | participant 2 200 PORT MAC 172.0.0.11/16 14 | participant 3 300 PORT MAC 172.0.0.21/16 15 | participant 4 400 PORT MAC 172.0.0.31/16 PORT MAC 172.0.0.32/16 16 | participant 5 500 PORT MAC 172.0.0.41/16 17 | 18 | host AS ROUTER _ IP # host names of form a1_100 a1_110 19 | 20 | announce 1 100.0.0.0/24 21 | announce 2 110.0.0.0/24 22 | announce 3 140.0.0.0/24 150.0.0.0/24 23 | announce 4 140.0.0.0/24 150.0.0.0/24 24 | announce 5 140.0.0.0/24 150.0.0.0/24 25 | 26 | outflow a1 -t 80 > c 27 | outflow a1 -t 4321 > d 28 | outflow a1 -t 4322 > d 29 | inflow -t 4321 > d1 30 | inflow -t 4322 > d2 31 | outflow b1 -t 80 > e 32 | outflow b1 -t 4321 > d 33 | outflow b1 -t 4322 > d 34 | 35 | listener AUTOGEN 80 4321 4322 8888 36 | 37 | test init { 38 | listener 39 | } 40 | 41 | test regress { 42 | verify a1_100 c1_140 80 43 | verify a1_100 d1_140 4321 44 | verify a1_100 d2_140 4322 45 | verify a1_100 c1_140 8888 46 | 47 | verify b1_110 e1_140 80 48 | verify b1_110 d1_140 4321 49 | verify b1_110 d2_140 4322 50 | verify b1_110 c1_140 8888 51 | } 52 | 53 | test info { 54 | local ovs-ofctl dump-flows S1 55 | local ovs-ofctl dump-flows S2 56 | local ovs-ofctl dump-flows S3 57 | local ovs-ofctl dump-flows S4 58 | exec a1 ip route 59 | bgp a1 60 | exec b1 ip route 61 | bgp b1 62 | exec c1 ip route 63 | bgp c1 64 | exec d1 ip route 65 | bgp d1 66 | exec d2 ip route 67 | bgp d2 68 | exec e1 ip route 69 | bgp e1 70 | } -------------------------------------------------------------------------------- /test/specs/test4-ms.spec: -------------------------------------------------------------------------------- 1 | # test outbound rules 2 | # 1 source, many receivers 3 | 4 | mode multi-switch 5 | participants 9 6 | peers 1 2 3 4 5 6 7 8 9 7 | 8 | #participant ID ASN PORT MAC IP PORT MAC IP 9 | participant 1 100 PORT MAC 172.0.0.1/16 10 | participant 2 200 PORT MAC 172.0.0.11/16 11 | participant 3 300 PORT MAC 172.0.0.21/16 12 | participant 4 400 PORT MAC 172.0.0.31/16 13 | participant 5 500 PORT MAC 172.0.0.41/16 14 | participant 6 600 PORT MAC 172.0.0.51/16 15 | participant 7 700 PORT MAC 172.0.0.61/16 16 | participant 8 800 PORT MAC 172.0.0.71/16 17 | participant 9 900 PORT MAC 172.0.0.81/16 18 | 19 | host AS ROUTER _ IP # host names of form a1_100 a1_110 20 | 21 | announce 1 100.0.0.0/24 22 | announce 2 140.0.0.0/24 23 | announce 3 140.0.0.0/24 24 | announce 4 140.0.0.0/24 25 | announce 5 140.0.0.0/24 26 | announce 6 140.0.0.0/24 27 | announce 7 140.0.0.0/24 28 | announce 8 140.0.0.0/24 29 | announce 9 140.0.0.0/24 30 | 31 | outflow a1 -t 80 > b 32 | outflow a1 -t 81 > c 33 | outflow a1 -t 82 > d 34 | outflow a1 -t 83 > e 35 | outflow a1 -t 84 > f 36 | outflow a1 -t 85 > g 37 | outflow a1 -t 86 > h 38 | outflow a1 -t 87 > i 39 | 40 | listener AUTOGEN 77 80 81 82 83 84 85 86 87 41 | 42 | test init { 43 | listener 44 | } 45 | 46 | test regress { 47 | verify a1_100 b1_140 77 48 | verify a1_100 b1_140 80 49 | verify a1_100 c1_140 81 50 | verify a1_100 d1_140 82 51 | verify a1_100 e1_140 83 52 | verify a1_100 f1_140 84 53 | verify a1_100 g1_140 85 54 | verify a1_100 h1_140 86 55 | verify a1_100 i1_140 87 56 | } 57 | 58 | test info { 59 | local ovs-ofctl dump-flows S1 60 | local ovs-ofctl dump-flows S2 61 | local ovs-ofctl dump-flows S3 62 | local ovs-ofctl dump-flows S4 63 | } 64 | -------------------------------------------------------------------------------- /test/specs/test5-ms.spec: -------------------------------------------------------------------------------- 1 | # test inbound rules 2 | # 2 participants - receiver has multiple router connections 3 | 4 | mode multi-switch 5 | participants 2 6 | peers 1 2 7 | 8 | #participant ID ASN PORT MAC IP PORT MAC IP 9 | participant 1 100 PORT MAC 172.0.0.1/16 10 | participant 2 200 PORT MAC 172.0.0.11/16 PORT MAC 172.0.0.12/16 PORT MAC 172.0.0.13/16 PORT MAC 172.0.0.14/16 PORT MAC 172.0.0.15/16 PORT MAC 172.0.0.16/16 PORT MAC 172.0.0.17/16 PORT MAC 172.0.0.18/16 PORT MAC 172.0.0.19/16 11 | 12 | host AS ROUTER _ IP # host names of form a1_100 a1_110 13 | 14 | announce 1 100.0.0.0/24 15 | announce 2 140.0.0.0/24 16 | 17 | inflow -t 80 > b1 18 | inflow -t 81 > b2 19 | inflow -t 82 > b3 20 | inflow -t 83 > b4 21 | inflow -t 84 > b5 22 | inflow -t 85 > b6 23 | inflow -t 86 > b7 24 | inflow -t 87 > b8 25 | inflow -t 88 > b9 26 | 27 | listener AUTOGEN 77 80 81 82 83 84 85 86 87 88 28 | 29 | test init { 30 | listener 31 | } 32 | 33 | test regress { 34 | verify a1_100 b1_140 77 35 | verify a1_100 b1_140 80 36 | verify a1_100 b2_140 81 37 | verify a1_100 b3_140 82 38 | verify a1_100 b4_140 83 39 | verify a1_100 b5_140 84 40 | verify a1_100 b6_140 85 41 | verify a1_100 b7_140 86 42 | verify a1_100 b8_140 87 43 | verify a1_100 b9_140 88 44 | } 45 | 46 | test info { 47 | local ovs-ofctl dump-flows S1 48 | local ovs-ofctl dump-flows S2 49 | local ovs-ofctl dump-flows S3 50 | local ovs-ofctl dump-flows S4 51 | } -------------------------------------------------------------------------------- /test/specs/test6-ms.spec: -------------------------------------------------------------------------------- 1 | mode multi-switch 2 | participants 3 3 | peers 1 2 3 4 | 5 | participant 1 100 PORT MAC 172.0.0.10/16 6 | participant 2 200 PORT MAC 172.0.0.20/16 7 | participant 3 300 PORT MAC 172.0.0.30/16 8 | 9 | host AS ROUTER _ IP # host names of form a1_100 a1_110 10 | 11 | announce 1 110.0.0.0/24 140.0.0.0/24 150.0.0.0/24 12 | announce 2 120.0.0.0/24 150.0.0.0/24 160.0.0.0/24 13 | announce 3 130.0.0.0/24 160.0.0.0/24 140.0.0.0/24 14 | 15 | outflow a1 -t 80 > b 16 | outflow b1 -t 80 > c 17 | outflow c1 -t 80 > a 18 | outflow a1 -t 81 > c 19 | outflow b1 -t 81 > a 20 | outflow c1 -t 81 > b 21 | 22 | listener AUTOGEN 80 81 88 23 | 24 | test init { 25 | listener 26 | } 27 | 28 | test regress { 29 | verify a1_110 b1_160 80 30 | verify b1_120 c1_140 80 31 | verify c1_130 a1_150 80 32 | 33 | verify a1_110 c1_160 81 34 | verify b1_120 a1_140 81 35 | verify c1_130 b1_150 81 36 | 37 | verify a1_110 b1_160 88 38 | verify b1_120 a1_140 88 39 | verify c1_130 a1_150 88 40 | } 41 | 42 | test info { 43 | local ovs-ofctl dump-flows S1 44 | local ovs-ofctl dump-flows S2 45 | local ovs-ofctl dump-flows S3 46 | local ovs-ofctl dump-flows S4 47 | } 48 | -------------------------------------------------------------------------------- /test/templates/exabgp-bgp.conf: -------------------------------------------------------------------------------- 1 | group rs { 2 | process parsed-route-backend { 3 | run /home/vagrant/iSDX/xrs/client.py; 4 | encoder json; 5 | receive-routes; 6 | } 7 | 8 | _NEIGHBORS_ 9 | 10 | } 11 | -------------------------------------------------------------------------------- /test/templates/quagga-bgpd.conf: -------------------------------------------------------------------------------- 1 | ! 2 | ! Zebra configuration saved from vty 3 | ! 2013/10/02 20:47:51 4 | ! 5 | hostname _DESCRIPTION_ 6 | password bgpd 7 | log stdout 8 | ! 9 | router bgp _ASN_ 10 | bgp router-id _IP_ 11 | neighbor 172.0.255.254 remote-as 65000 12 | neighbor 172.0.255.254 next-hop-self 13 | _NETWORKS_ 14 | redistribute static 15 | ! 16 | line vty 17 | ! 18 | -------------------------------------------------------------------------------- /test/templates/quagga-daemons: -------------------------------------------------------------------------------- 1 | # This file tells the quagga package which daemons to start. 2 | # 3 | # Entries are in the format: =(yes|no|priority) 4 | # 0, "no" = disabled 5 | # 1, "yes" = highest priority 6 | # 2 .. 10 = lower priorities 7 | # Read /usr/share/doc/quagga/README.Debian for details. 8 | # 9 | # Sample configurations for these daemons can be found in 10 | # /usr/share/doc/quagga/examples/. 11 | # 12 | # ATTENTION: 13 | # 14 | # When activation a daemon at the first time, a config file, even if it is 15 | # empty, has to be present *and* be owned by the user and group "quagga", else 16 | # the daemon will not be started by /etc/init.d/quagga. The permissions should 17 | # be u=rw,g=r,o=. 18 | # When using "vtysh" such a config file is also needed. It should be owned by 19 | # group "quaggavty" and set to ug=rw,o= though. Check /etc/pam.d/quagga, too. 20 | # 21 | zebra=yes 22 | bgpd=yes 23 | ospfd=no 24 | ospf6d=no 25 | ripd=no 26 | ripngd=no 27 | isisd=no 28 | -------------------------------------------------------------------------------- /test/templates/quagga-debian.conf: -------------------------------------------------------------------------------- 1 | # 2 | # If this option is set the /etc/init.d/quagga script automatically loads 3 | # the config via "vtysh -b" when the servers are started. 4 | # Check /etc/pam.d/quagga if you intend to use "vtysh"! 5 | # 6 | vtysh_enable=yes 7 | zebra_options=" --daemon -A 127.0.0.1" 8 | bgpd_options=" --daemon -A 127.0.0.1" 9 | ospfd_options=" --daemon -A 127.0.0.1" 10 | ospf6d_options="--daemon -A ::1" 11 | ripd_options=" --daemon -A 127.0.0.1" 12 | ripngd_options="--daemon -A ::1" 13 | isisd_options=" --daemon -A 127.0.0.1" 14 | -------------------------------------------------------------------------------- /test/templates/quagga-zebra.conf: -------------------------------------------------------------------------------- 1 | ! 2 | ! Zebra configuration saved from vty 3 | ! 2013/10/02 20:47:51 4 | ! 5 | hostname _HOSTNAME_ 6 | password zebra 7 | enable password zebra 8 | ! 9 | !interface eth0 10 | ! ipv6 nd suppress-ra 11 | ! 12 | !interface eth1 13 | ! ipv6 nd suppress-ra 14 | ! 15 | interface _HOST_-eth0 16 | ipv6 nd suppress-ra 17 | ip forwarding 18 | ! 19 | !interface eth3 20 | ! ipv6 nd suppress-ra 21 | ! 22 | !interface lo 23 | ! 24 | line vty 25 | ! 26 | -------------------------------------------------------------------------------- /test/templates/test-README.md: -------------------------------------------------------------------------------- 1 | # Auto Generated Test Directory 2 | 3 | This directory hierarchy was generated automatically from the specification file: _SPECFILE_. Do not make changes here - they will be overwritten. 4 | 5 | The specification used was: 6 | 7 | ``` 8 | _SPECIFICATION_ 9 | ``` -------------------------------------------------------------------------------- /util/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/util/__init__.py -------------------------------------------------------------------------------- /util/log.py: -------------------------------------------------------------------------------- 1 | import logging, logging.handlers 2 | import pprint 3 | import json 4 | 5 | # Use a global LogLevel to get uniform behavior across all python processes. 6 | LogLevel = logging.DEBUG 7 | 8 | # where logging info goes / where logServer.py is running. 9 | HOST = 'localhost' 10 | PORT = logging.handlers.DEFAULT_TCP_LOGGING_PORT 11 | 12 | socketHandler = logging.handlers.SocketHandler(HOST, PORT) 13 | 14 | def getLogger(name): 15 | logger = logging.getLogger(name) 16 | logger.setLevel(LogLevel) 17 | logger.addHandler(socketHandler) 18 | 19 | return logger 20 | -------------------------------------------------------------------------------- /visualization/dockers/apache/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:14.04 2 | 3 | VOLUME ["/var/www"] 4 | 5 | RUN apt-get update && \ 6 | apt-get install -y \ 7 | apache2 \ 8 | php5 \ 9 | php5-cli \ 10 | libapache2-mod-php5 \ 11 | php5-gd \ 12 | php5-json \ 13 | php5-ldap \ 14 | php5-mysql \ 15 | php5-pgsql 16 | COPY apache_default /etc/apache2/sites-available/000-default.conf 17 | COPY run /usr/local/bin/run 18 | RUN chmod +x /usr/local/bin/run 19 | RUN a2enmod rewrite 20 | ADD web-interface /var/www 21 | RUN chmod -R 755 /var/www 22 | RUN ls -al /var/www/* 23 | EXPOSE 80 24 | CMD ["/usr/local/bin/run"] 25 | RUN ps -elf 26 | -------------------------------------------------------------------------------- /visualization/dockers/apache/apache_default: -------------------------------------------------------------------------------- 1 | 2 | # The ServerName directive sets the request scheme, hostname and port that 3 | # the server uses to identify itself. This is used when creating 4 | # redirection URLs. In the context of virtual hosts, the ServerName 5 | # specifies what hostname must appear in the request's Host: header to 6 | # match this virtual host. For the default virtual host (this file) this 7 | # value is not decisive as it is used as a last resort host regardless. 8 | # However, you must set it for any further virtual host explicitly. 9 | #ServerName www.example.com 10 | 11 | ServerAdmin webmaster@localhost 12 | DocumentRoot /var/www 13 | 14 | 15 | AllowOverride All 16 | Require all granted 17 | 18 | 19 | # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, 20 | # error, crit, alert, emerg. 21 | # It is also possible to configure the loglevel for particular 22 | # modules, e.g. 23 | #LogLevel info ssl:warn 24 | 25 | ErrorLog /dev/stdout 26 | CustomLog /dev/stdout combined 27 | 28 | # For most configuration files from conf-available/, which are 29 | # enabled or disabled at a global level, it is possible to 30 | # include a line for only one particular virtual host. For example the 31 | # following line enables the CGI configuration for this host only 32 | # after it has been globally disabled with "a2disconf". 33 | #Include conf-available/serve-cgi-bin.conf 34 | 35 | 36 | # vim: syntax=apache ts=4 sw=4 sts=4 sr noet 37 | -------------------------------------------------------------------------------- /visualization/dockers/apache/run: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | PHP_ERROR_REPORTING=${PHP_ERROR_REPORTING:-"E_ALL & ~E_DEPRECATED & ~E_NOTICE"} 5 | sed -ri 's/^display_errors\s*=\s*Off/display_errors = On/g' /etc/php5/apache2/php.ini 6 | sed -ri 's/^display_errors\s*=\s*Off/display_errors = On/g' /etc/php5/cli/php.ini 7 | sed -ri "s/^error_reporting\s*=.*$//g" /etc/php5/apache2/php.ini 8 | sed -ri "s/^error_reporting\s*=.*$//g" /etc/php5/cli/php.ini 9 | echo "error_reporting = $PHP_ERROR_REPORTING" >> /etc/php5/apache2/php.ini 10 | echo "error_reporting = $PHP_ERROR_REPORTING" >> /etc/php5/cli/php.ini 11 | 12 | source /etc/apache2/envvars && exec /usr/sbin/apache2 -DFOREGROUND 13 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/Princeton_shield.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/visualization/dockers/apache/web-interface/Princeton_shield.png -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/css/fonts/BebasNeue-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/visualization/dockers/apache/web-interface/css/fonts/BebasNeue-webfont.eot -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/css/fonts/BebasNeue-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/visualization/dockers/apache/web-interface/css/fonts/BebasNeue-webfont.ttf -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/css/fonts/BebasNeue-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/visualization/dockers/apache/web-interface/css/fonts/BebasNeue-webfont.woff -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/css/fonts/fontomas-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/visualization/dockers/apache/web-interface/css/fonts/fontomas-webfont.eot -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/css/fonts/fontomas-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/visualization/dockers/apache/web-interface/css/fonts/fontomas-webfont.ttf -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/css/fonts/fontomas-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/visualization/dockers/apache/web-interface/css/fonts/fontomas-webfont.woff -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/css/fonts/franchise-bold-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/visualization/dockers/apache/web-interface/css/fonts/franchise-bold-webfont.eot -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/css/fonts/franchise-bold-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/visualization/dockers/apache/web-interface/css/fonts/franchise-bold-webfont.ttf -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/css/fonts/franchise-bold-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/visualization/dockers/apache/web-interface/css/fonts/franchise-bold-webfont.woff -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/css/legend.css: -------------------------------------------------------------------------------- 1 | /*Lengend.css*/ 2 | .rickshaw_legend { 3 | font-family: Arial; 4 | font-size: 12px; 5 | color: white; 6 | background: #404040; 7 | display: inline-block; 8 | padding: 12px 5px; 9 | border-radius: 2px; 10 | position: relative; 11 | } 12 | .rickshaw_legend:hover { 13 | z-index: 10; 14 | } 15 | .rickshaw_legend .swatch { 16 | width: 10px; 17 | height: 10px; 18 | border: 1px solid rgba(0, 0, 0, 0.2); 19 | } 20 | .rickshaw_legend .line { 21 | clear: both; 22 | line-height: 140%; 23 | padding-right: 15px; 24 | } 25 | .rickshaw_legend .line .swatch { 26 | display: inline-block; 27 | margin-right: 3px; 28 | border-radius: 2px; 29 | } 30 | .rickshaw_legend .label { 31 | margin: 0; 32 | white-space: nowrap; 33 | display: inline; 34 | font-size: inherit; 35 | background-color: transparent; 36 | color: inherit; 37 | font-weight: normal; 38 | line-height: normal; 39 | padding: 0px; 40 | text-shadow: none; 41 | } 42 | .rickshaw_legend .action:hover { 43 | opacity: 0.6; 44 | } 45 | .rickshaw_legend .action { 46 | margin-right: 0.2em; 47 | font-size: 10px; 48 | opacity: 0.2; 49 | cursor: pointer; 50 | font-size: 14px; 51 | } 52 | .rickshaw_legend .line.disabled { 53 | opacity: 0.4; 54 | } 55 | .rickshaw_legend ul { 56 | list-style-type: none; 57 | margin: 0; 58 | padding: 0; 59 | margin: 2px; 60 | cursor: pointer; 61 | } 62 | .rickshaw_legend li { 63 | padding: 0 0 0 2px; 64 | min-width: 80px; 65 | white-space: nowrap; 66 | } 67 | .rickshaw_legend li:hover { 68 | background: rgba(255, 255, 255, 0.08); 69 | border-radius: 3px; 70 | } 71 | .rickshaw_legend li:active { 72 | background: rgba(255, 255, 255, 0.2); 73 | border-radius: 3px; 74 | } 75 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/css/line.css: -------------------------------------------------------------------------------- 1 | div, span, p, td { 2 | font-family: Arial, sans-serif; 3 | } 4 | #chart { 5 | display: inline-block; 6 | } 7 | #legend { 8 | display: inline-block; 9 | position: relative; 10 | left: 8px; 11 | } 12 | #legend_container { 13 | position: absolute; 14 | right: 0; 15 | bottom: 26px; 16 | width: 0; 17 | } 18 | #chart_container { 19 | float: left; 20 | position: relative; 21 | } 22 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/fonts/BebasNeue-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/visualization/dockers/apache/web-interface/fonts/BebasNeue-webfont.eot -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/fonts/BebasNeue-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/visualization/dockers/apache/web-interface/fonts/BebasNeue-webfont.ttf -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/fonts/BebasNeue-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/visualization/dockers/apache/web-interface/fonts/BebasNeue-webfont.woff -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/fonts/fontomas-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/visualization/dockers/apache/web-interface/fonts/fontomas-webfont.eot -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/fonts/fontomas-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/visualization/dockers/apache/web-interface/fonts/fontomas-webfont.ttf -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/fonts/fontomas-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/visualization/dockers/apache/web-interface/fonts/fontomas-webfont.woff -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/fonts/franchise-bold-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/visualization/dockers/apache/web-interface/fonts/franchise-bold-webfont.eot -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/fonts/franchise-bold-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/visualization/dockers/apache/web-interface/fonts/franchise-bold-webfont.ttf -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/fonts/franchise-bold-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/visualization/dockers/apache/web-interface/fonts/franchise-bold-webfont.woff -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/force.csv: -------------------------------------------------------------------------------- 1 | source,target,value 2 | Harry,Sally,1.2 3 | Harry,Mario,1.3 4 | Sarah,Alice,0.2 5 | Eveie,Alice,0.5 6 | Peter,Alice,1.6 7 | Mario,Alice,0.4 8 | James,Alice,0.6 9 | Harry,Carol,0.7 10 | Harry,Nicky,0.8 11 | Bobby,Frank,0.8 12 | Alice,Mario,0.7 13 | Harry,Lynne,0.5 14 | Sarah,James,1.9 15 | Roger,James,1.1 16 | Maddy,James,0.3 17 | Sonny,Roger,0.5 18 | James,Roger,1.5 19 | Alice,Peter,1.1 20 | Johan,Peter,1.6 21 | Alice,Eveie,0.5 22 | Harry,Eveie,0.1 23 | Eveie,Harry,2.0 24 | Henry,Mikey,0.4 25 | Elric,Mikey,0.6 26 | James,Sarah,1.5 27 | Alice,Sarah,0.6 28 | James,Maddy,0.5 29 | Peter,Johan,0.7 30 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/functioncalling.php: -------------------------------------------------------------------------------- 1 | 23 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/iSDX-nsdi-demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/visualization/dockers/apache/web-interface/iSDX-nsdi-demo.png -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Dynamic Table 7 | 8 | 9 | 10 | 11 | 45 | 46 | 47 | 48 | 49 | 50 |
51 |
52 | 53 | 54 |
55 | 56 | 57 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/isdx-demo-image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/visualization/dockers/apache/web-interface/isdx-demo-image.jpg -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/js/angular/README.md: -------------------------------------------------------------------------------- 1 | # bower-angular 2 | 3 | This repo is for distribution on `bower`. The source for this module is in the 4 | [main AngularJS repo](https://github.com/angular/angular.js). 5 | Please file issues and pull requests against that repo. 6 | 7 | ## Install 8 | 9 | Install with `bower`: 10 | 11 | ```shell 12 | bower install angular 13 | ``` 14 | 15 | Add a ` 19 | ``` 20 | 21 | ## Documentation 22 | 23 | Documentation is available on the 24 | [AngularJS docs site](http://docs.angularjs.org/). 25 | 26 | ## License 27 | 28 | The MIT License 29 | 30 | Copyright (c) 2010-2012 Google, Inc. http://angularjs.org 31 | 32 | Permission is hereby granted, free of charge, to any person obtaining a copy 33 | of this software and associated documentation files (the "Software"), to deal 34 | in the Software without restriction, including without limitation the rights 35 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 36 | copies of the Software, and to permit persons to whom the Software is 37 | furnished to do so, subject to the following conditions: 38 | 39 | The above copyright notice and this permission notice shall be included in 40 | all copies or substantial portions of the Software. 41 | 42 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 43 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 44 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 45 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 46 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 47 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 48 | THE SOFTWARE. 49 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/js/angular/angular-csp.css: -------------------------------------------------------------------------------- 1 | /* Include this file in your html if you are using the CSP mode. */ 2 | 3 | @charset "UTF-8"; 4 | 5 | [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], 6 | .ng-cloak, .x-ng-cloak, 7 | .ng-hide { 8 | display: none !important; 9 | } 10 | 11 | ng\:form { 12 | display: block; 13 | } 14 | 15 | .ng-animate-block-transitions { 16 | transition:0s all!important; 17 | -webkit-transition:0s all!important; 18 | } 19 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/js/angular/angular.min.js.gzip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/visualization/dockers/apache/web-interface/js/angular/angular.min.js.gzip -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/js/app.js: -------------------------------------------------------------------------------- 1 | angular.module('hierarchie', [ 2 | 'ngRoute', 3 | 'hierarchie.controllers', 4 | 'hierarchie.filters', 5 | 'hierarchie.services', 6 | 'hierarchie.directives' 7 | ]); -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/js/create_lun.js: -------------------------------------------------------------------------------- 1 | function submitForm(oFormElement) 2 | { 3 | var id = oFormElement.serial_list.value; 4 | var name = oFormElement.name.value; 5 | var capacity = oFormElement.capacity.value; 6 | var sp = oFormElement.sp_type.value; 7 | var params = "ID=" + id + "&name=" + name + "&capacity=" + capacity + "&sp=" + sp + ""; 8 | 9 | var xmlhttp = new XMLHttpRequest(); 10 | var url = localStorage.getItem("create_lun_url"); 11 | 12 | xmlhttp.open("POST", url, true); 13 | xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); 14 | 15 | xmlhttp.onreadystatechange=function() 16 | { 17 | if (xmlhttp.readyState == 4 && xmlhttp.status == 200) 18 | { 19 | ; 20 | } 21 | } 22 | //xmlhttp.send(new FormData(oFormElement)); 23 | xmlhttp.send(params); 24 | document.getElementById("create_lun_form").reset(); 25 | return false; 26 | } 27 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/js/d3/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010-2014, Michael Bostock 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * The name Michael Bostock may not be used to endorse or promote products 15 | derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT, 21 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 22 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 26 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/js/d3/README.md: -------------------------------------------------------------------------------- 1 | # Data-Driven Documents 2 | 3 | 4 | 5 | **D3.js** is a JavaScript library for manipulating documents based on data. **D3** helps you bring data to life using HTML, SVG and CSS. D3’s emphasis on web standards gives you the full capabilities of modern browsers without tying yourself to a proprietary framework, combining powerful visualization components and a data-driven approach to DOM manipulation. 6 | 7 | Want to learn more? [See the wiki.](https://github.com/mbostock/d3/wiki) 8 | 9 | For examples, [see the gallery](https://github.com/mbostock/d3/wiki/Gallery) and [mbostock’s bl.ocks](http://bl.ocks.org/mbostock). 10 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/js/directives.js: -------------------------------------------------------------------------------- 1 | 2 | /* Define directives module*/ 3 | angular.module('hierarchie.directives', ['hierarchie.services']); 4 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/js/dropdownmenu.js: -------------------------------------------------------------------------------- 1 | var options = []; 2 | 3 | $( '.dropdown-menu a' ).on( 'click', function( event ) { 4 | 5 | var $target = $( event.currentTarget ), 6 | val = $target.attr( 'data-value' ), 7 | $inp = $target.find( 'input' ), 8 | idx; 9 | 10 | if ( ( idx = options.indexOf( val ) ) > -1 ) { 11 | options.splice( idx, 1 ); 12 | setTimeout( function() { $inp.prop( 'checked', false ) }, 0); 13 | } else { 14 | options.push( val ); 15 | setTimeout( function() { $inp.prop( 'checked', true ) }, 0); 16 | } 17 | 18 | $( event.target ).blur(); 19 | 20 | console.log( options ); 21 | return false; 22 | }); -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/js/filters.js: -------------------------------------------------------------------------------- 1 | 2 | angular.module('hierarchie.filters', ['hierarchie.services']) 3 | .filter('interpolate', ['version', function(version) { 4 | return function(text) { 5 | return String(text).replace(/\%VERSION\%/mg, version); 6 | }; 7 | }]); 8 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/js/gauge-render.js: -------------------------------------------------------------------------------- 1 | 2 | function createGauge(name, label, min, max, size, gauges) 3 | { 4 | var config = 5 | { 6 | size: undefined != size ? size : 240, 7 | label: label, 8 | min: undefined != min ? min : 0, 9 | max: undefined != max ? max : 100, 10 | minorTicks: 5 11 | } 12 | 13 | var range = config.max - config.min; 14 | config.redZones = [{ from: config.min + range*0, to: config.min + range*0.25 }]; 15 | //config.yellowZones = [{ from: config.min + range*0.25, to: config.min + range*0.50 }]; 16 | config.greenZones = [{ from: config.min + range*0.70, to: config.max }]; 17 | 18 | gauges[name] = new Gauge(name, config); 19 | gauges[name].render(); 20 | } 21 | 22 | function createGauges(gauges) 23 | { 24 | createGauge("F1", "THPUT-1", 0 , 1000, 125, gauges); 25 | createGauge("F2", "THPUT-2", 0 , 1000, 125, gauges); 26 | createGauge("F3", "THPUT-3", 0 , 1000, 125, gauges); 27 | createGauge("F4", "THPUT-4", 0 , 1000, 125, gauges); 28 | 29 | createGauge("B1", "THPUT-1", 0 , 1000, 125, gauges); 30 | createGauge("B2", "THPUT-2", 0 , 1000, 125, gauges); 31 | createGauge("B3", "THPUT-3", 0 , 1000, 125, gauges); 32 | createGauge("B4", "THPUT-4", 0 , 1000, 125, gauges); 33 | } 34 | 35 | function updateGauges() 36 | { 37 | for (var key in gauges) 38 | { 39 | var value = getRandomValue(gauges[key]) 40 | gauges[key].redraw(value); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/js/globals.js: -------------------------------------------------------------------------------- 1 | function onLoadPage() { 2 | 3 | // var nodejs_url = "http://127.0.0.1:3000"; 4 | // var apache_url = "http://10.245.12.198"; 5 | 6 | // --------------------------------------- 7 | // Read websocket info from stats-feed microservice 8 | // --------------------------------------- 9 | localStorage.setItem("nodejs", "http://192.168.99.100:8080"); 10 | 11 | // ------------------------------------- 12 | 13 | var apache_url = "http://192.168.99.100"; 14 | 15 | var cpu_uri = "getCPUHistory.php"; 16 | var serial_uri = "getSerialNumbers.php"; 17 | var requests_uri = "getRequestsStatus.php"; 18 | var login_uri = "login.php"; 19 | var register_uri = "register.php"; 20 | var create_lun_uri = "createLUNs.php"; 21 | var healthcheck_uri = "getLastHealth.php"; 22 | var capacity_uri = "getLastCapacity.php"; 23 | var execute_uri = "executeCommand.php"; 24 | console.log("globs"); 25 | // localStorage.setItem("nodejs", nodejs_url); 26 | localStorage.setItem("execute_url", apache_url + "/php/" + execute_uri); 27 | localStorage.setItem("cpu_url", apache_url + "/php/" + cpu_uri); 28 | 29 | localStorage.setItem("serial_url", apache_url + "/php/" + serial_uri); 30 | localStorage.setItem("requests_url", apache_url + "/php/" + requests_uri); 31 | localStorage.setItem("register_url", apache_url + "/php/" + register_uri); 32 | localStorage.setItem("login_url", apache_url + "/php/" + login_uri); 33 | localStorage.setItem("create_lun_url", apache_url + "/php/" + create_lun_uri); 34 | localStorage.setItem("healthcheck_url", apache_url + "/php/" + healthcheck_uri); 35 | localStorage.setItem("capacity_url", apache_url + "/php/" + capacity_uri); 36 | } 37 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/js/list_requests.js: -------------------------------------------------------------------------------- 1 | function reload_request_list() { 2 | var xmlhttp = new XMLHttpRequest(); 3 | var url = localStorage.getItem("requests_url"); 4 | 5 | xmlhttp.onreadystatechange=function() { 6 | if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { 7 | myFunction(xmlhttp.responseText); 8 | } 9 | } 10 | // xmlhttp.open("GET", url, true); 11 | xmlhttp.open("GET", url, false); 12 | xmlhttp.send(); 13 | 14 | function myFunction(response) { 15 | var arr = JSON.parse(response); 16 | var i; 17 | var request_table = ''; 18 | request_table += ''; 19 | request_table += ' No. '; 20 | request_table += ' Type'; 21 | request_table += ' Serial '; 22 | request_table += ' Status '; 23 | request_table += ''; 24 | 25 | for(i = 0; i < arr.length; i++) 26 | { 27 | var status = ""; 28 | 29 | if(arr[i].status == 'P') 30 | { 31 | status='two-gears-rotate' ; 32 | } 33 | else if(arr[i].status == 'C') 34 | { 35 | status='flag' ; 36 | } 37 | else if(arr[i].status == 'A') 38 | { 39 | status='eye' ; 40 | } 41 | else if(arr[i].status == 'N') 42 | { 43 | status='hamburger' ; 44 | } 45 | else if(arr[i].status == 'F') 46 | { 47 | status='attention' ; 48 | } 49 | var icount = i+1; 50 | request_table += ''; 51 | request_table += '' + icount + ''; 52 | request_table += '' + arr[i].type + ''; 53 | request_table += '' + arr[i].serial + ''; 54 | request_table += '
'; 55 | request_table += ''; 56 | 57 | } 58 | document.getElementById('request_table').innerHTML = request_table; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/js/list_serial.js: -------------------------------------------------------------------------------- 1 | var xmlhttp = new XMLHttpRequest(); 2 | var url = localStorage.getItem("serial_url"); 3 | 4 | xmlhttp.onreadystatechange=function() { 5 | if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { 6 | myFunction(xmlhttp.responseText); 7 | } 8 | } 9 | xmlhttp.open("GET", url, true); 10 | xmlhttp.send(); 11 | 12 | function myFunction(response) { 13 | var arr = JSON.parse(response); 14 | var i; 15 | var request_table = ''; 16 | 17 | for(i = 0; i < arr.length; i++) 18 | { 19 | request_table += ''; 20 | } 21 | document.getElementById('serial_list').innerHTML = request_table; 22 | } 23 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/js/logout.js: -------------------------------------------------------------------------------- 1 | 2 | function logout() 3 | { 4 | eraseCookie("username"); 5 | self.location="index.html"; 6 | console.log("Logout JS:" + readCookie("username")); 7 | } 8 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/js/main.js: -------------------------------------------------------------------------------- 1 | require.config({ 2 | paths: { 3 | angular: '../../js/angular/angular', 4 | angularRoute: '../../js/angular-route/angular-route', 5 | text: '../../js/requirejs-text/text', 6 | underscore: '../../js/underscore/underscore', 7 | d3: '../../js/d3/d3.min' 8 | }, 9 | /* Ability to shim D3 was removed in v3.4.0. We must manually require it for use. 10 | * https://github.com/mbostock/d3/issues/1693 */ 11 | shim: { 12 | 'underscore': { 13 | exports: '_' 14 | }, 15 | 'angular': {'exports': 'angular'}, 16 | 'angularRoute': ['angular'], 17 | }, 18 | priority: [ 19 | "angular" 20 | ] 21 | }); 22 | 23 | //http://code.angularjs.org/1.2.1/docs/guide/bootstrap#overview_deferred-bootstrap 24 | window.name = "NG_DEFER_BOOTSTRAP!"; 25 | 26 | require( [ 27 | 'angular', 28 | 'app', 29 | 'routes', 30 | 'underscore' 31 | ], function(angular, app, routes, underscore) { 32 | 'use strict'; 33 | var $html = angular.element(document.getElementsByTagName('html')[0]); 34 | 35 | angular.element().ready(function() { 36 | angular.resumeBootstrap([app['name']]); 37 | }); 38 | }); 39 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/js/register.js: -------------------------------------------------------------------------------- 1 | function registerForm(oFormElement) 2 | { 3 | var username = oFormElement.usernamesignup.value; 4 | var password = oFormElement.passwordsignup.value; 5 | var password_confirm = oFormElement.passwordsignup_confirm.value; 6 | var email = oFormElement.emailsignup.value; 7 | 8 | var params = "username=" + username + "&password=" + password + "&email=" + email; 9 | 10 | var xmlhttp = new XMLHttpRequest(); 11 | var url = localStorage.getItem("register_url"); 12 | 13 | xmlhttp.open("POST", url, true); 14 | xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); 15 | 16 | xmlhttp.onreadystatechange=function() 17 | { 18 | if (xmlhttp.readyState == 4 && xmlhttp.status == 200) 19 | { 20 | console.log("Response: " + xmlhttp.responseText); 21 | if(xmlhttp.responseText > 0) 22 | { 23 | console.log("Response: " + xmlhttp.responseText); 24 | createCookie("username",username,1); 25 | console.log("register-page: " + readCookie("username")); 26 | self.location="index.html"; 27 | } 28 | } 29 | } 30 | //xmlhttp.send(new FormData(oFormElement)); 31 | xmlhttp.send(params); 32 | document.getElementById("register_form").reset(); 33 | return false; 34 | } 35 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/js/routes.js: -------------------------------------------------------------------------------- 1 | angular.module('hierarchie') 2 | .config(['$routeProvider', 3 | function($routeProvider) { 4 | $routeProvider.when('/', { 5 | templateUrl: 'views/charts.html', 6 | controller: 'MainCtrl' 7 | }) 8 | .when('/fcc', { 9 | templateUrl: 'views/fcc.html', 10 | controller: 'FccCtrl' 11 | }) 12 | .when('/about', { 13 | templateUrl: 'views/about.html' 14 | }) 15 | .otherwise({ 16 | redirectTo: '/' 17 | }); 18 | } 19 | ]); 20 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/js/tabs.js: -------------------------------------------------------------------------------- 1 | jQuery(document).ready(function(){jQuery('.tabs.standard .tab-links a').on('click',function(e){var currentAttrValue=jQuery(this).attr('href');jQuery('.tabs '+ currentAttrValue).show().siblings().hide();jQuery(this).parent('li').addClass('active').siblings().removeClass('active');e.preventDefault();});jQuery('.tabs.animated-fade .tab-links a').on('click',function(e){var currentAttrValue=jQuery(this).attr('href');jQuery('.tabs '+ currentAttrValue).fadeIn(400).siblings().hide();jQuery(this).parent('li').addClass('active').siblings().removeClass('active');e.preventDefault();});jQuery('.tabs.animated-slide-1 .tab-links a').on('click',function(e){var currentAttrValue=jQuery(this).attr('href');jQuery('.tabs '+ currentAttrValue).siblings().slideUp(400);jQuery('.tabs '+ currentAttrValue).delay(400).slideDown(400);jQuery(this).parent('li').addClass('active').siblings().removeClass('active');e.preventDefault();});jQuery('.tabs.animated-slide-2 .tab-links a').on('click',function(e){var currentAttrValue=jQuery(this).attr('href');jQuery('.tabs '+ currentAttrValue).slideDown(400).siblings().slideUp(400);jQuery(this).parent('li').addClass('active').siblings().removeClass('active');e.preventDefault();});}); 2 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/js/tooltip.js: -------------------------------------------------------------------------------- 1 | var tooltip = d3.selectAll(".tooltip:not(.css)"); 2 | var SVGmouseTip = d3.select("g.tooltip.mouse"); 3 | 4 | d3.select("svg").select("g") 5 | .selectAll("circle") 6 | 7 | .attr("title", "Automatic Title Tooltip") 8 | 9 | .on("mouseover", function () { 10 | tooltip.style("opacity", "1"); 11 | tooltip.style("color", this.getAttribute("fill") ); 12 | }) 13 | .on("mousemove", function () { 14 | 15 | var mouseCoords = d3.mouse( 16 | SVGmouseTip.node().parentElement); 17 | 18 | SVGmouseTip 19 | .attr("transform", "translate(" 20 | + (mouseCoords[0]-10) + "," 21 | + (mouseCoords[1] - 10) + ")"); 22 | }) 23 | .on("mouseout", function () { 24 | return tooltip.style("opacity", "0"); 25 | }); 26 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/js/underscore/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative 2 | Reporters & Editors 3 | 4 | Permission is hereby granted, free of charge, to any person 5 | obtaining a copy of this software and associated documentation 6 | files (the "Software"), to deal in the Software without 7 | restriction, including without limitation the rights to use, 8 | copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | OTHER DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/js/underscore/README.md: -------------------------------------------------------------------------------- 1 | __ 2 | /\ \ __ 3 | __ __ ___ \_\ \ __ _ __ ____ ___ ___ _ __ __ /\_\ ____ 4 | /\ \/\ \ /' _ `\ /'_ \ /'__`\/\ __\/ ,__\ / ___\ / __`\/\ __\/'__`\ \/\ \ /',__\ 5 | \ \ \_\ \/\ \/\ \/\ \ \ \/\ __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\ __/ __ \ \ \/\__, `\ 6 | \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/ 7 | \/___/ \/_/\/_/\/__,_ /\/____/ \/_/ \/___/ \/____/\/___/ \/_/ \/____/\/_//\ \_\ \/___/ 8 | \ \____/ 9 | \/___/ 10 | 11 | Underscore.js is a utility-belt library for JavaScript that provides 12 | support for the usual functional suspects (each, map, reduce, filter...) 13 | without extending any core JavaScript objects. 14 | 15 | For Docs, License, Tests, and pre-packed downloads, see: 16 | http://underscorejs.org 17 | 18 | Underscore is an open-sourced component of DocumentCloud: 19 | https://github.com/documentcloud 20 | 21 | Many thanks to our contributors: 22 | https://github.com/jashkenas/underscore/contributors 23 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/js/vendor/queue.v1.min.js: -------------------------------------------------------------------------------- 1 | !function(){function n(n){function e(){for(;i=ap;){var u=a++,e=c[u],o=t.call(e,1);o.push(l(u)),++p,e[0].apply(null,o)}}function l(n){return function(u,t){--p,null==s&&(null!=u?(s=u,a=d=0/0,o()):(c[n]=t,--d?i||e():o()))}}function o(){null!=s?m(s):f?m(s,c):m.apply(null,[s].concat(c))}var r,i,f,c=[],a=0,p=0,d=0,s=null,m=u;return n||(n=1/0),r={defer:function(){return s||(c.push(arguments),++d,e()),r},await:function(n){return m=n,f=!1,d||o(),r},awaitAll:function(n){return m=n,f=!0,d||o(),r}}}function u(){}var t=[].slice;n.version="1.0.7","function"==typeof define&&define.amd?define(function(){return n}):"object"==typeof module&&module.exports?module.exports=n:this.queue=n}(); -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/php/dbproperties.php: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/php/executeCommand.php: -------------------------------------------------------------------------------- 1 | &1', $output); 11 | print_r($output); // to see the respond to your command 12 | 13 | ?> 14 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/php/getCPUHistory.php: -------------------------------------------------------------------------------- 1 | connect(); 8 | 9 | if ($_POST){ 10 | extract($_POST); 11 | }else { $serial='APM00143230622';} 12 | 13 | $result = mysql_query("SELECT DISTINCT(ts) ts, spa, spb FROM cpu_stat where serial='$serial' order by ts"); 14 | $out = "["; 15 | 16 | while($record = mysql_fetch_array($result)) 17 | { 18 | if ($out != "[") {$out .= ",";} 19 | $out .= '{"ts":"' . $record['ts'] . '",'; 20 | $out .= '"spa":"' . $record['spa'] . '",'; 21 | $out .= '"spb":"' . $record['spb'] . '"}'; 22 | 23 | } 24 | $out .= "]"; 25 | 26 | $db->close(); 27 | 28 | echo($out); 29 | ?> 30 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/php/getLastCapacity.php: -------------------------------------------------------------------------------- 1 | connect(); 8 | 9 | if ($_POST){ 10 | extract($_POST); 11 | }else { $serial='APM00143230622';} 12 | 13 | $result = mysql_query("SELECT DISTINCT(ts) ts, syscap, freecap, unconfigcap, usedcap FROM capacity_stat where serial='$serial' order by ts desc limit 1"); 14 | $out = "["; 15 | 16 | while($record = mysql_fetch_array($result)) 17 | { 18 | if ($out != "[") {$out .= ",";} 19 | $out .= '{"ts":"' . $record['ts'] . '",'; 20 | $out .= '"usedcap":"' . $record['usedcap'] . '",'; 21 | $out .= '"freecap":"' . $record['freecap'] . '",'; 22 | $out .= '"unconfigcap":"' . $record['unconfigcap'] . '",'; 23 | $out .= '"syscap":"' . $record['syscap'] . '"}'; 24 | } 25 | $out .= "]"; 26 | 27 | $db->close(); 28 | 29 | echo($out); 30 | ?> 31 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/php/getLastHealth.php: -------------------------------------------------------------------------------- 1 | connect(); 8 | 9 | if ($_POST){ 10 | extract($_POST); 11 | }else { $serial='APM00143230622';} 12 | 13 | $result = mysql_query("SELECT DISTINCT(ts) ts, score, note FROM healthcheck where serial='$serial' order by ts desc limit 1"); 14 | $out = "["; 15 | 16 | while($record = mysql_fetch_array($result)) 17 | { 18 | if ($out != "[") {$out .= ",";} 19 | $out .= '{"ts":"' . $record['ts'] . '",'; 20 | $out .= '"score":"' . $record['score'] . '",'; 21 | $out .= '"note":"' . $record['note'] . '"}'; 22 | } 23 | $out .= "]"; 24 | 25 | $db->close(); 26 | 27 | echo($out); 28 | ?> 29 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/php/getRequestsStatus.php: -------------------------------------------------------------------------------- 1 | connect(); 10 | 11 | if ($_POST){ 12 | extract($_POST); 13 | }else { $serial='APM00143230622';} 14 | 15 | $result = mysql_query("SELECT * FROM requests ORDER BY ID DESC"); 16 | $out = "["; 17 | 18 | while($record = mysql_fetch_array($result)) 19 | { 20 | $sql_serial = mysql_query("SELECT serial_no FROM array where ID ='" . $record['system_id'] . "'"); 21 | $row_serial = mysql_fetch_array($sql_serial); 22 | $serial = $row_serial['serial_no']; 23 | if ($out != "[") {$out .= ",";} 24 | $out .= '{"serial":"' . $serial . '",'; 25 | $out .= '"status":"' . $record['status'] . '",'; 26 | $out .= '"type":"' . $record['type'] . '",'; 27 | $out .= '"id":"' . $record['ID'] . '"}'; 28 | } 29 | $out .= "]"; 30 | 31 | $db->close(); 32 | 33 | echo($out); 34 | ?> 35 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/php/getSerialNumbers.php: -------------------------------------------------------------------------------- 1 | connect(); 8 | 9 | if ($_POST){ 10 | extract($_POST); 11 | }else { $serial='APM00143230622';} 12 | 13 | $result = mysql_query("SELECT * FROM array"); 14 | $out = "["; 15 | 16 | while($record = mysql_fetch_array($result)) 17 | { 18 | if ($out != "[") {$out .= ",";} 19 | $out .= '{"serial":"' . $record['serial_no'] . '",'; 20 | $out .= '"id":"' . $record['ID'] . '"}'; 21 | } 22 | $out .= "]"; 23 | 24 | $db->close(); 25 | 26 | echo($out); 27 | ?> 28 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/php/include/db_connect.php: -------------------------------------------------------------------------------- 1 | close(); 34 | } 35 | 36 | // Connecting to database 37 | public function connect() { 38 | // connecting to mysql 39 | $con = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); 40 | // selecting database 41 | mysql_select_db(DB_DATABASE); 42 | 43 | // return database handler 44 | return $con; 45 | } 46 | 47 | // Closing database connection 48 | public function close() { 49 | mysql_close(); 50 | } 51 | 52 | } 53 | 54 | ?> 55 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/php/include/util.inc: -------------------------------------------------------------------------------- 1 | 18 | 19 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/php/kafka.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/visualization/dockers/apache/web-interface/php/kafka.so -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/php/lib/kafka.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/visualization/dockers/apache/web-interface/php/lib/kafka.so -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/php/login.php: -------------------------------------------------------------------------------- 1 | connect(); 18 | 19 | 20 | // Define $username and $password 21 | $username = string_escape(util_aiod($_POST, 'username', "")); 22 | $password = string_escape(util_aiod($_POST, 'password', "")); 23 | 24 | $query = mysql_query("select * from user where password='$password' AND name='$username'"); 25 | $rows = mysql_num_rows($query); 26 | echo $rows; 27 | 28 | $db->close(); 29 | ?> 30 | 31 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/php/rabbitmq_info.php: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/php/register.php: -------------------------------------------------------------------------------- 1 | connect(); 18 | 19 | 20 | // Define $username and $password 21 | $username = string_escape(util_aiod($_POST, 'username', "")); 22 | $password = string_escape(util_aiod($_POST, 'password', "")); 23 | $email = string_escape(util_aiod($_POST, 'email', "")); 24 | 25 | 26 | $query = mysql_query("INSERT INTO `user` (name, email, password) values ('$username', '$email', '$password');"); 27 | echo $query; 28 | 29 | $db->close(); 30 | ?> 31 | 32 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/php/updateRequests.php: -------------------------------------------------------------------------------- 1 | connect(); 10 | 11 | $update_id = string_escape(util_aiod($_POST, "update_id", "")); 12 | $status = string_escape(util_aiod($_POST, "status", "")); 13 | 14 | $cmd = "UPDATE `requests` SET status='$status' WHERE ID =$update_id;"; 15 | 16 | echo "$update_id:$status"; 17 | echo $cmd; 18 | 19 | $result = mysql_query($cmd); 20 | 21 | $db->close(); 22 | ?> 23 | -------------------------------------------------------------------------------- /visualization/dockers/apache/web-interface/us.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdn-ixp/iSDX/aa7f3d01ac22c56b5882de50884b0473c8bb6ba2/visualization/dockers/apache/web-interface/us.png -------------------------------------------------------------------------------- /visualization/dockers/docker-compose.yml: -------------------------------------------------------------------------------- 1 | apache: 2 | build: ./apache 3 | links: 4 | - node 5 | ports: 6 | - "80:80" 7 | node: 8 | build: ./node 9 | links: 10 | - redis:redis 11 | ports: 12 | - "8080:8080" 13 | 14 | redis: 15 | build: ./redis-service 16 | ports: 17 | - "6379:6379" 18 | -------------------------------------------------------------------------------- /visualization/dockers/node/Dockerfile: -------------------------------------------------------------------------------- 1 | # Set the base image to Ubuntu 2 | FROM ubuntu:14.04 3 | 4 | # Install Node.js and other dependencies 5 | RUN apt-get update && \ 6 | apt-get -y install curl && \ 7 | curl -sL https://deb.nodesource.com/setup | sudo bash - && \ 8 | apt-get -y install python build-essential nodejs 9 | 10 | # Install nodemon 11 | RUN npm install -g nodemon 12 | 13 | # Provides cached layer for node_modules 14 | ADD package.json /tmp/package.json 15 | RUN cd /tmp && npm install 16 | RUN mkdir -p /src && cp -a /tmp/node_modules /src/ 17 | 18 | # Define working directory 19 | WORKDIR /src 20 | ADD . /src 21 | 22 | # Expose port 23 | EXPOSE 8080 24 | 25 | # Run app using nodemon 26 | CMD ["nodemon", "/src/index.js"] 27 | -------------------------------------------------------------------------------- /visualization/dockers/node/index.js: -------------------------------------------------------------------------------- 1 | var app = require("express")(); 2 | 3 | app.use(function(req, res, next) { 4 | res.append("Access-Control-Allow-Origin", "*"); 5 | res.append("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); 6 | res.append('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE'); 7 | res.append('Access-Control-Allow-Credentials', true); 8 | next(); 9 | }); 10 | var http = require('http') 11 | , server = http.Server(app) 12 | , io = require('socket.io'); 13 | 14 | 15 | var redis = require('redis'); 16 | 17 | var socket = io.listen(server); 18 | 19 | server.listen(8080, '0.0.0.0'); 20 | socket.on('connection', function(client) { 21 | console.log("WebSocket Connected to server"); 22 | var subscribe1 = redis.createClient('6379', 'redis'); 23 | var subscribe2 = redis.createClient('6379', 'redis'); 24 | 25 | subscribe1.subscribe('stats'); // listen to messages from channel pubsub 26 | subscribe2.subscribe('sdx_stats'); // listen to messages from channel pubsub 27 | 28 | subscribe1.on("message", function(channel, message) { 29 | console.log(message); // Debug output 30 | client.send(message); 31 | }); 32 | 33 | subscribe2.on("message", function(channel, message) { 34 | console.log(message); // Debug output 35 | client.send(message); 36 | }); 37 | 38 | client.on('message', function(msg) { 39 | }); 40 | 41 | client.on('disconnect', function() { 42 | subscribe1.quit(); 43 | subscribe2.quit(); 44 | }); 45 | }); 46 | -------------------------------------------------------------------------------- /visualization/dockers/node/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "portalStatsFeed", 3 | "version": "1.0.0", 4 | "description": "hi", 5 | "main": "index.js", 6 | "engines": { 7 | "node": "0.12.7" 8 | }, 9 | "scripts": { 10 | "start": "node index.js" 11 | }, 12 | "author": "", 13 | "license": "ISC", 14 | "dependencies": { 15 | "express": "^4.13.1", 16 | "redis": "^0.12.1", 17 | "socket.io": "^1.3.5" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /visualization/dockers/redis-service/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:14.04 2 | RUN apt-get update && apt-get install -y redis-server 3 | EXPOSE 6379 4 | ENTRYPOINT ["/usr/bin/redis-server"] 5 | -------------------------------------------------------------------------------- /visualization/dockers/redis-service/pub-sub/pub.py: -------------------------------------------------------------------------------- 1 | from settings import r 2 | import sys 3 | import time as t 4 | from random import randint 5 | import datetime 6 | 7 | if __name__ == '__main__': 8 | channel = sys.argv[1] 9 | 10 | print 'Welcome to {channel}'.format(**locals()) 11 | 12 | while True: 13 | cpuA = randint(0,100) 14 | cpuB = randint(0,100) 15 | time = datetime.datetime.fromtimestamp(t.time()).strftime('%Y-%m-%d %H:%M:%S') 16 | message = "C1|" + str(time) + "|" + str(cpuA) + "|" + str(cpuB) 17 | print message 18 | r.publish(channel, message) 19 | message = "C2|" + str(time) + "|" + str(cpuA) + "|" + str(cpuB) 20 | print message 21 | r.publish(channel, message) 22 | message = "B|" + str(time) + "|" + str(cpuA) + "|" + str(cpuB) 23 | print message 24 | r.publish(channel, message) 25 | 26 | message = "ng|Outbound|Main|" + str(cpuA); 27 | r.publish(channel, message) 28 | t.sleep(1) 29 | message = "ng|ARP-Proxy|Inbound|" + str(cpuB); 30 | message = "network_graph|Main|BGP-Proxy|bgp|20" 31 | r.publish(channel, message) 32 | -------------------------------------------------------------------------------- /visualization/dockers/redis-service/pub-sub/settings.py: -------------------------------------------------------------------------------- 1 | import redis 2 | 3 | config = { 4 | 'host': '192.168.99.100', 5 | 'port': 6379, 6 | 'db': 0, 7 | } 8 | 9 | r = redis.StrictRedis(**config) 10 | -------------------------------------------------------------------------------- /visualization/dockers/redis-service/pub-sub/sub.py: -------------------------------------------------------------------------------- 1 | from settings import r 2 | import sys 3 | 4 | if __name__ == '__main__': 5 | channel = sys.argv[1] 6 | 7 | pubsub = r.pubsub() 8 | pubsub.subscribe(channel) 9 | 10 | print 'Listening to {channel}'.format(**locals()) 11 | 12 | while True: 13 | for item in pubsub.listen(): 14 | print item['data'] 15 | -------------------------------------------------------------------------------- /visualization/log_replay/README.md: -------------------------------------------------------------------------------- 1 | # LogReplay 2 | 3 | ```bash 4 | $ python ~/iSDX/visualization/log_replay/replay.py