3

I have an Ubuntu Server 14.04 install which is connected to the internet using PPPoE. At the moment my ppp0 interface have an MTU of 1492 which mostly works.

I'd like to increase the MTU to 1500, which is supported by my ISP.

So far I have increased the MTU of the underlying Ethernet interface to 1508, and I have tried adding the following lines in /etc/ppp/peers/dsl-provider

mtu 1500
mru 1500

But my ppp0 interface still has an MTU of 1492. I believe the syntax of my added lines is correct, since using values lower than 1492 does work as expected.

Manually changing the MTU of the ppp0 interface to 1500 after it has been brought up works, but it only affects packets in one direction. Doing that I am able to send 1500 bytes packets across the internet and they will arrive at their destination with no fragmentation. But incoming traffic to me is still sent in 1492 byte fragments.

By capturing traffic on the Ethernet interface as the PPPoE connection is brought up, I can see that in the configuration request that my Ubuntu Server 14.04 machine sends to the provider, the MRU is specified as 1492. So I know the issue is on my end of the connection.

Why does Ubuntu Server 14.04 use 1492 as MRU in the configuration request, when the configuration file says 1500? And how can I change it to 1500?

Kaz Wolfe
  • 34,680
kasperd
  • 1,779

2 Answers2

2

I downloaded the ppp source code by typing these two commands:

sudo apt-get build-dep ppp
apt-get source ppp

In the header file pppd/plugins/rp-pppoe/pppoe.h I found this:

/* Header size of a PPPoE packet */
#define PPPOE_OVERHEAD 6  /* type, code, session, length */
#define HDR_SIZE (sizeof(struct ethhdr) + PPPOE_OVERHEAD)
#define MAX_PPPOE_PAYLOAD (ETH_DATA_LEN - PPPOE_OVERHEAD)
#define MAX_PPPOE_MTU (MAX_PPPOE_PAYLOAD - 2)

ETH_DATA_LEN is defined in /usr/include/linux/if_ether.h

#define ETH_DATA_LEN      1500            /* Max. octets in payload        */

And in pppd/plugins/rp-pppoe/plugin.c I found this:

    if (lcp_allowoptions[0].mru > MAX_PPPOE_MTU)
        lcp_allowoptions[0].mru = MAX_PPPOE_MTU;
    if (lcp_wantoptions[0].mru > MAX_PPPOE_MTU)
        lcp_wantoptions[0].mru = MAX_PPPOE_MTU;

What all of this means is that the rp-pppoe plugin has a hard coded limit of 1492 bytes. And the only way to increase it is by modifying the source and rebuild the plugin with a higher limit.

By removing the above four lines from plugin.c and rebuilding the module, I was able to increase the MTU from 1492 to 1500. This only works as long as the underlying line is known to support the larger size, which happens to be the case on my connection.

In order to detect the capability of the underlying line it would be necessary to use a newer pppd version with RFC 4638 support. Ubuntu 16.04 has a newer pppd version and thus should be capable of using larger MTU sizes for PPPoE without needing to recompile any code.

kasperd
  • 1,779
-1

you could run pppd via strace and filter to display 'open' requests to see which files its opening to get its config from.

sudo strace -f -e open pppd

In my experience (of uk broadband) all connections have been 1492 if they go over BT , is there a specific reason you need another 8 octets ?

My understanding is that if you don't match the MRU properly you can end up having your packets become multiple packets, especially if you don't allow things like an 8 octet overhead for encapsulation.

Amias
  • 5,359