Introduction

This article is a continuation of my previous post, 11. A Brief Introduction to Conntrack .

In this piece, we will dive deeper into the impact of conntrack on Docker networking. Furthermore, we will explore how the TCP three-way handshake and four-way handshakes (teardown) operate within this context.

Lab3 - How Linux Conntrack Determines Performance and Security in Docker Containers

<aside> πŸ’‘

In this experiment, we will observe how Docker utilizes conntrack to establish filter table rules (stateful connections), which not only optimizes performance but also enhances security.

We will explore the contributions of conntrack through three sub-experiments:

  1. Use the nc command to observe packet changes during TCP establishment and analyze the packet transitions during the three-way handshake and four-way teardown.
  2. Use the curl command to observe packet changes during HTTP Requests and Responses.
  3. Remove conntrack rules to understand the impact of stateless connections. </aside>

Conntrack.drawio.svg

Environment Setup

ζˆͺεœ– 2025-11-24 上午10.37.43.png

For this session, we will use iximiuz Labs' flexbox to set up two machines.

1. View the initial state of the filter table

ζˆͺεœ– 2025-12-28 上午10.14.44.png

First, once the environment initialization is complete, let's observe the iptables filter table on box-01. You will see the content as shown in the figure on the left.

Chain Analysis

2. Start the Nginx server container

To observe how packets traverse the filter table, we will start an Nginx web server on the box-1 machine.