Potential Optimization: Handle oversized TCP segments from guest VMs with TSO enabled

Issue Description:

When running macOS guest virtual machines with TCP Segmentation Offload (TSO) enabled on their virtual network interfaces, the guests can send excessively large TCP segments that exceed the path MTU, causing fragmentation and performance issues.


Steps to Reproduce:


  1. Set up a macOS guest VM (e.g., 13.6 or 14.3) on a macOS host system using Apple Virtualization.
  2. Enable TSO on the guest VM's virtual network interface.
  3. Initiate a large file transfer (e.g., HTTPS upload) from the guest VM to a server.
  4. Observe slow transfer speeds and excessive packet fragmentation due to the guest VM sending oversized TCP segments (e.g., 13980 bytes) that exceed the path MTU (e.g., 1450 bytes).


Expected Behavior:

The virtualization framework should handle oversized TCP segments from guest VMs with TSO enabled gracefully, without causing fragmentation and performance issues.


Potential Optimizations:

  • Automatically disable TSO on the guest VM's virtual NIC if oversized segments are detected.
  • Transparently segment oversized TCP segments to MTU size before reaching the guest VM.
  • Provide a configuration option to control this behavior or set a maximum TCP segment size for guest VMs.


Environment:


  • Host: macOS 13.6 (Mac mini 2023 with M2 chip)
  • Guest: macOS 13.6 and 14.3 (using Apple Virtualization)
  • Virtualization Software: UTM 4.4.5 (but likely affects any software using Apple Virtualization)


Workaround:

Disabling TSO on the guest VM's virtual NIC resolves the issue by preventing the guest from sending oversized TCP segments.


Additional Information:

This issue appears to be related to how Apple's virtualization framework handles TCP segmentation offload (TSO) from guest virtual machines. Optimizing this behavior could improve performance and prevent fragmentation issues when TSO is enabled on guest VMs, without requiring downstream software to implement workarounds.


Mac mini

Posted on Mar 24, 2024 10:52 AM

Reply

Similar questions

There are no replies.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Potential Optimization: Handle oversized TCP segments from guest VMs with TSO enabled

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.