Principle analysis of multicast (multicast)

Source: Internet
Author: User
Why to use multicast:
The network card receives the target physical address from the net the corresponding all bit bit bits all 1 data timekeeping, will receive this message and passes it to the driver, this network card's working mode is called the broadcast mode, the network card's default working mode contains the direct mode and the broadcast mode. With this feature, the UDP (User Datagram Protocol) also provides the ability to send broadcast packets to multiple destination addresses. Broadcast data is issued from a workstation, as long as all bit bits corresponding to the destination physical address of the packet are set to 1, all workstation network cards in the local area network will receive this message and pass it to the driver. This feature applies to connectionless protocols because all machines on a local area network (LAN) can obtain and process broadcast messages. The disadvantage of using broadcast messages is that each machine must process the message. For example, a user broadcasts a message on a LAN, and the NIC on each machine receives the message, and upload it to the network stack (the driver completes), and then the stack compares the destination port number of the message to the port number specified in all network applications running on that host, to see if they are equal. To determine which network application should receive this message. Typically, most machines on the local area network are not interested in the message, hastily discarding it. However, each machine still takes time in the driver to process the packet to see if any applications are interested in it. As a result, high broadcast traffic causes the machines on the LAN to get bogged down because each workstation checks the packet.
There are special physical addresses that they cannot use as actual physical addresses of any network adapters, but the NIC can be set to not filter the frames received from the network with one of these physical addresses and a number of physical addresses as the destination. These physical addresses are called multicast delivery addresses, and the operating mode of the NIC is called the multicast transfer mode.
"Multicast" also known as "multicast" (multicast), that is, a host of packets can be received by a number of other qualified hosts, this host and those qualified host to form a group, their communications within the group is broadcast-type. Multicast works by setting the NIC of some hosts on a network to multicast transfer mode, specifies that it does not filter a data frame that is the physical address of a multicast address as the destination, so that the driver of these hosts can simultaneously receive a data frame with the physical address of that multicast address as the destination. The drivers of other hosts are not received, and these hosts logically form a "multicast" group. This technology, in contrast to broadcasting, can effectively reduce the burden on other hosts outside the multicast group on the network, because the data sent to the multicast group is not routed to their drivers to avoid unnecessary waste of resources. At first, this technique was designed to compensate for the lack of "broadcast" (broadcasting) communications.

Multicast can be implemented in two ways:
1. Set the NIC to promiscuous mode, then filter all packets received by driver, leaving the packet of the specified multicast address.
This approach is less efficient and is suitable for network adapters that do not support multicast mode.
2. Set the network card for multicast mode, the network card itself has a multicast filter, the network card can determine whether the incoming packets belong to multicast data.
Because multicast filtering is done by hardware, the efficiency is high.

The network card receives only the frame of the destination address as the physical address of the network card and the multicast address (broadcast is one of the multicast). For Ethernet, the lowest bit of the maximum byte for a multicast address is 1 (01:00:00:00:00:00)
For IP multicast, IP multicast addresses are converted to Ethernet multicast addresses, and an Ethernet multicast address can correspond to multiple IP multicast addresses.

Therefore, the device driver or IP layer must filter the datagram because the NIC may receive a multicast data frame that the host does not want to receive. When the network card does not provide enough multicast data frame filtering function, you must set the NIC to "promiscuous mode", by the driver to check whether the data frame received by the host need.
In other words, the two implementation modes of multicast need to be filtered by the driver, but if the network card is filtered first, the workload of the driver can be reduced.

A multicast address is a set of host identifiers that have been added to a multicast group. In Ethernet, a multicast address is a 48-bit identifier that names a set of sites that should be applied in this network to receive a grouping. In IPv4, it is historically called the D-class address, a type of IP address, ranging from 224.0.0.0 to 239.255.255.255. Class D addresses are used for multicast.

Broadcast address is an address that is specifically designed to send to all workstations in the network at the same time. In a network using the TCP/IP protocol, the host identity segment host ID is a full 1 IP address and the broadcast packet is routed to all computers involved in the host ID segment. For example, for a 10.1.1.0 (255.255.255.0) segment, the broadcast address is 10.1.1.255 (255 is 11111111 2), when a packet (packet) with a destination address of 10.1.1.255 is issued, It will be distributed to all computers on the network segment.

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.