This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| network_stuff:tcpdump [2020/11/28 22:40] – jotasandoku | network_stuff:tcpdump [2023/11/02 14:38] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | **__TCPDUMP__** \\ | + | **__TCPDUMP NOTES__** \\ |
| + | [[https:// | ||
| To write the tcpdump output in pcap format. If we Add capital W, that means rotate: | To write the tcpdump output in pcap format. If we Add capital W, that means rotate: | ||
| tcpdump -ni eth0 -s0 -w / | tcpdump -ni eth0 -s0 -w / | ||
| tcpdump -ni eth0 -w / | tcpdump -ni eth0 -w / | ||
| tcpdump -nni bond1 -w / | tcpdump -nni bond1 -w / | ||
| + | tcpdump -e -r sflow_2022_new.pcap | ||
| After capture, transfer example: | After capture, transfer example: | ||
| - | gk# scp root@slingshot2.nj.grapeshot.co.uk:/ | + | gk# scp root@slingshot2.nj.mycompany1.co.uk:/ |
| - | hm# scp root@gatekeeper.grapeshot.co.uk:/ | + | hm# scp root@gatekeeper.mycompany1.co.uk:/ |
| remote# rm / | remote# rm / | ||
| gk# rm / | gk# rm / | ||
| Line 24: | Line 25: | ||
| tcpdump -nni any portrange 60000-60100 | tcpdump -nni any portrange 60000-60100 | ||
| tcpdump -vv -e -nni any ether proto 0x8809 | tcpdump -vv -e -nni any ether proto 0x8809 | ||
| + | tcpdump -n -i eth0 -A -x dst port 443 and greater 100 # packet lenght | ||
| Line 33: | Line 35: | ||
| -S : To print absolute rather than relative TCP sequence numbers.\\ | -S : To print absolute rather than relative TCP sequence numbers.\\ | ||
| tcpdump -nnvvi bond0 'not (src net (10 or 172.16/12 or 192.168/16) and dst net (10 or 172.16/12 or 192.168/ | tcpdump -nnvvi bond0 'not (src net (10 or 172.16/12 or 192.168/16) and dst net (10 or 172.16/12 or 192.168/ | ||
| + | tcpdump -nni any 'not ((dst net (10 or 172.16/12 or 192.168/16 or 169.254/ | ||
| A very simple check before tcpdump is the one below, showing which interface is passing the traffic: | A very simple check before tcpdump is the one below, showing which interface is passing the traffic: | ||
| Line 92: | Line 95: | ||
| ---- | ---- | ||
| - | + | **LIBCAP RELATED UTILITIES** | |
| - | __NOTES ON TCP__ | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| \\ | \\ | ||
| - | The ACK number for a packet is the packet' | + | tcprewrite |
| - | + | | |
| - | \\ | + | |
| - | * The __**congestion window**__ is a **sender imposed** window that was implemented to avoid overrunning some routers in the middle of the network path. The **sender, with each segment sent, increases the congestion window slightly**, | + | [[https://gist.github.com/niranjan-nagaraju/4532037]] |
| - | * You can't ' | + | |
| - | | + | |
| - | \\ | + | |
| - | + | ||
| - | ---- | + | |
| - | + | ||
| - | + | ||
| - | TCP CONGESTION CONTROL ALGORITHMS (Reno, Cubic, Tahoe, more recently, BBR + Vegas, , Westwood) | + | |
| - | [[https://medium.com/@atoonk/tcp-bbr-exploring-tcp-congestion-control-84c9c11dc3a9]] | + | |
| - | + | ||
| - | * sysctl net.ipv4.tcp_congestion_control | + | |
| - | * sysctl net.ipv4.tcp_available_congestion_control | + | |
| - | * sysctl -w net.ipv4.tcp_congestion_control=bbr | + | |
| - | + | ||
| - | To test performance: | + | |
| - | tc qdisc replace dev enp0s20f0 root netem loss 1.5% latency 70ms # introduces some latency and packet loss | + | |