The MTU (Maximum Transmission Unit) for Ethernet, for instance, is 1500 bytes but Ubuntu is sending 1514 bytes. I’ve increased buffer size in code.ino to 1550 for client.read but no success on 1460 byte TCP frame (which is 1514 bytes Ethernet). I searched back an couldn’t find a apecific answer. I’m a newbie to this forum so do I need to start reading Device OS code from Github or is there some other way of finding such answer?
Just poking this - is there a documented way or possibility of changing the MTU size on Argons? A search through (Device OS API | Reference Documentation | Particle) doesn’t seem to indicate that this is the case, but that seems a bit strange.
Since we are going to be going over a cellular connection, ideally we would like to drop it from the default for 1500 to 1400.
There is no ‘official’ way to do that, but you can use a low level API to change the MTU:
#include "ifapi.h"
// ....
if_t iface = nullptr;
if_get_by_index(WiFi, &iface);
if_set_mtu(iface, 1400);
To add a slight follow-up question - will the argons query the DHCP server for MTU settings?
DHCP option 26 (Interface MTU) is not supported in our DHCP client.
To ask the silly question: my assumption is that passing the Wifi interface won’t apply for changing the Ethernet interface - is that correct?
If so, what interface name/index should be passed for ethernet,(I’m guessing Ethernet)?
Correct, you pass Ethernet object reference and that gets cast to the appropriate index.
You can also use NETWORK_INTERFACE_WIFI_STA and NETWORK_INTERFACE_ETHERNET accordingly.