define packet based protocols in a declarative fashion