Raspberry Pi 5 (bcm2712) or Pi 4B (bcm2711) for L4S Build Notes (Sept 23, 2024)

Help towards building a kernel which is L4S capable and runs on a raspberry pi 5. The devices are assumed to be used for experimental, wired testing purposes only and not on production networks. This is not an endorsement of L4S but the expected use is for technical evaluations.
Please read the following disclaimer.

Disclaimer

This site does not make claims on nor endorse L4S generally nor per any specific implementations. The site is provided on an as-is and as-available basis. You acknowledge that you bear all risks involved in using this website or the software and hardware mentioned on this site. The site maintainers make no claims, promises, or guarantees about the accuracy, completeness, or adequacy of the contents of this site, and expressly disclaims liability for errors and omissions in the contents of this site. No warranty of any kind, implied, expressed, or statutory, including but not limited to the warranties of non-infringement of third party rights, title, merchantability, fitness for a particular purpose or freedom from computer virus, is given with respect to the contents of this website or its links to other Internet resources.

Hardware requirements & suggestions

Software

Other

Native build with apt (build from source notes here)

Create a full debian bullseye system with 64 bit support, using a 64G micro SD card

  1. Download the bullseye image from here or from debian.

  2. Use rasberry pi imager to write to a 64G card, it will destroy all existing data

  3. Install the card into a raspberry pi 4 with wired ethernet attached

  4. Boot card and follow initial setup including creating a user id, and system updates

  5. Reboot, set root password with ‘sudo passwd’

  6. optionally ‘sudo apt-get install firefox-esr’

  7. optionally enable ssh via ‘systemctl start ssh” & ‘systemctl enable ssh’

  8. Install build tools

Build a L4S capable kernel (not optimized)

  1. Clone the kernel from l4s team site
  2. Get the sourced code for 6.6 kernel: git clone https://github.com/minuscat/rpi-6.6.y.git

  3. Go into kernel directory: cd rpi-6.6.y/

  4. Review the url on building rpi kernels

  5. Set the KERNEL environment variable to a unique value (this is just an example): KERNEL=kernel_2712_l4s

  6. Make a Rpi5 config: make bcm2712_defconfig

  7. Set prague CCA & dual queue kernel flags: make menuconfig

  8. Set CONFIG_LOCALVERSION environment variable to a unique value: CONFIG_LOCALVERSION="-l4s-kernel"

  9. Compile kernel, modules, device tree blobs: make -j6 Image.gz modules dtbs

  10. Install modules: make -j6 modules_install

  11. sudo cp /boot/firmware/$KERNEL.img /boot/firmware/$KERNEL-backup.img sudo cp arch/arm64/boot/Image.gz /boot/firmware/$KERNEL.img sudo cp arch/arm64/boot/dts/broadcom/*.dtb /boot/firmware/ sudo cp arch/arm64/boot/dts/overlays/*.dtb* /boot/firmware/overlays/ sudo cp arch/arm64/boot/dts/overlays/README /boot/firmware/overlays/
    1. Checkout l4s branch

    1. Download bcm2711_defconfig from this site

    1. make menuconfig

    Install custom kernel

    1. make modules_install

    2. make install

    3. emacs /boot/config.txt

    4. kernel=vmlinuz-5.15.72-v8+

    5. # uncomment if you get no picture on HDMI for a default "safe" mode

      #hdmi_safe=1

    6. or sudo systemctl set-default multi-user.target

    7. reboot

    Verify TCP Prague and BBRv2

    rjmcmahon@raspberrypi:~ $ uname -r

    5.15.72-v8+

    kernel.random.entropy_avail = 256

    kernel.seccomp.actions_avail = kill_process kill_thread trap errno user_notif trace log allow

    net.ipv4.tcp_available_congestion_control = reno bbr bbr2 cubic dctcp vegas prague

    net.ipv4.tcp_available_ulp =


    Configuration for Testing
    You can configure the test machine with the following commands.


    Enabling Accurate ECN

    sysctl net.ipv4.tcp_ecn=3


    Enabling BBRv2 CC w/ Accurate ECN

    sysctl net.ipv4.tcp_ecn=3 net.ipv4.tcp_congestion_control=bbr2


    Enabling TCP Prague CC w/ Accurate ECN

    sysctl net.ipv4.tcp_ecn=3 net.ipv4.tcp_congestion_control=prague


    Enabling CUBIC CC w/ Accurate ECN

    sysctl net.ipv4.tcp_ecn=3 net.ipv4.tcp_congestion_control=cubic


    Enabling CUBIC CC w/o Accurate ECN

    sysctl net.ipv4.tcp_ecn= net.ipv4.tcp_congestion_control=cubic

    Build the latest iperf 2

    1. cd /usr/local/src

    2. git clone https://git.code.sf.net/p/iperf2/code iperf2-code

    3. cd iperf2-code

    4. .configure

    5. make -j 4

    6. make install

    Build goresponsiveness tool (git repo)

    wget https://go.dev/dl/go1.20.6.linux-arm64.tar.gz

    tar -C /usr/local/ -xvf go1.20.6.linux-arm64.tar.gz

    tar -C /usr/local -xzf go1.20.6.linux-arm64.tar.gz

    export PATH=$PATH:/usr/local/go/bit

    type go

    go version

    cd goresponsiveness/

    go mod download

    go build networkQuality.go



    TCP client stats

    Adding a realtime clock

    Example clone with dd (from micro SD to file, use lsblk to find device)

    [rjmcmahon@ryzen3950 L4S]$ sudo dd bs=4M if=/dev/sdc of=l4s_kernel conv=fsync

    [sudo] password for rjmcmahon:

    15226+1 records in

    15226+1 records out

    63864569856 bytes (64 GB, 59 GiB) copied, 692.6 s, 92.2 MB/s

    Example clone with dd (from file to micro SD, use lsblk to find device)



    Cross compile for a buildroot small embedded system (not done)


    A picture