Detailed analysis and implementation of sip protocol

SIP SIP (Session IniTIaTIon Protocol) is an application layer signaling control protocol. A session for creating, modifying, and releasing one or more participants. These sessions can be Internet multimedia conferencing, IP telephony or multimedia distribution. Participants in the session can communicate via multicast (mulTIcast), mesh unicast, or a mixture of the two.

SIP interoperates with Resource Reservation Protocol (RSVP) responsible for voice quality. It also collaborates with several other protocols, including Lightweight Directory Access Protocol (LDAP) for location, Remote Authentication Dial-In User Service (RADIUS) for authentication, and RTP for real-time transport.

An important feature of SIP is that it does not define the type of session to be established, but only how the session should be managed. This flexibility means that SIP can be used in a wide range of applications and services, including interactive gaming, music and video on demand, as well as voice, video and web conferencing. SIP messages are text-based and therefore easy to read and debug. The programming of new services is simpler and more intuitive for designers. SIP reuses MIME type descriptions just like email clients, so session-related applications can be started automatically. SIP reuses several existing and mature Internet services and protocols such as DNS, RTP, and RSVP. There is no need to introduce new services to support the SIP infrastructure because many parts of the infrastructure are already in place or ready to use.

The extension to SIP is easy to define and can be added by service providers in new applications without damaging the network. Old SIP-based devices in the network do not interfere with new SIP-based services. For example, if the old SIP implementation does not support the methods/headers used by the new SIP application, it will be ignored.

SIP is independent of the transport layer. Therefore, the underlying transport can be an IP using ATM. SIP uses User Datagram Protocol (UDP) and Transmission Control Protocol (TCP) to flexibly connect users independent of the underlying infrastructure. SIP supports multi-device function adjustment and negotiation. If the service or session initiates video and voice, you can still transfer the voice to a device that does not support video, or you can use other device features, such as one-way video streaming.

Communication providers and their partners and users are increasingly eager for a new generation of IP-based services. Now with SIP (The Session Initiation Protocol), it's an urgent need. SIP was an idea born in a computer science lab less than a decade ago. It is the first protocol to implement multi-user sessions for a variety of media content and is now the specification of the Internet Engineering Task Force (IETF).

SIP protocol parsing and implementation

The SIP protocol is an application layer based session control protocol. It can create, modify, terminate multimedia sessions (meetings), or invite participants to join an existing session.

Because SIP is an application layer-based protocol, it is not a complete communication system solution. It needs to be combined with other solutions or protocols to implement the entire system. For example, Real Time Transport Protocol (RTP) (RFC1889) is used to transmit real-time streaming media data such as audio and video. Real Time Streaming Protocol (RTSP) (RFC 2326) is used to control the delivery of media streams. The Media Gateway Control Protocol (MEGACO) (RFC3015) is used to control the PSTN gateway.

It can be seen that the SIP protocol should be used to combine other protocols to achieve a complete service. However, the functionality and operation of the SIP base does not depend on other protocols.

SIP (Session Initiation Protocol, RFC 3261) is a signaling protocol for Internet conferences and telephony established by the IETF (International Internet Standards Development Organization). SIP is an application layer protocol that can establish, modify or suspend multimedia sessions or calls. It is an ASCII-based end-to-end protocol that actually provides "dating" services over the Internet. There are three types of open protocols used to implement VoIP, SIP, MGCP (Media Gateway Control Protocol), and H.323.

The SIP protocol is a protocol designed specifically for IP telephony, especially in combination with the Internet. Compared with the traditional H.323 protocol, SIP has obvious advantages: excellent scalability - greatly improving the processing power of the system; Tight integration - making communication easier and more convenient; excellent openness - not only good support for mobile devices such as mobile phones, PDAs, but also for multimedia applications such as online instant communication, voice and video data transmission .

SIP features and advantages

Detailed analysis and implementation of sip protocol

Detailed analysis and implementation of sip protocol

SIP compatible protocol

The SIP protocol can work alone or in conjunction with the following protocols.

Detailed analysis and implementation of sip protocol

Second first example

Detailed analysis and implementation of sip protocol

