Skip to content

Instantly share code, notes, and snippets.

@yjuba
Created May 7, 2017 07:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yjuba/c5ebaf4686395ac68e0346dc78f2cd8e to your computer and use it in GitHub Desktop.
Save yjuba/c5ebaf4686395ac68e0346dc78f2cd8e to your computer and use it in GitHub Desktop.

XDPで80/TCPのパケットをフィルタした時の結果

一旦これで、パケットのドロップとカウンタの出力が出来ることを確認した。
現状、仮想環境上で稼働させているので、性能は後日物理環境上で計測する。

送信元

yjuba@yjuba-xdp-work002:~$ sudo hping3 --flood -S -p 80 192.0.2.1
HPING 192.0.2.1 (ens3 192.0.2.1): S set, 40 headers + 0 data bytes
hping in flood mode, no replies will be shown
^C
--- 192.0.2.1 hping statistic ---
76172 packets transmitted, 0 packets received, 100% packet loss
round-trip min/avg/max = 0.0/0.0/0.0 ms

送信先

yjuba@yjuba-xdp-work001:~/b4d0cf3396941bbb4338f9bd04e098ef$ git remote -v
origin  https://gist.github.com/b4d0cf3396941bbb4338f9bd04e098ef.git (fetch)
origin  https://gist.github.com/b4d0cf3396941bbb4338f9bd04e098ef.git (push)
yjuba@yjuba-xdp-work001:~/b4d0cf3396941bbb4338f9bd04e098ef$ ls -lah
total 32K
drwxrwxr-x 3 yjuba yjuba 4.0K May  7 16:25 .
drwxrwxr-x 3 yjuba yjuba 4.0K May  7 14:23 ..
-rw-rw-r-- 1 yjuba yjuba 2.4K May  7 15:28 drop_80.c
-rw-rw-r-- 1 yjuba yjuba 1.1K May  7 15:49 drop_80.py
-rw-rw-r-- 1 yjuba yjuba  713 May  7 15:50 fetch_counter.py
drwxrwxr-x 8 yjuba yjuba 4.0K May  7 16:18 .git
-rw-rw-r-- 1 yjuba yjuba  657 May  7 16:15 Makefile
yjuba@yjuba-xdp-work001:~/b4d0cf3396941bbb4338f9bd04e098ef$ make exec-drop80
XDP loaded.
Port:80 Count:31095
Port:80 Count:62234
Port:80 Count:74786
yjuba@yjuba-xdp-work001:~/b4d0cf3396941bbb4338f9bd04e098ef$ make fetch-counter
Port:80 Count:74786
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment