Skip to content

Commit

Permalink
add bpftool ans some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mindw committed Jan 26, 2024
1 parent 332c7db commit 2e01dad
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ RUN set -ex; \
btop \
bash \
bash-completion \
bpftool \
bcc-tools \
bind-tools \
bird \
Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ some with some sample use-cases.
- btop: Resource monitor
- bcc: A toolkit for creating efficient kernel tracing and manipulation programs
- bcc-tools: Command line tools for BPF Compiler Collection (BCC)
- bpftool - Linux kernel bpf manipulation tool.
- bpftrace: High-level tracing language for Linux eBPF
- bpftrace-tools: High-level tracing language for Linux eBPF (tools)
- ctop: Top-like interface for container metrics
Expand Down Expand Up @@ -418,6 +419,25 @@ Connection to service-a 8080 port [tcp/http-alt] succeeded!
```

## hping

Purpose: Packet generator capable of doing quite a lot.
In terms of troubleshooting, handy to test network latency where ICMP does not work.

Example : Test network latency from the container to a remote host on a specific port
```
🐳 → docker run -it --net container:perf-test-a.1.bil2mo8inj3r9nyrss1g15qav nicolaka/netshoot hping -S -c 5 google.com -p 80
HPING google.com (eth0 74.125.201.139): S set, 40 headers + 0 data bytes
len=44 ip=74.125.201.139 ttl=62 id=40057 sport=80 flags=SA seq=0 win=65504 rtt=42.8 ms
len=44 ip=74.125.201.139 ttl=62 id=40058 sport=80 flags=SA seq=1 win=65504 rtt=44.6 ms
len=44 ip=74.125.201.139 ttl=62 id=40059 sport=80 flags=SA seq=2 win=65504 rtt=43.1 ms
len=44 ip=74.125.201.139 ttl=62 id=40060 sport=80 flags=SA seq=3 win=65504 rtt=37.2 ms
len=44 ip=74.125.201.139 ttl=62 id=40061 sport=80 flags=SA seq=4 win=65504 rtt=34.6 ms
--- google.com hping statistic ---
5 packets tramitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 34.6/40.5/44.6 ms
```

## netgen
Purpose: `netgen` is a simple [script](netgen.sh) that will generate a packet of data
between containers periodically using `netcat`. The generated traffic can be used to
Expand Down

0 comments on commit 2e01dad

Please sign in to comment.