Skip to content

ICMP Packet Too Big #1700

@neilalexander

Description

@neilalexander

Describe the bug

The TUN adapter sets up with an MTU 1500 and this seems to be the network-wide MTU.

However, if you want to route beyond a given lokinet router (e.g. masquerading NAT outbound to allow some other network to reach lokinet, or destination NAT inbound) across a link with an MTU of lower than 1500, it appears lokinet ignores the ICMP Packet Too Big messages generated as a result of upstream links and continues to send packets that are too large.

To Reproduce

Set up lokinet on machine A with masquerading NAT and forwarding enabled. Set up some kind of tunnel between machine A and B with an MTU of less than 1500. Try to reach a lokinet service from machine B whilst watching tcpdump on machine A. Lots of ICMP Packet Too Big messages are generated because the return traffic from lokinet on machine A for machine B is too large.

e.g. continuing to send 1448 bytes when the next hop interface is MTU 1410:

15:33:37.021991 IP 172.19.0.1 > 172.19.0.2: ICMP 172.19.0.1 unreachable - need to frag (mtu 1410), length 556
15:33:37.034400 IP 172.19.0.2.80 > 172.19.0.1.58478: Flags [.], seq 2217:3665, ack 694, win 505, options [nop,nop,TS val 2824688482 ecr 1978533898], length 1448: HTTP
15:33:37.034567 IP 172.19.0.1 > 172.19.0.2: ICMP 172.19.0.1 unreachable - need to frag (mtu 1410), length 556
15:33:37.054451 IP 172.19.0.2.80 > 172.19.0.1.58478: Flags [.], seq 3665:5113, ack 694, win 505, options [nop,nop,TS val 2824688482 ecr 1978533898], length 1448: HTTP
15:33:37.054647 IP 172.19.0.1 > 172.19.0.2: ICMP 172.19.0.1 unreachable - need to frag (mtu 1410), length 556
15:33:37.080589 IP 172.19.0.2.80 > 172.19.0.1.58478: Flags [.], seq 5113:6561, ack 694, win 505, options [nop,nop,TS val 2824688493 ecr 1978533898], length 1448: HTTP
15:33:37.081042 IP 172.19.0.1 > 172.19.0.2: ICMP 172.19.0.1 unreachable - need to frag (mtu 1410), length 556
15:33:37.101681 IP 172.19.0.2.80 > 172.19.0.1.58478: Flags [.], seq 6561:8009, ack 694, win 505, options [nop,nop,TS val 2824688516 ecr 1978533898], length 1448: HTTP
15:33:37.102010 IP 172.19.0.1 > 172.19.0.2: ICMP 172.19.0.1 unreachable - need to frag (mtu 1410), length 556
15:33:37.123696 IP 172.19.0.2.80 > 172.19.0.1.58478: Flags [.], seq 8009:9457, ack 694, win 505, options [nop,nop,TS val 2824688539 ecr 1978533898], length 1448: HTTP
15:33:37.123939 IP 172.19.0.1 > 172.19.0.2: ICMP 172.19.0.1 unreachable - need to frag (mtu 1410), length 556
15:33:37.148182 IP 172.19.0.2.80 > 172.19.0.1.58478: Flags [.], seq 9457:10905, ack 694, win 505, options [nop,nop,TS val 2824688562 ecr 1978533898], length 1448: HTTP
15:33:37.148425 IP 172.19.0.1 > 172.19.0.2: ICMP 172.19.0.1 unreachable - need to frag (mtu 1410), length 556
15:33:37.171572 IP 172.19.0.2.80 > 172.19.0.1.58478: Flags [.], seq 10905:12353, ack 694, win 505, options [nop,nop,TS val 2824688585 ecr 1978533898], length 1448: HTTP
15:33:37.171920 IP 172.19.0.1 > 172.19.0.2: ICMP 172.19.0.1 unreachable - need to frag (mtu 1410), length 556
15:33:37.194388 IP 172.19.0.2.80 > 172.19.0.1.58478: Flags [.], seq 12353:13801, ack 694, win 505, options [nop,nop,TS val 2824688607 ecr 1978533898], length 1448: HTTP
15:33:37.194605 IP 172.19.0.1 > 172.19.0.2: ICMP 172.19.0.1 unreachable - need to frag (mtu 1410), length 556

Incidentally, we had a similar problem in Yggdrasil and we largely avoided this by allowing each side to configure their own MTU and then exchanging MTUs with anyone we opened a session to. Both sides agree to use the lower MTU and ICMP Packet Too Big messages are synthesised by the TUN reader when packets that exceed that size are read, which applications use to pick smaller packet sizes.

Device and Operating system (please complete the following information):

  • OS: Linux
  • Lokinet Version number or Git commit hash: 0.9.5

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions