{"id":16191901,"url":"https://github.com/streamr-dev/lnem","last_synced_at":"2026-04-26T12:31:43.210Z","repository":{"id":46649127,"uuid":"352904394","full_name":"streamr-dev/lnem","owner":"streamr-dev","description":"Lighweight Network EMulator","archived":false,"fork":false,"pushed_at":"2021-10-12T09:55:30.000Z","size":15,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-20T15:03:03.213Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/streamr-dev.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}},"created_at":"2021-03-30T07:09:13.000Z","updated_at":"2024-12-26T08:50:24.000Z","dependencies_parsed_at":"2022-09-22T14:25:29.853Z","dependency_job_id":null,"html_url":"https://github.com/streamr-dev/lnem","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/streamr-dev/lnem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamr-dev%2Flnem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamr-dev%2Flnem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamr-dev%2Flnem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamr-dev%2Flnem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/streamr-dev","download_url":"https://codeload.github.com/streamr-dev/lnem/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamr-dev%2Flnem/sbom","scorecard":{"id":855058,"data":{"date":"2025-08-11","repo":{"name":"github.com/streamr-dev/lnem","commit":"409aa558a61556e79f75e9390b19ac1b81bdc689"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":3,"reason":"Found 6/18 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T23:41:09.962Z","repository_id":46649127,"created_at":"2025-08-23T23:41:09.962Z","updated_at":"2025-08-23T23:41:09.962Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32297893,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T09:34:17.070Z","status":"ssl_error","status_checked_at":"2026-04-26T09:34:00.993Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T08:07:39.433Z","updated_at":"2026-04-26T12:31:43.194Z","avatar_url":"https://github.com/streamr-dev.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lightweight Network EMulator\n\nLightweight Network EMulator simplifies integration testing of network applications on Linux. It is implemented as a collection of easy-to-use \nBash scripts on top of Linux network namespaces and Netem.\n\n## How it works \nLightweight Network EMulator creates a number of Linux network namespaces and places them in a star topology around the host machine. \nThe network namespaces are named blue1, blue2, ... , blueN. Each network namespace is connected to the host with the help of a pair of virtual ethernet devices. For network namespace blueN, the virtual ethernet devices are named vethrealN and vethvirtualN, respectively. The device vethvirtualN is only visible\nfrom the namespace blueN, and the device vethrealN is visible from the host. The connection between the vethrealN and vethvirtualN devices is traffic-shaped using Netem and the tc command to introduce emulated latency, and limits for the uplink and downlink bandwidth. The emulated network uses the 10.240.0.0/12 network range. In case of emulated  networks with less than 255 namespaces, the IP adderess of the device vethrealN is 10.240.N.1 and the IP address of device vethvirtualN 10.240.N.2, respectively. All routing towards the other network namespaces and the Internet goes through the host machine.\n\n\n\n\n\n\n```\n                                          Internet \n                                             |                                       \n  ___________________                        |                         ___________________\n |                   |                       |                        |                   |\n |  vethvirtual1     |----- vethreal1 ----- host ----- vethreal2 -----|  vethvirtual2     |  \n |  10.240.1.2       |      10.240.1.1       |         10.240.2.1     |  10.240.2.2       |\n |  namespace blue1  |                       |                        |  namespace blue2  |\n |___________________|                       |                        |___________________|   \n                                         vethrealN\n                                         10.240.N.1  \n                                             |\n                                             |  \n                                             |\n                                     ___________________ \n                                    |                   |\n                                    |  vethvirtualN     |\n                                    |  10.240.N.2       |\n                                    |  namespace blueN  | \n                                    |___________________|   \n\n\n```\n\n## Prerequisites\n\n* A Linux host with a 5.x+ kernel and root privilleges  (use a dedicated virtual machine to stay safe)\n* The following Debian packages (or equivivalent):\n\n```\nsudo apt-get install iproute2\nsudo apt-get install net-tools\n```\n\n* Ensure that ipv4 forwarding is enabled (if pings will not go through this is most likely disabled)\n\n```\nsudo sysctl -w net.ipv4.ip_forward=1\nsudo sysctl -p /etc/sysctl.conf\n```\n\n[more info on how to make the ip forwarding change permanent](https://askubuntu.com/questions/311053/how-to-make-ip-forwarding-permanent)\n\n* You need a working nodejs and npm setup if you intend to install the scripts globally using npm. Alternatively you can directly execute the scripts from the bin folder \n\n## Installing using npm\n\n```\nsudo npm install -g @streamr/lnem\n```\n\n## Uninstalling using npm\n\n```\nsudo npm uninstall -g @streamr/lnem\n```\n\n## Connecting the emulated network to Internet through NAT\n\nIf you wish your emulated network to be able to connect to the Internet, you\ncan set uo NAT using the script: \n\n```\nsudo lnem-create-nat\n```\n\n## Disconnecting the emulated network from Internet\n\nThe NAT can be deleted using the script:\n\n```\nsudo lnem-delete-nat\n```\n\n## Usage examples\n\n## Measuring emulated network using ping and netperf\n\nInstall netperf \n\n```\nsudo apt-get install netperf\n```\n\nCreate a network namespace for the netperf server with download bandwidth limit of 1000 kbit/s, upload bandwidth limit of 2000 kbit/s, and\none-way latency of 10 ms between the namespace and the host machine.\n\n```\nsudo lnem-up --download 1000 --upload 2000 --latency 10 --num 1\n```\n\nCreate a network namespace for the netperf client with no limits. Notice that we give the offset parameter\nto start creating the network namespaces starting from namespace blue2, since namespace blue1 is already in use by the server.\n\n```\nsudo lnem-up --num 1 --offset 2\n```\n\nMeasure the RTT between the blue1 and blue2 network namespaces using ping\n\n```\nsudo ip netns exec blue2 ping 10.240.1.2\n```\n\nStart the netperf server in the blue1 namespace\n\n```\nsudo ip netns exec blue1 netserver -4 \u0026\n```\n\n\nRun the netperf client in the blue2 namespace, and instruct it to connect to the server running in namespace blue2. The result should\nbe close to 1 Mibit/s (the download bandwidth limit we set to the server's namespace)\n\n```\nsudo ip netns exec blue2 netperf -4 -H 10.240.1.2 \n```\n\nTo clean up, kill netperf server, and delete the two namespaces.\n\n```\nsudo pkill netserver\nsudo lnem-down -n 2\n```\n\n\n## License\n\nThis project is licensed under the MIT License.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstreamr-dev%2Flnem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstreamr-dev%2Flnem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstreamr-dev%2Flnem/lists"}