{"id":21170056,"url":"https://github.com/covenantsql/gnte","last_synced_at":"2025-04-09T22:14:41.184Z","repository":{"id":57502599,"uuid":"137912159","full_name":"CovenantSQL/GNTE","owner":"CovenantSQL","description":"simple Global Network Topology Emulator","archived":false,"fork":false,"pushed_at":"2018-12-27T07:06:04.000Z","size":382,"stargazers_count":293,"open_issues_count":1,"forks_count":19,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-09T22:14:36.699Z","etag":null,"topics":["docker","emulator","network"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CovenantSQL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-19T15:40:46.000Z","updated_at":"2024-09-23T20:20:09.000Z","dependencies_parsed_at":"2022-09-13T07:02:18.864Z","dependency_job_id":null,"html_url":"https://github.com/CovenantSQL/GNTE","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CovenantSQL%2FGNTE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CovenantSQL%2FGNTE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CovenantSQL%2FGNTE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CovenantSQL%2FGNTE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CovenantSQL","download_url":"https://codeload.github.com/CovenantSQL/GNTE/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119290,"owners_count":21050755,"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":["docker","emulator","network"],"created_at":"2024-11-20T15:55:51.841Z","updated_at":"2025-04-09T22:14:41.144Z","avatar_url":"https://github.com/CovenantSQL.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"logo/logo.jpeg\" width=200\u003e\n\n# GNTE\nGNTE(Global Network Topology Emulator) is a docker-based all-in-one unstable global network emulator. It emulates functionality such as random delay and packet loss.\n\n## Before Use\nInstall docker\n\n## Build and Run\n### 1. build docker image\nClone this repo and run `build.sh`. There should be an image named `ns` in your docker environment.\n\n### 2. modify network definition file\nEdit ```example.yaml``` to fit your requirements. The rules of this file are described in the bottom section.\n\n### 3. generate and launch network emulator\nRun the following command:\n\n```\n./generate.sh\n```\n\nOnce all CovenantSQL testnet dockers are running, you can use `docker ps -a` to see all container nodes: \n\u003cimg src=\"logo/container_node.png\"\u003e\n\nYou can also find a graph of the network in `graph.png` under your root folder:\n\u003cimg src=\"logo/graph.png\"\u003e\n\n### 4. stop random one node or all nodes\nRun the following command:\n\n```\n./generate.sh stopone filter\n```\n\nwill stop randon one node. If filter is not empty, it will stop node name contains filter.\n\nAnd there is also a command to stop all:\n\n```\n./generate.sh stopall filter\n```\n\nAlso a command for restart all stopped nodes:\n\n```\n./generate.sh startall\n```\n\n### 5. run your own program in testnet\nContainers are referenced by group_name+ip. For example, given containers 10.250.1.2 and 10.250.8.2, you can run `docker exec -it china10.250.1.2 ping 10.250.8.2` to test the connection between these two networks.\n\nYou can replace the `cmd` in the group section of yaml to run your own command. \nThe `scripts` dir will be \"volumed\" to containers.\n`docker run --rm -it -v $DIR/scripts:/scripts` you can put your own binaries or scripts here and put your self defined `scripts/my.yaml`: \n\n```yaml\ngroup:\n  - \n    name: china\n    nodes:\n      - \n        ip: 10.250.1.2\n        cmd: \"cd /scripts \u0026\u0026 ./YourBin args\"\n      - \n        ip: 10.250.1.3\n        cmd: \"cd /scripts \u0026\u0026 ./YourBin args\"\n    delay: \"100ms 10ms 30%\"\n    loss: \"1% 10%\"\n  - \n    name: us\n    nodes:\n      - \n        ip: 10.250.2.2\n        cmd: \"cd /scripts \u0026\u0026 ./YourBin args\"\n      - \n        ip: 10.250.2.3\n        cmd: \"cd /scripts \u0026\u0026 ./YourBin args\"\n    delay: \"1000ms 10ms 30%\"\n    loss: \"1% 10%\"\n    \nnetwork:\n  -\n    groups:\n      - china\n      - us\n    delay: \"200ms 10ms 1%\"\n    corrupt: \"0.2%\"\n    rate: \"10mbit\"\n\n```\n\nand run \n```bash\n./generate.sh scripts/my.yaml\n```\n\n### 5. [optional] clean network\nRun `./scripts/clean.sh`\n\n## Modify Network Definition\nA sample network description is provided in `example.yaml`, which you can edit directly.\n\n### sample\n```yaml\n# Only support 10.250.0.2 ~ 10.250.254.254\ngroup:\n  -\n    name: china\n    nodes:\n      -\n        ip: 10.250.1.2/32\n        cmd: \"ping -c3 g.cn\"\n      -\n        ip: 10.250.2.2/32\n        cmd: \"ping -c3 g.cn\"\n      -\n        ip: 10.250.3.2/32\n        cmd: \"ping -c3 g.cn\"\n      -\n        ip: 10.250.4.2/32\n        cmd: \"ping -c3 g.cn\"\n    delay: \"100ms 10ms 30%\"\n    loss: \"1% 10%\"\n  -\n    name: eu\n    nodes:\n      -\n        ip: 10.250.5.2/32\n        cmd: \"ping -c3 g.cn\"\n      -\n        ip: 10.250.6.2/32\n        cmd: \"ping -c3 g.cn\"\n      -\n        ip: 10.250.7.2/32\n        cmd: \"ping -c3 g.cn\"\n    delay: \"10ms 5ms 30%\"\n    loss: \"1% 10%\"\n  -\n    name: jpn\n    nodes:\n      -\n        ip: 10.250.8.2/32\n        cmd: \"ping -c3 g.cn\"\n      -\n        ip: 10.250.9.2/32\n        cmd: \"ping -c3 g.cn\"\n    delay: \"100ms 10ms 30%\"\n    duplicate: \"1%\"\n    rate: \"100mbit\"\n\nnetwork:\n  -\n    groups:\n      - china\n      - eu\n    delay: \"200ms 10ms 1%\"\n    corrupt: \"0.2%\"\n    rate: \"10mbit\"\n\n  -\n    groups:\n      - china\n      - jpn\n    delay: \"100ms 10ms 1%\"\n    rate: \"10mbit\"\n\n  -\n    groups:\n      - jpn\n      - eu\n    delay: \"30ms 5ms 1%\"\n    rate: \"100mbit\"\n\n```\n\n## Description\nThe network definition contains two sections: group and network. Group defines ips and describes network info between them. Network describes network info between groups.\n\n### group\n- **name**: unique name of the group\n\n- **nodes**: list of node in the network. \n\n#### node\n- **ip**: Node IP must be between \"10.250.0.2 ~ 10.250.254.254\" and written in CIDR format, eg. `10.250.1.2/32`.\n\n- **cmd**: Node command to run. Blocking or Non-blocking are both ok.\n\n- **network params**:\nThe following 6 tc network limit parameters are supported:\n    ```\n    delay\n    loss\n    duplicate\n    corrupt\n    reorder\n    rate\n    ```\nThe values of these parameters are exactly like those of the `tc` command.\n\n* `delay: \"100ms 10ms 30%\"` means 100ms delay in network and 30% packets +-10ms.\n* `duplicate: \"1%\"` means 1% packets is duplicated.\n* `rate: \"100mbit\"` means network transmit rate is 100mbit.\n* `corrupt: \"0.2%\"` means 0.2% packets are randomly modified.\n\n### network\n- **groups**: list of group names\n\n- **network params**: same as group\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcovenantsql%2Fgnte","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcovenantsql%2Fgnte","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcovenantsql%2Fgnte/lists"}