Media Gateway: it is mainly used to convert voice signals into IP packets.
Media Gateway controller, also known as gate keeper or call server. Responsible for signal transmission and conversion management.
Voice server: mainly provides voice response services when the phone is disconnected, busy, or busy.
Signaling Gateway: it is mainly used to control the call establishment and provide value-added services for related applications during the exchange process.
Classification of Media Gateway (MG)
Relay Media Gateway (TG): Used to complete relay connection with the PSTN/plmn telephone switch and convert the 64 kbit/s voice signal in the PCM relay of the telephone switch to an IP packet.
Signaling Gateway (SG): used for completing the Signaling connection with the PSTN/plmn telephone switch, and converting the signaling information of the telephone switch based on the TDM circuit to the IP package.
Access Gateway (AG): provides analog user line interfaces for directly connecting normal telephone users to the softswitch network. It can provide all services provided by the PSTN, such as telephone services and dial-up Internet services, it directly encapsulates user data and user line signaling in the IP package.
Integrated Access Device (IAD)
IAD provides both analog user lines and Ethernet interfaces for accessing common telephones and computer devices. It is applicable to users who use telephone services and computers to use data services respectively.
The other type of IAD Only provides Ethernet interfaces for accessing computer devices. It is suitable for users who use both telephone and data services on computers, in this case, you need to install a dedicated "softphone software" on your computer device ".
PBX, which is a Programmable switch. PBX is a commonly used telephone communication management method in modern office work. It enables telephone managers to manage incoming calls and outgoing calls within the group.
The PBX device generally consists of an external port and an internal port. The external line refers to the total number of external lines connected to the group phone number, and the internal line refers to the number of telephones arranged by the employee. The external port of the PBX is fxo and the internal port is FXS.
Fxo, external exchange board. Its full name is foreign exchange office. It is a relay interface, which is generally connected to the port of the local machine or the extension of the upper-level switch. It provides an out-of-band route for the upper-level switch to implement the loop remote connection function.
FXS is an external exchange station. It is called foreign exchange station in English. It is a telephone terminal interface. Generally, it is followed by the relay port or telephone of the first-level switch to provide an outbound route for the extension of the next-level switch to call the IP address.
What are the factors involved in session quality?
A. Delay: the value of round-trip delay cannot exceed 300 ms.
B. jitter: the key is to ensure latency consistency. The solution is to use jitter buffers.
C. packet loss: the packet loss rate cannot exceed 5%;
Retransmission policy: 1. Back N frames; 2. selective retransmission.
D. Speech Coding Technology: There are many commonly used speech coding technologies, such as g.711 and the bit rate is 64 Kbps.
Management and priority: for example, it is a key task to ensure that voice packets in the queue are not congested when a large file transmission occupies network bandwidth.
What applications does VoIP have?
A. IP-based PBX: combines an enterprise's telephone system with a computer network;
B. IP voice mail;
C. Hosted PBX solutions;
D. IP Call Centers: customer service center;
IP protocol Problems
Indentification is used to identify the fragments belonging to the same datasync;
The flags field indicates whether a datagram can be further divided. If the datagram has been segmented, it indicates whether it is the last fregment;
Fragment offset is used for sequential synthesis of destination segments;
Time to live (TTL) is not actually the time, but the maximum number of allowed segments (hops );
In Protocol, the value of TCP is 6, and the value of UDP is 17;
TCP protocol Problems
Divide the data stream into segments, and add a TCP header to each segment;
If the sequence number of a segment is 100 and contains 150 ETS (= byte), the serial number of the next segment is 250;
URG: whether urgent data is included;
Ack: acknowledgement;
Psh: Push function, indicating that data should be sent to the receiver immediately;
RST: an error occurs and a session is aborted;
SYN: used for initial data transmission. (This flag is set to 1)
Fin: The session ends normally.
Window field: when TCP receives data and sends an ACK, this field is used to describe the available empty cache space.
UDP protocol Problems
Source Port is optional unless the sender expects a response;
Why is voice over UDP and not TCP?
UDP packet loss is within the tolerable range;
Due to the high sensitivity to latency, the TCP retransmission mechanism will lead to an intolerable delay, which is fatal in communication;
Packet loss rate is less than 5%, which does not greatly affect the call quality;
In fact, most packets use the same route when using UDP;
QoS technology will also continue to mature to continuously improve the quality of calls.
Gateway: for example, you can call a long-distance call to San Francisco in Beijing. In Beijing, a common public call is connected to a local gateway through PSTN. The local gateway performs specific compression algorithm processing on the data, it is organized into IP groups that contain data such as the master, called number, time, and call information, analyzes the called number, and maps it into an IP address based on the route table, the remote gateway that is sent to this IP address (such as San Francisco. In San Francisco, the remote gateway receives the IP Data Group transmitted by the local gateway in Beijing, decompress the data in the opposite process, and then sends the data to the local terminal's PSTN network. In this way, real-time communication between two locations is realized. The communication fee included in the fee is only for Beijing local ordinary telephone fee + Internet communication fee + San Francisco local telephone fee.
RTP Problems
--------------------------
| IP | UDP | RTP | data |
--------------------------
Contains time-stamp
RTCP package is used for quality feedback transmission;
RTP sessions and RTCP sessions always start at the same time;
The default port number of RTP is 5004, and RTCP is 5005;
The payload type in RTP is used to indicate various encoding standards, such as 7bit, 35-71, and 77-95 To be determined. It is dynamic in 96-127 and is retained in 72-76;
RTP Header:
Version (v) the current version is 2;
Padding (p) When p = 1, it indicates that one or more filling bytes are included for 32-bit alignment;
Whether extension (x) includes header extension;
Number of count (CC) ;
Marker (m) is used to support silence suppression. It is set to 1 in the first package of a talkspurt;
Payload type (PT) Generally, each single RTP packet only contains one encoding format of the load, but there are also exceptions. For example, red profile contains multiple encoding formats, at this time, the loads of each encoding are managed by an additional header. The PT value only indicates that this is a red load. For details, refer to RFC 2198;
Sequence number is set to a random value at the beginning of a session. Then, this value is added to 1 in each RTP packet to detect packet loss and sort packets by recipient;
The timestamp records the sampling time of the first byte in the load and is used to calculate latency and jitter. The initial value is a random value and increases progressively according to the number of samples made between two consecutive RTP packets;
Synchronization soruce (SSRC) indicates the entity responsible for setting the serial number and timestamp, usually the sender of the RTP package. The ID is randomly selected, so it has nothing to do with the network address. In addition, if the RTP stream comes from a mixer, SSRC indicates that the mixer is not the media source;
Contributing source is used to indicate the media source after the mixer when the RTP stream comes from a mixer.
RTP Header extensions: valid when the X Domain value is 1. In this case, the first few bytes of payload are used as extension headers with special meanings, followed by the domain.
Mixers
Merge multiple media streams: In view of bandwidth problems, mixer combines 4-channel 64 Kbps RTP streams into a separate 64 Kbps stream.
Adjust the data format: for example, if a low-speed connection access person appears in a high-speed connection session, mixer may use a low-bandwidth encoding mechanism for it;
Set the timestamp value.
Traslators
Only used for media format conversion, not a SS (synchronization source ).
RTCP Problems
The ability to periodically control information exchange among session participants aims to provide quality-related feedback. By using the RTCP and IP multicast mechanisms, you can perform third-party monitoring and detection.
RTCP defines five different types of RTCP packages:
1. Sender report (SR) is used to relay sending and receiving statistics;
2. Receiver report (RR) receives statistics only from participants who do not send a media stream;
3. source description (sdes) contains one or more descriptions of a specific session participant. A unique canonical name (cname) must be included to identify the session participant. It is different from SSRC because the SSRC value may change after the host reset. Furthermore, if the sender simultaneously sends two RTP streams of the audio and video in a given session, the two media streams have different SSRC values but have the same cname;
4. Bye indicates that a session is aborted;
5. The app is used to investigate specific media types and application information, but the RTCP does not specify the details of the app package.
In fact, two or more RTCP packages are always bundled into a hybrid package for sending. All RTCP packages must start with one Sr or RR and contain at least one sdes, even if an empty Sr or RR is added between sdes.
Example of compound packet: (the sender leaves the session)
H: Header D: Data
-------------------------------------------------------------
| Sr H | Sr d | sdes H | sdes d | bye H | bye d |
-------------------------------------------------------------
RTCP Sender report (SR)
Consists of three parts: Header, sender information, and multiple report blocks.
1. header:
RC field, which indicates the number of receiption report blocks, 5bit. A single SR can contain up to 31 RR blocks. When there are more than 31 RR, you only need to add one Sr after the last RR;
The payload type (TP) value is 200;
2. Sender info:
SSRC of sender;
NTP timestamp: The first integer and the second decimal part. The reference time is from, January 1, January 1, 1900. The unit is seconds. The decimal part is accurate to 200 milliseconds, this version of the Network Time Protocol expires on April 9, 2036. A new version should be available between them. The timestamp information comes from a time server which transmits timing information over the network through the NTP protocol;
RTP timestamp simultaneously contains the RTP and NTP timestamps to make the receiver better synchronize with the sender;
Sender's Packet Count records the total number of RTP packets transmitted from the session to the RTCP packet sent out. This item is reset only when the sender's SSRC value changes;
Sender's octet count records the total number of load bytes transmitted from the session to the RTCP packet sent out. This item is reset only when the sender's SSRC value changes;
3. RR blocks :( RR is used to feedback the receipt of RTP packets)
Ssrc_n indicates the source ID of the session participant associated with the RR block;
Fractioin lost (8 bit) indicates the packet loss rate, that is, the number of lost packets divided by the expected number of packets, the number of dropped packets can be measured by the sequence nmuber In the RTP packet header each time;
Cumulative number of packets lost (24bit) the total number of packages lost since the beginning of the session;
Extended highest sequence number receirved (32bit) Low 16-bit indicates the serial number of the recently received RTP packet. Generally, the 16-bit height is 0, however, if the serial number of A sent source is cyclic, the 16-bit value in the corresponding RR segment indicates the number of cycles;
Interarrival jitter's estimation of inconsistency in the arrival of RTP packets;
Last Sr timestamp (LSR) indicates the 32-bit middle of the 64-bit NTP timestamp in the last Sr sent by the SSRC corresponding to the received RR block, to tell whether the SR sent by it has been received;
Delay since last Sr (dlsr) is accurate to 1/65536 seconds from the time when the last SR was received to the time when the RR block was issued.
The RR package includes the header, the sender SSRC, and the report blocks, which are basically the same as the SR, but the PT value in the header is 201.
RTCP source description packet (sdes) related
It must exist in each RTCP hybrid package. It consists of one header and zero or multiple chunks. The PT value in the header is 202, and the SC value indicates the number of chunks;
Each chunk includes an SSRC or value, followed by some sdes items, such as the email address, phone number, and name. However, one item is required, that is, the cname, it is in the form of user @ host.
RTCP bye Packet
The PT value is 203, and SC indicates the number of SSRC or. After that, there is a length field indicating the number of bytes of the text string. The length field is followed by the reason that the text characters are stored and left the session.
Application-defined RTCP Packet