Network Working Group                                       P. Srisuresh
INTERNET-DRAFT                                          Jasmine Networks
Expires as of December 13, 2001                                J. Kuthan
                                                               GMD Fokus
                                                            J. Rosenberg
                                                             Dynamicsoft
                                                              A. Molitor
                                                     Aravox Technologies
                                                               A. Rayhan
                                                              Consultant
                                                              June, 2001


          Middlebox Communication Architecture and framework
                <draft-ietf-midcom-framework-02.txt>

Status of this Memo

   This document is an Internet-Draft and is in full conformance with
   all provisions of Section 10 of RFC2026.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF), its areas, and its working groups.  Note that
   other groups may also distribute working documents as Internet-
   Drafts.

   Internet-Drafts are draft documents valid for a maximum of six
   months and may be updated, replaced, or obsoleted by other documents
   at any time.  It is inappropriate to use Internet- Drafts as
   reference material or to cite them other than as "work in progress."

   The list of current Internet-Drafts can be accessed at
   http://www.ietf.org/ietf/1id-abstracts.txt

   The list of Internet-Draft Shadow Directories can be accessed at
   http://www.ietf.org/shadow.html.


Abstract

   There are a variety of intermediate devices in the Internet today
   that require application intelligence for their operation.
   Datagrams pertaining to real-time streaming applications such
   as SIP and H.323 and peer-to-peer applications such as Napster
   and NetMeeting cannot be identified by merely examining packet
   headers. Middleboxes implementing Firewall and Network Address
   Translator services typically embed application intelligence



Srisuresh et al.                                                [Page 1]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


   within the device for their operation. The document specifies an
   architecture and framework in which trusted third parties can
   be delegated to assist the middleboxes to perform their operation
   without resorting to embedding application intelligence. Doing
   this will allow a middlebox to continue to provide the services,
   while keeping the middlebox application agnostic. A principal
   objective of this document is to enable complex applications
   through the middleboxes seamlessly using a trusted third party.


1. Introduction

   Intermediate devices requiring application intelligence are the
   subject of this document. These devices are referred as
   middleboxes throughout the document. Many of these devices enforce
   application specific policy based functions such as packet
   filtering, differentiated Quality of Service, tunneling, Intrusion
   detection, security and so forth. Network Address Translator
   service, on the other hand, provides routing transparency across
   address realms (within IPv4 routing network or across V4 and V6
   routing realms). Application Level gateways (ALGs) are used in
   conjunction with NAT to provide end-to-end transparency for many of
   the applications. There may be other types of services requiring
   embedding application intelligence in middleboxes for their
   operation. The discussion scope of this document is however limited
   to middleboxes implementing Firewall and NAT services only.
   Nonetheless, the middlebox framework is designed to be extensible
   to support the deployment of new services.

   Tight coupling of application intelligence with middleboxes makes
   maintenance of middleboxes hard with the advent of new applications.
   Built-in application awareness typically requires updates of
   operating systems with new applications or newer versions of
   existing applications. Operators requiring support for newer
   applications will not be able to use third party software/hardware
   specific to the application and are at the mercy of their
   middlebox vendor to make the necessary upgrade. Further, embedding
   intelligence for a large number of application protocols within
   the same middlebox increases complexity of the middlebox and is
   likely to be error prone and degrade in performance.

   This document describes a framework in which application
   intelligence can be moved from middleboxes into external MIDCOM
   agents. The premise of the framework is to devise a MIDCOM
   protocol that is application independent, so the middleboxes
   can stay focused on services such firewall and NAT. MIDCOM
   agents with application intelligence can, in turn, assist the
   middleboxes through the MIDCOM protocol in permitting applications



Srisuresh et al.                                                [Page 2]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


   such as FTP, SIP and H.323. The communication between a MIDCOM
   agent and a middlebox will be transparent to the end-hosts that
   take part in the application, unless one of the end-hosts assumes
   the role of a MIDCOM agent. Discovery of middleboxes in the path
   of an application instance and communication amongst middleboxes
   is outside the scope of this document.

   This document describes the framework in which middlebox
   communication takes place and the various elements that constitute
   the framework. Section 2 describes the terms used in the document.
   Section 3 defines the architectural framework of a middlebox for
   communication with MIDCOM agents. The remaining sections cover the
   components of the framework, illustration using sample flows and
   operational considerations with the MIDCOM architecture. Section 4
   describes the nature of MIDCOM protocol. Section 5 identifies
   entities that could potentially host the MIDCOM agent function.
   Section 6 considers the role of Policy server and its function
   with regard to communicating MIDCOM agent authorization policies.
   Sections 7 and 8 are illustration of MIDCOM framework with sample
   flows using In-Path and out-of-path agents respectively. Section 9
   addresses operational considerations in deploying a protocol
   adhering to the framework described here. Section 10 is an
   applicability statement, scoping the location of middleboxes.
   Section 12 outlines security considerations for the middlebox
   in view of the MIDCOM framework.


2. Terminology

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALLNOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED",  "MAY", and "OPTIONAL" in
   this document are to be interpreted as described in RFC 2119.
   Below are the definitions for the terms used throughout the
   document.

2.1. MiddleBox function/service

   A middlebox function or a middlebox service is an operation or
   method performed on a network intermediary that requires application
   specific intelligence for its operation. Policy based packet
   filtering (a.k.a. firewall), Network address translation (NAT),
   Intrusion detection, Load balancing, Policy based tunneling and
   IPsec security are all examples of a middlebox function (or
   service).

2.2. MiddleBox

   Middlebox is a network intermediate device that implements one or



Srisuresh et al.                                                [Page 3]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


   more of the middlebox services. A NAT middlebox is a middlebox
   implementing NAT service. A firewall middlebox is a middlebox
   implementing firewall service.

2.3. Firewall

   Firewall is a policy based packet filtering Middlebox function,
   typically used for restricting access to/from specific devices and
   applications. The policies are often termed Access Control
   Lists (ACLs).

2.4. NAT

   Network Address Translation is a method by which IP addresses are
   mapped from one address realm to another, providing transparent
   routing to end-hosts. This is achieved by modifying end node
   addresses en-route and maintaining state for these updates so
   that datagrams pertaining to a session are forwarded to the right
   end-host in either realm. Refer [NAT-TERM] for the definition of
   various NAT types and the associated terms in use.

   The term NAT in this document is very similar to the IPv4 NAT
   described in [NAT-TERM], but is extended beyond IPv4 networks
   to include the IPv4-v6 NAT-PT described in [NAT-PT]. While the
   IPv4 NAT [NAT-TERM] translates one IPv4 address into another IPv4
   address to  provide routing between private V4 and external V4
   address realms, IPv4-v6 NAT-PT [NAT-PT] translates an IPv4 address
   into an IPv6 address and vice versa to provide routing between a
   V6 address realm and an external V4 address realm.

   Unless specified otherwise, NAT in this document is a middlebox
   function referring to both IPv4 NAT as well as IPv4-v6 NAT-PT.

2.5. Proxy

   A proxy is an intermediate relay agent between clients and servers
   of an application, relaying application messages between the two.
   Proxies use special protocol mechanisms to communicate with proxy
   clients and relay client data to servers and vice versa. A Proxy
   terminates sessions with both the client and the server, acting as
   server to the end-host client and as client to the end-host server.

   Applications such as FTP, SIP and RTSP use a control connection to
   establish data sessions. These control and data sessions can take
   divergent paths. While a proxy can intercept both the control and
   data connections, it might intercept only the control connection.
   This is often the case with real-time streaming applications such
   as SIP and RTSP.



Srisuresh et al.                                                [Page 4]


Internet-Draft       MIDCOM Architecture & Framework           June 2001



2.6. ALG

   Application Level Gateways (ALGs) are agents that possess the
   application specific intelligence and knowledge of an associated
   middlebox function. An ALG examines application traffic in transit
   and assists middlebox in carrying out its function.

   An ALG may be co-resident with a middlebox or reside externally,
   communicating through a middlebox communication protocol. It
   interacts with a middlebox to set up state, access control
   filters, use middlebox state information, modify application
   specific payload or perform whatever else is necessary to enable
   the application to run through the middlebox.

   ALGs are different from proxies. ALGs are transparent to
   end-hosts, unlike the proxies which are relay agents terminating
   sessions with both end-hosts. ALGs do not terminate session with
   either end-host. Instead, ALGs examine and optionally modify
   application payload content to facilitate the flow of application
   traffic through a middlebox. ALGs are middlebox centric, in that
   they assist the middleboxes in carrying out their function.
   Whereas, the proxies act as focal point for application servers,
   relaying traffic between application clients and servers.

   ALGs are similar to Proxies, in that, both ALGs and proxies
   facilitate Application specific communication between clients
   and servers.

2.7. End-Hosts

   End-hosts are entities that are party to a networked application
   instance. End-hosts referred in this document are specifically
   those terminating Real-time streaming Voice-over-IP
   applications such as SIP and H.323 and peer-to-peer applications
   such as Napster and NetMeeting.

2.8. MIDCOM Agents

   MIDCOM agents are entities performing ALG function, logically
   external to a middlebox. MIDCOM agents possess a combination of
   application awareness and knowledge of the middlebox function.
   A MIDCOM agent may communicate with one or more middleboxes.

   MIDCOM agents may be located either In-Path or Out-of-path of
   an application instance. In-Path MIDCOM agents are those in
   which the MIDCOM agent function is co-resident on devices that
   are naturally within the message path of the application they



Srisuresh et al.                                                [Page 5]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


   are associated with. This may be an application proxy, gateway,
   or in the extreme case, one of  the end-hosts, that is party to
   the application. Out-of-Path (OOP) MIDCOM agents are those that
   are not necessarily resident (or co-resident) on entities that
   are natively in the path of application flows.

