A Very Brief Primer On IP Technology

"MIDI Over Ethernet" is the popular term, but "MIDI Over IP" is more correct. All of the approaches mentioned transport MIDI using one of the two basic IP (Internet Protocol) packet types: UDP (User Datagram protocol) or TCP (Transmission Control Protocol). While Ethernet is the network transport most commonly used to carry IP traffic, other transports are often used as well. Ethernet has the advantage of being very fast, mature, widely available and dirt-cheap.

UDP is much lighter-weight than TCP (in size, processing overhead and protocol complexity) Most protocols for MIDI Over IP use UDP.

UDP (User Datagram Protocol)

  • Connectionless (receiver is unknown, like MIDI-DIN).
    Can support broadcast or multicast (like MIDI thru box)
    Single duplex (one way) communication.
  • Unreliable. No flow control or error recovery; minimal error detection.
    Datagrams may arrive out of sequence (not in order transmitted).
    Datagrams can be lost (no retries).
  • Uses port addressing (logical network port; not MIDI port)
  • Explicit message boundaries: one message per datagram.
  • Very lightweight compared to TCP. Minimum datagram size is 28 bytes.
    Protocol handler is very simple.

TCP (Transmission Control Protocol)

  • Connection oriented: 1 sender to 1 (known) receiver.
    No support for broadcast or multicast.
    Full duplex (bidirectional) communication.
  • Reliable.
    Out-of-order packets are queued and reordered.
    Flow control and retries are used automatically to recover dropped packets.
  • Models data as a simple byte stream (no message boundaries).
  • Heavyweight compared to UDP. Minimum header size is (at least) 40 bytes.
    Extra features add substantial processing overhead.

Virtually all Internet media streaming protocols use UDP rather than TCP, for performance reasons. Since UDP is not "reliable" in the network sense, media-specific mechanisms are used to handle dropped or out-of-order packets (with varying success). RTP (Real-Time Transport Protocol) is commonly "layered" on top of UDP to help manage UDP deficiencies and provide additional services.

When used strictly over Ethernet (e.g. within a single LAN), UDP can be quite reliable in practice. Ethernet itself has some built-in error recovery, particularly for cases where two hosts attempt to send traffic simultaneously. It is unusual, though not unheard of , for an Ethernet datagram to be lost or corrupted, and out-of-order datagrams are similarly rare.

A newly-introduced protocol (SCTP: Stream Control Transmission Protocol) holds promise for MIDI transport, and should be investigated as a possible basis for a MIDI Over IP protocol (see RFC 2960).