MPTCP(三) : 在内核中启用MPTCP相关模块

在内核中启用MPTCPv1相关的模块

1. 简介

  • 本文所涉及的均为MPTCPv1版本的MPTCP,采用的内核版本为5.18.19

  • 需要注意的是

    • 虽然MPTCP官方文档中提到在5.6之后的linux内核中均已集成了MPTCP相关源码,但是不同的linux发行版可能并没有启用MPTCP相关的内核模块,需要修改内核配置并重新编译内核
    • 如何确定linux发行版是否启用了MPTCP,请参考前文: 《MPTCP(二):MPTCP版本说明》
    • 实际测试过程中发现:(1)ubuntu22.04中已经集成了MPTCP源码并使能了MPTCP相关的内核模块,不需要修改内核相关配置;(2)然而在树莓派raspberry OS中,虽然已经在内核中集成了MPTCP模块源码,但是并没有启用MPTCP内核模块,实际并没有生效
  • 本文就以树莓派5.18.19内核源码为例说明如何启用MPTCP内核模块,硬件平台为树莓派CM4

2. 获取内核源码

  • 下载地址如下,选择分支rpi-5.18.y

https://github.com/raspberrypi/linux

  • clone源码
    git clone https://github.com/raspberrypi/linux.git --single-branch --branch=rpi-5.18.y
    或
    git clone git@github.com:raspberrypi/linux.git --single-branch --branch=rpi-5.18.y
    

3. 安装交叉编译工具

  • 不赘述,参考如下链接:

https://blog.csdn.net/FireStarway/article/details/104921147

4. 编译内核

4.1 修改顶层Makefile

  • 修改Makefile,在顶层Makefile中添加如下内容

    ARCH := arm64
    CROSS_COMPILE := aarch64-linux-gnu-
    KBUILD_OUTPUT := ../linux_build
    

  • 树莓派CM4使用的是博通BCM2711 SoC, 因此使用默认配置文件bcm2711_defconfig

    $ ls arch/arm64/configs/
    bcm2711_defconfig  bcmrpi3_defconfig  defconfig
    
    $ make bcm2711_defconfig
    

4.2 make menuconfig启用MPTCP内核模块

  • 修改make menuconfig中的如下配置
    -> Networking support
      -> Networking options
        -> The IPv6 protocol (选择编译进内核)
        -> MPTCP: Multipath TCP (选择编译进内核或内核模块均可,编译为内核模块时每次开机都需要先加载相关驱动,较为麻烦)
        -> MPTCP: IPv6... (可选可不选)
    

4.3 编译

$ make Image modules dtbs -j$(nproc)
posted @ 2023-05-15 10:59  zhijun  阅读(913)  评论(0编辑  收藏  举报