2.9. Policy Server

   Policy Server is a management entity that acts in advisory
   capacity and interfaces with a middlebox to communicate policies
   concerning authorization of MIDCOM agents gaining access to
   middlebox resources. A MIDCOM agent may be pre-configured on a
   middlebox. In the case where a MIDCOM agent is not pre-configured,
   the middlebox will consult Policy Server out-of-band and obtain
   the agent profile to validate connection setup and authorization
   of the agent to gain access to middlebox resources. Once an agent
   is connected to the middlebox, the policy server may at anytime
   notify the middlebox to terminate authorization for the agent.

   The protocol facilitating the communication between a middlebox
   and Policy Server need not be part of MIDCOM protocol. Section 6
   in the document addresses the Policy server interface and protocol
   framework independent of the MIDCOM framework.

   Application specific policy data and policy interface between an
   agent or application endpoint and a policy server is out of scope
   for this document. The Policy server issues addressed in the
   document are focussed at an aggregate domain level as befitting
   the middlebox. For example, a SIP midcom agent may choose to
   query a policy server for the administrative (or corporate)
   domain to find whether a certain user is allowed to make an
   outgoing call. This type of application specific policy data, as
   befitting an end user is out of bounds for the Policy server
   considered in this document. It is within bounds however for the
   middlebox policy server to specify the specific end-user
   applications (or tuples) for which an agent is permitted to be
   an ALG.

2.10. Middlebox Communication (MIDCOM) protocol

   The protocol between a MIDCOM agent and a middlebox that allows
   the MIDCOM agent to gain access to middlebox resources and
   allows the middlebox to delegate application specific processing
   to MIDCOM agent. The MIDCOM protocol allows the middlebox to
   perform its operation with the aid of MIDCOM agents, without
   resorting to embedding application intelligence. The principal
   motivation behind architecting this protocol is to enable complex
   applications through middleboxes seamlessly using a trusted third



Srisuresh et al.                                                [Page 6]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


   party, i.e., a MIDCOM agent.

   This is a protocol yet to be devised.


3.0 Architectural framework for Middleboxes

   A middlebox may implement one or more of the middlebox functions
   selectively on multiple interfaces of the device. There can be a
   variety of MIDCOM agents interfacing with the middlebox to
   communicate with one or more of the middlebox functions on an
   interface. As such, the Middlebox communication protocol MUST
   allow for selective communication between a specific MIDCOM agent
   and one or more middlebox functions on the interface. The following
   diagram identifies a possible layering of the service supported
   by a middlebox and a list of MIDCOM agents that might interact
   with it.

       +---------------+  +--------------+  +-------------+
       | MIDCOM agent  |  | MIDCOM agent |  | Stand-alone |
       | co-resident on|  | co-resident  |  | MIDCOM agent|
       | Proxy Server  |  | on Appl. GW  |  | (OOP Agent) |
       +---------------+  +--------------+  +-------------+
                      ^        ^             ^
                      |        |             |          +--------+
                      |        |   MIDCOM    |          | Policy |
                      |        |   Protocol  |        +-| Server |
                      |        |             |       /  +--------+
   +-------------+    |        |             |      /
   | MIDCOM agent|    |        |             |     /
   | co-resident |    |        |             |    /
   | on End-hosts|<-+ |        |             |   /
   +-------------+  | |        |             |  |
                    v v        v             v  v
              +-------------------------------------------+
              |  Middlebox Communication      |Policy     |
              |  Protocol (MIDCOM) Interface  |Interface  |
              +----------+--------+-----------+-----------+
   Middlebox  |          |        |           |           |
   Functions  | Firewall |  NAT   | DiffServ- | Intrusion |
              |          |        |     QOS   | Detection |
              +----------+--------+-----------+-----------+
   Middlebox  | Firewall ACLs, Session-descriptors,       |
   Managed    | NAT-BINDs, NAT Address-Maps and other     |
   Resources  | Middlebox function specific attributes    |
              +-------------------------------------------+

     Figure 1: MIDCOM agents interfacing with a middlebox



Srisuresh et al.                                                [Page 7]


Internet-Draft       MIDCOM Architecture & Framework           June 2001




   Resources such as a Session-Descriptor may be shared across
   middlebox functions. A Session-Descriptor may uniquely identify
   a session denoted by the tuple of (SessionDirection,
   SourceAddress, DestinationAddress, Protocol, SourcePort,
   DestinationPort). An aggregated Session-Descriptor, on the other
   hand, may have one of the tuple elements denoted by a regular
   expression (ex: Any source port). The attributes associated
   with a Session-Descriptor may be specific to the individual
   middlebox function. As Session-Descriptors may be shared across
   middlebox functions, a Session-Descriptor may be created by a
   function, and terminated by a different function. For example, a
   session-descriptor may be created by the firewall function, but
   terminated by the NAT function, when a session timer expires.

   A middlebox may also have function specific resources such as
   Address maps and Address binds to enforce NAT function and
   application based policies to enforce firewall function.
   Application specific MIDCOM agents (co-resident on the middlebox
   or external to the middlebox) would examine the IP datagrams and
   help identify the application the datagram belongs to and assist
   the middlebox in performing functions unique to the application
   and the middlebox service. For example, a MIDCOM agent assisting
   a NAT middlebox might perform payload translations; whereas a
   MIDCOM agent assisting a firewall middlebox might request the
   firewall to permit access to application specific dynamically
   generated session traffic.


4. MIDCOM Protocol

   The MIDCOM protocol between a MIDCOM agent and a middlebox allows
   the MIDCOM agent to gain access to middlebox resources and
   allows the middlebox to delegate application specific processing
   to MIDCOM agent. The protocol will allow MIDCOM agents to signal
   the middleboxes to let complex applications using dynamic port
   based sessions through them (i.e., middleboxes) seamlessly.

   It is important to note that an agent and a middlebox can be on
   the same physical device. In such a case, it is not desirable
   for them to communicate using MIDCOM protocol. They may communicate
   using a MIDCOM protocol message formats, but using a non-IP based
   transport such as IPC messaging (or) they may communicate using a
   well-defined API/DLL (or) the application intelligence is fully
   embedded into the middlebox service (as it is done today in many
   stateful inspection firewall devices and NAT devices).




Srisuresh et al.                                                [Page 8]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


   The MIDCOM protocol will consist of a connection setup phase,
   run-time connection phase and a connection termination phase.

   Connection setup must be preceded by registration of the
   MIDCOM agent with either the middlebox or the Policy Server.
   The MIDCOM agent access and authorization profile may either
   be pre-configured on the middlebox (or) listed on a Policy
   Server the middlebox is configured to consult. MIDCOM is a
   peer-to-peer protocol. As such, either the agent or the
   middlebox may choose to initiate the connection.

   A MIDCOM session may be terminated by either of the parties.
   Alternately, a MIDCOM session termination may be triggered by
   one of (a) agent going out of service and not being available
   for further MIDCOM operations, or (b) a policy server notifying
   the middlebox that a particular MIDCOM agent is no longer
   authorized for a particular set of sessions any longer.

   The MIDCOM protocol data exchanged during run-time is governed
   principally by the middlebox services the protocol supports.
   Firewall and NAT middlebox services are considered in this
   document. Nonetheless, the MIDCOM framework is designed to
   be extensible to support deployment of other services as well.

   Few of the middlebox services are stateless. There are many that
   are stateful and maintain per-connection state in the system.
   Firewall service may be implemented as a stateless list of ACLs.
   Many firewall implementations, however, are stateful. NAT
   service, on the other hand, is inherently stateful. As such,
   support of the MIDCOM protocol will require a middlebox to be
   stateful. Here is why.

   Let us consider the case of a middlebox implementing firewall
   service. With the advent of MIDCOM protocol, the middlebox is
   required to allocate dynamic resources, such as pin-holes,
   upon request from agents. Explicit release of dynamically
   allocated resources happens when the application session is
   ended or when a Midcom agent requests the middlebox to release
   the resource. However, the middlebox must be able to recover the
   dynamically allocated resources at some point in time even if
   the agent that was responsible for the dynamic allocation is not
   alive. Typically, this is done by tracking the state of each
   dynamically allocated pin-hole with some type of a timer.
   This goes to show that even the firewall function will need to
   maintain per-connection state, as a requirement to support the
   MIDCOM protocol.





Srisuresh et al.                                                [Page 9]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


5.0. MIDCOM Agents

   MIDCOM agents are logical entities which may reside physically
   on nodes external to a middlebox, possessing a combination of
   application awareness and knowledge of middlebox function. A
   MIDCOM agent may communicate with one or more middleboxes. The
   issues of middleboxes discovering agents or vice versa are
   outside the scope of this document. The focus of the document
   is the framework in which a MIDCOM agent communicates with a
   middlebox using MIDCOM protocol, which is yet to be devised.

   We will examine two types of MIDCOM agents in the following
   sub-sections.

5.1. In-path MIDCOM agents

   In-Path MIDCOM agents are entities that have a native role in the
   path of the application traversal (with prior knowledge to one of
   the application end-hosts), independent of their MIDCOM function.
   Bundled session applications such as H.323, SIP and RTSP which
   have separate control and data sessions may have their
   sessions take divergent paths. In those scenarios, In-Path MIDCOM
   agents are those that find themselves in the control path.
   In majority of cases, a middlebox will likely require the
   assistance of a single agent for an application in the control
   path alone. However, it is possible that a middlebox function
   might require the intervention of more than a single MIDCOM
   agent for the same application, one for each sub-session of the
   application.

   Application Proxies and gateways are a good choice for In-Path
   MIDCOM agents, as these entities, by definition, are in the path
   of an application between a client and server. In addition to
   hosting the MIDCOM agent function, these natively in-path
   application specific entities may also enforce
   application-specific choices locally, such as dropping messages
   infected with known viruses, or lacking user authentication.
   These entities can be interjecting both the control and data
   connections. For example, FTP control and Data sessions are
   interjected by an FTP proxy server. However, proxies may also be
   interjecting just the control connection and not the data
   connections, as is the case with real-time streaming applications
   such as SIP and RTSP. Note, applications may not always traverse
   a proxy and some applications may not have a proxy server
   available.

   SIP proxies and H.323 gatekeepers may be used to host MIDCOM
   agent function to control middleboxes implementing firewall and



Srisuresh et al.                                               [Page 10]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


   NAT functions. The advantage of using in-path entities as opposed
   to creating an entirely new agent is that the in-path entities
   already possess application intelligence. You will need to merely
   enable the use of MIDCOM protocol to be an effective MIDCOM
   agent. Figure 2 below illustrates a scenario where the in-path
   MIDCOM agents interface with the middlebox. Let us say, the
   policy Server has pre-configured the in-path proxies as trusted
   MIDCOM agents on the middlebox and the packet filter
   implements 'default-deny' packet filtering policy. Proxies use
   their application-awareness knowledge to control the firewall
   function and selectively permit a certain number of voice stream
   sessions dynamically using MIDCOM protocol.

   In the illustration below, the proxies and the policy server are
   shown inside a private domain. The intent however is not to imply
   that they be inside the private boundary alone. The proxies may
   also reside external to the domain. The only requirement is that
   there be a trust relationship with the middlebox.

































