Media Gateway Control Protocol
|
In computing, Media Gateway Control Protocol (MGCP) is a protocol used within a Voice over IP system. MGCP is defined in an informational (non-standard) IETF document, RFC 3435 (http://www.ietf.org/rfc/rfc3435.txt), which obsoletes an earlier definition in RFC 2705. It superseded SGCP.
MGCP is an internal protocol used within a distributed system that can appear to the outside world as a single VoIP gateway.
This system is composed of a Call Agent, and a set of gateways, including at least one "media gateway" that performs the conversion of media signals between circuits and packets, and at least one "signaling gateway" when connected to an SS7 controlled network.
The "approved" IETF protocol for the same purpose, although not as widely implemented (as of 2004 Q3) as MGCP, is Megaco, defined in RFC 3015.
Contents |
Architecture
MGCP is interesting because, although the Call Agent acts as a software switch for a VoIP network, it stays conspicuously uninvolved with the actual dirty work of encoding, decoding, and transferring the sound data.
An MGCP Call Agent really does nothing more than direct the MGs and SGs which do the work. In fact, the greatest challenge in creating a Call Agent appears to be implementing all of the myriad possibilities in the protocol. This is born out by the fact that there are numerious informational RFCs that describe expected behavior under a wide variety of circumstances.
In MGCP, every command receives an acknowledgement, has a transaction ID, and receives a response. It is best described as a subscription architecture, as the Call Agent tells the MGs and SGs what events it cares about and otherwise leaves them alone.
At any given time, an MG or SG has a "controlling" Call Agent that receives all notifications. Contact in any capacity (excepting auditing) by a Call Agent makes that Call Agent the new controlling Call Agent. Auditing is excepted to allow line monitoring and smart resource reservation without taking control of the clients. Due to the ability to audit who the current controlling Call Agent is, it also provides a slick way to determine if failover is needed when a Call Agent goes down. This is exceptionally important in the situation where a Call Agent is not down, but does lose connectivity with other Call Agents.
MGCP is designed around the idea that your 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.
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.
Implementations
- Vovida MGCP (http://www.vovida.org/downloads/mgcp/)
RFCs
A more complete list of RFCs to get started with if you are truly concerned with MGCP might be:
- RFC 3435 - Media Gateway Control Protocol (MGCP) Version 1.0 (this supersedes RFC 2705)
- RFC 3660 - Basic Media Gateway Control Protocol (MGCP) Packages (informational)
- RFC 3064 - MGCP CAS Packages
- RFC 3149 - MGCP Business Phone Packages
- RFC 3515 - The Session Initiation Protocol (SIP) Refer Method
See also
- MGCP Information Site (http://www.packetizer.com/voip/mgcp) This site provides information related to MGCP
- H.323
- Session Initiation Protocol (SIP)
- This article was originally based on material from the Free On-line Dictionary of Computing, which is licensed under the GFDL.