Medium Gateway Control Protocol
Introduction
In computing, Media Gateway Control Protocol (MGCP) is a protocol used within a distributed Voice over IP system. MGCP is defined in RFC 3435, which obsoletes an earlier definition in RFC 2705. It superseded the Simple Gateway Control Protocol (SGCP). Another protocol for the same purpose is Megaco, a co-production of IETF (RFC 3525) and ITU (Recommendation H.248-1). Both protocols follow the guidelines of the API Media Gateway Control Protocol Architecture and Requirements at RFC 2805.
Media Gateway Control Protocol (MGCP)1.0 is a protocol for the control of Voice over IP (VoIP) calls by external call-control elements known as media gateway controllers (MGCs) or call agents (CAs).
Media Gateway Control Protocol (MGCP) is used for controlling telephony gateways from external call control elements called media gateway controllers or call agents. A telephony gateway is a network element that provides connectivity and conversion between different types of networks such as the audio signals carried on telephone circuits and data packets carried over the Internet or over other packet networks.
MGCP assumes a call control architecture where the call control intelligence is outside the gateways and handled by external call control elements. The MGCP assumes that these call control elements, or Call Agents, will synchronize with each other to send coherent commands to the gateways under their control. MGCP is, in essence, a master/slave protocol, where the gateways are expected to execute commands sent by the Call Agents.
The MGCP implements the media gateway control interface as a set of transactions. The transactions are composed of a command and a mandatory response. MGCP forms the basis of the PacketCable NCS protocol.
What is MGCP ?
MGCP (Media Gateway Control Protocol) is a protocol used within a Voice over IP (VoIP) system. This internal protocol was primarily developed to address the demands of carrier-based IP telephone networks. MGCP is a complementary protocol for both H.323 and SIP, which was designed as an internal protocol between the Media Gateway Controller and the Media Gateway. In MGCP, an MGC primarily handles all the call processing by linking with the IP network through constant communications with an IP signaling device, for example an SIP Server or an H.323 gatekeeper.
MGCP is comprised of a Call Agent, one MG (media gateway) which performs the conversion of media signals between circuits and packets, and one SG (signaling gateway) when connected to the PSTN (Public Switched Telephone Network). MGCP is widely used between elements of a decomposed multimedia gateway. The gateway has a Call Agent, which is comprised of the call control “intelligence” and a media gateway boasting the media functions, for example conversion from TDM voice to Voice over IP.
Media Gateways feature endpoints for the Call Agent to create and manage media sessions with other multimedia endpoints. Endpoints are sources and/or sinks of data that can be physical or virtual. For creating physical endpoints, hardware installation is needed while virtual endpoint can be created using available software.
Call Agents come with the capability of creating new connections, or modify an existing connection. Generally, a media gateway is a network element which provides conversion between the data packets carried over the Internet or other packet networks and the voice signals carried by telephone lines. The Call Agent provides instructions to the endpoints to check for any events and – if there is any – create signals. The endpoints are designed in such a way as to automatically communicate changes in service state to the Call Agent. The Call Agent can audit endpoints and the connections on endpoints.
MGCP Connections
MGCP connections can be point to point or multipoint. Point to point connection can be a connection between two endpoints for transmitting data between these endpoints. Once the connection is setup between two endpoints, data transfer takes place between the endpoints. In a multipoint connection, the connection is set up between an endpoint and a multipoint session. In a multipoint connection, connections can be created over various types of bearer networks.
MGCP Architecture
MGCP came to be a much sought after application of VoIP technology because it is not involved in the frustrating work of encoding, decoding, and transferring voice signals. Though, the MGCP Call Agent works as a software switch for a VoIP network, it really does nothing more than simply direct the media gateways and signaling gateways which perform all the work. One of the main tasks in building a Call Agent is implementing the numerous possibilities in the protocol. There are various informational RFCs which may explain the expected behavior under a wide range of conditions.
In MGCP architecture, each and every command features a transaction ID, gets an acknowledgement and receives a response. This can be better understood as subscription architecture, as the Call Agent informs the media gateways and the signaling gateways as to what events it takes care of and what events it leaves unattended.
MGCP packets are generally found wrapped in UDP port 2427. Similar to what you might find in TCP protocols, MGCP datagrams are formatted with whitespace. An MGCP packer can either be a command or a response. Commands start with a four-letter verb while “responses” start with a three number response code.
The distributed system is composed of a Call Agent (or Media Gateway Controller), at least one Media Gateway (MG) that performs the conversion of media signals between circuits and packets, and at least one Signaling gateway (SG) when connected to the PSTN.
The Call Agent uses MGCP to tell the Media Gateway:
-
what events should be reported to the Call Agent
-
how endpoints should be connected together
-
what signals should be played on endpoints.
MGCP also allows the Call Agent to audit the current state of endpoints on a Media Gateway.
The Media Gateway uses MGCP to report events (such as off-hook, or dialed digits) to the Call Agent.
(While any Signaling Gateway is usually on the same physical switch as a Media Gateway, this needn’t be so. The Call Agent does not use MGCP to control the Signaling Gateway; rather, SIGTRAN protocols are used to backhaul signaling between the Signaling Gateway and Call Agent).
In MGCP, every command has a transaction ID and receives a response.
Typically, a Media Gateway is configured with a list of Call Agents from which it may accept programming (where that list normally comprises only one or two Call Agents). In principle, event notifications may be sent to different Call Agents for each endpoint on the gateway (as programmed by the Call Agents, by setting the NotifiedEntity parameter). In practice however, it is usually desirable that at any given moment all endpoints on a gateway should be controlled by the same Call Agent; other Call Agents are available only to provide redundancy in the event that the primary Call Agent fails, or loses contact with the Media Gateway. In the event of such a failure it is the backup Call Agent’s responsibility to reprogram the MG so that the gateway comes under the control of the backup Call Agent. Care is needed in such cases; two Call Agents may know that they have lost contact with one another, but this does not guarantee that they are not both attempting to control the same gateway. The ability to audit the gateway to determine which Call Agent is currently controlling can be used to resolve such conflicts.
MGCP assumes that the multiple Call Agents will maintain knowledge of device state among themselves (presumably with an unspecified protocol) or rebuild it if necessary (in the face of catastrophic failure). Its failover features take into account both planned and unplanned outages.
MGCP Model
MGCP describes a call control architecture, where the intelligence of the call control is outside the gateways and handled by external call control elements. The MGCP assumes that these call control elements will synchronize with each other by sending coherent commands to the gateways under their control. MGCP is a master/slave protocol where the gateways are expected to execute commands sent by the call control elements. MGCP does not define a mechanism for synchronizing call control elements. MGCP assumes a Connection model where the basic constructs are Endpoints and Connections.
|
|
Endpoints
An Endpoint is a logical representation of a physical entity, such as an analog phone or a channel in a trunk. Endpoints are sources or sinks of data and can be physical or virtual. Physical Endpoint creation requires hardware installation while software is sufficient for creating a virtual Endpoint. An interface on a gateway that terminates a trunk connected to a PSTN switch is an example of a physical Endpoint. An audio source in an audio-content server is an example of a virtual Endpoint.
For example, when you tell an Endpoint to “ring”, the Endpoint makes the analog phone actually ring. Or when someone picks up the receiver of an analog phone and it goes “off hook”, a Media Gateway will recognize that an event has occurred at the Endpoint and it will behave appropriately. In the Trunking Gateway described on page above, the bearer channel is an Endpoint. Events and signals occur at Endpoints. A phone ringing is an event, while a phone off the hook is a signal. In Figure 1 the Endpoints are A, B, C and D. The MGC knows four objects: A@MG1, B@MG1, C@MG2, D@MG2. Each MG knows two objects: MG1 knows about A and B, and MG2 knows about C and D. When an event occurs at the physical phone, the Endpoint object of the phone in the MG recognizes that an event has occurred. The MG notifies the object of a particular Endpoint in the MGC. The MGC then acts accordingly and changes the state.
Connections
An Endpoint holds a set of Connections. Connections may be either point-to-point or multipoint. A point-to-point Connection associates two Endpoints. Once this association is established for both Endpoints, data transfer between these Endpoints can begin. A multipoint Connection is established by connecting the Endpoint to a multipoint session. Connections can be established over several types of bearer networks-audio packet transmission using RTP and UDP over a TCP/IP network; audio packet transmission using AAL2 or another adaptation layer over an ATM network; and transmission of Implementing Media Gateway Control Protocols 13 packets over an internal Connection. The Endpoints can be in separate gateways or in the same gateway for both point-to-point and multipoint Connections.
Protocol Overview
MGCP packets are unlike what you find in many other protocols. Usually wrapped in UDP port 2427, the MGCP datagrams are formatted with whitespace, much like you would expect to find in TCP protocols. An MGCP packet is either a command or a response.
Commands begin with a four-letter verb. Responses begin with a three number response code.
There are eight (8) command verbs:
AUEP, AUCX, CRCX, DLCX, MDCX, NTFY, RQNT, RSIP
Two verbs are used by a Call Agent to query (the state of) a Media Gateway:
AUEP – Audit Endpoint
AUCX – Audit Connection
Three verbs are used by a Call Agent to manage an RTP connection on a Media Gateway (a Media Gateway can also send a DLCX when it needs to delete a connection for its self-management):
CRCX – Create Connection
DLCX – Delete Connection
MDCX – Modify Connection
One verb is used by a Call Agent to request notification of events on the Media Gateway, and to request a Media Gateway to apply signals:
RQNT – Request for Notification
One verb is used by a Media Gateway to indicate to the Call Agent that it has detected an event for which the Call Agent had previously requested notification of (via the RQNT command verb):
NTFY – Notify
One verb is used by a Media Gateway to indicate to the Call Agent that it is in the process of restarting:
RSIP – Restart In Progress
Key Benefits
The decomposed gateway architecture greatly eases the problems of management and expansion.
-
Management-Media Gateways can be small and low-cost. They require minimum configuration and management. The Media Gateway Controller controls the Media Gateway, leading to simple and centralized management.
-
Scalability-One Media Gateway Controller can support many Media Gateways. Growth can be dynamic and expansion requires little more than the installation of another Media Gateway.
References
http://www.radcom.com/Technologies.aspx?boneid=720
http://www.iana.org/assignments/mgcp-localconnectionoptions
http://en.wikipedia.org/wiki/MGCP
http://www.tech-faq.com/mgcp.shtml
http://www.cisco.com/en/US/tech/tk652/tk701/tk419/tsd_technology_support_sub-protocol_home.html
http://www.packetizer.com/ipmc/mgcp/
RFCs
RFC 3435 – F. Andreasen and B. Foster, “Media Gateway Control Protocol (MGCP) Version 1.0″, RFC 3435, January 2003. (this supersedes RFC 2705)
RFC 3660 – B. Foster and F. Andreasen, “Basic MGCP Packages”, RFC 3660,December 2003.
RFC 3661 – Media Gateway Control Protocol (MGCP) Return Code Usage
RFC 3064 – MGCP CAS Packages
RFC 3149 – MGCP Business Phone Packages
RFC 3991 – Media Gateway Control Protocol (MGCP) Redirect and Reset Package
RFC 3992 – Media Gateway Control Protocol (MGCP) Lockstep State Reporting Mechanism
RFC 2805 – Media Gateway Control Protocol Architecture and Requirements
MGCP