Use of Formal Specifications for Protocol Design, Implementation and Testing