mirror of
https://github.com/Kioubit/ColorPing
synced 2026-01-24 12:07:32 +08:00
No description
| .github/workflows | ||
| tcbpf | ||
| .gitignore | ||
| colorping.service | ||
| go.mod | ||
| go.sum | ||
| http.go | ||
| main.go | ||
| Makefile | ||
| processing.go | ||
| README.md | ||
| screenshot.png | ||
| statistics.go | ||
| template.html | ||
| util.go | ||
ColorPing
How does it work?
Each IPv6 address in a /64 IPv6 subnet is associated to one pixel with color (RGB) information.
When an address is pinged, the corresponding pixel is changed on the canvas and displayed
to all viewers via a webpage.
Speed / Max packet rate
The program uses an eBPF program running in the Linux kernel eBPF sandbox. Since userspace is not involved, except for periodically polling the pixel array from the kernel, speed is not limited by this program.
Setup
Create a dummy interface and assign a /64 IPv6 subnet to it.
The program needs to be run as root or with the CAP_NET_ADMIN, CAP_BPF, (CAP_SYS_RESOURCE) capabilities.
Access the webpage where the canvas is displayed at: http://localhost:9090/
Example setup
# ip link add canvas type dummy
# ip addr add fdcf:8538:9ad5:3333::1/64 dev canvas
# ip link set up canvas
# ./ColorPing -i canvas
Ping format
ping ????:????:????:????:XXXX:YYYY:11RR:GGBB
Where:
????can be anythingXXXXmust be the target X coordinate of the canvas, encoded as hexadecimalYYYYmust be the target Y coordinate of the canvas, encoded as hexadecimalRRtarget "red" value (0–255), encoded as hexadecimalGGtarget "green" value (0–255), encoded as hexadecimalBBtarget "blue" value (0–255), encoded as hexadecimal