📘 Post

Understanding TCP MSS, IP MTU, TCP MSS Clamping and SSL/TCP Proxy Behavior

08/31/2026 By Sanchit Agrawal 7 min read 👁 69 views

A Complete Guide with Real Packet Flow Examples

One of the most misunderstood networking topics is the relationship between IP MTU, TCP MSS, TCP MSS Clamping, and SSL/TCP Proxy devices such as Load Balancers, Firewalls, Reverse Proxies, and ADCs.

Many engineers assume that if a client advertises an MSS of 1380 bytes, every packet transmitted must be exactly 1380 bytes.

That assumption is incorrect.

Similarly, many people believe a Load Balancer simply forwards TCP packets. Modern Layer-4/Layer-7 load balancers usually do not. When SSL Offloading or Full Proxy mode is enabled, the Load Balancer terminates one TCP session and creates another completely independent TCP session toward the backend server.

Understanding this behaviour is essential for troubleshooting:

  • Slow applications
  • SSL offloading
  • Fragmentation
  • PMTU issues
  • MSS mismatch
  • Firewalls dropping ICMP
  • VPN tunnels
  • GRE/IPsec overhead
  • Data center load balancers

This article explains everything from first principles.


What is IP MTU?

MTU (Maximum Transmission Unit) is the maximum IP packet size that can be transmitted over a network interface without fragmentation.

MTU includes:

  • IP Header
  • TCP/UDP Header
  • Payload

Example:

mss cal

Common MTU Values

TechnologyTypical MTU
Ethernet1500
Jumbo Frame9000
PPPoE1492
GRE Tunnel1476
IPsec VPN1400–1460
VXLAN1450
WireGuard~1420

What is TCP MSS?

TCP MSS (Maximum Segment Size) is the largest TCP payload a sender is willing to receive in a single TCP segment.

It does not include:

  • Ethernet Header
  • IP Header
  • TCP Header

It includes only:

TCP Data

Formula:

mss/mtu cal

MTU vs MSS

MTUMSS
IP packet sizeTCP payload size
Layer 3Layer 4
Includes headersPayload only
Interface propertyTCP connection property

TCP Three-Way Handshake and MSS Negotiation

tcp 3 way and mss

The advertised MSS is the maximum payload each endpoint is willing to receive.

The effective payload size in each direction is determined independently:

  • Client → Server: limited by the server’s advertised receive MSS.
  • Server → Client: limited by the client’s advertised receive MSS.

A sender may transmit smaller segments than the negotiated MSS at any time, but should not exceed the peer’s advertised receive MSS.


Relationship Between MTU and MSS

tcp packet flow

TCP MSS Clamping

Sometimes the network path contains smaller MTUs due to:

  • VPN
  • GRE Tunnel
  • MPLS
  • PPPoE
  • IPSec
  • Cloud Interconnect
  • SD-WAN

Instead of allowing fragmentation, a firewall or router can rewrite the MSS value in SYN packets.

Example

The server therefore limits its TCP payloads sent to the client to 1300 bytes, reducing the chance of fragmentation.


Why MSS Clamping Exists

mss path

SSL/TCP Proxy Behaviour

Modern Load Balancers such as:

  • A10
  • F5 BIG-IP
  • Citrix ADC
  • NGINX
  • HAProxy
  • Envoy

often operate as full TCP proxies.

They terminate the client’s TCP session and establish a separate TCP session to the backend.

StepNetwork OperationMSS
1Client sends SYN1380
2TCP Session #1 established (Client ↔ Load Balancer)1380
3Load Balancer terminates the client connection
4Load Balancer creates a new TCP connection1400
5TCP Session #2 established (Load Balancer ↔ Server)1400
6Server communicates with Load Balancer using the new session1400

These sessions are independent.

Each side negotiates:

  • MSS
  • Window Size
  • SACK
  • Timestamps
  • Congestion Control
  • TLS Parameters (if applicable)

independently.


SSL Offloading Example

