Draft of protocol codec