The examples presented in this chapter are intended to introduce the key features of UML that need to be used for protocol modeling. We start with a simple protocol, implementing an “echo” to a message received. We then add more and more features to this protocol in order to obtain a simplified full-duplex data sending protocol.
This first example aims at modeling a simple protocol with the following characteristics:
– there are two communicating entities: client and server;
– the client sends a “Hello_req” message to the server, and the server answers with a “Hello_res” message;
– system ends.
Let us represent these requirements by using a communication diagram (see Figure 2.1).
First, let us create a simple sequence diagram representing the expected behavior in a chronological order. For this, we will use a sequence diagram1.
First, the client sends a Hello_req message to the server. On receipt, the server answers with a Hello_res message. The system then finishes. Figure 2.2 represents this expected behavior.