StepTraffic FlowProtocol
1ClientHTTPS
2Client → Load BalancerEncrypted SSL/TLS
3Load BalancerTerminates SSL/TLS Session
4Decrypts the Client TrafficSSL Offloading
5Applies Security Policies (Optional)WAF / Authentication / Inspection
6Creates a New Backend ConnectionIndependent TCP Session
7Load Balancer → ServerHTTP or HTTPS
8ServerProcesses the Application Request

The backend may use:

  • HTTP
  • HTTPS
  • Different MSS
  • Different MTU
  • Different Window Size

without affecting the client-side negotiation.


Complete Real-World Packet Flow

mssnettopo

Step 1 – Client Sends TCP SYN

PacketValue
SourceClient
DestinationServer (through network)
TCP FlagSYN
Advertised MSS1380 Bytes

Step 2 – Gateway Firewall Performs MSS Clamping

Before FirewallAfter Firewall
MSS = 1380MSS = 1300

Firewall Action

OperationDescription
Packet InspectionReads the TCP SYN packet
MSS RewriteChanges MSS from 1380 → 1300
PurposePrevents fragmentation on smaller MTU paths

Server Perspective

Server Learns
Client Maximum Receive MSS = 1300 Bytes

Step 3 – Load Balancer Receives the Connection

