{"id":15056924,"url":"https://github.com/hyouteki/cwndebpf","last_synced_at":"2025-04-10T04:55:43.004Z","repository":{"id":252348865,"uuid":"839732047","full_name":"hyouteki/cwndebpf","owner":"hyouteki","description":"eBPF programs to monitor and update kernel congestion window","archived":false,"fork":false,"pushed_at":"2024-11-20T20:17:07.000Z","size":33,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T06:11:27.646Z","etag":null,"topics":["bpf","bpftool","c","ebpf","libbpf","python"],"latest_commit_sha":null,"homepage":"","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/hyouteki.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":"2024-08-08T08:07:24.000Z","updated_at":"2025-03-14T04:56:25.000Z","dependencies_parsed_at":"2024-08-14T20:05:29.693Z","dependency_job_id":null,"html_url":"https://github.com/hyouteki/cwndebpf","commit_stats":null,"previous_names":["hyouteki/cwndebpf"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyouteki%2Fcwndebpf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyouteki%2Fcwndebpf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyouteki%2Fcwndebpf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyouteki%2Fcwndebpf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyouteki","download_url":"https://codeload.github.com/hyouteki/cwndebpf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248161256,"owners_count":21057554,"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":["bpf","bpftool","c","ebpf","libbpf","python"],"created_at":"2024-09-24T21:58:33.298Z","updated_at":"2025-04-10T04:55:42.955Z","avatar_url":"https://github.com/hyouteki.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kernel\\_cwnd\n\nAn eBPF program that modifies the kernel's congestion window (cwnd) based on a user-space-provided value stored in an eBPF map. The modification occurs only if a fallback flag, stored in another eBPF map, is set to true. The user-space program updates these maps using the `bpftool map update` command.\n\n## Getting Started\n- `make`: Build `vmlinux.h` and the program.\n- `make load_kernel_cwnd`: Attach the hooks and load the program.\n- `make map.update MAP=CwndMap VAL=00`: Update the `CwndMap` for testing the loaded eBPF program.\n- `make map.dump MAP=CwndMap`: Dump the contents of `CwndMap` to stdout.\n- `make unload_kernel_cwnd`: Detach the hooks and unload the program.\n\n# log\\_tcp\\_cwnd\n\nAn eBPF program that logs the kernel's congestion window (cwnd) value to the trace pipe whenever a TCP connection is used for an HTTPS request.\n\n## Getting Started\n- `make`: Build `vmlinux.h` and the program.\n- `make load_log_tcp_cwnd`: Attach to the tracepoint and load the program.\n- `make trace_log_tcp_cwnd`: Flush the trace pipe and store new logs in `log_tcp_cwnd.log`.\n- `make log_tcp_cwnd.csv`: Process `log_tcp_cwnd.log` and create a CSV file.\n- `make unload_log_tcp_cwnd`: Detach the hooks and unload the program.\n- `make read_cwnd_map`: Demo to read the value of CwndMap in user-space program.\n\n# always\\_update\\_cwnd\n\nAn eBPF program that modifies the kernel's congestion window (cwnd) based on a user-space-provided value stored in an eBPF map. Unlike `kernel_cwnd.bpf.c`, the update occurs every time. The user-space program updates these maps using the `bpftool map update` command.\n\n## Getting Started\n- `make`: Build `vmlinux.h` and the program.\n- `make load_always_update_cwnd`: Attach the hooks and load the program.\n- `make map.update MAP=CwndMap VAL=00`: Update the `CwndMap` for testing the loaded eBPF program.\n- `make map.dump MAP=CwndMap`: Dump the contents of `CwndMap` to stdout.\n- `make unload_always_update_cwnd`: Detach the hooks and unload the program.\n\n\u003e **Important**\n\u003e Unloading the program is crucial; otherwise, the program and map will persist until the system restarts.\n\n# Installation\n```bash\ngit clone https://github.com/hyouteki/cwndebpf --depth=1\ncd cwndebpf\nmake setup\ngit clone --recurse-submodules https://github.com/libbpf/bpftool\ncd bpftool/src\nmake\n```\n\n## Dependency\n- [libbpf-dev](https://packages.ubuntu.com/search?keywords=libbpf-dev)\n- [bpftool](https://github.com/libbpf/bpftool)\n- [Clang](https://clang.llvm.org/) and [LLVM](https://llvm.org/)\n\n## References\n- [Learning eBPF - lizrice](https://github.com/lizrice/learning-ebpf)\n- [BPF helpers - man](https://man7.org/linux/man-pages/man7/bpf-helpers.7.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyouteki%2Fcwndebpf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyouteki%2Fcwndebpf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyouteki%2Fcwndebpf/lists"}