The following examples of RFC3261 are used to illustrate the basic functions of sip, including: locating terminals, sending communication requests, negotiating session parameters, establishing sessions, and revoking established sessions. Figure 1 shows a typical example of users Alice and Bob exchanging information using SIP (each message is numbered with the letter F and a number, with a short message type description in front of the label). In this example, Alice calls Bob using a SIP application on her PC, and Bob uses his SIP phone, which is logged into the Internet. At the same time, please note that the two SIP proxy servers play a role in the establishment of Alice and Bob's session.

Alice calls Bob to use his SIP identifier. A SIP identifier is a URI (Uniform Resource Identifier) ​​called a SIP URI. The SIP URI format is much like an email address and contains a username and a hostname, such as: sip:. Here biloxi.com is the domain name of Bob's SIP service provider. Alice's SIP URI is: sip:. SIP also supports secure URIs, called SIPS URIs, for example, sips:. A call to a SIPS URI uses encrypted transmission (ie, TLS) to carry all SIP messages from the caller to the callee.

SIP is a request/response transaction model that is very similar to the HTTP protocol. Each transaction consists of at least one request to complete a particular method or function, and a response from the server side. In this example, the transaction begins with Alice's softphone sending an INVITE request to Bob's SIP URI. INVITE is a SIP message indicating that the requester Alice wants to talk to Bob. The INVITE request contains some header fields. The header field is called an attribute and can provide additional information about this message. We will explain them in detail about the header fields. The INVITE message (F1) in Figure 1 might look like this:

Detailed analysis and implementation of sip protocol

The first line of text is the method name (INVITE) of this request. The following lines are multiple header fields. Only the minimum required header fields are listed here. Here is a brief introduction to these header fields:

The Via header field contains the address that Alice wishes to receive in response to this request. That is, she told the recipient of the request that the response should be sent to pc33.atlanta.com. The latter branch parameter is the identifier of this transaction.

The To header field contains a display name (Bob) and a SIP URI or SIPS URI, here is the SIP URI (sip:) used. This SIP URI is the target to be sent by this request.

The From header field also contains a display name (Alice) and a SIP URI or SIPS URI, here is the SIP used.

URI(sip:) to indicate the originator of the request. This header field also contains a tag parameter, which contains a random string (1928301774). The number of this string is automatically added by the softphone. It mainly plays the role of authentication, and will be explained later.

The Call-ID header field contains a globally unique identifier to identify the call. This identifier is generated using a random string along with the host name (or IP address) where the softphone is located. In this way, the To header field, the From header field, and the Call-ID header fields can uniquely determine the peer-to-peer communication relationship between Alice and Bob, and hand this communication relationship to a dialog to handle.

The Cseq header field (command sequence) contains an integer and a method name. Each new request in this conversation will increase the value of this integer to ensure that the value is ordered.

The Contact header field contains a SIP URI or SIPS URI indicating a direct route to Alice. This SIP URI is typically composed of a username and a fully qualified domain name (FQDN). Because many end systems do not have a registered domain name, you can also use an IP address instead of an FQDN. The Via header field indicates to the other party where the response to the request should be sent, and the Contact header field indicates to the other party where the future request should be sent.

The Max-Forwards header field limits the maximum number of hops that can be made when this request is sent to the destination. It contains an integer that is reduced at each hop.

The Content-Type header field describes the type of message body (in this example the message body uses the SDP description, but the message body content is not given).

The Content-Length header field indicates the number of bytes in the message body.

In the following we will fully introduce the SIP header field (RFC3261 section 20).

In the session, information such as media type, encoding mode, sampling rate and the like are not described by SIP, but the format of other session description protocols is used in the message body. The SDP description (RFC2327) is used in this example.

The softphone does not know Bob or the SIP server that owns the biloxi.com domain name. It sends the INVITE request to the SIP server with the domain name atlanta.com serving Alice. How Alice obtains the address of the atlanta.com SIP server can be specified by Alice's softphone or by DHCP.