Srisuresh et al.                                               [Page 11]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


                           +-----------+
                           | Middlebox |
                           | Policy    |
                           | Server    |~~~~~~~~~~~~~|
                           +-----------+              \
                                                       \
                    +--------+                          \
                    | SIP    |___                        \
            ________| Proxy  |   \            Middlebox   \
           /        +--------+..  |        +--------------------+
          |                    :  | MIDCOM |           |        |
          |  RSTP +---------+  :..|........| MIDCOM    | POLICY |
      SIP |   ____|  RSTP   |.....|........| PROTOCOL  | INTER- |
          |  /    |  Proxy  |___  |        | INTERFACE | FACE   |
          | |     +---------+   \  \       |--------------------|
          | |                     \  \-----|                    |
          | |                      \-------|                    |
          | |                           ---|     FIREWALL       |-->--
         +-----------+                 /---|                    |--<--
        +-----------+|  Data streams  //   +--------------------+
       +-----------+||---------->----//            |
       |end-hosts  ||-----------<-----             .
       +-----------+   (RTP, RSTP data, etc.)      |
                                                   .  Outside the
              Within a private domain              |  private domain

       Legend: ---- Application data path datagrams
               ____ Application control path datagrams
               .... Middlebox Communication Protocol (MIDCOM)
               ~~~~ MIDCOM Policy Server Interface
                 |
                 .  private domain Boundary
                 |


       Figure 2: In-Path MIDCOM Agents for Middlebox Communication



5.1.1. End-hosts as In-Path MIDCOM agents

   End-hosts are another variation of In-Path MIDCOM agents. Unlike
   Proxies, End-hosts are direct party to the application and
   possess all the end-to-end application intelligence there is to
   it. End-hosts terminate both the control and data paths of an
   application. Unlike other entities hosting MIDCOM agents, end-host
   is able to process secure datagrams. However, the problem
   would be one of manageability - upgrading all the end-hosts



Srisuresh et al.                                               [Page 12]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


   running a specific application.

5.2. Out-of-Path MIDCOM agents

   Out-of-Path MIDCOM agents (a.k.a. OOP agents) are entities that
   are not natively in the transport path of an application.
   OOP Agents have a role in the application traversal, only by
   virtue of their MIDCOM function. No native role otherwise. It
   would be safe to assume that OOP agents are not in the path
   of application traversal. Out-of-Path agents have a few
   benefits. Out-of-Path agents can be implemented in a system,
   independent of any pre-existing application-aware entity. Unlike
   In-path agents, there are no topological restrictions to where
   the agents can be located. Further, multiple application
   specific agents can be grouped together on the same node.

   There is however a significant difference between in-path MIDCOM
   agents and Out-of-path MIDCOM agents in the way the middlebox
   directs application specific traffic for processing by the
   agents. During connection establishment, an agent would identify
   itself as either In-Path or Out-Of-Path(OOP) to the middlebox.
   When an agent is naturally in the transport path of the
   application (as is the case with an In-Path MIDCOM agent), there
   is no additional effort required of the middlebox in redirecting
   the application traffic. The middlebox cannot assume the same
   with an OOP agent and hence will need to explicitly redirect
   datagrams to the agent. The out-of-path MIDCOM agent should in
   turn be capable of returning the processed traffic to the
   middlebox point of origin or forwarding to the destination.

   In essence, a middlebox provides to an Out-of-Path MIDCOM agent
   the ability to transparently "snoop" and modify the control
   traffic. It is reasonable to further classify Out-of-Path agents
   into those which modify control traffic, and those which do not.
   For example, if an Out-of-Path agent is used simply to manage
   firewall policy for SIP-based telephony, it is enough to simply
   forward SIP messages to the agent for examination. On the
   other hand, if the agent must also manage NAT bindings, the
   agent needs to modify the SIP messages, and re-inject them into
   the control path.

   In order to support Out-of-Path agents, the middlebox will require
   an additional "Datagram Diverter" functional component. This
   function is strictly to support the Out-of-path MIDCOM agents and
   is independent of any middlebox service or application. Such a
   Datagram diverter function is also independent of the MIDCOM
   protocol, per se. The diverter function on the middlebox would be
   required to do the following.



Srisuresh et al.                                               [Page 13]


Internet-Draft       MIDCOM Architecture & Framework           June 2001



   1. When a datagram is received by the middlebox, the middlebox
      will subject the datagram to the standard middlebox services as
      appropriate. However, if the datagram is designated for diversion
      (i.e., the application specific MIDCOM agent is registered as
      OOP), the middlebox will redirect the datagram to the diversion
      target.

      The datagram will have been directed to an application specific
      payload processing entity. As such, this may be accomplished using
      some type of tunneling mechanism (or) Remote procedure Call (RPC)
      (or) some other proprietary mechanism.

   2. The recipient of the diverted datagram (i.e., the OOP agent) will
      snoop and optionally modify the payload (as appropriate to the
      middlebox service) and does one of the following. Of these, the
      safe thing to assume would be the first option.

           (a) Send the processed datagram right back to the middlebox
               using the same diversion approach the middlebox used.
                              (or)
           (b) Forward the datagram to the appropriate destination
               (i.e., one of the end-hosts that is party to the
               application). This assumes that the OOP agent has
               routing/forwarding capability.

   3. When the middlebox receives a diverted (i.e., co-processed)
      datagram from the OOP agent, the middlebox will simply forward
      the processed datagram to the appropriate destination (i.e., one
      of the end-hosts that is party to the application). Note, the
      middlebox will not subject the datagram to any of the middlebox
      services (i.e., NAT or firewall) this time around.

   Note, Step 2a followed by step 3 would be same as going with
   step 2b by itself. Below is an illustration of a scenario where
   Out-of-path MIDCOM agents interface with the middlebox. The
   middlebox is assumed to implement firewall service on it. Let us
   say, the Out-of-path agents are pre-configured as trusted MIDCOM
   agents on the middlebox and the packet filter implements
   'default-deny' packet filtering policy. The OOP agents register
   themselves as the diversion traffic targets for the applications
   they support. They snoop the payload of the diverted traffic and
   use application-awareness knowledge to control the firewall
   function and selectively permit a certain number of FTP or voice
   stream sessions dynamically using the MIDCOM protocol.






Srisuresh et al.                                               [Page 14]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


             +---------+   Snooped ftp-control traffic
             | FTP OOP |============>=============================\
             |   Agent |++++++++++++<++++++++++++++++++++++++++++ ||
             |         |   Diverted ftp-control traffic         + ||
             +---------+                                        + ||
                 :                                              + ||
                 :     +----------+  Snooped SIP traffic        + ||
                 :     | SIP OOP  |=========>===============\   + ||
                 :     |   Agent  |+++++++++<++++++++++++++ ||  + ||
                 :     |          |  Diverted SIP traffic + ||  + ||
                 :     +----------+                       + ||  + ||
                 :       :                                + ||  + ||
                 :       :   +-----------+                + ||  + ||
                 :       :   | Middlebox |                + ||  + ||
                 :       :   | Policy    |~~~~~|          + ||  + ||
                 :       :   | Server    |     \          + ||  + ||
                 :       :   +-----------+      \         + ||  + ||
                 :       :                       \        + ||  + ||
                 :       :..............          \       + ||  + ||
                 :   MIDCOM            :           \      + ||  + ||
                 :.................    :            \     + ||  + ||
                                  :    :             \    + ||  + ||
                                +-----------+-----------+-----------+
                                |           |           |           |
                                | MIDCOM    | POLICY    | DATAGRAM  |
                                | PROTOCOL  | INTERFACE | DIVERSION |
                                | INTERFACE |           | INTERFACE |
       +------------+           +-----------+-----------+-----------+
      +------------+|------>----|             FIREWALL              |->-
     +------------+||------<----|                                   |-<-
     |end-hosts   || Ctrl +Data +-----------------------------------+
     +------------+  (SIP, RTP, FTP-CTRL,           |
                      FTP-Data, etc.)               .
                                                    |
            Within a private domain                 . Outside the
                                                    | private domain

       Legend: ---- Application data & control path datagrams
               .... Middlebox Communication Protocol (MIDCOM)
               ~~~~ MIDCOM Policy Server Interface
               ++++ Control traffic diverted To a MIDCOM agent
               ==== Snooped and optionally modified application specific
                    control traffic returning FROM the Out-of-Path agent
                 |
                 .  private domain Boundary
                 |

       Figure 3: Out-of-Path MIDCOM Agents for Middlebox Communication



Srisuresh et al.                                               [Page 15]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


6.0. Policy Server functions

   The functional decomposition of the MIDCOM architecture assumes
   the existence of a logical entity known as Policy Server,
   responsible for performing authorization and related provisioning
   services for the middlebox as depicted in figure 1. The Policy
   server is a logical entity which may reside physically on a
   middlebox or on a node external to the middlebox. The protocol
   employed for communication between the middlebox and the policy
   server is unrelated to the MIDCOM protocol.

   Agents are pre-registered with a Policy Server for authorization to
   gain access to a middlebox. The policy server maintains a list of
   agents that are authorized to connect to each of the middleboxes the
   policy server supports. The Policy server has no knowledge of
   middlebox service and as such cannot help a middlebox with any of
   the middlebox services and the resource authorization.

   The policy server acts in an advisory capacity to a middlebox to
   authorize or terminate authorization for an agent to gain
   connectivity to the middlebox. The primary objective of a policy
   server is to communicate agent authorization information so as to
   ensure that the security and integrity of a middlebox is not
   jeopardized. Specifically, the policy server should associate a
   trust level with each agent attempting to connect to a middlebox
   and provide a security profile. The policy server should be capable
   of addressing cases when end-hosts are agents to the middle-box.

6.1. Authentication, Integrity and Confidentiality

   Host authenticity and individual message security are two distinct
   types of security considerations. Host authentication refers to
   credentials required of a MIDCOM agent to authenticate itself to
   the middlebox and vice versa. When authentication fails, the
   middlebox MUST not process signaling requests received from the
   agent that failed authentication. Two-way authentication should be
   supported. In some cases, the 2-way authentication may be tightly
   linked to the establishment of keys to protect subsequent traffic.
   Two-way authentication is often required to prevent various active
   attacks on the MIDCOM protocol and secure establishment of keying
   material.

   Security services such as authentication, data integrity,
   confidentiality and replay protection may be adapted to secure
   MIDCOM messages in an untrusted domain. Message authentication is
   same as data origin authentication and is an affirmation that the
   sender of the message is who it claims to be. Data integrity means
   the whole truth and nothing but the truth. Confidentiality is



Srisuresh et al.                                               [Page 16]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


   encryption of message with a key so that only those in possession
   of the key can decipher the message content. Lastly, replay
   protection is a form of sequence integrity so when an intruder
   plays back a previously recorded sequence of messages, the
   receiver of the replay messages will simply drop the replay
   messages into bit-bucket. Certain applications of the MIDCOM
   protocol might require support for non-repudiation as an option of
   the data integrity service. Typically, support for non-repudiation
   is required for billing, service level agreements, payment orders,
   and receipts for delivery of service.

   IPsec AH ([IPSEC-AH]) offers data-origin authentication, data
   integrity and protection from message replay. IPsec ESP
   ([IPSEC-ESP]) provides data-origin authentication to a lesser
   degree (same as IPsec AH if the MIDCOM transport protocol turns out
   to be TCP or UDP), message confidentiality, data integrity and
   protection from replay. Besides the IPsec based protocols, there
   are other security options as well. TLS based transport layer
   security is one option. There are also many application-layer
   security mechanisms available. Simple Source-address based
   security is the least form of security in a trusted domain and
   may be permitted to trusted hosts.

   MIDCOM message security shall use existing standards, whenever the
   existing standards satisfy the requirements. Security shall be
   specified to minimize the impact on connections that do not use the
   security option. Security should be designed to avoid introducing
   and to minimize the impact of denial of service attacks. Some
   security mechanisms and algorithms require substantial processing
   or storage, in which case the security protocols should protect
   themselves as well as against possible flooding attacks that
   overwhelm the endpoint (i.e., the middlebox or the agent) with
   such processing. For connection oriented protocols (such as TCP)
   using security services, the security protocol should detect
   premature closure or truncation attacks.


6.2. Registration and deregistration with a middlebox

   Prior to giving MIDCOM agents access to the middlebox resources,
   a registration process MUST take place. Registration is a
   different process than establishing a transport connection.
   The former requires exchanging agent profile information. The
   latter refers to establishing a MIDCOM transport connection and
   exchanging security credentials between an agent and a
   middlebox. The latter uses the information from the former for
   connection establishment.




Srisuresh et al.                                               [Page 17]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


   Profile of a MIDCOM agent includes agent authorization policy (i.e,
   session tuples for which the agent is authorized to act as ALG),
   agent type (e.g., In-path or Out-of-Path), agent accessibility
   profile (including any host level authentication information) and
   security profile (i.e., security requirements for messages
   exchanged between the middlebox and the agent).

   MIDCOM agent profile may be pre-configured on the middlebox while
   provisioning the middlebox function. Either the agent or the
   middlebox can choose to initiate a connection prior to any data
   traffic. Alternately, either party (middlebox or the MIDCOM agent)
   may choose to initiate a connection only upon noticing the
   application specific traffic.

   Coupling MIDCOM agents with the middlebox resources requires
   a means of reflecting that into the resource description table
   of the middlebox. In the case of a firewall, for example, the
   ACL tuple may me altered to reflect the optional ALG presence.
   The revised ACL may look something like the following.

   (<Session-Direction>, <Source-Address>, <Destination-Address>,
   <IP-Protocol>, <Source-Port>, <Destination-Port>, <ALG>)

   The reader should note that this is an illustrative example and
   not necessarily the actual definition of an ACL tuple. The formal
   description of the ACL is yet to be devised. Agent accessibility
   information should also be provisioned. For a  MIDCOM agent,
   accessibility information includes the IP address, trust level,
   host authentication parameters and message authentication
   parameters. Once a connection is established between a middlebox
   and a MIDCOM agent, that connection should be usable with multiple
   instances of the application(s), as appropriate. Note, all of this
   could be captured in an agent profile for ease of management.

   The technique described above is necessary for the pre-registration
   of MIDCOM agents with the middlebox. However, it is possible to
   retain the provisioning on middlebox unchanged, by requiring MIDCOM
   agents to initiate the connection to middlebox. In such a case, the
   agent should initiate the connection prior to the start of the
   application.  If the agent connection is delayed until after the
   application has started, the agent might be unable to process the
   control stream to permit the data connections. When Middlebox notices
   an incoming MIDCOM connection, and the middlebox has no prior profile
   of the MIDCOM agent, the middlebox will consult its Policy Server for
   authenticity, authorization and trust guidelines for the connection.

   At the end of the MIDCOM session, it should be possible for either
   the middlebox or the agent to disconnect. MIDCOM session



Srisuresh et al.                                               [Page 18]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


   disconnection may be prompted by a successful termination or
   failure of some sort.

   It should be possible for the agent to deregister itself from the
   middlebox, which means that the agent is going out of service and
   will not be available for further MIDCOM operations. Alternately,
   a policy server may notify a middlebox that a particular MIDCOM
   agent is no longer authorized for a particular set of sessions
   any longer. Note, Policy Server notifying the middlebox is one of
   many ways by which a middlebox could disconnect an agent.


7.0. MIDCOM Framework Illustration using an In-Path agent

   In figure 3 below, we consider SIP application (Refer [SIP]) to
   illustrate the operation of MIDCOM protocol. Specifically, the
   application assumes a caller, external to a private domain,
   initiates the call. Middlebox is assumed to be located at the
   edge of the private domain. A SIP phone (SIP User Agent
   Client/Server) inside the private domain is capable of receiving
   calls from external SIP phones. The caller uses a SIP Proxy
   node, located external to the private domain, as its outbound
   proxy. No interior proxy is assumed for the callee. Lastly, the
   external SIP proxy node is designated to host the MIDCOM agent
   function.

   Arrows 1 and 4 in the figure below refer to SIP call setup
   exchange between the external SIP phone and the SIP proxy.
   Arrows 6 and 7 refer to SIP call setup exchange between the SIP
   proxy and the interior SIP phone and are assumed to be
   traversing the middlebox. Arrows 2 and 3 below between the SIP
   proxy and the middlebox refer to MIDCOM communication. Na and Nb
   represent RTP/RTCP media traffic (Refer [RTP]) path in the
   external network. Nc and Nd represent media traffic inside the
   private domain.
















Srisuresh et al.                                               [Page 19]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


                          _________
                     --->|   SIP   |<-----\
                    /    |  Proxy  |       \
                   |     |_________|       |
                  1|       |     |        6|
                   |       |     |         |
                   |4      |2    |3        |7
   ______________  |       |     |         |    _____________
   |            |<-/      _v_____^___       \->|            |
   | External   |    Na   |           |   Nc   | SIP Phone  |
   | SIP phone  |>------->| MiddleBox |>------>| within     |
   |            |<-------<|___________|<------<| Pvt. domain|
   |____________|    Nb                   Nd   |____________|

   Figure 4: MIDCOM framework illustration with In-Path SIP Proxy


   As for the SIP application, we make the assumption that the
   middlebox is pre-configured to accept SIP calls into the
   private SIP phone. Specifically, this would imply that the
   middlebox implementing firewall service is pre-configured to
   permit SIP calls (destination TCP or UDP port number set to
   5060) into the private phone. Likewise, middlebox implementing
   NAPT service would have been pre-configured to provide a port
   binding to permit incoming SIP calls to be redirected to the
   specific private SIP phone. I.e., the INVITE from the external
   caller is not made to the private IP address, but to the NAPT
   external address.

   The objective of the MIDCOM agent in the following illustration
   is to merely permit the RTP/RTCP media stream (Refer [RTP])
   through the middlebox, using the MIDCOM protocol architecture
   outlined in the document. RTP/RTCP media stream, When used in
   conjunction with SIP will typically result in two independent
   media sessions - one from the callee to the caller and another
   from the caller to the callee. These media sessions are UDP based
   and will use dynamic ports. The dynamic ports used for the media
   stream are specified in the SDP section (Refer [SDP]) of SIP
   payload message. The MIDCOM agent will parse the SDP section and
   use the MIDCOM protocol to (a) open pinholes (i.e., permit RTP/RTCP
   session tuples) in a middlebox implementing firewall service, or
   (b) create PORT bindings and appropriately modify the SDP content to
   permit the RTP/RTCP streams through a middlebox implementing NAT
   service. The MIDCOM protocol should be sufficiently rich and
   expressive to support the operations described under the timelines.
   The examples do not show the timers maintained by the agent to
   keep the firewall pinholes and NAT session descriptors and BINDs
   from timing out.



Srisuresh et al.                                               [Page 20]


Internet-Draft       MIDCOM Architecture & Framework           June 2001



   Midcom agent Registration and connectivity between the Midcom
   agent and the middlebox are not shown in the interest of
   restricting the focus of the MIDCOM transactions to enabling the
   middlebox to let the media stream through. Policy server is also
   not shown in the diagram below or on the timelines for the same
   reason.

   The following subsections illustrate a typical timeline sequence
   of operations that transpire with the various elements involved
   in a SIP telephony application path. Each subsection is devoted
   to a specific instantiation of a middlebox service - NAPT
   (refer [NAT-TERM], [NAT-TRAD]), firewall and a combination of
   both NAPT and firewall are considered.

7.1. Timeline flow - Middlebox implementing firewall service

   In the following example, we will assume a middlebox implementing
   a firewall service. We further assume that the middlebox is
   pre-configured to permit SIP calls (destination TCP or UDP port
   number set to 5060) into the private phone. The following timeline
   illustrates the operations performed by the MIDCOM agent to permit
   RTP/RTCP media stream through the middlebox.

   The INVITE from the caller (external) is assumed to include the
   SDP payload. You will note that the In-Path agent requests
   the middlebox to permit the Pri-to-ext RTP/RTCP flows before the
   INVITE is relayed to the callee. This is because, in SIP, the
   calling party must be ready to receive the media when it sends
   the INVITE with a session description. If the called party
   (private phone) assumes this and sends "early media" before
   sending the 200 OK response, the firewall will have blocked these
   packets without this initial MIDCOM signaling from the agent.


   SIP Phone      SIP Proxy              Middlebox      SIP Phone
   (External)     (In-Path               (FIREWALL      (private)
                  MIDCOM agent)          Service)          |
   |                 |                      |              |
   |----INVITE------>|                      |              |
   |                 |                      |              |
   |              Identify end-2-end        |              |
   |              parameters (from Caller's |              |
   |              SDP) for the pri-to-Ext   |              |
   |              RTP & RTCP sessions.      |              |
   |              (RTP1, RTCP1)             |              |
   |                 |                      |              |
   |                 |+Permit RTP1, RTCP1 +>|              |



Srisuresh et al.                                               [Page 21]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


   |                 |<+RTP1, RTCP1 OKed++++|              |
   |                 |                      |              |
   |                 |--------INVITE---------------------->|
   |<---100Trying----|                      |              |
   |                 |                      |              |
   |                 |<-----180 Ringing--------------------|
   |<--180Ringing----|                      |              |
   |                 |<-------200 OK-----------------------|
   |                 |                      |              |
   |              Identify end-2-end        |              |
   |              parameters (from callee's  |              |
   |              SDP) for the Ext-to-Pri   |              |
   |              RTP and RTCP sessions.    |              |
   |              (RTP2, RTCP2)             |              |
   |                 |                      |              |
   |                 |+Permit RTP2, RTCP2 +>|              |
   |                 |<+RTP2, RTCP2 OKed++++|              |
   |                 |                      |              |
   |<---200 OK ------|                      |              |
   |-------ACK------>|                      |              |
   |                 |-----------ACK---------------------->|
   |                 |                      |              |
   |<===================RTP/RTCP==========================>|
   |                 |                      |              |
   |-------BYE------>|                      |              |
   |                 |--------------------------BYE------->|
   |                 |                      |              |
   |                 |<----------200 OK--------------------|
   |                 |                      |              |
   |                 |++Cancel permits to   |              |
   |                 |  RTP1, RTCP1, RTP2,  |              |
   |                 |  and RTCP2 +++++++++>|              |
   |                 |<+RTP1, RTP2, RTCP1 & |              |
   |                 |  RTCP2 cancelled ++++|              |
   |                 |                      |              |
   |<---200 OK-------|                      |              |
   |                 |                      |              |

      Legend:      ++++    MIDCOM control traffic
                   ----    SIP control traffic
                   ====    RTP/RTCP media traffic


7.2. Timeline flow - Middlebox implementing NAPT service

   In the following example, we will assume a middlebox implementing
   NAPT service. We make the assumption that the middlebox is
   pre-configured to redirect SIP calls to the specific private SIP



Srisuresh et al.                                               [Page 22]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


   phone application. I.e., the INVITE from the external caller is
   not made to the private IP address, but to the NAPT external
   address. Let us say, the external phone's IP address is Ea, NAPT
   middlebox external Address is Ma and the internal SIP phone's
   private address is Pa. SIP calls to the private SIP phone will
   arrive as TCP/UDP sessions with destination address and port set
   to Ma and 5060 respectively. The middlebox will redirect these
   datagrams to the internal SIP phone. The following  timeline
   will illustrate the operations necessary to be performed by the
   MIDCOM agent to permit the RTP/RTCP media stream through the
   middlebox.

   As with the previous example (section 7.1), INVITE from the
   caller (external) is assumed to include the SDP payload.
   You will note that the In-Path agent requests middlebox to create
   NAT session descriptors for the Pri-to-ext RTP/RTCP flows before
   the INVITE is relayed to the private SIP phone (for the same
   reasons as described in section 7.1). If the called party (private
   phone) sends "early media" before sending the 200 OK response, the
   NAPT middlebox will have blocked these packets without the
   initial MIDCOM signaling from the agent. Also, note that after
   the 200 OK is received by the proxy from the private phone,
   the agent requests the middlebox to allocate NAT session
   descriptors for the ext-to-pri RTP2 and RTCP2 flows, such that the
   ports assigned on the Ma for RTP2 and RTCP2 are contiguous. RTCP
   stream does not happen with a non-contiguous port. Lastly, you will
   note that even though each media stream (RTP1, RTCP1, RTP2 and
   RTCP2) is independent, they are all tied to the single SIP
   control session while the NAT session descriptors were being
   created. Finally, when the agent issues a terminate session bundle
   command for the SIP session, the middlebox is assumed to delete all
   associated media stream sessions automagically.

   Unlike firewall, NAT is stateful and strictly session oriented.
   The reader may refer [NAT-FRAMEWORK] for a detailed
   discussion of NAT managed stateful resources, including that of
   NAT session-descriptor and NAT BIND.














Srisuresh et al.                                               [Page 23]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


   SIP Phone      SIP Proxy              Middlebox     SIP Phone
   (External)     (In-Path               (NAPT         (Private)
   IP Addr:Ea     MIDCOM agent)          Service)      IP addr:Pa
   |                 |                   IP addr:Ma        |
   |                 |                      |              |
   |----INVITE------>|                      |              |
   |                 |++ Query Port-BIND    |              |
   |                 |   for (Ma, 5060) +++>|              |
   |                 |<+ Port-BIND reply    |              |
   |                 |   for (Ma, 5060) ++++|              |
   |                 |                      |              |
   |                 |++ Query NAT Session  |              |
   |                 |   Descriptor for     |              |
   |                 |   Ea-to-Pa SIP flow+>|              |
   |                 |<+ Ea-to-Pa SIP flow  |              |
   |                 |   Session Descriptor+|              |
   |                 |                      |              |
   |              Determine the Internal    |              |
   |              IP address (Pa)           |              |
   |              of the callee.            |              |
   |                 |                      |              |
   |              Identify UDP port numbers |              |
   |              on Ea (Eport1, Eport1+1)  |              |
   |              for pri-to-ext RTP & RTCP |              |
   |              sessions (RTP1, RTCP1)    |              |
   |                 |                      |              |
   |                 |++Create NAT Session  |              |
   |                 |  descriptors for     |              |
   |                 |  RTP1, RTCP1; Set    |              |
   |                 |  parent session to   |              |
   |                 |  SIP-ctrl session ++>|              |
   |                 |<+RTP1, RTCP1 session |              |
   |                 |  descriptors created+|              |
   |                 |                      |              |
   |                 |                      |..redirected..|
   |                 |--------INVITE--------|------------->|
   |<---100Trying----|                      |              |
   |                 |                      |              |
   |                 |<-----180Ringing---------------------|
   |                 |                      |              |
   |<--180Ringing----|                      |              |
   |                 |<-------200 OK-----------------------|
   |                 |                      |              |
   |              Identify UDP port numbers |              |
   |              on Pa (Pport2, Pport2+1)  |              |
   |              for ext-to-pri RTP & RTCP |              |
   |              sessions (RTP2, RTCP2)    |              |
   |                 |                      |              |



Srisuresh et al.                                               [Page 24]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


   |                 |++Create consecutive  |              |
   |                 |  port BINDs on Ma    |              |
   |                 |  for (Pa, Pport2),   |              |
   |                 |  (Pa, Pport2+1) ++++>|              |
   |                 |<+Port BINDs created++|              |
   |                 |                      |              |
   |                 |++Create NAT Session  |              |
   |                 |  descriptors for     |              |
   |                 |  RTP2, RTCP2; Set    |              |
   |                 |  parent session to   |              |
   |                 |  SIP-ctrl session ++>|              |
   |                 |<+RTP2, RTCP2 session |              |
   |                 |  descriptors created+|              |
   |                 |                      |              |
   |              Modify the SDP            |              |
   |              parameters in "200 OK"    |              |
   |              with NAPT PORT-BIND       |              |
   |              for the RTP2 port on Ma.  |              |
   |                 |                      |              |
   |<---200 OK ------|                      |              |
   |                 |                      |              |
   |-------ACK------>|                      |              |
   |                 |                      |              |
   |              Modify IP addresses       |              |
   |              appropriately in the SIP  |              |
   |              header (e.g., To, from,   |              |
   |              Via, contact fields)      |              |
   |                 |                      |..redirected..|
   |                 |-----------ACK--------|------------->|
   |                 |                      |              |
   |                 |                      |              |
   |<===================RTP/RTCP============|=============>|
   |                 |                      |              |
   |-------BYE------>|                      |              |
   |                 |                      |              |
   |              Modify IP addresses       |              |
   |              appropriately in the      |              |
   |              SIP header.               |              |
   |                 |                      |              |
   |                 |----------------------|-----BYE----->|
   |                 |                      |              |
   |                 |<----------200 OK--------------------|
   |                 |                      |              |
   |                 |+++Terminate the SIP  |              |
   |                 |   Session bundle +++>|              |
   |                 |<++SIP Session bundle |              |
   |                 |   terminated ++++++++|              |
   |                 |                      |              |



Srisuresh et al.                                               [Page 25]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


   |              Modify SDP                |              |
   |              parameters in "200 OK"    |              |
   |                 |                      |              |
   |<---200 OK-------|                      |              |
   |                 |                      |              |


      Legend:      ++++    MIDCOM control traffic
                   ----    SIP control traffic
                   ====    RTP/RTCP media traffic


7.3. Timeline flow - Middlebox implementing NAPT and firewall


   In the following example, we will assume a middlebox
   implementing a combination of a firewall and a stateful NAPT
   service. We make the assumption that the NAPT function is
   configured to translate the IP and TCP headers of the initial
   SIP session into the private SIP phone and the firewall
   function is configured to permit the initial SIP session.

   In the following time line, it may be noted that the firewall
   description is based on packet fields on the wire (ex: as seen
   on the external interface of the middlebox).  In order to
   ensure correct behavior of the individual services, you will
   notice that NAT specific MIDCOM operations precede firewall
   specific operations on the MIDCOM agent. This is noticeable in
   the time line below when the MIDCOM agent processes the
   "200 OK" from the private SIP phone. The MIDCOM agent initially
   requests the NAT service on the middlebox to set up port-BIND
   and session-descriptors for the media stream in both directions.
   Subsequent to that, the MIDCOM agent determines the session
   parameters (i.e, the dynamic UDP ports) for the media stream,
   as viewed by the external interface and requests the firewall
   service on the middlebox to permit those sessions through.



   SIP Phone      SIP Proxy              Middlebox     SIP Phone
   (External)     (In-Path               (NAPT &       (Private)
   IP Addr:Ea     MIDCOM agent)          firewall      IP addr:Pa
   |                 |                   Services)         |
   |                 |                   IP addr:Ma        |
   |                 |                      |              |
   |----INVITE------>|                      |              |
   |                 |++ Query Port-BIND    |              |
   |                 |   for (Ma, 5060) +++>|              |



Srisuresh et al.                                               [Page 26]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


   |                 |<+ Port-BIND reply    |              |
   |                 |   for (Ma, 5060) ++++|              |
   |                 |                      |              |
   |                 |++ Query NAT Session  |              |
   |                 |   Descriptor for     |              |
   |                 |   Ea-to-Pa SIP flow+>|              |
   |                 |<+ Ea-to-Pa SIP flow  |              |
   |                 |   Session Descriptor+|              |
   |                 |                      |              |
   |              Determine the Internal    |              |
   |              IP address (Pa)           |              |
   |              of the callee.            |              |
   |                 |                      |              |
   |              Identify UDP port numbers |              |
   |              on Ea (Eport1, Eport1+1)  |              |
   |              for pri-to-ext RTP & RTCP |              |
   |              sessions (RTP1, RTCP1)    |              |
   |                 |                      |              |
   |                 |++Create NAT Session  |              |
   |                 |  descriptors for     |              |
   |                 |  RTP1, RTCP1; Set the|              |
   |                 |  parent session to   |              |
   |                 |  point to SIP flow++>|              |
   |                 |<+RTP1, RTCP1 session |              |
   |                 |  descriptors created+|              |
   |                 |                      |              |
   |                 |++Permit RTP1 & RTCP1 |              |
   |                 |  sessions External to|              |
   |                 |  middlebox, namely   |              |
   |                 |  Ma to Ea:Eport1,    |              |
   |                 |  Ma to Ea:Eport1+1   |              |
   |                 |  sessions ++++++++++>|              |
   |                 |<+Ma to Ea:Eport1,    |              |
   |                 |  Ma to Ea:Eport1+1     |              |
   |                 |  sessions OKed ++++++|              |
   |                 |                      |              |
   |                 |                      |..redirected..|
   |                 |--------INVITE--------|------------->|
   |<---100Trying----|                      |              |
   |                 |                      |              |
   |                 |<-----180Ringing---------------------|
   |                 |                      |              |
   |                 |                      |              |
   |<--180Ringing----|                      |              |
   |                 |<-------200 OK-----------------------|
   |                 |                      |              |
   |              Identify UDP port numbers |              |
   |              on Pa (Pport2, Pport2+1)  |              |



Srisuresh et al.                                               [Page 27]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


   |              for ext-to-pri RTP & RTCP |              |
   |              sessions (RTP2, RTCP2)    |              |
   |                 |                      |              |
   |                 |++Create consecutive  |              |
   |                 |  port BINDs on Ma    |              |
   |                 |  for (Pa, Pport2),   |              |
   |                 |  (Pa, Pport2+1) ++++>|              |
   |                 |<+Port BINDs created  |              |
   |                 |  on Ma as (Mport2,   |              |
   |                 |  Mport2+1) ++++++++++|              |
   |                 |                      |              |
   |                 |++Create NAT Session  |              |
   |                 |  descriptors for     |              |
   |                 |  RTP2, RTCP2; Set the|              |
   |                 |  parent session to   |              |
   |                 |  point to SIP flow++>|              |
   |                 |<+RTP2, RTCP2 session |              |
   |                 |  descriptors created+|              |
   |                 |                      |              |
   |              Modify the SDP            |              |
   |              parameters in "200 OK"    |              |
   |              with NAPT PORT-BIND       |              |
   |              for RTP2 port on Ma.      |              |
   |                 |                      |              |
   |                 |++Permit RTP2 & RTCP2 |              |
   |                 |  sessions External   |              |
   |                 |  middlebox, namely   |              |
   |                 |  Ea to Ma:Mport2,    |              |
   |                 |  Ea to Ma:Mport2+1   |              |
   |                 |  sessions ++++++++++>|              |
   |                 |<+Ea to Ma:Mport2,    |              |
   |                 |  Ea to Ma:Mport2     |              |
   |                 |  sessions OKed ++++++|              |
   |                 |                      |              |
   |<---200 OK ------|                      |              |
   |                 |                      |              |
   |-------ACK------>|                      |              |
   |                 |                      |..redirected..|
   |                 |-----------ACK--------|------------->|
   |                 |                      |              |
   |                 |                      |              |
   |<===================RTP/RTCP============|=============>|
   |                 |                      |              |
   |-------BYE------>|                      |              |
   |                 |                      |              |
   |              Modify SDP payload        |              |
   |              parameters in BYE         |              |
   |                 |                      |              |



Srisuresh et al.                                               [Page 28]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


   |                 |----------------------|-----BYE----->|
   |                 |                      |              |
   |                 |<----------200 OK--------------------|
   |                 |                      |              |
   |                 |+++Terminate the SIP  |              |
   |                 |   Session bundle +++>|              |
   |                 |<++SIP Session bundle |              |
   |                 |   terminated ++++++++|              |
   |                 |                      |              |
   |                 |++Cancel permits to   |              |
   |                 |  sessions External   |              |
   |                 |  middlebox, namely   |              |
   |                 |  Ma to Ea:Eport1,    |              |
   |                 |  Ma to Ea:Eport1+1   |              |
   |                 |  Ea to Ma:Mport2,    |              |
   |                 |  Ea to Ma:Mport2+1   |              |
   |                 |  sessions ++++++++++>|              |
   |                 |<+Removed permits to  |              |
   |                 |  sessions listed ++++|              |
   |                 |                      |              |
   |              Modify SDP                |              |
   |              parameters in "200 OK"    |              |
   |                 |                      |              |
   |<---200 OK-------|                      |              |
   |                 |                      |              |

      Legend:      ++++    MIDCOM control traffic
                   ----    SIP control traffic
                   ====    RTP/RTCP media traffic

8.0. MIDCOM framework illustration with an Out-Of-path FTP Agent

   In the following figure, an FTP client inside a private domain
   connects via a middlebox to an external FTP server. The middlebox
   is assumed to implement NAPT and firewall functions. The FTP
   traffic is addressed directly to the external FTP server. The Arrow
   labeled 1 indicates a registration via the MIDCOM protocol in
   which the Out-of-Path FTP agent indicates that it would like to
   receive TCP traffic directed to or from port 21 (FTP control). The
   OOP agent may be located either inside the private domain or
   external to the domain.

   The FTP control traffic traversing the middlebox is diverted by
   the middlebox to the Out-of-Path FTP agent for FTP control payload
   processing. Diverted control traffic is indicated by Arrow 2. The
   OOP agent parses the FTP control commands and responses and possibly
   modifies, as appropriate and forwards the traffic over to the server
   and/or the client. Neither of the end-hosts is aware of the OOP Agent



Srisuresh et al.                                               [Page 29]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


   or the middlebox in transit.

   At some point, the Client sends a PORT command to the Server,
   indicating that the Server should create a TCP connection from the
   Server to the Client. This port command specifies an IP address and
   port number to which the Server should connect. The IP address may
   be a private IP address, if the client is located in a privately
   addressed domain.

   The OOP agent parses the PORT command, and carries out appropriate
   MIDCOM  transactions (Arrow 4) to discover any changes to the IP
   address required, to request a new NAPT port binding if necessary,
   and to open a suitable pinhole allowing the connection from the
   Server to the dynamically allocated port number on the Client to
   succeed. The (perhaps modified) PORT command is then sent on to the
   Server, which responds by connecting to the indicated IP address and
   port, which will now flow through the middlebox to the Client.

   The example does not show the timers maintained by the agent to
   keep the firewall pinholes and NAT session descriptors and BINDs
   from timing out. Readers are urged to refer [NAT-FRAMEWORK] for
   a detailed illustration of how an OOP agent could interface with
   the NAT-only middlebox.

                        ---------------
                        | Out-of-Path |
                        | (OOP)  FTP  |
                        |  Agent      |
                        |_____________|
                            |  ^  |  |
                            |  |  |  |
                            |1 |2 |3 |4
   ______________           |  |  |  |         _____________
   |            |          _v__|__v__v_        |            |
   | FTP client |   Ctrl  |           |  Ctrl  | External   |
   | within the |<------->| MiddleBox |<------>| FTP Server |
   | Pvt. domain|<------->|___________|<------>|            |
   |____________|  Data                  Data  |____________|


           Ctrl - indicates the FTP control traffic, which
                  is transparently diverted to the OOP agent (2 and 3)
           Data - indicates the FTP data traffic, which flows
                  directly through the middlebox between the FTP
                  end hosts (i.e., FTP client and Server)

   Figure 5: MIDCOM framework illustration Out-of-Path FTP agent




Srisuresh et al.                                               [Page 30]


Internet-Draft       MIDCOM Architecture & Framework           June 2001



8.1. Timeline Flow - Middlebox implementing NAPT and Firewall

   In the following figure, an end-host inside the private network
   at address(pa) 10.0.0.4 wishes to communicate with an external FTP
   server with an IP address Ea. The Middlebox provides public IP
   address(Ma) 209.46.41.66 for external communication by private
   hosts.

   The middlebox diverts the FTP control traffic to the OOP agent.
   The OOP agent, in turn, reviews the datagrams and optionally
   modify as appropriate and redirects the datagrams right back to
   the middlebox. The OOP agent may need to update even the TCP
   SYNs and ACKs (i.e., datagrams with no application specific
   payload) in the event the agent had to rewrite the address
   content in the payload and the payload length changed as a result.


   FTP-client    OOP FTP                Middlebox (NAPT &   FTP Server
   (Private)     Agent                  Firewall Services)  (External)
   IP addr(Pa):   |                     IP addr(Ma):        IP addr: Ea
     10.0.0.4     |                       209.46.41.66       |
   |              |                       |                  |
   |              |                       |                  |
   |              |++Attach as FTP ALG+++>|                  |
   |              |                       |                  |
   |              |<+++++ OK +++++++++++++|                  |
   |              |                       |                  |
   |          The OOP FTP Agent attaches with middlebox &    |
   |          is authorized to process FTP control           |
   |          traffic from private hosts (or any set         |
   |          of hosts adhering to a certain policy)         |
   |              |                       |                  |
   |              |                       |                  |
   The FTP client connects to the external FTP server. The middlebox
   would have created a NAT Port-BIND and an FTP control session
   resource with the appropriate translation parameters.
   |              |                       |                  |
   | PORT 10,0,0,4,4,9                    |                  |
   |--------------------------------------|                  |
   |              |                       |                  |
   |              |<## Ctrl-Pkt diverted #|                  |
   |              |                       |                  |
   |              |++Query NAT Session    |                  |
   |              |  Descriptor for       |                  |
   |              |  Pa-to-Ea FTP flow+++>|                  |
   |              |                       |                  |
   |              |<+Pa-to-Ea FTP flow    |                  |



