# Middlebox

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Middlebox
> Markdown URL: https://mediated.wiki/source/Middlebox.md
> Source: https://en.wikipedia.org/wiki/Middlebox
> Source revision: 1353650447
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{Short description|Intermediary box on the data path between a source host and destination host}}
A '''middlebox''' is a [computer networking](/source/computer_networking) device that transforms, inspects, filters, and manipulates traffic for purposes other than [packet forwarding](/source/packet_forwarding).<ref name=mboxtaxonomy /> Examples of middleboxes include [firewalls](/source/firewall_(networking)), [network address translators](/source/network_address_translation) (NATs), [load balancer](/source/load_balancer)s, and [deep packet inspection](/source/deep_packet_inspection) (DPI) devices.<ref name="dublin">{{cite book |author1=Shan Huang |author2=Steve Uhlig |author3=Félix Cuadrado |title = 2017 Network Traffic Measurement and Analysis Conference (TMA)|date=2017 |pages=1–9 |doi=10.23919/TMA.2017.8002906 |chapter=Middleboxes in the Internet: A HTTP perspective |isbn=978-3-901882-95-1 |s2cid=34925433 }}</ref>

The term ''middlebox'' was coined in 1999 by [UCLA](/source/University_of_California%2C_Los_Angeles) computer science professor [Lixia Zhang](/source/Lixia_Zhang).<ref name="mboxtaxonomy"/><ref name="postel">{{citation|url=http://newsroom.ucla.edu/releases/lixia-zhang-named-to-jonathan-228215|title=Lixia Zhang named to UCLA's Jonathan B. Postel Chair in Computer Science|first=Wileen Wong|last=Kromhout|date=February 2, 2012|journal=UCLA Newsroom|accessdate=2015-06-14|archive-url=https://web.archive.org/web/20190425202848/http://newsroom.ucla.edu/releases/lixia-zhang-named-to-jonathan-228215|archive-date=April 25, 2019|url-status=dead}}</ref>

== Usage ==
Middleboxes are widely deployed across both private and public networks. Dedicated middlebox hardware is widely deployed in enterprise networks to improve network [security](/source/network_security) and performance; however, even home network routers often have integrated firewall, NAT, or other middlebox functionality.<ref name=ciscohomefirewall /> One 2017 study counted more than 1,000 deployments in [autonomous systems](/source/Autonomous_system_(Internet)), in both directions of traffic flows, and across a wide range networks, including mobile operators and data center networks.<ref name="dublin"/>

=== Examples ===
The following are examples of commonly-deployed middleboxes:

* [Firewalls](/source/Firewall_(computing)) filter traffic based on a set of predefined security rules defined by a network administrator. IP firewalls reject packets "based purely on fields in the IP and transport headers (e.g., disallow incoming traffic to certain [port numbers](/source/Port_(computer_networking)), disallow any traffic to certain [subnets](/source/subnetwork) etc.)"<ref name=mboxtaxonomy /> Other types of firewalls may use more complex rulesets, including those that inspect traffic at the session or application layer.<ref name=appfirewall />
* [Intrusion detection system](/source/Intrusion_detection_system)s (IDSs) monitor traffic and collect data for [offline analysis](/source/online_algorithm) for security anomalies. Unlike firewalls, IDSs do not filter packets in real time, as they are capable of more complex inspection and must decide whether to accept or reject each packet as it arrives.<ref name=ids />
* [Network address translators](/source/Network_address_translation) (NATs) replace the source and/or destination IP addresses of packets that traverse them. Typically, NATs are deployed to allow multiple end hosts to share a single [IP address](/source/IP_address): hosts "behind" the NAT are assigned a [private IP address](/source/IP_address) and their packets destined to the public Internet traverse a NAT, which replaces their internal private address with a shared public address.<ref name=nat /> These are widely used by cellular network providers to manage scarce resources.<ref name="cells">{{cite journal |author1=Zhaoguang Wang, Zhiyun Qian, Qiang Xu, [Z. Morley Mao](/source/Z._Morley_Mao), Ming Zhang |title=An Untold Story of Middleboxes in Cellular Networks |journal=ACM SIGCOMM Computer Communication Review |date=August 2011 |volume=41 |issue=4 |pages=374–385 |doi=10.1145/2043164.2018479 |url=https://web.eecs.umich.edu/~zmao/Papers/netpiculet.pdf |publisher=Association for Computing Machinery}}</ref>
* [WAN optimizers](/source/WAN_optimization) improve bandwidth consumption and perceived latency between endpoints. Typically deployed in large enterprises, WAN optimizers are deployed near both sending and receiving endpoints of communication; the devices then coordinate to cache and compress traffic that traverses the Internet.<ref name=wanopt /> 
* [Load balancers](/source/Load_balancing_(computing)) provide one point of entry to a service, but forward traffic flows to one or more hosts that actually provide the service.
* Cellular networks use middleboxes to ensure scarce network resources are used efficiently as well as to protect client devices.

== Criticism and challenges ==
Middleboxes have generated technical challenges for application development and have incurred "scorn" and "dismay" in the network architecture community<ref name="harmful">{{cite journal |author1=Michael Walfish, Jeremy Stribling, Maxwell Krohn, Hari Balakrishnan, Robert Morris, and Scott Shenker |title=Middleboxes No Longer Considered Harmful |journal=6th Symposium on Operating Systems Design and Implementation |date=2004 |pages=215–230 |url=https://www.usenix.org/legacy/event/osdi04/tech/full_papers/walfish/walfish.pdf |publisher=USENIX Association}}</ref> for violating the [end-to-end principle](/source/end-to-end_principle) of computer system design.<ref name=e2eviolate />

=== Application interference ===
Some middleboxes interfere with application functionality, restricting or preventing end host applications from performing properly.

In particular, network address translators (NATs) present a challenge in that NAT devices divide traffic destined to a public IP address across several receivers. When connections between a host on the Internet and a host behind the NAT are initiated by the host behind the NAT, the NAT learns that traffic for that connection belongs to the local host. Thus, when traffic coming from the Internet is destined to the public (shared) address on a particular [port](/source/Port_(computer_networking)), the NAT can direct the traffic to the appropriate host. However, connections initiated by a host on the Internet do not present the NAT any opportunity to "learn" which internal host the connection belongs to. Moreover, the internal host itself may not even know its own public IP address to announce to potential clients what address to connect to. To resolve this issue, several new protocols have been proposed.<ref name=stun /><ref name=natpmp /><ref name=pcp />

Additionally, because middlebox deployments by cell operators such as [AT&T](/source/AT%26T) and [T-Mobile](/source/T-Mobile_US) are opaque, application developers are often "unaware of the middlebox policies enforced by operators", while operators lack full knowledge about application behavior and requirements. For example, one carrier set an "aggressive [timeout](/source/Timeout_(computing)) value to quickly recycle the resources held by inactive [TCP](/source/Transmission_Control_Protocol) connections in the firewall, unexpectedly causing frequent disruptions to long-lived and occasionally idle connections maintained by applications such as [push-based email](/source/Push_email) and [instant messaging](/source/instant_messaging)".<ref name="cells"/>

Other common middlebox-induced application challenges include [web proxies](/source/Proxy_server) serving "stale" or out-of-date content,<ref name=staleproxy /> and firewalls rejecting traffic on desired ports.<ref name=firewallblock />

=== Internet extensibility and design ===
One criticism of middleboxes is they can limit the choice of transport protocols, thus limiting application or service designs. Middleboxes may filter or drop traffic that does not conform to expected behaviors, so new or uncommon protocols or protocol extensions may be filtered out.<ref name=nrg/> Specifically, because middleboxes make hosts in private address realms unable to "pass handles allowing other hosts to communicate with them", they have hindered the spread of newer protocols like the [Session Initiation Protocol](/source/Session_Initiation_Protocol) (SIP) as well as various peer-to-peer systems.<ref name="harmful"/><ref>{{cite journal |author1=Bryan Ford |author2=Pyda Srisuresh |author3=Dan Kegel |title=Peer-to-Peer Communication Across Network Address Translators |journal=2005 USENIX Annual Technical Conference |date=2005 |pages=179–192 |url=https://www.usenix.org/legacy/event/usenix05/tech/general/full_papers/ford/ford.pdf |publisher=USENIX Association|bibcode=2006cs........3074F |arxiv=cs/0603074 }}</ref> This progressive reduction in flexibility has been described as [protocol ossification](/source/protocol_ossification).<ref>{{Cite journal|last1=Papastergiou|first1=Giorgos|last2=Fairhurst|first2=Gorry|last3=Ros|first3=David|last4=Brunstrom|first4=Anna|last5=Grinnemo|first5=Karl-Johan|last6=Hurtig|first6=Per|last7=Khademi|first7=Naeem|last8=Tuxen|first8=Michael|last9=Welzl|first9=Michael|last10=Damjanovic|first10=Dragana|last11=Mangiante|first11=Simone|date=2017|title=De-Ossifying the Internet Transport Layer: A Survey and Future Perspectives|journal=IEEE Communications Surveys & Tutorials|volume=19|issue=1|pages=619–639|doi=10.1109/COMST.2016.2626780|issn=1553-877X|hdl=2164/8317|s2cid=1846371|hdl-access=free}}</ref><ref>{{Cite web|url=https://lwn.net/Articles/745590/|title=QUIC as a solution to protocol ossification|website=lwn.net|access-date=2020-03-14|first=Jonathan|last=Corbet|date=January 29, 2018}}</ref>

Conversely, some middleboxes can assist in protocol deployment by providing a translation between new and old protocols. For example, [IPv6](/source/IPv6) can be deployed on public endpoints such as [load balancers](/source/Load_balancing_(computing)), proxies, or other forms of NAT, with backend traffic routed over [IPv4](/source/IPv4) or [IPv6](/source/IPv6).

== See also ==

* [End-to-end connectivity](/source/End-to-end_connectivity)
* [Interactive Connectivity Establishment](/source/Interactive_Connectivity_Establishment) (ICE)
* [Session Traversal Utilities for NAT](/source/Session_Traversal_Utilities_for_NAT) (STUN)
* [Traversal Using Relay NAT](/source/Traversal_Using_Relay_NAT) (TURN)
* [Multilayer switch](/source/Multilayer_switch)

== References ==
{{Reflist|30em|refs=<ref name=ciscohomefirewall>{{cite web|last=Ido Dubrawsky and Wes Noonan|title=Broadband Routers and Firewalls|url=http://www.ciscopress.com/articles/article.asp?p=598649&seqNum=5|publisher=CISCO Press|accessdate=15 July 2012}}</ref>

<ref name=mboxtaxonomy>{{cite journal|author=Brian Carpenter |title=Middleboxes: Taxonomy and Issues|newspaper=Ietf Datatracker |year=2002 |doi=10.17487/RFC3234 |url= https://tools.ietf.org/html/rfc3234|rfc=3234|author-link=Brian Carpenter (Internet engineer)}}</ref>

<ref name=appfirewall>{{cite web|last=Magalhaes|first=Ricky|title=The Difference Between Application and Session Layer Firewalls|url=http://www.windowsecurity.com/articles/difference-between-application-session-layer-firewalls.html|accessdate=17 July 2012}}</ref>

<ref name=ids>{{cite web|title=Understanding Intrusion Detection Systems|url=http://www.sans.org/reading_room/whitepapers/detection/understanding-intrusion-detection-systems_337|accessdate=17 July 2012}}</ref>

<ref name=nat>{{cite journal|last=K. Egevang and P. Francis|title=The IP Network Address Translator (NAT)|newspaper=Ietf Datatracker |year=2001 |doi=10.17487/RFC3022 |url = https://tools.ietf.org/html/rfc3022|rfc=1631}}</ref>

<ref name=wanopt>{{cite web|last=Poe|first=Robert|title=What Is WAN Optimization, and How Can It Help You?|url=http://www.comparebusinessproducts.com/briefs/what-wan-optimization-and-how-can-it-help-you|accessdate=17 July 2012}}</ref>

<ref name=stun>{{cite journal|last=J. Rosenberg|url = https://tools.ietf.org/html/rfc5389 |title=Session Traversal Utilities for NAT (STUN)|newspaper = Ietf Datatracker |year = 2008 |doi = 10.17487/RFC5389 |rfc=5389|s2cid = 6777753 |display-authors=etal|doi-access = free }}</ref>

<ref name=e2eviolate>{{cite journal|last=Walfish|title=Middleboxes no longer considered harmful|journal=OSDI|year=2004|url=http://static.usenix.org/event/osdi04/tech/full_papers/walfish/walfish.pdf|accessdate=17 July 2012|display-authors=etal}}</ref>

<ref name=pcp>{{cite web|title=Port Control Protocol Working Group|url=http://datatracker.ietf.org/wg/pcp/charter/|accessdate=17 July 2012}}</ref>

<ref name=natpmp>{{cite news|title=NAT-PMP|newspaper=Ietf Datatracker |url=http://tools.ietf.org/html/draft-cheshire-nat-pmp-03|accessdate=17 July 2012}}</ref>

<ref name=staleproxy>{{cite web|title=BlueCoat Knowledge Base: Proxy is displaying stale content|url=https://kb.bluecoat.com/index?page=content&id=KB3286|accessdate=17 July 2012}}</ref>

<ref name=firewallblock>{{cite web|title=Using FaceTime and iMessage behind a firewall|url=http://support.apple.com/kb/HT4245|accessdate=17 July 2012}}</ref>

<ref name=nrg>{{cite journal|last=Honda|title=Is it still possible to extend TCP?|journal=Internet Measurement Conference|year=2011|url=http://conferences.sigcomm.org/imc/2011/docs/p181.pdf|display-authors=etal}}</ref>
}}

Category:Computer network security
Category:1990s neologisms

---
Adapted from the Wikipedia article [Middlebox](https://en.wikipedia.org/wiki/Middlebox) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Middlebox?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
