1. Introduction
IP multicast transfers data to some hosts. One or more hosts are represented by one IP address. Multicast transfers data to all hosts in the best way like normal IP Address Transmission. The group members are dynamic. Members can join or leave a group at any time. The group size and position are not limited. A host can be a member of multiple groups. The Group can be permanent or temporary. The Permanent Group has a notarized assigned IP address, and the number of members in the permanent group can also be 0. Some multicast addresses are retained for temporary groups and only exist when there are members in the group. When multicast data is reported over the network, multicast routers can be used together with gateways or separated from gateways. When a host transmits an IP multicast data report, it acts as a local network multicast, and a Local Network Multicast transmits a datagram to a directly adjacent host. If the IP lifetime of the datagram is greater than 1, the multicast router forwards the data to the network of other members in the group. On the network that can be achieved within the IP lifetime, the corresponding multicast Router performs local multicast to complete all the multicast processes.
2. Level
There are three situations in this article: we classify them:
Level 0: IP multicast not supported
Currently, IP multicast is not required for all hosts. For hosts at this level, multicast does not affect their activities. If a network has Level 1 or Level 2 hosts, they may send multicast datagram to level 0 hosts. This type of datagram uses Class D addresses, so it is easy to identify. It is enough for a level 0 host to discard them.
Level 1: supports sending IP multicast, but does not support receiving Multicast
Level 1 hosts complete some multicast functions, but these hosts cannot join any host group. Upgrading from level 0 to level 1 is very easy, and the amount of code changes is very small.
Level 2: fully supports IP Multicast
Level 2 allows the host to join or leave the group, and can also send datagram to the group. It needs to implement IGMP and IP extension as well as some host interface programs of the domestic network.
3. Group address
The Host group is a Class D address, and the class D address is "1110", that is, the Class D address ranges from 224.0.0.0 to 239.255.255.255, of which 224.0.0.0 is retained, 224.0.0.1 indicates a permanent group (including a gateway ).
4. IP implementation example
The multicast extensions implemented by IP addresses are represented by the following layers. In this model, ICMP and IGMP are implemented in the IP module. The local network module maps IP addresses to local network addresses.
5. send multicast IP Datagram
5.1. IP Service Interface Extension
Multicast datagram is transmitted in the same way as normal IP transmission. The upper-layer protocol module only tells the IP address to transmit the datagram to a multicast address, rather than some addresses. However, some extensions are also necessary. If the upper-layer interface does not provide a method to specify the IP survival time of multicast datagram, the service interface should provide. If the upper-layer protocol does not specify the survival time, the default value of IP datagram for all multicast IP addresses is 1. If the host is connected to multiple networks, a method of upper-layer protocol should be provided for service receiving so that it can know which interface will be used for multicast. During initial transmission, only one port is involved, and the multicast router is responsible for forwarding to other networks. If the upper-layer protocol does not specify the transmission interface, use the default Interface to transmit multicast datagram. If the sending host is a member of this group, the service interface must be able to provide a mechanism to prohibit local data transmission.
5.2. IP Module Extension
To support multicast, the IP module must be able to identify IP host Group addresses. Most IP modules include the following code:
If the IP address destination transmits data to the IP address in the region Network
Else transmits the data in the Gateway
To adapt to multicast expansion, the routing algorithm needs to be improved as follows:
If the IP destination address is in the internet or the IP destination address, the host group directly transmits the datagram to the destination address.
Else sends data to the Gateway
If the sender host is a member of the group, you must keep a copy of the sent data. The Host group address cannot appear anywhere in the datagram source address domain or source route.
5.3. Expansion of local network service interfaces
You do not need to modify the local network service interface. The IP module specifies a group address instead of a single address.
5.4. Expansion of the Ethernet Network Module
Ethernet directly supports sending local multicast packets. All you need to do is map the IP Group address to the Ethernet multicast address. An IP multicast address can be mapped to a 23-bit Ethernet multicast address 01-00-5e-00-00-00. Because 28 meaningful BITs exist in IP multicast addresses, several host Group addresses can be mapped to an Ethernet multicast address.
5.5. Expansion of other local network modules
Local Networks that comply with the IEEE 802.2 standard or support multicast can process multicast like Ethernet. For a network that does not support multicast but supports broadcast, all host Group addresses can be mapped to one broadcast address. For hosts that are connected only in point-to-point mode, only one server is sent. For a storage forwarding network, such as ARPAnet or X.25, all IP host Group addresses can be mapped to a recognized IP multicast router's local address, this vro completes multicast tasks within and between the network.
6. Receive IP multicast packets
6.1. IP Service Interface Extension
The multicast IP address datagram is processed in the same way as that in normal unicast mode, and is processed by the upper layer protocol. The Protocol selected depends on the Protocol domain in the IP header. It has nothing to do with the destination address. However, before the datagram does not reach a specific group, the upper-layer protocol must require the IP module to join the group because two new services are required:
Joinhostgroup (group-address, interface)
Leavehostgroup (group-address, interface)
Joinhostgroup requires the host to be a member of the group specified by group-address, and leavegroup is the opposite of it, so that the host leaves a group. If the host has only one interface, the interfaces in the above two functions can be ignored. If the host is connected to multiple networks, you can choose not to specify the upper-Layer Protocol. In this case, the request is sent to the default port of multicast. Allow multiple interfaces to join the same group, and allow multiple upper-layer protocols to join the same group. The two operations must be returned immediately and the caller determines whether the operation is successful. If invalid parameters are provided, joinhostgroup will certainly fail, while leavehostgroup may not.
6.2. IP Module Extension
To support receiving IP multicast datagram, the IP module also needs to expand to Support Group members related to a network interface. The Processing Method of the received datagram is the same as that of the host to receive the datagram at a specific address. If the received datagram is not for this group, it is discarded directly without errors or logs. If a host has multiple interfaces, and another interface receives the datagram, the datagram will also be discarded. The received datagram is not denied because the survival time is 1. If the received datagram has an IP host group address in its source address domain, the packet is directly discarded. The Host group list can be updated with joinhostgroup and leavehostgroupt. Each member body must have an access log (or similar mechanism) to process multiple requests for joining and leaving. When the first request and the Last Exit request are added, the corresponding host interface is used to update the multicast receiving filter.
The IP module also needs to implement the IGMP protocol, which is used to notify the local router of the specific members of the local network. To support IGMP, each second-level host must add each interface to the "all-hosts" group (Address: 224.0.0.1) during initialization. As long as the machine is on, it cannot leave the group.
6.3. Expansion of local network service interfaces
The received Local Network Multicast package is a common local network package. It is sent to the IP Module after receive local is used. To be able to name the IP module to know which local module should receive the package, two new services must be added:
Joinlocalgroup (group-address)
Leavelocalgroup (group-address)
"Group-address" is the IP host group address. Joinlocalgroup requires the local network module to receive packets. Leavelocalgroup requires the local network module to stop transmission. The local network module should map the IP host group address and the local network address, and update the filter according to the requested service (such as joining or leaving the group. If you cannot filter the received packets correctly, the local network module does not need to care about leavelocalgroup. You can send more packets than joinlocalgroup requires. The local network module cannot transmit the multicast packets to the upstream layer. The loopback multicast is handled by the Protocol above the IP layer.
6.4. Ethernet Local Network Module Expansion
This supports multicast. The Ethernet module must receive packets sent to an Ethernet multicast address. The Ethernet multicast address corresponds to the IP multicast address. The filtering function of Ethernet hardware should be effectively used. However, the current Ethernet interface has a limit on the number of addresses that can be identified, but it must be able to listen on a certain number of Ethernet multicast addresses, this means that when the address exceeds the filter limit, open the address filter to receive all multicast packets. If the hardware implementation is inappropriate, you can use the Ethernet software module for implementation.
6.5. Non-Ethernet Local Network Module Expansion
Other multicast networks, such as the IEEE 802.2 network, can process multicast IP data packets like Ethernet. For pure broadcast networks, such as experimental Ethernet, all received broadcast packets must be transmitted to the IP module for IP filtering. In point-to-point or storage-based forwarding networks, multicast is similar to normal transmission, and no module needs to be changed.