Srisuresh et al.                                               [Page 31]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


   |              |  Session Descriptor+++|                  |
   |              |                       |                  |
   |              |++Create NAT port-BIND |                  |
   |              |  for (Pa, 1033) +++++>|                  |
   |              |                       |                  |
   |              |<+Port BINDs created   |                  |
   |              |  with (Ma, 15324)+++++|                  |
   |              |                       |                  |
   |              |++Create NAT Session   |                  |
   |              |  descriptor for the   |                  |
   |              |  Data session from Ea |                  |
   |              |  to (Ma, 15324);Set   |                  |
   |              |  Parent session to    |                  |
   |              |  FTP-Ctrl session +++>|                  |
   |              |                       |                  |
   |              |<+FTP-Data session     |                  |
   |              |  descriptor created+++|                  |
   |              |                       |                  |
   |              |++Permit FTP data      |                  |
   |              |  session from Ea to   |                  |
   |              |  (Ma, 15324)+++++++++>|                  |
   |              |                       |                  |
   |              |<+Data session OKed++++|                  |
   |              |                       |                  |
   |              |### Modified  Control  |                  |
   |              |    Pkt forwarded #######################>|
   |              |                       |                  |
   |<===FTP Data traffic between Pa & Ea==|=================>|
   |              |                       |                  |
   |              |                       |                  |



      Legend:      ++++    MIDCOM control traffic
                   #####   Diverted datagrams between
                   ----    FTP control traffic
                   ====    FTP data traffic


   The above flow does not indicate all packets as diverted, only
   the important ones (e.g. the datagram with the PORT command in
   the payload). It is safe to assume that all control packets are
   diverted from the middlebox to the OOP Agent via the datagram
   diversion component of the middlebox.

   Note that the FTP data traffic is not diverted to the OOP Agent.
   This is because the OOP agent does not assign a diversion function
   associated with the data session while at the instance creating the



Srisuresh et al.                                               [Page 32]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


   FTP-Data session. This is an essential feature, since we allow the
   middlebox to move the data about, while the Agent intervention is
   limited just to the control session.


9.0. Operational considerations

9.1. Multiple MIDCOM connections between agents and middlebox

   A middlebox cannot be assumed to be a simple device
   implementing just one middlebox function and no more than a
   couple of interfaces. Middleboxes often combine multiple
   intermediate functions into the same device and have the
   ability to provision individual interfaces of the same device
   with different sets of functions and varied provisioning for
   the same function across the interfaces.

   As such, a MIDCOM agent ought to be able to have a single
   MIDCOM connection with a middlebox and use the MIDCOM
   interface on the middlebox to interface with different
   services on the same middlebox interface.

9.2. MIDCOM agent registration with a middlebox

   A MIDCOM agent may be pre-configured on a middlebox as a
   trusted entity. In the case where a MIDCOM agent is not
   pre-configured, a policy server should be made available
   to the middlebox, so the middlebox can consult the Policy
   Server for authorization to accept requests from the agent.
   A middlebox should be capable of connecting to more than
   a single MIDCOM agent.


9.3. Asynchronous notification to MIDCOM agents

   Asynchronous notification by the middlebox to a MIDCOM agent
   can be useful for events such as Session creation, Session
   termination, MIDCOM protocol failure, Middlebox function
   failure or any other significant event. Independently, ICMP
   error codes can also be useful to notify transport layer
   failures to the agents.

   In addition, periodic notification of statistics update would
   also be a useful function that would be beneficial to
   certain types of agents.

9.4. Packet redirection




Srisuresh et al.                                               [Page 33]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


   During connection establishment between an agent and a middlebox,
   the agent identifies itself as in-path (or) Out-of-Path. The
   middlebox takes no additional action to redirect a packet, if the
   agent is in-path. If the agent is Out-of-Path, the middlebox will
   be required to have a datagram diverter function that diverts
   datagrams to the out-of-path agent. The datagram diverter function
   on a middlebox, however, is not a requirement when the middlebox
   chooses not to support OOP agents.

   The OOP agent should be capable of returning processed datagrams
   to the middlebox point of origin or forward to the destination.
   The middlebox should in turn forward the processed datagrams
   without subjecting to any middlebox services the second time
   around. I.e., A datagram should not be diverted back to the OOP
   agent the second time around. Failing this, the datagram could
   simply recycle between the two entities.

   The datagram diverter function is an internal implementation
   issue for the middlebox and is unrelated to the MIDCOM protocol.
   One approach to datagram diversion might be to encapsulate
   datagrams (both diverted and processed)  in a tunnel during
   traversal between the agent and the middlebox. Another approach
   might be to dedicate an interface on the middlebox for the
   purpose. There may be other proprietary approaches.

9.5. Middleboxes supporting multiple services

   A middlebox could be implementing a variety of services (e.g. NAT
   and firewall) in the same box. Some of these services might have
   inter-dependency on shared resources and sequence of operation.
   Others may be independent of each other. Generally speaking,
   the sequence in which these function operations may be performed
   on datagrams is not within the scope of this document.

   In the case of a middlebox implementing NAT and firewall
   services, it is safe to state that the NAT operation will precede
   firewall on the egress and will  follow firewall on the ingress.
   Further, firewall access control lists used by a firewall are
   assumed to be based on session parameters as seen on the
   interface supporting firewall service.

9.6. Signaling and Data traffic

   The class of applications the MIDCOM architecture is addressing
   focus around applications that have a combination of one or more
   signaling and data traffic sessions. The signaling
   may be done out-of-band using a dedicated stand-alone session
   or may be done in-band with data session. Alternately, signaling



Srisuresh et al.                                               [Page 34]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


   may also be done as a combination of both stand-alone and
   in-band sessions.

   SIP is an example of an application based on distinct signaling
   and data sessions. SIP signaling session is used for call setup
   between a caller and a callee. MIDCOM agent may be required to
   examine/modify SIP payload content to administer the middlebox
   so as to let the media streams (RTP/RTCP based) through. MIDCOM
   agent is not required to intervene in the data traffic.

   Signaling and context specific Header information is sent in-band
   within the same data stream for applications such as HTTP embedded
   applications, sun-RPC (embedding a variety of NFS apps), Oracle
   transactions (embedding oracle SQL+, MS ODBC, Peoplesoft) etc.

   H.323 is an example of application that sends signaling in both
   dedicated stand-alone session as well as in conjunction with data.
   Q.931 traffic traverses middleboxes by virtue of static policy,
   no MIDCOM control needed. Q.931 also negotiates ports for an
   H.245 TCP stream. A MIDCOM agent is required to examine/modify
   the contents of the H.245 so that H.245 can traverse it.

   H.245 traverses the middlebox and also carries Open Logical
   Channel information for media data. So the MIDCOM agent is once
   again required to examine/modify the payload content needs to
   let the media traffic flow.

   The MIDCOM architecture takes into consideration, supporting
   applications with independent signaling and data sessions as
   well as applications that have signaling and data communicated
   over the same session.

   In the cases where signaling is done on a single stand-alone
   session, it is desirable to have a MIDCOM agent interpret the
   signaling stream and program the middlebox (that transits the
   data stream) so as to let the data traffic through uninterrupted.


10. Applicability Statement

   Middleboxes may be stationed in a number of topologies. However, the
   signaling framework outlined in this document may be limited to only
   those middleboxes that are located in a DMZ (De-Militarized Zone) at
   the edge of a private domain, connecting to the Internet.
   Specifically, the assumption is that you have a single middlebox
   (running NAT or firewall) along the application route. Discovery of
   middlebox along application route is outside the scope of this
   document. It is conceivable to have middleboxes located between



Srisuresh et al.                                               [Page 35]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


   departments within the same domain or inside service provider's
   domain and so forth. However, care must be taken to review each
   individual scenario and determine the applicability on a
   case-by-case basis.

   The applicability may also be illustrated as follows. Real-time and
   streaming applications such as Voice-Over-IP and peer-to-peer
   applications such as Napster and Netmeeting require administering
   firewall and NAT middleboxes to let their media streams reach hosts
   inside a private domain. The requirements are in the form of
   establishing a "pin-hole" to permit a TCP/UDP session (the port
   parameters of which are dynamically determined) through a firewall
   or retain an address/port bind in the NAT device to permit
   connections to a port. These requirements are met by current
   generation middleboxes using adhoc methods, such as embedding
   application intelligence within a middlebox to identify the dynamic
   session parameters and administering the middlebox internally as
   appropriate. The objective of the MIDCOM architecture is to create
   a unified, standard way to exercise this functionality, currently
   existing in an ad-hoc fashion in some of the middleboxes.

   By adopting MIDCOM architecture, middleboxes will be able to
   support newer applications they have not been able to support thus
   far. MIDCOM architecture does not and MUST not, in anyway, change
   the fundamental characteristic of the services supported on the
   middlebox.

   Typically, organizations shield a majority of their corporate
   resources (such as end-hosts) from visibility to the external
   network by the use of a De-Militarized Zone (DMZ) at the domain
   edge. Only a portion of these hosts are allowed to be accessed by
   the external world. The remaining hosts and their names are unique
   to the private domain. Hosts visible to the external world and the
   authoritative name server that maps their names to network
   addresses are often configured within a DMZ (De-Militarized Zone)
   in front of a firewall. Hosts and middleboxes within DMZ are
   referred to as DMZ nodes.

   Figure 4 below illustrates configuration of a private domain with
   a DMZ at its edge. Actual configurations may vary. Internal hosts
   are accessed only by users inside the domain. Middleboxes,
   located in the DMZ may be accessed by agents inside or outside
   the domain.








Srisuresh et al.                                               [Page 36]


