SIP or to give it its full name Session Initialization Protocol is an IEFT standard protocol used for establishing VoIP sessions over the internet. SIP is the set of messages, which are themselves heavily inspired by HTTP are in text readable format. The messages establish, modify and terminate sessions belonging to one of more media streams. Typical SIP enabled applications such as video conferencing, instant messaging, file transfers and presence notification are the basic tools required to build VoIP and chat applications found in soft-phone and unified communication platforms.
SIP uses text-based messages that are considered either requests or responses between a SIP agent and a SIP server. SIP only concerns itself with the message communication it relies on underlying transport and session protocols to deliver the message on TCP or UDP ports 5060, and/or 5061.
SIP as we have seen focuses on setting up the sessions for voice and video calls. Once it has accomplished the task the actual data streams between the SIP end-points are transported over another protocol called Real-time Transport Protocol (RTP). SIP supports encrypted transfer if required using TLS. Encryption however is accomplished on a hop-by-hop bases so really requires all hops in the path to be trusted which is okay for a LAN but not over the internet.
SIP uses the concept of user agents, servers and proxies. Although two SIP devices can communicate with each other sometimes it is easier to use a proxy. The job of the SIP proxy is to translate the numbers entered into the keypad of the phone into a SIP address and ultimately an IP address. SIP proxies are therefore very useful for offloading and performing lookup and registration and call setup between the devices.
SIP is a very simple protocol, which because of its simple command structure and it is text readable, which makes it easy to troubleshoot yet still be powerful enough to build complex PBX systems.