University of Ottawa
SEG-2106 : Software construction
Gregor v. Bochmann

SEG-2106 - Lab-1


Domain modeling - A telephone system

Preliminaries: Please look at these examples:

Problem definition

We consider a simple telephone system to be used within a given group of people. We assume that the system consists of a certain number of telephones that are connected to a central switch (either through fixed communication links or through a wireless system). A model of the system structure is given here:

sy;system structure

These telephones are used by the people for making calls or receiving calls (according to the standard procedures for establishing telephone connections). We only consider one-to-one telephone conversations, no teleconferencing.

Typically, for establishing a telephone conversation, the user of a telephone picks up the phone, selects the telephone number of the destination party and requests a call to be made. If the telephone at the destination is not busy, the telephone at the destination will ring, while the original user will hear a ring tone in the telephone. If the a user at the destination picks up the phone the two users can talk. The telephone conversation is terminated when one of the telephones is hang up.

Part 1: the telephone system: domain model and system interactions


  1. Domain analysis:
    1. Normally, a textual description of the problem domain and requirements is given in some form.
    2. Establish a dictionary of terms, which includes the most important words in the textual description.
    3. Domain modeling: Each noun indicates an object, or object class that may be important to be represented in the model. These are the so-called "entities" in the entity-relationship modeling approach. Each verb indicates a relationship between objects that may be important to be represented in the model. Distinguish between active objects (so-called actors) and passive objects that have no own initiatives (they are usually "called").
  2. Identify system boundaries
  3. Identify system interfaces and interactions: Based on the relationships between the system and the other objects in its environment, identify the interactions between entities. There may be different kinds of interactions identified at an abstract level (see below for more detail): operation (method) calls, rendezvous interactions, and message exchanges.
  4. Identify component states: Some of the identified objects may exist in different states, and their dynamic behavior may be different in these different states. Identify these states by constructing a state machine model for these objects. Note that the state transitions (in the state-oriented modeling approach) correspond to transitions between states in the state machine model.

Task 1: Please follow this methodology. The textual description (point 1.1 of the Methodology) is given above in the Problem Definition. We consider here the telephone system as a black box, that is, for the points 3 of the Methodology, we consider the interactions between the users and the telephone system.

Note: Point 4 of the methodology will be addressed in Part 2.

Part 2: Defining the dynamic behavior of the telephone system (black-box approach) - system requirements

Task 2: Here we address Point (4) of the Methodology above. Please define the dynamic behavior of a telephone, as seen by a usert. We only consider the states of a single telephone. It is suggested to describe the dynamic behavior separately for the calling user and for the called user. For this purpose:

  1. Write down use cases for the interactions of a user with the telephone for the following cases:
    1. User A calls another user who accepts the call.
    2. User A calls another user who does not respond.
    3. User A calls another user who is busy.
    4. User B is called and answers the phone.
  2. Write down state diagrams for the calling user and the called user showing their interactions with their phone.

Part 3: System design: the dynamic behavior of a telephone (component view) - state machine model

Now we consider the internal structure of the telephone system, as shown in the diagram above. It is clear that a telephone not only interacts with a user, but also with the switch. The objective of your work in this Part 3 is to provide a model of the dynamic behavior of a telephone including the interactions with the user (as elaborated above) AND the interactions with the switch component.

Task 3: For this purpose, you should perform the following steps:

  1. Establish a list of interactions between a telephone and the switch. For each interaction, indicate whether it is output to the switch, or input from the switch, or both.
  2. Write down a state machine model of a telephone showing its states (including the idle and connected state) and the interactions with the user and the switch. You may show two behavior models, one for the calling telephone and one for the called telephone.

Part 4: Compare your system design with SIP (the IP-telephony protocol defined by IETF)

The SIP protocol has been defined by the Internet Society (IETF) as a standard protocol for IP-telephony. A SIP-telephone realizes the functions of a SIP user agent. This functionality includes a so-called Client behavior (for initiating a telephone call) and a so-called Server behavior (for receiving a call). A SIP-telephone can directly communicate with another SIP-telephone (if it knows the IP address of the called telephone), but normally the establishment of a telephone call goes through a so-called SIP proxy that plays a role similar to the switch in the telephone system considered above.

The interactions between the SIP-telephones and SIP proxies are classified into SIP Requests (messages sent by a SIP user agent Client and received by a Server) and SIP Responses (messages sent by a SIP user agent Server in response to a SIP Request, and received by a Client).

Task 4: The objective of this Part 4 is to compare your system design (Part 3 above) with SIP. For this purpose, please provide the following:

  1. For each interaction between a telephone and the switch, identified under Part 3, please indicate whether there is a SIP message which has a similar role.
  2. Compare the order of exchanges of SIP messages with the order of interactions in your design model (Part 3 above). Please explain which aspects are similar, and which aspects are different.

An overview description of SIP is given in Wikipedia. A more detailed description was given by the main authors of the SIP protocol in the journal article "Internet Telephony: architecture and protocols – an IETF perspective". I think, for the purpose of this Lab work, it is sufficient to read this extract from the article of the Wikipedia. Here is a summary explanation of the diagram that is shown at the end: This diagram shows the establishment of a connection between the telephone (user agent) "" and the telephone of the destination. "" first sends an Invite message to "SIP Stateful Proxy 1" who does not know how to find the destination and therefore tries to find this information by forwarding the Invite message to the "SIP Redirect Server" who sends back the "Moved temporarily" response message including the efffective address of the destination user, which is "". Then the "SIP Stateful Proxy 1" sends an Invite message with the effective destination address through two other proxies until the destination is reached. The telephone user agent of the destination returns the "200 OK" response which finally reaches the calling user agent. The latter then sends an ACK Request to confirm that the OK response was received. Thereafter the connection is established and the voice traffic goes directly between "" and "".

It is to be noted that the specification of the SIP protocol does not talk about the interactions with the user. It only talks about the interactions of a SIP-telephone with another SIP-telephone or with a SIP proxy. (Note: Because the user interactions are not defined, it is sometimes not clear what the meaning of the defined telephone-to-telephone interactions are.)

Results to be handed in: A lab report (to be submitted on paper to the TA at the next lab session).

Your lab report shoukl report on your results for the four tasks above.

The (preliminary) marking scheme is as follows:

Please consult with the TA during the Lab session. The role of the TA is to help you to do the work suggested within this Lab.