Enabling jumbo frames on Ubuntu 22.04 connected to a MikroTik switch requires configuring the MTU to 9000 on both the Linux interface and the corresponding MikroTik port. This optimization reduces CPU overhead for high-bandwidth tasks like video surveillance by increasing payload size, but it demands end-to-end consistency across all network devices in the path.
Understanding MTU and Jumbo Frames
The Maximum Transmission Unit (MTU) defines the largest packet size that can be transmitted over a network link without fragmentation. The standard Ethernet MTU is 1500 bytes. Jumbo frames typically refer to an MTU of 9000 bytes, allowing significantly more data per packet. For applications such as IP cameras connected to a MikroTik switch and then to an Ubuntu server, larger packets mean fewer interrupts and lower processing overhead, which can improve throughput and reduce latency. However, if any device in the chain does not support this size, packets will be dropped or fragmented, leading to severe performance degradation or connectivity loss.Configuring the MikroTik Switch
Before modifying the Linux server, you must ensure the MikroTik switch port supports jumbo frames. Log into your MikroTik RouterOS via WinBox or SSH. Navigate to Interfaces and select the specific ether port connected to the Ubuntu server. In the general tab, look for the mtu field. Change this value from the default (usually auto or 1500) to9000. If you are using a dedicated switch model rather than a router acting as a switch, check the hardware specifications to confirm jumbo frame support. Apply the changes. You should verify that the port status reflects the new configuration. If the port resets or shows errors, the hardware may not support the increased MTU, and you should revert to 1500 immediately.
Configuring Ubuntu 22.04 Network Interface
Ubuntu 22.04 uses Netplan for network configuration. To enable jumbo frames persistently, you need to edit the Netplan YAML file. Identify your interface name using the commandip link show. Common names include eth0, enp3s0, or similar. Open the relevant configuration file in /etc/netplan/. It might be named 00-installer-config.yaml or something similar depending on your installation method. Inside the network section for your interface, add the mtu: 9000 parameter. Ensure proper indentation, as YAML is sensitive to whitespace. Your configuration should resemble the following structure:
network:
version: 2
ethernets:
enp3s0:
addresses:
- 192.168.1.10/24
gateway4: 192.168.1.1
nameservers:
addresses:
- 8.8.8.8
mtu: 9000
If you are using DHCP instead of static IPs, ensure the DHCP client allows overriding the MTU. Some DHCP servers advertise the MTU, so you may need to explicitly set it to ignore the server's suggestion. After editing the file, apply the changes with the command sudo netplan apply. Check the interface status with ip link show enp3s0 to confirm the MTU is now 9000. Note that applying network configurations can briefly disconnect services; schedule this during a maintenance window if possible.
Verifying Connectivity
After changing the MTU, test connectivity by pinging the MikroTik switch or other devices on the same subnet. Use the-M do flag to prevent fragmentation and ensure the packet size matches the MTU. For example:
ping -c 5 -s 8972 -M do 192.168.1.1
The payload size of 8972 plus the 28 bytes of IP and ICMP headers equals 9000 bytes. If this ping fails, the network path does not support jumbo frames end-to-end. Check intermediate switches, routers, or firewalls. Fragmentation issues often arise when traffic crosses between networks with different MTU capabilities.
Performance Considerations and Risks
While jumbo frames improve throughput for large sequential transfers, they can increase latency for small packets due to longer transmission times on the wire. For mixed traffic environments containing both video streams and small control packets, evaluate whether the benefit outweighs the potential latency impact. Additionally, some older NICs or drivers may not handle jumbo frames efficiently, leading to buffer overflows. Monitor system logs for errors usingdmesg | grep -i error after enabling the feature. If you experience instability, consider reducing the MTU to an intermediate value like 4096 or 8192, which offers some benefits without the strict requirements of 9000.
For users experiencing broader networking issues on Ubuntu, understanding how interfaces are managed is crucial. See How do Ubuntu-server network interfaces work? for a deeper dive into Netplan and systemd-networkd. Similarly, if you encounter connectivity drops after these changes, check IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready message repeating every minute for related diagnostic steps.
Frequently Asked Questions
What happens if only one side has jumbo frames enabled?
Packets larger than 1500 bytes sent from the Linux server will be dropped by the MikroTik switch if it is still configured for standard MTU. This results in complete communication failure for those flows. Conversely, if the switch sends jumbo frames and the Linux server cannot receive them, the server will drop incoming large packets, causing timeouts and retransmissions.
Can I use jumbo frames with Wi-Fi connections?
No, Wi-Fi standards generally do not support jumbo frames. The IEEE 802.11 protocol stack limits frame sizes significantly below 9000 bytes. If your Ubuntu server connects via wireless, you must keep the MTU at 1500 or lower to maintain stable connectivity.
How do I disable jumbo frames if my network breaks?
Edit the Netplan YAML file again and change the mtu: 9000 line to mtu: 1500 or remove the line entirely to revert to the default. Then run sudo netplan apply to restore standard operation. You can also temporarily reset the interface with sudo ip link set dev enp3s0 mtu 1500 for immediate effect without rebooting.
Do I need to configure jumbo frames on all switches in the path?
Yes, jumbo frames require end-to-end support. Every switch, router, and firewall between the Ubuntu server and the destination must have an MTU of at least 9000 on the relevant interfaces. If any single hop restricts the MTU to 1500, the entire jumbo frame path is broken.
Is there a performance penalty for using jumbo frames?
The primary penalty is increased latency for small packets because the wire is occupied longer by each large frame. Additionally, if buffers are undersized, large frames can cause head-of-line blocking. For pure video surveillance traffic, the throughput gain usually outweighs these minor latency increases.