Audio and video two-time IP multicast technology development

Source: Internet
Author: User

On the Internet , 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 business transmission characteristic -- single point of sending multipoint receive, because the server must provide each receiver with a copy of the same content of the IP message, while the network also repeatedly transmits the same content of the message, occupy a lot of resources. In this case, multicast (multicast) came into being, and it solved the way that a host sends messages to a specific number of recipients. 1989 , theIETF defines the multicast mode on the Internet through RFC1112.

    host group can be dynamically changed, and the host has the option to opt in or out of one of the host groups. Hosts can join multiple host groups, or they can send data to host groups that they do not join. There are two kinds of host groups: permanent and temporary. ip address of the permanent group is weekly, internet Administrative agency assignment, is the reserved address. The address of the staging group uses the non-reserved d class address except for the permanent group address.

      IP multicast packet forwarding on the internet is handled by a multicast-enabled router. The IP multicast packets sent by the host are received by all the 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 scope of transmission of the group broadcast text is determined by the lifetime value of the message (TTL, time-to-live) , if ttl value is equal to or less than the set router port ttl threshold value ( Span style= "Word-wrap:break-word" >ttl Threshold ), the router will no longer forward the message.

The multicast capability of single data streams can be sent to multiple clients has become a means of transmission for most multimedia applications. Multicast technology uses a ip address to send ip data packets to a user group. ip multicast uses a specially defined purpose ip address and destination mac address. igmp provides a way for clients to join and leave the multicast group. cgmp enables the router to configure multicast forwarding for the switch and tells the switch the current multicast member. Assigning routers uses dense mode DM or Sparse mode depending on the distribution and use of multicast members in the network SM Multicast routing protocol to construct a multicast distribution tree, which will determine a unique path between the source subnet and the multicast group to improve data transfer efficiency.

IP Multicast technology requires three layer switch, or router support, usually applied to the private network, such as: Education Network, * * Network and Intranet, etc., using IP Multicast technology can greatly reduce the data sender's bandwidth requirements, the biggest advantage is that the number of data receivers can be thousands, Without causing the network to block.

Anychatplatform Core SDK V4.0 has added support for IP Multicast Technology, which describes how to use the relevant API interfaces, typically joining a multicast group, and sending data to a multicast group as follows:

1.//setting Local Multicast policy

2.DWORD dwmulticastpolitic = 1;

3.brac_setsdkoption (Brac_so_network_multicastpolitic, (constchar*) &dwmulticastpolitic,sizeof (DWORD));

4.

5.//Join a multicast group

6.DWORD dwFlags = Brac_mcflags_joingroup | Brac_mcflags_senddata | Brac_mcflags_recvdata;

7.brac_multicastcontrol ("224.2.3.4", 9810, "", 5, DwFlags);

In the code above, the "dwFlags" flag indicates that the multicast group "224.2.3.4:9810"is joined, the local data is transferred through the multicast group, and it also receives audio and video data from other users from the multicast group.

When multicast data needs to be sent locally, it is necessary to set the local multicast policy because the system defaults to the network data transfer policy configured by the server ( "Routingpolicy" inAnychatcoreserver.ini Configuration items) for data sending, if the local multicast policy is not set, the data will not be sent to the multicast address, after which the local data can be sent multiple multicast addresses and ports, as the following code indicates that the audio and video data is going to "224.2.3.4:9810"," 224.2.3.4:9812 " two multicast ports broadcast data:

1.//setting Local Multicast policy

2.DWORD dwmulticastpolitic = 1;

3.brac_setsdkoption (Brac_so_network_multicastpolitic, (constchar*) &dwmulticastpolitic,sizeof (DWORD));

4.

5.//Join a multicast group

6.DWORD dwFlags = Brac_mcflags_joingroup | Brac_mcflags_senddata;

7.brac_multicastcontrol ("224.2.3.4", 9810, "", 5, DwFlags);

8.brac_multicastcontrol ("224.2.3.4", 9812, "", 5, DwFlags);

When the system has more than one network card, and needs to be connected to a network of a NIC to multicast, can be specified by the third parameter of "Brac_multicastcontrol" , the third parameter is the IP address of the specified network card.

Audio and video two-time IP multicast technology development

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.