njunction with other protocols in order to provide complete services to the users. It is easy to use FSM to model channels and interaction between every two protocols, which helps to analyze problems such as security problems in the interactions boundary. Each protocol establishes an FSM with synchronous transitions for interaction. See C 2009 by Taylor & Francis Group, LLC SIP Handbook: Services, Technologies, and Security Completed Proceeding Terminated Initial Calling so = Initial, S1 Calling, S2 = Proceeding, S3 = Completed, S4 = Terminated +INVITE, (+INVITE) && (twait>=2*T1)) r5 = ++(300-699)-ACK,r6r4r7 rg = +2xx-2xx,rgr5&&twait<=32s,10=-Error e1 = TU-INVITE, e2 = Timer A (T1) e3 = =(TU+2xx)Il(Timer B(64*T1))I (Error), TU+1xx e5 = TU+(300-699)+ACK, 10 (TU+Error) I(TimerD(64*T1)) Notes: "+" means receive message, "-" means send message FIGURE 16.1 FSM model for INVITE client transaction procedure. Figure 16.2 for a simple model of interactions between SIP and the public switched telephone network (PSTN), which is introduced in [22]. In [21], an FSM framework is defined for the SIP extensions (for current as well as future SIP extensions). Various FSMs within a modelled system can interact with each other to achieve the basic functionality. Further, from [23] we learn about an extended finite state machine (EFSM), which extends FSM with input and output parameters, context variables, operations, and predicates. These extensions are used to describe the data flow and the context of the communication. Figure 16.3 is a simple EFSM model for a CANCEL attack prevention method for SIP, which is proposed in [10]. The intruder sends spurious a CANCEL message to the callee to end the calling from the caller. And then the caller would continue waiting for a 200OK message, which causes a (Denial of Service) attack. In order to prevent C 2009 by Taylor & Francis Group, LLC SIP Modeling and Simulation INVITE 180 Ring received received 200 OK 100 Trying 200 OK received SIP FSM PSTN FSM IAM sent received received REL sent re