{"id":15735246,"url":"https://github.com/long-gong/switch-simulator","last_synced_at":"2025-03-31T03:47:09.614Z","repository":{"id":176487813,"uuid":"272759611","full_name":"long-gong/switch-simulator","owner":"long-gong","description":"Switch Simulator for Our QPS Paper","archived":false,"fork":false,"pushed_at":"2020-06-16T18:46:21.000Z","size":68,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-06T08:31:56.575Z","etag":null,"topics":["bipartite-matching","c89","crossbar-scheduler","input-queued-switch","simulator"],"latest_commit_sha":null,"homepage":"https://github.com/long-gong/switch-simulator","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/long-gong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-16T16:33:14.000Z","updated_at":"2024-04-11T02:38:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"22df4ec3-9a53-40b1-868b-f65a78e4ecca","html_url":"https://github.com/long-gong/switch-simulator","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"ef0726dd9c29923e2bc99a04cf240fb0c5b8acbc"},"previous_names":["long-gong/switch-simulator"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/long-gong%2Fswitch-simulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/long-gong%2Fswitch-simulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/long-gong%2Fswitch-simulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/long-gong%2Fswitch-simulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/long-gong","download_url":"https://codeload.github.com/long-gong/switch-simulator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246413245,"owners_count":20773053,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bipartite-matching","c89","crossbar-scheduler","input-queued-switch","simulator"],"created_at":"2024-10-04T01:11:19.440Z","updated_at":"2025-03-31T03:47:09.593Z","avatar_url":"https://github.com/long-gong.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SWITCH SIMULATOR\r\n\r\n[![Build Status](https://travis-ci.org/long-gong/switch-simulator.svg?branch=master)](https://travis-ci.org/long-gong/switch-simulator)\r\n\r\nSimulation codes for our switching paper:\r\n\r\n[Long Gong](https://lgong30.github.io/), Paul Tune, Liang Liu, Sen Yang, and [Jun (Jim) Xu](https://www.cc.gatech.edu/home/jx/). 2017. [Queue-Proportional Sampling: A Better Approach to Crossbar Scheduling for Input-Queued Switches](https://www.cc.gatech.edu/home/jx/reprints/Gong%20et%20al.%20-%202017%20-%20Queue-Proportional%20Sampling%20A%20Better%20Approach%20to%20.pdf). Proc. ACM Meas. Anal. Comput. Syst. 1, 1, Article 3 (June 2017), 33 pages. DOI:https://doi.org/10.1145/3084440\r\n  \r\n## Repository Structure\r\n\r\n    .\r\n    ├── config_experiment_one.cfg        Confiuration for experiment one\r\n    ├── config_experiment_two.cfg        Confiuration for experiment two  \r\n    ├── cxx                              Directory for C++ code (C++11 support REQUIRED)\r\n    │   └── random_variable.cpp             \r\n    ├── include                          Directory for C header files\r\n    │   ├── common.h\r\n    │   ├── graphtypes.h\r\n    │   ├── match.defs\r\n    │   ├── measure_merge_time.h\r\n    │   ├── pairs.c\r\n    │   ├── pointer.c\r\n    │   ├── random_variable.h\r\n    │   ├── readgraph.c\r\n    │   ├── schedule.h\r\n    │   ├── term.c\r\n    │   ├── unpairs.c\r\n    │   ├── uthash.h\r\n    │   ├── util.h\r\n    │   ├── vector.h\r\n    │   └── weighted_uniform_sampler.h\r\n    ├── Makefile                           Makefile for this project\r\n    ├── README.md                          This file\r\n    └── src                                Directory for C (some codes use C89) source codes\r\n        ├── common.c\r\n        ├── delayed_schedule.c              \r\n        ├── existing_schedule.c\r\n        ├── fqps_based_schedules.c\r\n        ├── glib.c\r\n        ├── incoming_common.c\r\n        ├── jq.c\r\n        ├── measure_merge_time.c\r\n        ├── qps_based_schedules.c\r\n        ├── schedule.c\r\n        ├── util.c\r\n        ├── vector.c\r\n        ├── weighted_uniform_sampler.c\r\n        └── wmatch.c\r\n\r\n## Benchmark Switching Algorithms (Selected)\r\n\r\nAlgorithms from literature:\r\n\r\n1. **iSLIP** [[1](#1)]: the standard iSLIP algorithm,\r\n2. **PIM** [[2](#2)]: parallel iterative matching,\r\n3. **MWM** [[4](#4)]: maximum weighted matching,\r\n4. **SERENA** [[5](#5)]: previous matching + arrival graph,\r\n5. **iLQF** [[3](#3)]: iterative longest queue first, and\r\n6. **THRESHOLD**: threshold based scheduling.\r\n\r\nEarly proposals (**NOT USED**):\r\n\r\n1. **iSLIP_RPS**: rate proportional sampling iSLIP, uses an arrival matrix in the first round,\r\n2. **PIM_RPS**: rate proportional sampling parallel iterative matching,\r\n3. **THRESHOLD_RPS**: rate proportional sampling threshold based scheduling.\r\n\r\nFinal proposals (**USED IN OUR PAPER**):\r\n\r\n1. **QPS-iSLIP** [[6](#6)]: Queue Proportional Sampling (QPS) augmented iSLIP\r\n2. **QPS-SERENA** [[6](#7)]: Queue Proportional Sampling (QPS) augmented SERENA\r\n\r\n## Usage\r\n\r\nCompilation: `make` : two binaries will be generated if succeeded: `ss_experiment_one` and `ss_experiment_two` in folder `build`: more details, please refer to the [**Makefile**](./Makefile)\r\n\r\nExecution of these binaries:\r\n\r\n    usage: [options]\r\n\r\n    -h\t\tprint usage\r\n    -p\t\tuse Pareto distribution (default Bernoulli)\r\n    -u average_burst_length\t\tuse geometric burst distribution (default: mean = N)\r\n    -w\t\tuse skewed input loading (default Bernoulli)\r\n    -f\t\tset user flag 1\r\n    -g\t\tset user flag 2\r\n    -a\t\tset user flag 3\r\n    -s\t\tset user flag 4\r\n    -b\t\tset user flag 5\r\n    -n size\t\tspecify N, number of input/output ports (default 32)\r\n    -m frames\tspecify number of macroframes (default N*500)\r\n    -l minimum_traffic_load\tspecify minimum traffic load (default 0.1, including)\r\n    -L maximum_traffic_load\tspecify maximum traffic load (default 1.0, including)\r\n    -S traffic_load_step\tspecify traffic load step (default 0.1)\r\n\r\n## Traffic Modules\r\n\r\n### Traffic Patterns\r\n\r\n1. uniform,\r\n2. diagonal,\r\n3. log diagonal, and\r\n4. quasi diagonal.\r\n\r\n### Arrival Processes\r\n\r\n1. Bernoulli,\r\n2. Pareto bursts\r\n\r\n## Fixes\r\n\r\n1. Modification of readgraph.c [by Paul Tune]\r\n   + Lines 7 and 10, where the **inttypes.h** library (Long changes it to **stdint.h** library) was added and gptr's type was changed to **intptr_t**, instead of **int**. This is because there are problems casting to the integer type for 64-bit machines, causing a segmentation fault. Changing it to a integer pointer fixed the problem. The simulator should be able to run on both 32 and 64 bit machines. The original code of **readgraph.c** can be accessed from http://compgenomics.utsa.edu/SVMicrO%20Source%20Code/SVMicrO/ViennaRNA-1.7/RNAforester/src/readgraph.c\r\n   + Aside from that **stdio.h** and **stdlib.h** libraries were included the scripts requiring **malloc** and **printf** to avoid complains from the compiler. \r\n2. Modification of wmatch.c [by Long Gong]\r\n   + Line 23: Change the type of **gptr** from **int** to **intptr_t**. Paul suggested a modification from **int** (actually, in the original source code it is **void ***) to **intptr_t** to adapt to 64-bit machine, however, he seemed to forget to change the definition of **Weighted_Match** which still uses **int**, so it will cause a segmentation fault problem when running on 64-bit machines. \r\n\r\n## Acknowledgements\r\n\r\nThis project was modified from [Dr. Bill Lin](http://cwcserv.ucsd.edu/~billlin/)'s original source codes.\r\n\r\n## Authors\r\n\r\n+ Long Gong long.github@gmail.com\r\n+ Paul Tune\r\n\r\n## References\r\n\r\n[\u003ca id=\"1\"\u003e1\u003c/a\u003e] [McKeown, N.](http://yuba.stanford.edu/~nickm/), 1999. [The iSLIP scheduling algorithm for input-queued switches](https://www.cs.rutgers.edu/~sn624/552-F18/papers/islip.pdf). IEEE/ACM transactions on networking, 7(2), pp.188-201.  \r\n[\u003ca id=\"2\"\u003e2\u003c/a\u003e] Anderson, T.E., Owicki, S.S., Saxe, J.B. and Thacker, C.P., 1993. [High-speed switch scheduling for local-area networks](https://dl.acm.org/doi/abs/10.1145/161541.161736). ACM Transactions on Computer Systems (TOCS), 11(4), pp.319-352.  \r\n[\u003ca id=\"3\"\u003e3\u003c/a\u003e] [McKeown, N.W.](http://yuba.stanford.edu/~nickm/), 1995. [Scheduling algorithms for input-queued cell switches](http://yuba.stanford.edu/~nickm/papers/nickMcKeown_thesis.pdf) (Doctoral dissertation, University of California, Berkeley).  \r\n[\u003ca id=\"4\"\u003e4\u003c/a\u003e] [McKeown, N., Mekkittikul](http://yuba.stanford.edu/~nickm/), A., Anantharam, V. and Walrand, J., 1999. [Achieving 100% throughput in an input-queued switch](http://yuba.stanford.edu/~nickm/papers/IEEE_COMM_V3.pdf). IEEE Transactions on Communications, 47(8), pp.1260-1267.  \r\n[\u003ca id=\"5\"\u003e5\u003c/a\u003e] Giaccone, P., Prabhakar, B. and [Shah, D.](https://devavrat.mit.edu/), 2003. [Randomized scheduling algorithms for high-aggregate bandwidth switches](https://ieeexplore.ieee.org/document/1197700). IEEE Journal on Selected Areas in Communications, 21(4), pp.546-559.\r\n[\u003ca id=\"6\"\u003e6\u003c/a\u003e] Gong, L., Tune, P., Liu, L., Yang, S. and Xu, J., 2017. [Queue-Proportional Sampling: A Better Approach to Crossbar Scheduling for Input-Queued Switches](https://www.cc.gatech.edu/home/jx/reprints/Gong%20et%20al.%20-%202017%20-%20Queue-Proportional%20Sampling%20A%20Better%20Approach%20to%20.pdf). Proceedings of the ACM on Measurement and Analysis of Computing Systems, 1(1), pp.1-33.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flong-gong%2Fswitch-simulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flong-gong%2Fswitch-simulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flong-gong%2Fswitch-simulator/lists"}