Session Initiation Protocol
The Session Initiation Protocol (SIP) is a signaling protocol, widely used for controlling multimedia communication sessions such as voice and video calls over Internet Protocol (IP). Other feasible application examples include video conferencing, streaming multimedia distribution, instant messaging, presence information and online games. The protocol can be used for creating, modifying and terminating two-party (unicast) or multiparty (multicast) sessions consisting of one or several media streams. The modification can involve changing addresses or ports, inviting more participants, adding or deleting media streams, etc.
The SIP protocol is a TCP/IP-based Application Layer protocol. SIP is designed to be independent of the underlying transport layer; it can run on Transmission Control Protocol (TCP), User Datagram Protocol (UDP), or Stream Control Transmission Protocol (SCTP).[3] It is a text-based protocol, incorporating many elements of the Hypertext Transfer Protocol (HTTP) and the Simple Mail Transfer Protocol (SMTP),[4] allowing for direct inspection by administrators.
Protocol design
SIP employs design elements similar to HTTP-like request/response transaction model.[5] Each transaction consists of a client request that invokes a particular method or function on the server and at least one response.
SIP clients typically use TCP or UDP on port numbers 5060 and/or 5061 to connect to SIP servers and other SIP endpoints. Port 5060 is commonly used for non-encrypted signaling traffic whereas port 5061 is typically used for traffic encrypted with Transport Layer Security (TLS).
SIP is primarily used in setting up and tearing down voice or video calls. It has also found applications in messaging applications, such as instant messaging, and event subscription and notification.
SIP network elements
A SIP user agent (UA) is a logical network end-point used to create or receive SIP messages and thereby manage a SIP session. A SIP UA can perform the role of a User Agent Client (UAC), which sends SIP requests, and the User Agent Server (UAS), which receives the requests and returns a SIP response. These roles of UAC and UAS only last for the duration of a SIP transaction.
A SIP phone is a hardware-based or software-based SIP user agent, that provides call functions such as dial, answer, reject, hold/unhold, and call transfer. Examples include softphones such as Ekiga, KPhone, Twinkle, Windows Live Messenger, X-Lite, and hardware phones from vendors such as Avaya, Cisco, Leadtek, Polycom, Snom, and Nokia.
Each resource of a SIP network, such as a User Agent or a voicemail box, is identified by a Uniform Resource Identifier (URI), based on the general standard syntax also used in Web services and e-mail. A typical SIP URI is of the form: sip:username:password@host:port. The URI scheme used for SIP is sip:. If secure transmission is required, the scheme sips: is used and SIP messages must be transported over Transport Layer Security (TLS).
SIP Messages
SIP is a text-based protocol with syntax similar to that of HTTP. There are two different types of SIP messages: requests and responses. The first line of a request has a method, defining the nature of the request, and a Request-URI, indicating where the request should be sent.The first line of a response has a response code.
For SIP requests, RFC 3261 defines the following methods:
* REGISTER: Used by a UA to notify its current IP address and the URLs for which it would like to receive calls.
* INVITE: Used to establish a media session between user agents.
* ACK: Confirms reliable message exchanges.
* CANCEL: Terminates a pending request.
* BYE: Terminates a session between two users in a conference.
* OPTIONS: Requests information about the capabilities of a caller, without setting up a call.
The SIP response types defined in RFC 3261 fall in one of the following categories:
* Provisional (1xx): Request received and being processed.
* Success (2xx): The action was successfully received, understood, and accepted.
* Redirection (3xx): Further action needs to be taken (typically by sender) to complete the request.
* Client Error (4xx): The request contains bad syntax or cannot be fulfilled at the server.
* Server Error (5xx): The server failed to fulfill an apparently valid request.
* Global Failure (6xx): The request cannot be fulfilled at any server.
Source: http://en.wikipedia.org/wiki/Session_Initiation_Protocol
Sone more references:
SIP Concept based on some stories :)
http://www.sipcenter.com/sip.nsf/html/Personal+Selective+Presence
http://www.sipcenter.com/sip.nsf/html/SIP+Silent+Rejection+Service
http://www.sipcenter.com/sip.nsf/html/SIP+Call+Redirection
Thursday, November 5, 2009
How to Start and Stop Services
Httpd Service:
service httpd stop
service httpd start
Example:
[root@lnx init.d]# service httpd stop
Stopping httpd: [ OK ]
[root@lnx init.d]# wget http://localhost/index1.html
--23:02:18-- http://localhost/index1.html
=> `index1.html.1'
Resolving localhost... 127.0.0.1
Connecting to localhost[127.0.0.1]:80... failed: Connection refused.
[root@lnx init.d]# service httpd start
Starting httpd: [ OK ]
[root@lnx init.d]# wget http://localhost/index1.html
--23:02:28-- http://localhost/index1.html
=> `index1.html.1'
Resolving localhost... 127.0.0.1
Connecting to localhost[127.0.0.1]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 65 [text/html]
100%[=====================================================================>] 65 --.--K/s
23:02:28 (634.77 KB/s) - `index1.html.1' saved [65/65]
[root@lnx init.d]#
FTP Service:
Used Vsftpd server as FTP server here.
(To start any service using "service start", we should have the corresponding servie
in the /etc/init/d directory. Lets see how to add vsftpd to /etc/init.d later. For now we can
start / stop the vsftpd service using the process spawn / kill method)
To start the vsftpd service as a background process:
/usr/local/sbin/vsftpd &
To stop the vsftpd service, kill the process:
killall vsftpd
Example:
[root@lnx ~]# ftp localhost
Connected to lnx.cisco.com.
220 (vsFTPd 2.0.5)
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (localhost:root): root
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 "/root"
ftp> quit
221 Goodbye.
[root@lnx ~]#
DNS Service
Service "named" is meant for DNS.
[root@lnx ~]# service named restart
Stopping named: [ OK ]
Starting named: [ OK ]
[root@lnx ~]#
Instead of "restart", you can also "stop" and then "start".
Example:
[root@lnx ~]# dig @localhost www3.example.com
; <<>> DiG 9.2.4 <<>> @localhost www3.example.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 16182
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;www3.example.com. IN A
;; ANSWER SECTION:
www3.example.com. 1 IN A 3.1.1.2
www3.example.com. 1 IN A 3.1.1.3
www3.example.com. 1 IN A 3.1.1.4
;; AUTHORITY SECTION:
dnsins.com. 1 IN NS ns.dnsins.com.
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(localhost)
;; WHEN: Wed Nov 4 23:35:20 2009
;; MSG SIZE rcvd: 98
[root@lnx ~]#
SIP
service httpd stop
service httpd start
Example:
[root@lnx init.d]# service httpd stop
Stopping httpd: [ OK ]
[root@lnx init.d]# wget http://localhost/index1.html
--23:02:18-- http://localhost/index1.html
=> `index1.html.1'
Resolving localhost... 127.0.0.1
Connecting to localhost[127.0.0.1]:80... failed: Connection refused.
[root@lnx init.d]# service httpd start
Starting httpd: [ OK ]
[root@lnx init.d]# wget http://localhost/index1.html
--23:02:28-- http://localhost/index1.html
=> `index1.html.1'
Resolving localhost... 127.0.0.1
Connecting to localhost[127.0.0.1]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 65 [text/html]
100%[=====================================================================>] 65 --.--K/s
23:02:28 (634.77 KB/s) - `index1.html.1' saved [65/65]
[root@lnx init.d]#
FTP Service:
Used Vsftpd server as FTP server here.
(To start any service using "service
in the /etc/init/d directory. Lets see how to add vsftpd to /etc/init.d later. For now we can
start / stop the vsftpd service using the process spawn / kill method)
To start the vsftpd service as a background process:
/usr/local/sbin/vsftpd &
To stop the vsftpd service, kill the process:
killall vsftpd
Example:
[root@lnx ~]# ftp localhost
Connected to lnx.cisco.com.
220 (vsFTPd 2.0.5)
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (localhost:root): root
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 "/root"
ftp> quit
221 Goodbye.
[root@lnx ~]#
DNS Service
Service "named" is meant for DNS.
[root@lnx ~]# service named restart
Stopping named: [ OK ]
Starting named: [ OK ]
[root@lnx ~]#
Instead of "restart", you can also "stop" and then "start".
Example:
[root@lnx ~]# dig @localhost www3.example.com
; <<>> DiG 9.2.4 <<>> @localhost www3.example.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 16182
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;www3.example.com. IN A
;; ANSWER SECTION:
www3.example.com. 1 IN A 3.1.1.2
www3.example.com. 1 IN A 3.1.1.3
www3.example.com. 1 IN A 3.1.1.4
;; AUTHORITY SECTION:
dnsins.com. 1 IN NS ns.dnsins.com.
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(localhost)
;; WHEN: Wed Nov 4 23:35:20 2009
;; MSG SIZE rcvd: 98
[root@lnx ~]#
SIP
Subscribe to:
Posts (Atom)