A protocol layer is a function!
old state
new state
input event
output events
layer
A protocol layer is a
function
that takes the current state and an event as input, and produces a new state and zero or more output events.
Those events, in turn, are fed to other layers.