Studying the Architecture and Signaling Flow of SIP
Total Page:16
File Type:pdf, Size:1020Kb
Studying the Architecture and Signaling Flow of SIP Metropolia University of Applied Sciences Bachelor of Engineering Information Technology Bachelor’s Thesis 30 April 2021 Abstract Author Niruj Khadka Title Studying the Architecture and Signaling Flow of SIP 32 pages Number of Pages 30 April 2021 Date Degree Bachelor of Engineering Degree Programme Information Technology Professional Major IoT and Cloud Computing Instructors Janne Salnonen, Head of School School of ICT, Metropolia UAS The main purpose of this thesis was to explore Session Initiation Protocol (SIP) and it’s signaling methodology. The functions and the importance of this protocol in the field of Internet Telephony are discussed. Similarly, it also explains the overall architecture and important components used in signaling along with their functionalities. The structure of SIP messages and process of signaling flow between entities over the internet is covered in this study. Roles of other protocols used alongside SIP in VoIP industry is also explained. The author has taken the approach of literature review in conducting this study. Various online sources on SIP were accessed in the beginning. Out of those, 15 were sorted and used for the purpose of this study. The key information collected were then analyzed practically by setting up simple open-source SIP clients and studying the signaling logs of test calls between them. SIP (Session Initiation Protocol) is one of the most common protocols used in VoIP technology. It is an application layer protocol used for establishing, modifying, and terminating multimedia sessions between the two endpoints over the internet. The standard form of this protocol is defined by IETF (Internet Engineering Task Force) in RFC 3261. SIP generally uses SDP (Session Description Protocol) and RTP (Real-Time Transport Protocol) for describing sessions and carrying media over IP network respectively. Since, it is text- based protocol, signaling messages passed between the endpoints is simple and easy to understand. This thesis can be useful to have an overall understanding of SIP protocol, its architecture and application in the Internet Telephony industry. Keywords SIP protocol, VoIP, Proxy Server, SIP headers Contents 1 Introduction 1 2 Overview of SIP 2 2.1 Brief History 2 2.2 SIP OSI Model 3 2.3 Features of SIP 4 2.4 SIP Trunking and Benefits 5 3 SIP Architecture 7 3.1 SIP Entities 10 3.1.1 User Agents 10 3.1.2 SIP Server 11 3.2 SIP Messages 14 3.2.1 Requests 14 3.2.2 Responses 15 3.2.3 SIP URI Scheme 15 3.3 Structure of SIP Messages 17 3.3.1 Request line 17 3.3.2 Headers 17 3.3.3 Message Body 20 3.3.4 SIP Call Flow 20 3.4 Protocol used alongside SIP 22 3.4.1 Session Description Protocol (SDP) 22 3.4.2 Real-Time Transport Protocol (RTP) 23 3.4.3 RTP Control Protocol (RTCP) 24 3.4.4 User Datagram Protocol (UDP) 24 4 SIP Signaling Flow 25 4.1 Registration Process 25 4.2 Transaction flow 26 4.3 Dialog flow 28 4.4 Difference between transactions and dialogs 29 5 Project Work: Simple SIP client setup to study SIP parameters 30 5.1 Setup and Call example 30 5.2 SIP message logs 31 6 Summary and Conclusion 32 References 33 List of Abbreviations SIP Session Initiation Protocol IP Internet Protocol VoIP Voice Over Internet Protocol IETF Internet Engineering Task Force HTTP Hyper Text Transport Protocol SDP Session Description Protocol RTP Real-Time Transport Protocol RTCP Real-Time Transport Control Protocol TCP Transmission Control Protocol UDP User Datagram protocol TLS Transport Layer Security DNS Domain Name System UAC User Agent Client UAS User Agent Server OSI Open-Source Interconnection SMTP Simple Mail Transfer Protocol 1 1 Introduction This thesis explores the architecture and signaling methodology in Session Initiation Protocol. As the popularity of Internet started to grow in early 1990s, a standard program and methodology was felt and was published by Internet Engineering Task Force (IETF) during late 1990s and early 2000s. Since then, the popularity of SIP has been growing rapidly and standard method of its implementation is being followed by internet telephony sector across the globe. SIP protocol was developed and designed to set up, maintain and manage the signaling session between two entities. This thesis explores the detailed study of SIP protocol starting from the history, its components, its architecture, signaling methodology and its benefits. Over the years, SIP is being adopted as the base for internet telephony globally and its continual growth has been skyrocketing with its adoption globally. In this article, we focus completely on the use of SIP in terms of voice signaling over the internet. Apart from voice, SIP is also being used as a signaling protocol for video and instant messaging technology. Many video and instant messaging application available on internet today have adopted and incorporated SIP as a signaling protocol. The development of SIP has revolutionized the communication and especially internet telephony industry as it allows two entities on internet to communicate with each other by providing standard ways to share location, user availability and competence of software and endpoint devices that are used for communication. This standard method has allowed us to communicate with anyone around the world through Internet. Almost every audio and video applications available today use SIP as a standard protocol to handle the session interactions between two or more parties. This thesis has been divided into six major study parts apart. In the first part explores the overview of SIP and its functionality along with the brief history of its evolution along with the explanation of SIP Trunking technology and benefits of it in modern day IP telephony. Second part explores the detailed study of architecture and all the major components involved in SIP session. In the third section, we go through the signaling flows, dialogs and transaction scenarios involved in a signaling session. The fifth section is the case study performed using opensource SIP client i.e., Linphone to have the overview of 2 signaling flow and sip messages. The last section contains summary and conclusion upon the over study. 2 Overview of SIP SIP (Session Initiation Protocol) is an application layer protocol used for establishing and controlling multimedia sessions between two or more endpoints over the internet. This protocol is supported by various IP communications products which includes IP-PBXs, UC servers, application servers, video conferencing systems as well as various range of endpoints like IP phones, softphones, and other UC clients. It is an ASCII-based peer to peer protocol that is used for establishing, maintaining, and terminating Voice over IP (VoIP) sessions and other forms of multimedia sessions like video and text messaging between two or more entities over the internet. In SIP, endpoints of any session act as the (UAs) User Agents which send and respond to the SIP requests. Endpoint that initiates a SIP request is termed as User Agent Client (UAC) while the endpoint that responds to the request is known as User Agent Server (UAS). A SIP endpoint can also serve the functions of both UAC as well as UAS, for instance endpoint can act as UAC when initiating the call whereas it acts as a UAS when accepting the call. Basic function of SIP is to start, stop and maintain the communication session. Alongside these, SIP tracks the user through URI without mapping actual user location. It also lets user agent see when the other user is available to receive requests for communication. 2.1 Brief History Initially only traditional switch-based telephone systems were in use for the purpose of sending and receiving messages. However, with the introduction of internet, requirement of a system that can be used to connect people over the internet was realized. Among the different solutions put forward, the solution proposed by IETF was accepted as the standard one. The first draft presented by IETF was in February 1996 which was known as “draft-ietf-mmusic-sip-00”. The initial draft included only one type of request what was called call setup request. Later in the same year in December, new version was proposed which was called “draft-ietf-mmusic-sip-01”. IETF then introduced upgraded version of draft called “draft-ietf-mmusic-sip-12” that included six SIP requests that the protocol has 3 today. They also published RFC 2543 as a standard that was changed further to make today’s version of RFC 3261 in June 2002. RFC 3261 is the standard draft that describes the standard methodology of functioning SIP as a signaling protocol (K.Banerjee, 2018). 2.2 SIP OSI Model The standard of SIP is designed to match it with the OSI (Open System Interconnection) model. The model describes different layers of protocol mapped showing their functions in terms of transferring and receiving data and signals across a network. Though there is not any official definition of SIP OSI model, it is just a conceptual design that is being used to match the protocol and network element developed by different providers globally in terms of their functionality. SIP and related protocols that works alongside SIP i.e., SDP, RTP and RTCP is shown in the OSI model presented below. The Application layer identifies the communicating entities, authenticate, and allows communication with the lower layers. Presentation layer is used for converting the format of data being transmitted. Session layer coordinates the session connections. Transport layer is used for transferring data between the endpoints. Transport protocols like TCP, UDP and RTP are mapped to this layer. Network Layer is used for correct routing of data transmission to destination.