Embed presentation

![My First BCC
2
SOURCE: SAKURA Internet Rsearch Center. (2017/06) Project Sprig.
# sudo su
# uname -sr; cat /etc/lsb-release
Linux 4.10.0-19-generic
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=17.04
DISTRIB_CODENAME=zesty
DISTRIB_DESCRIPTION="Ubuntu 17.04"
# echo "deb [trusted=yes] https://repo.iovisor.org/apt/trusty trusty-nightly main" | tee /etc/apt/sources.list.d/iovisor.list
# apt-get update
# apt-get install bcc-tools libbcc-examples
# cd /usr/share/bcc/examples/
# ./hello_world.py
sshd-1415 [000] d... 2360.661916: : Hello, World!
sshd-13842 [000] d... 2360.722776: : Hello, World!
sshd-13842 [000] d... 2361.241498: : Hello, World!
sh-13844 [000] d... 2361.242180: : Hello, World!
# cat hello_world.py | grep -v "#"
from bcc import BPF
BPF(text='int kprobe__sys_clone(void *ctx) { bpf_trace_printk("Hello, World!n"); return 0; }').trace_print()
Single CPU benchmark (with single flow)
Very fast CPU: i7-6700K CPU @ 4.00GHz
NIC 50Gbit/s Mellanox-CX4 (driver: mlx5)
Drop: 4.7Mpps : iptables -t raw -I PREROUTING -p udp --dport 9 -j DROP
Drop: 16.9Mpps: XDP blacklist:
XDP – eXpress Data Path , Used for DDoS protection, Linux Kernel self protection, Learn writing eBPF code
Jesper Dangaard Brouer / Principal Engineer, Red Hat, OpenSourceDays ()March, 2017)](https://image.slidesharecdn.com/src20170607v1-170607040229/85/My-First-BCC-2-320.jpg)

The document outlines the installation and usage of the BPF Compiler Collection (BCC) on Ubuntu 17.04, including commands for updating and installing related tools. It demonstrates a simple BPF program that prints 'hello, world!' using the BPF framework. The document also mentions performance metrics and the use of eBPF for DDoS protection.

![My First BCC
2
SOURCE: SAKURA Internet Rsearch Center. (2017/06) Project Sprig.
# sudo su
# uname -sr; cat /etc/lsb-release
Linux 4.10.0-19-generic
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=17.04
DISTRIB_CODENAME=zesty
DISTRIB_DESCRIPTION="Ubuntu 17.04"
# echo "deb [trusted=yes] https://repo.iovisor.org/apt/trusty trusty-nightly main" | tee /etc/apt/sources.list.d/iovisor.list
# apt-get update
# apt-get install bcc-tools libbcc-examples
# cd /usr/share/bcc/examples/
# ./hello_world.py
sshd-1415 [000] d... 2360.661916: : Hello, World!
sshd-13842 [000] d... 2360.722776: : Hello, World!
sshd-13842 [000] d... 2361.241498: : Hello, World!
sh-13844 [000] d... 2361.242180: : Hello, World!
# cat hello_world.py | grep -v "#"
from bcc import BPF
BPF(text='int kprobe__sys_clone(void *ctx) { bpf_trace_printk("Hello, World!n"); return 0; }').trace_print()
Single CPU benchmark (with single flow)
Very fast CPU: i7-6700K CPU @ 4.00GHz
NIC 50Gbit/s Mellanox-CX4 (driver: mlx5)
Drop: 4.7Mpps : iptables -t raw -I PREROUTING -p udp --dport 9 -j DROP
Drop: 16.9Mpps: XDP blacklist:
XDP – eXpress Data Path , Used for DDoS protection, Linux Kernel self protection, Learn writing eBPF code
Jesper Dangaard Brouer / Principal Engineer, Red Hat, OpenSourceDays ()March, 2017)](https://image.slidesharecdn.com/src20170607v1-170607040229/85/My-First-BCC-2-320.jpg)