The Atlanta.com SIP server is a SIP proxy server. A proxy server receives the SIP request and forwards the request to the sender of the request. In this example, the proxy server sends a 100 response (Trying) to Alice's softphone after receiving the INVITE request. A 100 response indicates that the INVITE request has been received by the proxy server and has been further routed to the destination.

The responses in SIP are represented by 3 digits, each of which represents a descriptive phrase. This 100 response also includes the same To, From, Call-ID, CSeq, and Via and branch parameters as the INVITE request, so that Alice's softphone knows that the response is for the corresponding INVITE request. The atlanta.com proxy server locates the biloxi.com proxy server (this may need to be implemented via a Domain Name Resolution Server (DNS), as explained in more detail later) to obtain its IP address and is ready to forward the INVITE request to the biloxi.com proxy. server. Before forwarding the request, the atlanta.com proxy server adds an additional Via header field, which contains its own address (this time the first Via header field of the INVITE request contains the address of Alice's softphone).

The biloxi.com proxy server receives the INVITE request and also sends a 100 (Trying) response to the atlanta.com proxy server indicating that it has received the INVITE request and is processing the request. The biloxi.com proxy server knows Bob's IP address (which may require a location service), and it adds a new Via header field to the INVITE request, which is its own address, and then it sends the INVITE request to Bob. SIP phone.

Bob's SIP phone receives the INVITE request, sends a 180 (Ringing) response, and uses the ringtone to inform Bob that there is a call from Alice, allowing Bob to decide whether to answer. This 180 (Ringing) response is sent back to Alice via these two proxy servers. Each proxy server uses the Via header field to decide where to send this response and removes the Via header field it adds itself. Thus, although only the initial INVITE request is sent using the DNS service and the location service, and the 180 (Ringing) response is not used, and the proxy server does not need to record the status of the entire communication, the response can be successfully sent to The sender of the request, Alice.

When alice's softphone receives a 180 (Ringing) response, it tells Alice about the message, perhaps using a voice (ringback) or displaying a message on Alice's screen.

In this example, Bob decides to answer the call, and when he presses the answer button, his SIP phone sends a 200 (OK) response to accept the call. This 200 (OK) response contains a message body that uses SDP to describe information such as the media type of the session that Bob is prepared to establish with Alice. Thus, Alice and Bob exchanged SIP information once: Alice sends the message to Bob with the INVITE request, and Bob sends it to Alice with a 200 (OK) response. This exchange implements basic negotiation capabilities and a simple offer/answer model. If Bob does not want to answer the call, or if he is busy now (answering other calls), then he will send an error response instead of a 200 (OK) response. An error response will not establish a session.

The 200 (OK) response sent by Bob might look like this:

Detailed analysis and implementation of sip protocol

Detailed analysis and implementation of sip protocol

