MscGen


title: "MscGen" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["uml-tools", "free-documentation-generators", "free-diagramming-software"] topic_path: "general/uml-tools" source: "https://en.wikipedia.org/wiki/MscGen" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0

::data[format=table title="Infobox software"]

FieldValue
nameMscgen
developerMichael McTernan
latest_release_version0.20
latest_release_date
programming_languageC
operating_systemCross-platform
genreDiagramming software
licenseGNU General Public License
website
::

| name = Mscgen | logo = | caption = | screenshot = | developer = Michael McTernan | latest_release_version = 0.20 | latest_release_date = | programming_language = C | operating_system = Cross-platform | genre = Diagramming software | license = GNU General Public License | website =

Mscgen (short for MSC generator) is a software tool for drawing message sequence charts from a simple to manage text-based source file. Rendered charts can be output in PNG, SVG and PostScript, with hyperlink information in ismap format. There is an extension for MediaWiki, Sphinx (documentation generator) and integration with Doxygen that allows embedding of charts into source code comments with generated automatically inserted into the generated documentation page. Mscgen is free software licensed under the GNU General Public License (GPL).

Examples

The following example is from the author:

::figure[src="https://upload.wikimedia.org/wikipedia/commons/a/aa/Message_Sequence_Chart_-_Sample.png" caption="Sample Message Sequence Chart"] ::

::code[lang=mscgen] msc { a,b,c;

a->b [label="ab()"] ; b->c [label="bc(TRUE)"]; c=>c [label="process(1)"]; c=>c [label="process(2)"]; ...; c=>c [label="process(n)"]; c=>c [label="process(END)"]; a<<=c [label="callback()"]; --- [label="If more to run", ID="*"]; a->a [label="next()"]; a->c [label="ac()"]; b<-c [label="cb(TRUE)"]; b->b [label="stalled(...)"]; a<-b [label="ab() = FALSE"]; } ::

Here are two examples of input and output for some standard SIP message flows:

Simple Call Flow

::figure[src="https://upload.wikimedia.org/wikipedia/commons/d/d6/Message_Sequence_Chart_-_SIP_1.png" caption="Simple SIP Call"] ::

::code[lang=mscgen] msc { UAS1, UAC;

UAS1->UAC [label="INVITE"]; UAS1<-UAC [label="100 Trying"]; UAS1<-UAC [label="180 Ringing"]; --- [label="the client plays ringing"]; UAS1<-UAC [label="200 Ok"]; UAS1->UAC [label="ACK"]; ...; --- [label="the client hangs up"]; UAS1<-UAC [label="BYE"]; UAS1<-UAC [label="200 Ok"]; } ::

Alice calls Bob with Intermediary Proxies

::figure[src="https://upload.wikimedia.org/wikipedia/commons/d/dc/Message_Sequence_Chart_-_SIP_2.png" caption="Alice Calls Bob"] ::

::code[lang=mscgen] msc { Alice, P1, P2, Bob;

Alice->P1 [label="INVITE"]; Alice<-P1 [label="100 Trying"]; P1->P2 [label="INVITE"]; P1=>>P2 [label="100 Trying"]; P2->Bob [label="INVITE"]; P2<-Bob [label="100 Trying"]; P2<-Bob [label="180 Ringing"]; P1<-P2 [label="180 Ringing"]; Alice<-P1 [label="180 Ringing"]; --- [label="Alice's client plays ringing"]; ...; --- [label="Bob answers"]; P2<-Bob [label="200 Ok"]; P1<-P2 [label="200 Ok"]; Alice<-P1 [label="200 Ok"]; Alice->P1 [label="ACK"]; P1->P2 [label="ACK"]; P2->Bob [label="ACK"]; --- [label="two way media"]; ...; } ::

References

References

  1. "Specification Languages - MSC".

::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::

uml-toolsfree-documentation-generatorsfree-diagramming-software