Slide 1

Slide 1 text

ハッシュタグ: #CNCJ eBPF Japan Meetup のご紹介 2024/8/19 Kenta Tada, CNCJ Organizer Toyota Motor Corporation

Slide 2

Slide 2 text

ハッシュタグ: #CNCJ 2 @kenta_tada Toyota Motor Corporation ● Project Manager ○ Develop both server-side and automotive systems ○ Accelerate eBPF adoption across the company ● Open Source Program Office in Toyota Recent Activities ● The reviewer of the Japanese translation of the book "Learning eBPF" published by O'Reilly Japan ● Cloud Native Community Japan Organizer Kenta Tada

Slide 3

Slide 3 text

ハッシュタグ: #CNCJ トヨタ OSPO 活動紹介 3

Slide 4

Slide 4 text

ハッシュタグ: #CNCJ これまでのトヨタのオープンソースへの取組 - ライセンス等のリスク削減のため時限組織設置、対応プロセスの世界標準化推進 - Linux Foundationに加入し、Automotive Grade Linux(AGL)開発等を推進 2011 Linux Foundation参加 2012 Automotive Grade Linux(AGL)設立 2016 Open Invention Network (OIN)出資 2017 OpenChain Project参加 2020 ISO/IEC5230取得 2018 時限組織設置 (~2020) 2021 HSR(ロボット)のソース公開 マルチメディア向OSとして採用済 貢献 貢献 利用 利用 対応プロセスの世界標準取得を世界ではじめて公表 IVI向OSの標準化に創立メンバーとして貢献 2020 CNCF加盟

Slide 5

Slide 5 text

ハッシュタグ: #CNCJ OSPO(オープンソースプログラムオフィス)の設置 -トヨタのエンジニアのオープンソースの利用と貢献をより加速するため24年1月にOSPOを設置 -ツールやプロセス整備などでエンジニアを支援する他、OSPOメンバーもコミュニティ活動を推進 Open Source Program トヨタ 従業員 OSPO ポリシー コミュニティ プロセス 戦略 教育 サポート 貢献 (コントリビューション) ソースコード ドキュメント イベントスポンサード コミュニティ投資 法務・知財部門 セキュリティ部門 技術開発部門 経営層 協力 ライセンス セキュリティ レピュテーション オープンソースカルチャーの醸成 リスクマネジメント 品質 連携 利用

Slide 6

Slide 6 text

ハッシュタグ: #CNCJ LFエバンジェリストプログラムへの参画 -OSPOリーダがLFの初代ジャパンエバンジェリストに就任(本日プレスリリース) -自社だけでなく日本におけるコミュニティ活動の活性化にも貢献していく

Slide 7

Slide 7 text

ハッシュタグ: #CNCJ Introduction 7

Slide 8

Slide 8 text

ハッシュタグ: #CNCJ About this community 8 ● Share operational knowledge of eBPF to accelerate its introduction into production systems ● Disseminate patterns and best practices for developing eBPF programs ● Increase contributions to eBPF-related open-source software from Japan

Slide 9

Slide 9 text

ハッシュタグ: #CNCJ Activities 9 ● Cloud Native Community Japan - eBPF Japan Meetup(Today's topic) ● ebpfjp : https://github.com/ebpfjp ○ Workshop ■ Try out uprobe and usdt, which are implemented in familiar middleware. ○ Investigating hook points for kprobe and uprobe in various OSS ■ I'll explain this activity in KubeDay 2024!!

Slide 10

Slide 10 text

ハッシュタグ: #CNCJ Call for papers 10 ● eBPF-related features in the Linux Kernel ● Examples of eBPF usage in Open Source Software(Today's example session) ● Insights gained from practical eBPF operations

Slide 11

Slide 11 text

ハッシュタグ: #CNCJ Example Session : LoxiLB - eBPF Sync programs using kprobes 11

Slide 12

Slide 12 text

ハッシュタグ: #CNCJ Cloud Native Application with eBPF 12 ● Beyond Cilium, more CNCF projects are leveraging eBPF. ○ Examples: bpfman, Kepler, LoxiLB ● However, the ways in which eBPF is utilized often remain implicit knowledge. ● Let's dive into eBPF usage in LoxiLB!

Slide 13

Slide 13 text

ハッシュタグ: #CNCJ LoxiLB : eBPF based hyper-scale load-balancer 13 ● An open source hyper-scale software load-balancer for cloud-native workloads ● loxilb is being developed to support the adoption of cloud-native tech in telco, mobility, and edge computing. ref: https://www.loxilb.io/

Slide 14

Slide 14 text

ハッシュタグ: #CNCJ LoxiLB with eBPF : Overview 14 ● TC ○ TC is used for L4+ processing operations. ● XDP ○ XDP is difficult to handle tcp checksum offload and other such features used by linux networking stack. ○ XDP is perfect for quick operations at l2 layer. ● There are many other eBPF features in use, but today I will introduce two of them. ○ 1. Proxy server ○ 2. Sync states across the cluster

Slide 15

Slide 15 text

ハッシュタグ: #CNCJ 1. Proxy Server 15 Socket User Kernel Process A sockmap Socket TCP/IP Routing TCP/IP Routing Process B netns 1 netns 2 ● eBPF sockmap feature is used for tcp splicing and proxying.

Slide 16

Slide 16 text

ハッシュタグ: #CNCJ Bypass the network stack in the same cgroup 16 Socket User Kernel Process A sockmap Socket TCP/IP Routing TCP/IP Routing Process B netns 1 netns 2 SEC("sk_msg") - This program is called when sendmsg or sendfile syscalls are executed on the socket. - Redirect the message directly to the receiving socket. /opt/loxilb/cgroup/xxxx SEC("sockops") - This program is called when there's a socket operation on this cgroup. - Update sockmaps for redirection in the program of sk_msg.

Slide 17

Slide 17 text

ハッシュタグ: #CNCJ ● To achieve high availability and observability, LoxiLB synchronizes eBPF maps to others in the cluster. 2. Sync states across the cluster 17 eBPF Sync User Program Perf Ring Buffer eBPF Program attached to kprobe eBPF Maps eBPF Sync User Program Perf Ring Buffer eBPF Program attached to kprobe eBPF Maps gRPC or others User User Kernel Kernel

Slide 18

Slide 18 text

ハッシュタグ: #CNCJ eBPF Sync programs using kprobes 18 ● How to get the information about eBPF maps ○ For the current use-case in LoxiLB, we just need to hook entry-points of BPF_MAP_TYPE_HASH. ○ Hook into below kernel functions and bpf syscalls ■ htab_map_update_elem() ■ htab_map_delete_elem() ■ htab_map_lookup_and_delete_elem() ■ bpf_map_update_value() ■ array_map_update_elem() ● This method is inspired by the following proof-of-concept example, which uses eBPF to monitor changes to eBPF maps from user and kernel programs. ○ https://github.com/CrowdStrike/bpfmon-example

Slide 19

Slide 19 text

ハッシュタグ: #CNCJ Key takeaways 19 ● Unlocking the potential of eBPF demands collaboration between application developers and kernel experts. ● Let's discuss our activities in "Meet the speaker!" ○ Call for papers ○ Sponsors Needed ■ Venue Sponsorships and so on ○ Joint event with eBPF Japan Meetup

Slide 20

Slide 20 text

ハッシュタグ: #CNCJ Thank you 20