Protcol statemachine definitions