BlogsCloudflareLinux Connection Tracking (conntrack)

Linux Connection Tracking (conntrack)

Linux Connection Tracking (conntrack)

1
posts
2020

Cloudflare's understanding and utilization of Linux's conntrack subsystem has evolved from avoiding it for simplicity to actively investigating its intricacies for new product needs. This includes understanding its state management, capacity limits, and the implications of its behavior when full, such as implicit packet drops and EPERM errors for UDP flows. The company is exploring its use in containerized environments and the nuances of its strict vs. loose modes.

2020

Conntrack tales - one thousand and one flows

4/6/2020

This post details the internal investigation into Linux's conntrack subsystem. It explains what conntrack is, how it tracks connection states, its configurable limits (e.g., /proc/sys/net/nf_conntrack_max), and the challenges in testing it, particularly within containerized environments using 'unshare'. The post demonstrates how conntrack overfilling leads to silent packet drops (specifically SYN packets) and EPERM errors for new UDP flows, highlighting the critical need to manage conntrack capacity. It also touches upon the 'strict' vs. 'loose' modes and scenarios where conntrack entries are not created (e.g., packets hitting a DROP target).