Audio and Video SDK development IP Multicast Technology

Source: Internet
Author: User

in theInternet, multimedia services such as streaming media, video conferencing, and video-on-demand are becoming an important part of information transmission. The unicast mode of point-to-point transmission cannot adapt to this kind of service transmission specialSex--single-point multicast, because the server must provide each recipient with the same contentIPmessage Copy, while the network also repeatedly transmits the same content of the message, occupying a large amount of resources. 1.1is shown. AlthoughIPbroadcast allows a host to put aIPMessages are sent to all hosts on the same network, but because not all hosts require these messages, the network resources are wasted. In this situationunder conditions of multicast (Multicast) came into being, and it solved the way a host sends messages to a specific number of recipients. 1989years,IETFthroughRFC1112, defines theInterneton the multicast mode.


    IP multicast refers to a ip message to a " host group " transfer, This host group containing 0 or more hosts is identified by a separate ip address. Host group address also known as multicast address " d


    The members of the host group can change dynamically, Hosts have the option to opt in or out of a host group. Hosts can join multiple host groups, or they can send data to host groups that they do not join. There are two types of host groups: the persistent group and the temporary group. The ip internet management agency assigned, is the reserved address. The address of the staging group uses non-reserved d


the forwarding of IP multicast packets on the Internet is handled by routers that support multicast. The IP multicast packets sent by the host are received by all host group members in the subnet, and the multicast router directly connected to the subnet forwards the group broadcast to all the networks that contain the host group members. The range of group broadcast text is determined by the lifetime value of the message (ttl,time-to-live) , if the TTL value is equal to or less than the set router port TTL threshold value (ttlthreshold), the router will no longer forward the message.

    the multicast capability that a single data stream can send to multiple clients has become a means of transmission for most multimedia applications. Multicast technology leverages aIPAddress enablesIPData Messagessent to the user group. IPMulticast uses a special definition of purposeIPAddress and purposeMACaddress. IGMPprovides a way for clients to join and leave the multicast group. CGMPConfiguring the router to configure multicast for the switchforwarding and telling the current multicast members of the switch. Assigning routers uses dense mode based on the different distribution and use of multicast members in the networkDMor Sparse modeSMMulticast routing protocol to construct multicast distributiontree, and this distribution tree will determine a unique path between the source subnet and the multicast group to improve data transfer efficiency.

IP Multicast technology requires a layer three switch, or router support, usually used in private networks, such as: Education Network, radio and television network and intranet, etc., using IP Multicast technology can greatly reduce the bandwidth requirements of the data sender, the greatest benefit is that the number of data receivers can be thousands, without causing network congestion.

from anychat r4424 anychat supports client-side multicast while also supporting server multicast. Audio and video data can be sent locally on the client to the ip multicast group, It can also be uploaded to the server by the client and then sent by the server to the ip multicast group.

client about ip Multicast related interface definition (with javascript

1. // kernel parameter definition (API:brac_setsdkoption incoming parameter)

2. var brac_so_network_multicastpolitic = 45; Multicast policy control (parameter int type, defined as constant:brac_mcpolitic_xxxx)

3.

4. // multicast policy definition

5. var brac_mcpolitic_disable = 0; Execute Server routing policy, prohibit all group advertisements from sending [ default ]

6. var brac_mcpolitic_onlylocalmc = 1; Ignore Server routing policies, broadcast media streams only to client local multicast groups

7. var brac_mcpolitic_serverandlocalmc = 2; executes a server routing policy while sending multicast data locally on the client

8. var brac_mcpolitic_onlyservermc = 3; Ignore Server routing policies, broadcast media streams only to server local multicast groups

9. var brac_mcpolitic_serverandservermc = 4; executes the server routing policy while sending multicast data on the server side

.

One . // multicast function logo definition

var brac_mcflags_joingroup = 0x00000001; Join a multicast group

var brac_mcflags_leavegroup = 0x00000002; leave a multicast group

var brac_mcflags_senddata = 0x00000010; Data Send flag indicating that the multicast group is used to send data

- var brac_mcflags_recvdata = 0x00000020; A data receive flag indicating that the multicast group is used to receive data

.

// multicast function control

Functionbrac_multicastcontrol (lpmulticastaddr, Dwport, Lpnicaddr, Dwttl, dwFlags);

.

Typical applications:A,B,Cthree clients, where servers,B,Cin a multicast network environment,AMulticast is not supported locally,Aserver-side multicast data is expected to be passed toB,C, whileB,Cdata that you want to pass directly to the server .A
1,Aneed to use multicast policy4(SERVERANDSERVERMC), and notifies the server to send data to the multicast group, the sample code is as follows:

1. brac_setsdkoption (BRAC_SO_NETWORK_MULTICASTPOLITIC,BRAC_MCPOLITIC_SERVERANDSERVERMC);

2. Brac_multicastcontrol ("224.2.3.4", 8100, "", 5,brac_mcflags_senddata);

2 , B , C You also need to use a multicast policy ( SERVERANDSERVERMC ), along with the need to join the multicast group, the sample code is as follows:

1. brac_setsdkoption (BRAC_SO_NETWORK_MULTICASTPOLITIC,BRAC_MCPOLITIC_SERVERANDSERVERMC);

2. Brac_multicastcontrol ("224.2.3.4", 8100, "", 5,brac_mcflags_joingroup + brac_mcflags_recvdata);

related sample code ( Web ) is located Git Library \web\src\tools\anychatmulticast directory (need to install the latest version Web plugin)

Audio and Video SDK development IP Multicast Technology

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.