2

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,122
  • 21
  • 114
  • 172
kasperd
  • 1,729

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,729
  • @malo That is no longer true. Modern Ethernet equipment is often found with support for MTU sizes as large as 9000 bytes. And RFC 4638 allows for larger MTU sizes to be negotiated on PPPoE. Ubuntu 14.04 just doesn't appear to support RFC 4638 out of the box. – kasperd Sep 18 '16 at 17:10
  • only gigabit does such massive MTU , most of the internet runs with an MTU of 576 so you really wont get more speed doing this , you will probably just give someone elses router more work to do. – Amias Sep 19 '16 at 10:16
  • 1

    most of the internet runs with an MTU of 576... What? Maybe in India. Only dial-up used this value. I have a website with no specific target country and most users worldwide have between 1Mb and 4Mb ADSL. Which coincidentally also happens to have PPPoE under the hood imposing the same 1492B limit.

    – Zdenek Mar 28 '17 at 16:57
-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,246
  • 1. I have experienced a PMTU problem on a 6in4 tunnel, which would go away if my PMTU was 1500 bytes. 2. It seems silly to be using a 1492 byte MTU when the entire path supports 1500 bytes, and it is just my Ubuntu box which for some reason suggests a lower value during negotation. – kasperd Sep 18 '16 at 13:21
  • I have updated the question with a list of every configuration file read by pon dsl-provider, but I didn't find anything useful that way. – kasperd Sep 18 '16 at 14:25
  • Turns out the limit was hard coded in the rp-pppoe plugin. So I have removed the list of configuration files from my question again as that wasn't relevant after all. – kasperd Sep 18 '16 at 15:16