Upgrade to Pro — share decks privately, control downloads, hide ads and more …

eBPF Japan Meetup のご紹介

eBPF Japan Meetup のご紹介

Kenta Tada

August 21, 2024
Tweet

More Decks by Kenta Tada

Other Decks in Programming

Transcript

  1. ハッシュタグ: #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
  2. ハッシュタグ: #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加盟
  3. ハッシュタグ: #CNCJ OSPO(オープンソースプログラムオフィス)の設置 -トヨタのエンジニアのオープンソースの利用と貢献をより加速するため24年1月にOSPOを設置 -ツールやプロセス整備などでエンジニアを支援する他、OSPOメンバーもコミュニティ活動を推進 Open Source Program トヨタ 従業員

    OSPO ポリシー コミュニティ プロセス 戦略 教育 サポート 貢献 (コントリビューション) ソースコード ドキュメント イベントスポンサード コミュニティ投資 法務・知財部門 セキュリティ部門 技術開発部門 経営層 協力 ライセンス セキュリティ レピュテーション オープンソースカルチャーの醸成 リスクマネジメント 品質 連携 利用
  4. ハッシュタグ: #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
  5. ハッシュタグ: #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!!
  6. ハッシュタグ: #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
  7. ハッシュタグ: #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!
  8. ハッシュタグ: #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/
  9. ハッシュタグ: #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
  10. ハッシュタグ: #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.
  11. ハッシュタグ: #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.
  12. ハッシュタグ: #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
  13. ハッシュタグ: #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
  14. ハッシュタグ: #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