The first line of the response contains a response code (200) and an explanatory phrase (OK). The other line is the header field of the response. The values ​​of the Via, To, From, Call-ID and CSeq header fields are all copied from the INVITE request (this time there should be 3 Via header fields, respectively, by Alice's SIP softphone, atlanta.com proxy server, and biloxi. Com proxy server added). Bob's SIP phone adds a tag parameter to the To header field. All future requests and responses belonging to this dialog must contain this tag parameter.

When Alice's softphone receives this 200 (OK) response, it immediately stops ringing and shows that the call has been answered. Finally, Alice sends an acknowledgment message (ACK) to Bob's SIP phone, indicating that she has received the final response (200 (OK)). The final response in this example was sent directly by Alice to Bob, because Alice's softphone can get Bob's address information from the Contact header field. With the three-step handshake of INVITA/200/ACK, the SIP session is established. See Section 13 of RFC3261 for detailed steps on SIP session establishment.

Now that Alice and Bob's multimedia sessions have been established, they can send media data in a format negotiated by SDP. In general, the transmission of media packets and the transmission of SIP messages use different communication methods. Most SIP messages are forwarded through a proxy server, while media data uses peer-to-peer transmission.

During the session, either Alice or Bob decides to change the media session by sending a re-INVITE request. This re-INVITE request contains a new media description (probably SDP) that does not create a new session but modifies the currently existing session. After receiving the request, the other party sends a 200 (OK) to agree to the change, and finally the requester sends an ACK. If the other party does not agree with this modification, an error response may be sent, such as 488 (not accepted). But this failure response does not cause the existing session to exit, but continues to communicate using the previously negotiated media. For a detailed description of modifying a session, see Section 14 of RFC3261.

Finally, Bob sends a BYE message to hang up. The BYE message is sent directly to Alice's softphone. Alice sends 200 (OK) to determine that the BYE message was received and terminates the session. Bob does not need to send an ACK because the ACK is sent only when it receives a response to the INVITE. For a more detailed description of terminating a session, see Section 15 of RFC3261. Another question is how the biloxi.com server gets Bob's location. When Bob's SIP phone is turned on, it will send a REGISTER message to a registration server. The role of the REGISTER message is to bind Bob's SIP URI or SIPS URI to Bob's current phone address and save this binding information to the database. This is called a location service. The biloxi.com proxy server uses the location service to get Bob's address. The registration server, proxy server, and location server are all logical servers, not physical servers, so they can be on the same server.

Dc Gear Motor

Dc Gear Motor can be defined as an extension of Dc Motor which already had its Insight details demystified here. A dc gear motor has a gear assembly attached to the motor. The speed of motor is counted in terms of rotations of the shaft per minute and is termed as RPM .The gear assembly helps in increasing the torque and reducing the speed. Using the correct combination of gears in a dc gear motor, its speed can be reduced to any desirable figure. This concept where gears reduce the speed of the vehicle but increase its torque is known as gear reduction.

dc gear motor gear motor

Application field: usually used Electronic door locks, shutter motor, home audio equipment, sweep the floor machine robot

dc gear motorgear motordc gear motor

Features: dc gear motor drive precision, small volume, large torque, low noise, durability, low energy consumption, customized power design,easy installation, easy maintenance;Simplify design and save space.


Method of use: the best stable in horizontal plane, installed on the dc gear motor output shaft parts, cannot use a hammer to knock,knock prone to press into the dc gear motor drive, may cause damage to internal components, and cannot be used in the case of blocked.


dc gear motor


Operating temperature range:

Dc geared motors should be used at a temperature of -10~60℃.

The figures stated in the catalog specifications are based on use at ordinary room temperature catalog specifications re based on use at ordinary room temperature (approximately20~25℃.

If a geared motor is used outside the prescribed temperature range,the grease on the gearhead area will become unable to function normally and the motor will become unable to start.Depending on the temperature conditions ,it may be possible to deal with them by changing the grease of the motor's parts.Please feel free to consult with us about this.

dc gear motor dc gear motor

Storage temperature range:

Dc geared motors should be stored ta a temperature of -15~65℃.

In case of storage outside this range,the grease on the gearhead area will become unable to function normally and the motor will become unable to start.


Service life:

The longevity of dc gear motor is greatly affected by the load conditions , the mode of operation,the environment of use ,etc.Therefore,it is necessary to check the conditions under which the product will actually be used .The following conditions will have a negative effect on longevity.Please consult with us should any of them apply.

●Use with a load that exceeds the rated torque

●Frequent starting

●Momentary reversals of turning direction

●Impact loads

●Long-term continuous operation

●Forced turning using the output shaft

●Use in which the permitted overhang load or the permitted thrust load is exceeded

●A pulse drive ,e.g.,a short break,counter electromotive force,PWM control

●Use of a voltage that is nonstandard as regards the rated voltage

●Use outside the prescribed temperature or relative-humidity range,or in a special environment.

●Please consult with us about these or any other conditions of use that may apply,so that we can be sure that you select the most appropriate model.

dc gear motor dc gear motor



when it come to volume production,we're a major player as well .each month,we rurn out 600000 units,all of which are compliant with the rohs directive.Have any questions or special needed, please contact us, we have the engineer group and best sales department to service to you Looking forward to your inquiry. Welcome to our factory.

dc gear motor


Dc Gear Motor,Gear Box Motor,Gear Reduction Motor,Small Diameter Dc Gear Motor

Shenzhen Shunchang Motor Co., LTD. , https://www.scgearmotor.com

Posted on