Yutaro Hayakawa
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    --- lang: ja breaks: false --- <style> .ui-infobar, #doc.markdown-body { max-width: 1100px; } </style> # 2021-02-10 kernel network stack reading - Wireguard - - 参加者: hayakawa, kawakami, saito - kernel: `5.6.6` - ドライバー: hayakawa - 今回のテーマ - Wireguardをざっくり見る ## 使用マシン - 早川のローカルマシンのVagrant - fedora/32-cloud-base ``` ip link add wg0 type wireguard ip addr add 192.168.0.1/24 man wg参照 ``` ``` ===Handshake TX 4985624133291 000 selinux_ipv4_output 4985624142556 000 ip_output 4985624146133 000 nf_hook_slow 4985624150341 000 selinux_ipv4_postroute 4985624154205 000 selinux_ip_postroute 4985624157426 000 ip_finish_output 4985624161130 000 __ip_finish_output 4985624164221 000 ip_finish_output2 4985624168615 000 neigh_resolve_output 4985624172064 000 __neigh_event_send 4985624176679 000 eth_header 4985624179588 000 skb_push 4985624183636 000 dev_queue_xmit 4985624186952 000 __dev_queue_xmit 4985624190527 000 netdev_core_pick_tx 4985624194371 000 validate_xmit_skb 4985624198345 000 netif_skb_features 4985624201689 000 passthru_features_check 4985624205135 000 skb_network_protocol 4985624209940 000 skb_csum_hwoffload_help 4985624213073 000 validate_xmit_xfrm 4985624216079 000 dev_hard_start_xmit 4985624220469 000 skb_clone_tx_timestamp 4985624224575 000 __dev_forward_skb 4985624227651 000 skb_scrub_packet ===Handshake RX 4985624244082 000 ip_rcv_finish 4985624248671 000 udp_v4_early_demux 4985624252170 000 ip_route_input_noref 4985624255377 000 ip_route_input_slow 4985624260790 000 fib_validate_source 4985624264720 000 __fib_validate_source 4985624269532 000 ip_local_deliver 4985624274017 000 ip_local_deliver_finish 4985624277121 000 ip_protocol_deliver_rcu 4985624280735 000 raw_local_deliver 4985624285044 000 udp_rcv 4985624289334 000 __udp4_lib_rcv 4985624294605 000 udp_unicast_rcv_skb 4985624298580 000 udp_queue_rcv_one_skb 4985624302069 000 wg_receive 4985624305798 000 wg_packet_receive 4985624309970 000 skb_pull 4985624313782 000 skb_queue_tail 4985624904181 000 wg_receive_handshake_packet 4985624911724 000 wg_cookie_validate_packet 4985625756857 000 consume_skb 4985625760528 000 skb_release_head_state 4985625763498 000 skb_release_data 4985625766836 000 kfree_skbmem === 4985623716785 000 selinux_ipv4_output 4985623737120 000 ip_output 4985623740486 000 nf_hook_slow 4985623745622 000 selinux_ipv4_postroute 4985623750072 000 selinux_ip_postroute 4985623753325 000 ip_finish_output 4985623757295 000 __cgroup_bpf_run_filter_skb 4985623761442 000 __ip_finish_output 4985623765143 000 ip_finish_output2 4985623769954 000 neigh_direct_output 4985623774536 000 dev_queue_xmit 4985623778172 000 __dev_queue_xmit 4985623781929 000 netdev_core_pick_tx 4985623788734 000 validate_xmit_skb 4985623793592 000 netif_skb_features 4985623797917 000 skb_network_protocol 4985623801527 000 validate_xmit_xfrm 4985623805470 000 dev_hard_start_xmit 4985623809396 000 wg_xmit 4985623813734 000 wg_allowedips_lookup_dst 4985623821044 000 sock_wfree 4985626202620 000 encrypt_packet 4985626210356 000 skb_cow_data 4985626213830 000 skb_push 4985626216976 000 pskb_put 4985626220632 000 skb_to_sgvec 4985626223886 000 __skb_to_sgvec 4985626228464 000 skb_scrub_packet === 4985626390817 000 selinux_ipv4_output 4985626396451 000 ip_output 4985626399618 000 nf_hook_slow 4985626402811 000 selinux_ipv4_postroute 4985626405845 000 selinux_ip_postroute 4985626408772 000 ip_finish_output 4985626411729 000 __ip_finish_output 4985626414630 000 ip_finish_output2 4985626418027 000 neigh_resolve_output 4985626421068 000 eth_header 4985626423949 000 skb_push 4985626427002 000 dev_queue_xmit 4985626429901 000 __dev_queue_xmit 4985626432987 000 netdev_core_pick_tx 4985626436661 000 validate_xmit_skb 4985626439713 000 netif_skb_features 4985626443018 000 passthru_features_check 4985626445905 000 skb_network_protocol 4985626449091 000 skb_csum_hwoffload_help 4985626451916 000 validate_xmit_xfrm 4985626454768 000 dev_hard_start_xmit 4985626458151 000 skb_clone_tx_timestamp 4985626461680 000 __dev_forward_skb 4985626464566 000 skb_scrub_packet === 4985626473220 000 ip_rcv_finish 4985626477417 000 udp_v4_early_demux 4985626480675 000 ip_route_input_noref 4985626483917 000 ip_route_input_slow 4985626487964 000 fib_validate_source 4985626491229 000 __fib_validate_source 4985626494822 000 ip_local_deliver 4985626497992 000 ip_local_deliver_finish 4985626500820 000 ip_protocol_deliver_rcu 4985626503766 000 raw_local_deliver 4985626507677 000 udp_rcv 4985626511472 000 __udp4_lib_rcv 4985626515468 000 udp_unicast_rcv_skb 4985626519131 000 udp_queue_rcv_one_skb 4985626522575 000 wg_receive 4985626526079 000 wg_packet_receive 4985626529831 000 skb_pull 4985626755100 000 decrypt_packet 4985626760491 000 skb_push 4985626763940 000 skb_cow_data 4985626767005 000 skb_pull 4985626770054 000 skb_to_sgvec 4985626772910 000 __skb_to_sgvec 4985626776883 000 skb_push 4985626779790 000 skb_pull 4985626783354 000 skb_scrub_packet === 4985625640284 000 selinux_ipv4_output 4985625650647 000 ip_output 4985625654542 000 nf_hook_slow 4985625658476 000 selinux_ipv4_postroute 4985625661792 000 selinux_ip_postroute 4985625664854 000 ip_finish_output 4985625668719 000 __ip_finish_output 4985625671820 000 ip_finish_output2 4985625675481 000 neigh_resolve_output 4985625678649 000 __neigh_event_send 4985625682663 000 eth_header 4985625685614 000 skb_push 4985625689191 000 dev_queue_xmit 4985625692111 000 __dev_queue_xmit 4985625695282 000 netdev_core_pick_tx 4985625699073 000 validate_xmit_skb 4985625702415 000 netif_skb_features 4985625705577 000 passthru_features_check 4985625708658 000 skb_network_protocol 4985625712344 000 skb_csum_hwoffload_help 4985625715647 000 validate_xmit_xfrm 4985625718525 000 dev_hard_start_xmit 4985625722045 000 skb_clone_tx_timestamp 4985625725699 000 __dev_forward_skb 4985625728898 000 skb_scrub_packet === 4985626997923 000 selinux_ipv4_output 4985627003446 000 ip_output 4985627006438 000 nf_hook_slow 4985627009509 000 selinux_ipv4_postroute 4985627012747 000 selinux_ip_postroute 4985627015677 000 ip_finish_output 4985627018708 000 __ip_finish_output 4985627021625 000 ip_finish_output2 4985627024894 000 neigh_resolve_output 4985627027895 000 eth_header 4985627030774 000 skb_push 4985627033734 000 dev_queue_xmit 4985627036602 000 __dev_queue_xmit 4985627039670 000 netdev_core_pick_tx 4985627043102 000 validate_xmit_skb 4985627046245 000 netif_skb_features 4985627049328 000 passthru_features_check 4985627052227 000 skb_network_protocol 4985627055433 000 skb_csum_hwoffload_help 4985627058313 000 validate_xmit_xfrm 4985627061163 000 dev_hard_start_xmit 4985627064450 000 skb_clone_tx_timestamp 4985627067741 000 __dev_forward_skb 4985627070592 000 skb_scrub_packet ``` ## メモ - Wireguardの初期化 - udp_tunnelを利用している - 初期化時にソケットを作ってudp_tunnelに登録 - udp_rcvの先でencap_rcv call backの有無でtunnelのパスと普通のudpの受信パスを分岐 - tunnelの場合はソケットのキューにデータは積まない、skbをそのまま渡す

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully