SEG-2106 - Software Construction - Winter 2016
Assignment 1 : Designing and implementing a telephone system à la SIP
Given: January 26 - Due date: during your lab session of the week of February 22.
Students may work individually or in groups of two.
Please submit your report on paper to the TA. Also, please send an e-mail to the TA including your LTSA system specification and the Umple-Java program (point 4 below)
Preliminaries:
- In Lab-1, you saw the conceptual modeling of a telephone system, and the development through use cases of the specification of the dynamic behavior of telephones that talk with one another through a switch. The specification was at your discretion and you compared your design with the behavior specified by the SIP protocol for IP-telephony.
- In Lab-2, you saw some quite simple model of two telephones written in the LTSA-language which contained some shortcomings.
- In Lab-3, you experimented the design and implementation of a state-machine system using the Umple development environment.
The objective of this assignment is to practice these things again with a slightly different version of a telephone system.
System description
Structure
The telephone system consists of
- three telephones that are identified by the telephone numbers 0, 1 and 2,
- a switch that forwards messages received from a given telephone to the telephone to which they are destined.
- Each telephone is associated with a user objects that interacts with the telephone for making or receiving telephone connections.
Dynamic behavior
Each telephone can initate a call and also respond to a call request. The messages exchanged between the telephones (through the switch) follow the SIP conventions. Only the INVITE, INVITE_Response, ACK, BYE, and BYE_Response messages of SIP are used for the control of telephone connections. The switch plays the role of a SIP Stateful Proxy (see for instance Wikipedia).
The user objects communicate with their corresponding telephone through the following interactions:
- go (int xxx) : a command to establish a connection with telephone number xxx (input to the telephone)
- talk : output from the telephone which means that the connection is established and the user can talk and listen
- busy : output from the telephone which means that the destination user is busy
- ringing : output from the telephone which means that somebody wants to establish a telephone connection
- pick_up : command meaning that the user accepts the incoming telephone connection
- terminate : input or output meaning that the ongoing telephone connection is terminated (by the local or remote user)
Tasks
- Define the dynamic behavior of the user objects in terms of a state machine model involving the interactions listed above. Note: It is suggested to use a state machine model with a single interaction per transition, either input or output.
- The SIP messages mentioned above are quite complex and contain a large number of parameters. For modeling the behavior of the telephone system for this assignment, one can simplify the situation a lot by using as few parameters as possible. You should write down the list of messages and their parameters which you intend to use for this project. Note, you may change the names of the messages and their parameters compared with how they are called in SIP - however, it is important to keep these names similar in order to show the correspondance with the SIP definitions.
- Define the dynamic behavior of the telephone objects in terms of a state machine model involving the interactions with the user and with the switch. Note: It is suggested to use a Mealy state machine model where each transition has an input interaction that triggers the transition and zero, one or more output interactions that are generated during the transition.
- Note: To simplify the problem, you may assume that the termination of a connection will be initiated by the user who established the connection. - Or you may assume that there would never be a situation where both users terminate an existing connection at the same time.
- Based on your state machine models from points (1) and (3), build a simplified telephone system in LTSA and verify that it does not have any deadlocks. Suggestions for simplification:
- The system contains only two telephones and two users.
- The first user only initiates the connection, and the second user only accepts the connection.
- Consider also a second version of the system where the second user is busy (the second user has a different behavior).
- Note: The interactions of the two sides (telephones and users) must be distingished, also the messages flowing between the first telephone and the switch must have names different than the messages between the second telephone and the switch. An easy approach (but a bit ennoying) is to simply add a suffix 0 or 1 to the state names and interaction names in LTSA. You may look for inspiration in the LTSA example TCP symmetric v4 - TCP 1981.lts
- Model the telephone system (based on points (1), (2) and (3)) in the Umple development environment.
- Implement the telephone system in Umple by adding the main process which creates the switch and three telephones. Do some test runs and document the sequence of interactions that are performed. You may in particular test the following situations:
- The user of telephone number 0 initiates a connection to telephone 1 or 2.
- While telephone 0 and 1 have a connection, the user of telephone 2 tries to establish a connection with telephone numher 0 or 2.
- Compare some of the observed interaction sequences in the Umple implementation with the sequences provided by the LTSA modeling.
Hand-in on paper: A report on the results obtained for the above tasks
- And by e-mail to the TA: LTSA specification and Umple program
The (preliminary) marking scheme is as follows:
- Task 1: 10 points
- Task 2: 5 points
- Task 3: 15 points
- Task 4: 20 points
- Task 5: 20 points
- Task 6: 15 points
- Task 7: 5 points
- In addition: Writing style, organization, presentation of the report:
(20 points)