e is modeled by two places called RTP. Then interaction between SIP and RTP is simply modeled by the passing scenario of an RTP color set with two values of RTPCONN and RTPNONE indicating if receiving or sending RTP packages into the Internet or not. Although the model is simple, it describes the security problem of the inter- action boundary between SIP and RTP, specifies the BYE attack of SIP, and presents an intrusion detection mechanism of the attack. Here, we only focus on the interactions between SIP and RTP to find out the detection method of the BYE attack and ignore the concrete content of SIP and RTP. Modeling and simulation of SIP are for a specific purpose: the on-the-fly modeling helps simplify modeling if it doesn't require the whole modeling. 16.3.3 Timed SIP Model By use of timed color set and useful time attributes in tokens defined in CPN tools, timer and time-related problems of SIP can be easily modeled and analyzed. Timer is an important part for SIP, especially the INVITE transaction. There are some ways in CPN tools to model timer, overtime, and retransmission of SIP. The following example is a small model for Timer A and Timer B of the INVITE client transaction in RFC 3261 (Figure 16.10). colset Message=with INVITE CANCEL|OK200Ring180Busy486 Trying100 NotFound404 Timeout408 |NULL timed; colset time_cons=INT timed; var time_pass, time_cal: time_cons; val T1=500; fun OT (t:time_cons) bool=if t>64*T1 then true else false; As seen in Figure 16.11, retransmission is controlled by transition "Timer A and B" with T1, an interval 2*T1 and Place A. Timeout is controlled by declared overtime function OT of 64*T1 for Timer B with transition "Timer A and B" and Place B. Time transition inscription of "Timer A and B" indicates time consuming by attaching time to "@+." Another way to realize time mod- eling is to calculate consuming time of a token by code segment of transition inscription (see Figure 16.12). The ModelTime and time () are defined timed functions for timed net mod- eling. By calculating 