middlebox

term

networkingISP & telecom

Kept in this browser · My desk

Any device on the path between two hosts that does more than route packets: a firewall, a NAT, a proxy, a load balancer, a cache or an inspection engine. The IETF's term, defined in RFC 3234 (2002).

Middleboxes are where the Internet's end-to-end design and its real behaviour part company. Each one assumes something about the traffic it handles, and new protocols have to fit through those assumptions: TLS 1.3 disguises its handshake as TLS 1.2 session resumption because many middleboxes misbehaved when they saw the real one, and QUIC encrypts nearly all of its headers so that no middlebox can come to depend on them. The word is neutral on purpose: RFC 3234 refuses to classify middleboxes as good or evil.

The definition. RFC 3234, "Middleboxes: Taxonomy and Issues", by Brian Carpenter and Scott Brim (February 2002), credits the word to Lixia Zhang and defines a middlebox as "any intermediary device performing functions other than the normal, standard functions of an IP router on the datagram path between a source host and destination host". It may be virtual, a function embedded in another box, and it is "never the ultimate end-system of an applications session". The RFC catalogues twenty-two kinds, among them NAT (network address translation), tunnel endpoints, packet classifiers and schedulers, TCP performance-enhancing proxies, load balancers, IP firewalls, application firewalls, application-level gateways, transcoders, proxies, caches and modified DNS servers, and it deliberately excludes one classification: "good" versus "evil".

Talking to middleboxes. The same year the taxonomy appeared, the Internet Engineering Task Force (IETF) tried the opposite approach: instead of guessing what an application needs, let it ask. RFC 3303, "Middlebox communication architecture and framework" (August 2002), by Pyda Srisuresh, Jiri Kuthan, Jonathan Rosenberg, Andrew Molitor and Abdul Rayhan, set out the middlebox communication (MIDCOM) framework, in which the application intelligence needed for protocols such as File Transfer Protocol (FTP), Session Initiation Protocol (SIP) and H.323 moves out of the firewall or NAT (network address translation) device into external MIDCOM agents that tell the middlebox which pinholes and bindings to open. The idea of an explicit conversation between endpoints and the path returns in every later attempt to manage middleboxes rather than route around them.

The facets. Instead of a hierarchy, RFC 3234 describes each middlebox by eight facets: the protocol layer it acts at; whether it is explicit in the protocol's design or an implicit add-on; single or multiple hops; in-line or call-out; functional (the session cannot run without it) or merely optimizing; routing or processing; hard state (the session fails if the box loses its memory) or soft state; and, for hard state, failover to a copy or restart. A stateful firewall, in its terms, is an implicit, in-line, hard-state box: when it forgets a connection, the connection dies.

How many there are. Middleboxes are not a corner case. In November 2011 Justine Sherry and Sylvia Ratnasamy of the University of California, Berkeley surveyed 57 enterprise network administrators, mostly from the North American Network Operators' Group (NANOG) operators' group, and reported in a technical report of February 2012 that across all network sizes "the number of middleboxes is on par with the number of routers": the average very large network in their data set had 2,850 layer 3 routers and 1,946 middleboxes, the average small one 7.3 routers and 10.2 middleboxes. Respondents also said that overloads and failures pushed them to overprovision, a cost of hard state that the taxonomy predicts.

How they freeze protocols. In 2011 Michio Honda and colleagues from Keio University, Universitatea Politehnica Bucuresti and University College London asked whether TCP could still be extended. Measuring from 142 networks in 24 countries, they found that it could, but only within narrow limits: middleboxes rewrote initial sequence numbers, removed unknown options, proxied connections and split or coalesced segments, and on port 80 eight of the 20 cellular networks they tested removed new options, six of them by proxying the connection. Any extension, such as the multipath support the authors were working on, has to survive those behaviours. The Internet Architecture Board (IAB) took the problem up at its Stack Evolution in a Middlebox Internet (SEMI) workshop in Zurich on 26 and 27 January 2015 (RFC 7663), and its RFC 8558 (April 2019) draws the conclusion: on-path elements had been reading implicit signals, such as TCP's cleartext state machine, and when endpoints want the path to know something, they should send an explicit signal instead.

The cost. Because middleboxes act on what they can see, they freeze it. RFC 8446, the TLS 1.3 specification (August 2018), records that "a significant number of middleboxes misbehave when a TLS client/server pair negotiates TLS 1.3", and its compatibility mode makes the handshake resemble TLS 1.2 session resumption to get through them; its section 9.3 sets the rules every middlebox must follow, either terminating TLS as a fully compliant client and server or forwarding what it does not understand untouched. RFC 9065 (July 2021) describes the other response: encrypting transport headers "helps avoid transport protocol ossification by middleboxes". Operators set out what they lose when middleboxes can no longer see, from deep packet inspection to caching, in RFC 8404 (July 2018), and RFC 9849, the Encrypted Client Hello standard (March 2026), counts a middlebox that filters on plaintext contents as a passive attacker in its threat model.

What goes wrong in operation. Most middlebox incidents come from state. A stateful box that sees only one direction of an asymmetric path drops what it thinks is unsolicited; a failover pair that does not synchronize its tables cuts every session at switchover; a NAT or firewall timeout shorter than an application's idle period silently breaks long-lived connections; and an inspection device that rejects what it cannot parse turns a new protocol version into an outage, which is why TLS 1.3 and QUIC were designed the way they were. The operational lesson is to know where every middlebox sits on a path, what state it keeps and for how long. Neighbours in this glossary: firewall, stateful firewall, NAT, NAT application-level gateway (ALG), proxy, load balancer, deep packet inspection (DPI), Secure Sockets Layer (SSL) inspection, traffic normalization, wire image and Encrypted Client Hello.

Also known as: middleboxes, network intermediary, intermediary device, dispositivo intermediário

Sources

← Back to M Back to the glossary