Broadcast and multicast are only applicable to UDP. Generally, each Ethernet frame is sent only to a single destination host. The destination address specifies a single receiving interface, which is called unicast ). A host sends frames to other hosts on the Internet. This is broadcast. Multicast (multicast) is between unicast and broadcast: Ethernet frames are sent only to multiple hosts in multicast groups.
The host filters frames transmitted over a channel, as shown in Figure 1:
1. Check the frame on the NIC to determine whether to receive the frame. If the frame is received, it is passed to the device driver. The network adapter only receives frames whose destination address is the physical address or broadcast address of the network adapter. If multiple interfaces are set to the mixed mode, one copy of each frame can be received;
2. the device driver will perform another frame filter:
1) the Protocol to be used must be specified in the frame type;
2) perform multicast filtering to check whether the host belongs to the multicast group of the multicast address.
3. the device driver transmits the data frame to the IP layer (if it is an IP-type datagram ). The IP address performs more filtering checks based on the source address and destination address in the IP address. If normal, the datagram is transmitted to the next layer;
4. UDP filters the destination ports in the data transmitted at the IP layer.
Figure 1 filtering of received frames at each layer of the protocol stack
In any case, the vro does not forward a datagram whose destination address is a restricted broadcast address. Such a datagram only appears on the local network.
IP multicast provides two types of services:
1. send data to multiple destination addresses;
2. Customer requests to the server.
To specify a multicast address, the first byte of any ethernet address must be 01. For example, if IANA has an ethernet address block, that is, a 24-bit high value is 00: 00: 5e (expressed in hexadecimal notation), the address range of this address block is 00: 00: 5e: 00: 00: 00 to 00: 00: 5e: ff. The ethernet address range of IP multicast is 01: 00: 5e: 00: 00: 00: 00 to 01: 00: 5e: ff.