Client Side (TCP Session #1)
Client MSS1300 (after firewall clamping)
TCP HandshakeCompleted
SSLTLS Session Established
Load BalancerTerminates Client TCP Session
SSL OffloadingDecrypts Client Traffic
Next ActionCreates a new backend TCP connection

Step 4 – Backend TCP Session

Backend TCP Handshake

PacketAdvertised MSS
Load Balancer → ServerSYN (MSS = 1380)
Server → Load BalancerSYN-ACK (MSS = 1400)
Load Balancer → ServerACK

Backend Negotiation

DeviceAdvertised MSS
Load Balancer1380 Bytes
Server1400 Bytes

Effective MSS

DirectionMaximum TCP Payload
Server → Load Balancer1380 Bytes
Load Balancer → Server1400 Bytes (limited by the server’s receive capability, which is 1400 in this example)

Note: In each direction, the sender must not exceed the receiver’s advertised MSS. This means the server sending to the load balancer is limited by the load balancer’s advertised MSS (1380 bytes), while the load balancer sending to the server is limited by the server’s advertised MSS (1400 bytes).


End-to-End Session Summary

TCP SessionEndpointsMSSDescription
TCP Session #1Client ↔ Gateway Firewall ↔ Load Balancer1300 (after MSS clamping)Client-side TCP connection with SSL/TLS
TCP Session #2Load Balancer ↔ Server1380 / 1400Independent backend TCP connection

Key Takeaways

Description
The firewall modifies only the MSS option in the TCP SYN packet.
The Load Balancer terminates the client TCP session.
SSL is decrypted during SSL Offloading (if enabled).
The Load Balancer creates a new, independent TCP session to the backend server.
Each TCP session negotiates its own MSS, Window Size, TCP Options, and TLS parameters independently.

What Happens if the Client Sends More Than Its Advertised MSS?

Suppose the client advertised:

1380 MSS

Then later sends:

2000 Bytes of TCP payload

In normal TCP implementations, this should not happen because the sender’s TCP stack segments application data into TCP segments that respect the peer’s advertised MSS.

If an application writes 2000 bytes, the TCP stack typically splits it into multiple segments (for example, 1380 bytes and 620 bytes, subject to other factors).

If an oversized IP packet somehow appears (for example, due to encapsulation, misconfiguration, or non-TCP traffic), then:

  • If the IP packet exceeds the path MTU and fragmentation is allowed, routers or the sender may fragment it (IPv4).
  • If the DF (Don’t Fragment) bit is set and the packet exceeds the path MTU, the packet is dropped and an ICMP “Fragmentation Needed” message should be returned (Path MTU Discovery).
  • If ICMP is filtered, Path MTU Discovery may fail, causing retransmissions, timeouts, or “black hole” connections.

Can a Load Balancer Send 100-Byte TCP Segments?

Yes.

Assume negotiated MSS:

1380

The Load Balancer sends:

100 Bytes

100 Bytes

100 Bytes

This is perfectly valid.

MSS is a maximum, not a minimum.

TCP may send smaller segments for many reasons, including:

  • Small application writes
  • Nagle algorithm behavior
  • Delayed ACK interactions
  • TCP pacing
  • Congestion control
  • Proxy buffering or streaming
  • Flow control
  • Low-latency delivery

The receiver reassembles these segments into the original byte stream before delivering the data to the application.


Path MTU Discovery (PMTUD)

Instead of fragmenting packets, modern networks rely on Path MTU Discovery (PMTUD) to learn the smallest MTU along the path.

Basic process:

  1. Sender transmits packets with the Don’t Fragment (DF) bit set (IPv4).
  2. If a router cannot forward the packet because it exceeds the outgoing interface MTU, it drops the packet.
  3. The router sends an ICMP “Fragmentation Needed” message indicating the supported MTU.
  4. The sender reduces its packet size and continues transmitting.

If these ICMP messages are blocked by firewalls, communication can stall. MSS clamping is commonly used to reduce the likelihood of such PMTU issues, especially across tunnels and VPNs.


Best Practices

✔ Use MTU 1500 whenever possible.

✔ Enable PMTU Discovery.

✔ Allow required ICMP “Fragmentation Needed” messages through firewalls.

✔ Configure MSS Clamping on VPN and tunnel interfaces where appropriate.

✔ Avoid unnecessary IP fragmentation.

✔ Monitor TCP retransmissions and out-of-order segments during troubleshooting.

✔ Remember that proxy devices create independent TCP sessions and negotiate TCP options separately.


RFC References

  • RFC 791 – Internet Protocol (IPv4)
  • RFC 793 – Transmission Control Protocol (updated by RFC 9293)
  • RFC 879 – TCP Maximum Segment Size and Related Topics
  • RFC 1191 – Path MTU Discovery (IPv4)
  • RFC 1981 – Path MTU Discovery for IPv6 (updated by RFC 8201)
  • RFC 8201 – Path MTU Discovery for IPv6
  • RFC 9293 – Transmission Control Protocol (TCP) Specification

Key Takeaways

  • MTU defines the largest IP packet that can traverse a link without fragmentation.
  • MSS defines the largest TCP payload a receiver is willing to accept in a segment.
  • MSS Clamping rewrites the MSS value in TCP SYN packets to prevent fragmentation across smaller-MTU paths.
  • SSL/TCP proxies terminate one TCP connection and create another, negotiating TCP parameters independently on each side.
  • MSS is a maximum, not a required packet size—a sender may legally transmit much smaller segments.
  • Applications do not send “1380-byte packets” directly; they write a byte stream, and the TCP stack segments it according to the negotiated MSS, congestion control, and other TCP algorithms.

Useful References

ResourceDescription
RFC 791Internet Protocol (IPv4)
RFC 793 / RFC 9293TCP Specification
RFC 879Maximum Segment Size (MSS)
RFC 1191Path MTU Discovery (IPv4)
RFC 8201Path MTU Discovery (IPv6)
WiresharkAnalyze MSS negotiation, PMTUD, TCP segmentation, and retransmissions
tcpdumpCapture TCP SYN packets and verify MSS values
hping3Generate custom TCP packets for lab testing
OpenSSLTest TLS handshakes with SSL offloading devices
Disclaimer: This article may contain information that was accurate at the time of writing but could be outdated now. Please verify details with the latest vendor advisories or contact us at admin@sanchitgurukul.com.

Your feedback matters

Was this post helpful?

0 reactions

SanchitGurukul — Technology • Education • Innovation

Discussion

0 approved comments

No approved comments yet. You can start the discussion below.

Leave a Comment

No login is required. Name and email are used for moderation/security. Your email is never displayed publicly. All comments require administrator approval.

This field is not used to determine whether a comment is safe.

Plain text only. File uploads, scripts, executable code, abuse and spam are not accepted.


Discover more from SanchitGurukul

Subscribe to get the latest posts sent to your email.

Share this article

Help others find this guide.

Hi! I’m SanchitGurukul SaarthiNeed help finding something?

Discover more from SanchitGurukul

Subscribe now to keep reading and get access to the full archive.

Continue reading