[zeromq-dev] Full spec for ZeroMQ protocol over TCP

Martin Sustrik sustrik at 250bpm.com
Sun May 1 20:37:43 CEST 2011


Hi Pieter,

> This is my attempt at a full ABNF grammar:
>
> zmtp        = *connection
>
> connection  = greeting *content
> greeting    = anonymous / identity
> anonynous   = %0x01 %x00
> identity    = length %x00 (%0x01-ff) *OCTET
>
> message     = *more-frame final-frame
> more-frame  = length %x01 body
> final-frame = length %x00 body
> length      = OCTET / (%xFF 8OCTET)
> body        = *OCTET
>
> content     = broadcast | addressed | neutral
>
> broadcast   = header message
> header      = more-frame
>
> addressed   = envelope message
> envelope    = *more-frame delimiter
> delimiter   = %0x01 %x01
>
> neutral     = message

Great work, thanks!

I would separate the grammar into pieces though. Basically, there are 
two layers there: transport-specific layer and 
messaging-pattern-specific layer.

There are three wire level protocols on the first layer at the moment: 
TCP, PGM and EPGM. In the future we are likely to see SCTP, UDT and 
alike. This layer offers features such as framing, late joining, 
labeling and identities.

There are four wire level protocols on the second layer at the moment:
pub/sub, req/rep, pipeline, pair. Three of the four happen to be the 
same at the moment, but will presumably diverge in the future. This 
layer deals exclusively with message routing.

Martin



More information about the zeromq-dev mailing list