SIP is a layered protocol that allows different modules within it to function independently with just a loose coupling between each layer. Figure 12.4 visualizes the layered approach taken.
The first (bottommost) layer in the protocol is the syntax and encoding layer. Encoding makes use of augmented Backus-Naur Form (BNF) grammar, the complete description of which can be found in [RFC3261].
The second layer is the transport layer. As the name indicates, this is the layer that dictates how clients send requests and receive responses and how servers receive requests and send responses. The transport layer is closely related to the sockets layer of a SIP entity.
The third layer is the transaction layer. A transaction, in SIP terms, is a request that is sent by a client to a server, along with all responses to that request sent from the server back to the client. The transaction layer handles the matching of responses to requests. Application-layer re-transmissions and application-layer transaction timeouts are also handled in this layer and are dependent on the transport protocol used. A client transaction sends requests and receives responses, while a server transaction receives requests and sends responses. The transaction layer uses the ...