Internet-Draft       MIDCOM Architecture & Framework           June 2001



                                   \ | /
                           +-----------------------+
                           |Service Provider Router|
                           +-----------------------+
                            WAN  |
               Stub A .........|\|....
                               |
                     +---------------+
                     | NAT Middlebox |
                     +---------------+
                         |
                         |   DMZ - Network
   ------------------------------------------------------------
      |         |              |            |             |
     +--+      +--+           +--+         +--+      +-----------+
     |__|      |__|           |__|         |__|      | Firewall  |
    /____\    /____\         /____\       /____\     | Middlebox |
   DMZ-Host1  DMZ-Host2 ...  DMZ-Name     DMZ-Web    +-----------+
                             Server       Server etc.   |
                                                        |
     Internal Hosts (inside the private domain)         |
   ------------------------------------------------------------
       |             |                 |           |
      +--+         +--+               +--+       +--+
      |__|         |__|               |__|       |__|
     /____\       /____\             /____\     /____\
    Int-Host1    Int-Host2  .....   Int-Hostn   Int-Name Server

    Figure 6: DMZ network configuration of a private domain.


11. Acknowledgements

   The authors wish to thank Christian Huitema, Joon Maeng, Jon
   Peterson, Mike Fisk, Matt Holdrege, Melinda Shore, Paul Sijben,
   Philip Mart, Scott Brim and Richard Swale for their valuable
   critique, advice and input on an earlier rough version of this
   document. The authors owe special thanks to Eliot Lear for
   kick-starting the e-mail discussion on use-case scenarios with a
   SIP application flow diagram through a middlebox. Much thanks to
   Bob Penfield, Cedric Aoun, Christopher Martin, Eric Fleischman,
   George Michaelson, Wanqun Bao and others in the MIDCOM work group
   for their very detailed feedback on a variety of topics and
   adding clarity to the discussion. Last, but not the least, the
   authors owe much thanks to Melinda Shore for her continued
   support, critique and feedback throughout in bringing out fine
   subtleties and helping to make the document a better read.



Srisuresh et al.                                               [Page 37]


Internet-Draft       MIDCOM Architecture & Framework           June 2001




12. Security Considerations

   [SEC-GUIDE] defines security goals as either communication
   security related or systems security related. While the latter
   is important and should be addressed as part of a comprehensive
   security solution, it is considered to be outside the scope of
   this document. This section predominantly addresses what is
   required to ensure secure access to the middlebox.

   The premise of middlebox operation fundamentally requires
   stateful inspection of data in the clear. This compromises the
   confidentiality requirement in some environments. Further,
   Updating transport headers and rewriting application payload
   data in some cases by NAT prevents the use of integrity
   protection on some data streams traversing NAT middleboxes.
   Clearly, this can pose a significant security threat to the
   application in an untrusted transport domain.

   However, the MIDCOM protocol removes the need for a middlebox
   to inspect or manipulate data. This in turn allows applications
   to better protect themselves end-to-end with the aid of a trusted
   MIDCOM agent. This is especially the case when the agent is
   resident on the end-host. When an agent has the same end-to-end
   ability as the end-host to interpret encrypted and integrity
   protected data, data transiting a middlebox can be encrypted and
   integrity protected. The MIDCOM agent will still be able to
   interpret the data and simply notify the middlebox to open holes,
   install NAT table entries, etc.

   Security between a MIDCOM agent and a middlebox has a number of
   components. Authorization, authentication, integrity and
   confidentiality. Authorization refers to whether a particular
   agent is authorized to signal middlebox with requests for one or
   more applications adhering to a certain policy profile. Failing the
   authorization process might indicate resource theft attempt or
   failure due to administrative and/or credential deficiencies. In
   either case, the middlebox should take the proper measures to
   audit/log such attempts and consult its designated policy server
   for the required action if the middlebox is configured with one.
   Alternatively, the middlebox may resort to a default service deny
   policy when a midcom agent fails to prompt the required
   credentials. Section 6 discusses the middlebox-policy server
   interactions in view of policy decisions.

   Authentication refers to confirming the identity of originator
   for all datagrams received from the originator. Lack of strong



Srisuresh et al.                                               [Page 38]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


   credentials for authentication of MIDCOM messages between an agent
   and a middlebox can seriously jeopardize the fundamental service
   rendered by the middlebox. A consequence of not authenticating an
   agent would be that an attacker could spoof the identity of a
   "legitimate" agent and open holes in the firewall.  Another would
   be that it could otherwise manipulate state on a middlebox,
   creating a denial-of-service attack by closing needed pinholes or
   filling up a NAT table.  A consequence of not authenticating the
   middlebox to an agent is that an attacker could pose as a
   middlebox and respond to NAT requests in a manner that would divert
   data to the attacker. Failing to submit the required/valid
   credentials once challenged may indicate a replay attack and in
   which case a proper action is required by the middlebox such as
   auditing, logging, consulting its designated policy server to
   reflect such failure.

   Integrity is required to ensure that a MIDCOM message has not been
   accidentally or maliciously altered or destroyed. Result of a lack
   of data integrity enforcement in an untrusted environment could be
   that an imposter will alter the messages sent by an agent and
   bring the middlebox to a halt or cause a denial of service for the
   application the agent is attempting to enable.

   Confidentiality of MIDCOM messages ensure that the signaling data
   is accessible only to the authorized entities. When a middlebox
   agent is deployed in an untrusted environment, lack of
   confidentiality will allow an intruder to perform traffic flow
   analysis and snoop the middlebox resources. The intruder could
   cannibalize a lesser secure MIDCOM connection and destroy or
   compromise the middlebox resources he uncovered on other
   connections. Needless to say, the least secure MIDCOM connection
   will become the achilles heel and make the middlebox vulnerable
   to security attacks.

   Lastly, there can be security vulnerability to the applications
   traversing a middlebox when a resource on a middlebox is controlled
   by multiple external agents.  A middlebox service may be abruptly
   disrupted due to malicious manipulation or incorrect implementation
   of the middlebox or its agents of a certain shared resource by an
   agent purporting to offer ALG service for a different middlebox
   function. Care must be taken in the protocol design to ensure that
   agents for one function do not abruptly step over resources impacting
   a different function. Alternately, the severity of such
   manifestations could be lessened when a single MIDCOM agent is
   responsible for supporting all the middlebox services for an
   application due to the reduced complexity and synchronization effort
   in managing the middlebox resources.




Srisuresh et al.                                               [Page 39]


Internet-Draft       MIDCOM Architecture & Framework           June 2001



REFERENCES

   [IETF-STD] Bradner, S., " The Internet Standards Process --
              Revision 3", RFC 1602, IETF, October 1996.

   [SIP]      Handley, M., H. Schulzrinne, E. Schooler, and
              J. Rosenberg, "SIP: Session Initiation Protocol",
              RFC 2543, IETF, March 1999.

   [SDP]      Handley, M., and Jacobson, V., "SDP: session
              description protocol", RFC 2327, IETF, April 1998.

   [H.323]    ITU-T Recommendation H.323. "Packet-based Multimedia
              Communications Systems," 1998.

   [RTP]      Schulzrinne, H., S. Casner, R. Frederick, and V. Jacobson,
              "RTP: A Transport Protocol for Real-Time Applications",
              RFC 1889, IETF, January 1996.

   [RTSP]     Schulzrinne, H., A. Rao, R. Lanphier: "Real Time
              Streaming Protocol", RFC 2326, IETF, April 1998.

   [FTP]      J. Postel, J. Reynolds, "FILE TRANSFER PROTOCOL (FTP)",
              RFC 959

   [NAT-TERM] Srisuresh, P. and M. Holdrege, "IP Network Address
              Translator (NAT) Terminology and Considerations",
              RFC 2663, August 1999.

   [NAT-TRAD] Srisuresh, P. and Egevang, K., "Traditional IP Network
              Address Translator (Traditional NAT)", RFC 3022,
              January 2001.

   [NAT-COMP] Holdrege, M. and Srisuresh, P., "Protocol Complications
              with the IP Network Address Translator", RFC 3027,
              January 2001.

   [NAT-PT]   Tsirtsis, G. and Srisuresh, P., "Network Address
              Translation - Protocol Translation (NAT-PT)",
              RFC 2766, February 2000.

   [NAT-FRAMEWORK]  Srisuresh, P., "Framework for interfacing with
              Network Address Translator", Work in progress, April
              2001, <draft-ietf-nat-interface-framework-03.txt>

   [MIDCOM-REQ] Swale, R.P., Mart, P.A. and Sijben, P., "Requirements
              for the MIDCOM protocol", work in progress, April 2001,



Srisuresh et al.                                               [Page 40]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


              <draft-ietf-midcom-requirements-01.txt>

   [APPL-ID]  Bernet, Y. and Pabbati, R., "Application and Sub
              Application Identity Policy Element for Use with
              RSVP", RFC 2872, June 2000.

   [RFC 1918] Rekhter, Y., Moskowitz, B., Karrenberg, D.,
              de Groot, G. and E. Lear, "Address Allocation for
              Private Internets", BCP 5, RFC 1918, February 1996.

   [RFC 1700] J. Reynolds and J. Postel, "Assigned Numbers",
              RFC 1700

   [IPsec-AH] Kent, S., and R. Atkinson, "IP Authentication
              Header", RFC 2402, November 1998.

   [IPsec-ESP] Kent, S., and R. Atkinson, "IP Encapsulating
              Security Payload (ESP)", RFC 2406, November 1998.

   [TLS]      Dierks, T., and Allen, C., "The TLS Protocol
              Version 1.0", RFC 2246, January 1999.

   [SEC-GUIDE] Rescorla, E., and B. Korver, "Guidlines for Writing
              RFC Text on Security Considerations", Work in Progress,
              March 2001, <draft-rescorla-sec-cons-03.txt>



Authors' Addresses

   Pyda Srisuresh
   Jasmine Networks
   3061 Zanker Road, Suite B
   San Jose, CA 95134
   U.S.A.
   EMail: srisuresh@yahoo.com


   Jiri Kuthan
   GMD Fokus
   Kaiserin-Augusta-Allee 31
   D-10589 Berlin, Germany
   E-mail: kuthan@fokus.gmd.de


   Jonathan Rosenberg
   dynamicsoft
   200 Executive Drive



Srisuresh et al.                                               [Page 41]


Internet-Draft       MIDCOM Architecture & Framework           June 2001


   Suite 120
   West Orange, NJ 07052
   U.S.A.
   email: jdrosen@dynamicsoft.com

   Andrew Molitor
   Aravox technologies
   4201 Lexington Avenue North, Suite 1105
   Arden Hills, MN 55126
   U.S.A.
   voice: (651) 256-2700
   email: amolitor@visi.com


   Abdallah Rayhan
   P.O. Box 3511 Stn C
   Ottawa, ON, Canada K1Y 4H7
   eMail: ar_rayhan@yahoo.ca

































Srisuresh et al.                                               [Page 42]