Introduction to broadcast and multicast and IGMP Protocols 1. Introduction to unicast, multicast, and broadcast 1. 1. unicast (unicast) unicast means data transmission to a specific host. For example, an IP packet is sent to a host. At this time, the data link layer is given in the Data header is very specific destination address, for Ethernet, is the nic mac address (not FF-FF-FF-FF-FF-FF such address ). The current host with the routing function should be able to distribute unicast data in a targeted manner, while the network interface of the target host can filter out data inconsistent with its own MAC address. 1. 2. Broadcast (unicast) is a packet sent by a host to all hosts on a network. This network may be a network, a subnet, or all subnets. If it is A network, for example, the broadcast of A type of web site is netid.255.255.255. If it is A subnet, It is netid. netid. subnetid.255; for all subnets (Class B IP addresses), it is netid. netid.255.255. The MAC address FF-FF used by the broadcast. All hosts in the network will receive the broadcast data, the network card as long as the MAC address for the FF-FF-FF-FF-FF-FF of the data to the kernel can be. Generally, ARP or the route protocol RIP should be broadcast. 1. 3. multicast can be said to be a special case of multicast. multicast sends data to a specific host (multicast group, the data broadcast range is smaller (in fact, the broadcast range is not smaller). The multicast MAC address is the lowest of the highest byte, for example, 01-00-00-00-00-00. The multicast group address is a Class d ip address, which must be 224.0.0.0-239.255.255.255. Although multicasting is special, the principle is that multicast data must be bound to MAC addresses through the data link layer and then sent. Therefore, after an Ethernet Card is bound to a multicast IP address, it must be bound to a multicast MAC address so that it can work like unicast. This multicast IP address and multicast MAC address have a corresponding algorithm between the p133 and p134 of the book. We can see that this is not a one-to-one correspondence. The host still needs to filter multicast data. My opinion: the nature of broadcast and multicast is the same. The router puts the data in the LAN, and then the NIC filters the data and only obtains the data you want, for example, multicast data that you are interested in and multicast data that you are interested in. When a host runs a process that processes a multicast IP address, the process binds a virtual multicast mac address to the NIC and creates a multicast ip address. In this way, the NIC will allow the data with the multicast mac address to communicate, and those hosts that do not listen to the data will filter out the data. In other words, multicast makes the kernel of the host easy, and nic. Sorry, you are tired. 2. Some validation experiments are not very complex. We just need to ping a normal ip address and a broadcast address. First, ping a host in its subnet: Reply from 192.168.11.1: bytes = 32 time <1 ms TTL = 255 Reply from 192.168.11.1: bytes = 32 time <1 ms TTL = 255 Reply from 192.168.11.1: bytes = 32 time <1 ms TTL = 255 Reply from 192.168.11.1: bytes = 32 time = 1 ms TTL = 255 can be seen, the machine returns a response from a host, and then speculate, If I ping a broadcast address? The result is as follows: Reply from 192.168.11.9: bytes = 32 time = 1 ms TTL = 255 Reply from 192.168.11.174: bytes = 32 time <1 ms TTL = 64 Reply from 192.168.11.174: bytes = 32 time <1 ms TTL = 64 Reply from 192.168.11.174: bytes = 32 time <1 ms TTL = 64 Reply from 192.168.11.218: bytes = 32 time <1 ms TTL = 64 Reply from 192.168.11.174: bytes = 32 time <1 ms TTL = 64 can be seen, ping returns some random ip results, these ip addresses are all ip addresses in the same subnet as the host. We can see that the broadcast actually sends messages to all ip addresses in the subnet. Another example of multicasting is that it is not easy to implement this multicasting, because I don't know how many multicast groups are in the network, we had to use several special multicast addresses for verification. For multicast addresses, several special multicast addresses are occupied, which are 224.0.0.1-all the system groups in the subnet. 224.0.0.2 -- all routers in this subnet. 224.0.1.1 -- the network implements the dedicated ntp ip. 224.0.0.9 -- r242 private IP address. Therefore, you only need to ping these IP addresses to obtain some results, for example, ping 224.0.0.2. Reply from 192.168.11.1: bytes = 32 time <1 ms TTL = 255 Reply from 192.168.11.1: bytes = 32 time <1 ms TTL = 255 Reply from 192.168.11.1: bytes = 32 time <1 ms TTL = 255 Reply from 192.168.11.1: bytes = 32 time <1 ms TTL = 255 Reply from 192.168.11.1: bytes = 32 time <1 ms TTL = 255 Reply from 192.168.11.1: bytes = 32 time <1 ms TTL = 255 Reply from 192.168.11.1: bytes = 32 time <1 ms TTL = 255 we can see that this ping only returns a response from an ip address. This is the address of my gateway, which also verifies that 224.0.0.2 is the multicast (Multicast) address of all routers. 3. the IGMP protocol is used to let all other multicast group hosts and routers know their statuses. Generally, a multicast Router does not need to know how many hosts are in a multicast group, but only needs to know whether there are hosts in a multicast group in its subnet. As long as a multicast group has another host, the multicast router will transmit the data so that the receiver can obtain the desired data through the NIC filter function. To know multicast group information, the multicast router needs to regularly send IGMP queries. The IGMP format can be used to read books. The hosts in each multicast group need to reply to their statuses based on the query. The vro determines which multicast groups you want to send data. The TTL of this query response datagram is generally 1, and no ICMP error is generated even if an error occurs (unnecessary ).