Implementing Protocol State Machines
This paper presents some pointers on how to approach a network protocol definition, with a view to implementing it in software.
Protocols tend to be specified in a State Machine (SM) fashionto at least some degree. The control aspects (i.e. setting up, managing and closing connectionsrather than data transfer) lend themselves well to an SM definition and implementation. A protocol has 'state'; it receives input (events) and responds with output (actions, or subsequent events), perhaps changing state as a result of the event.
This paper begins with introducing the practical interpretation of a protocol layerwhat it's made up of and how it is described. Some general concepts surrounding SM models are then introduced. These lead on to case studies of protocol SMs and their design and implementation. Finally, some miscellaneous do's and don'ts are presentedin the hope that these will be of help to the reader should they be faced with the challenge of implementing a network protocol layer.