Method and device for realizing multicast proxy, home gateway and storage medium
By generating the link local address and Internet protocol address, the problem of failure of multicast proxy function in PPPoE scenarios is solved, and the normal operation of multicast proxy in PPPoE environment is achieved.
Patent Information
- Application Number
- CN202310782680.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-28
- Publication Date
- 2024-12-31
AI Technical Summary
Under PPPoE dialing mode, the router WAN port cannot be assigned to the physical Ethernet port address, resulting in the multicast proxy membership packet missing the source IP address, which in turn causes the multicast proxy function to fail.
By obtaining the router's physical Ethernet address, generating the link local address, and determining the Internet protocol address used by the multicast proxy based on the address, sending a membership change message to the queryer.
In the PPPoE scenario, the problem that the physical Ethernet port cannot be assigned to the address is solved, so that the multicast proxy function can work normally.
Smart Images

Figure CN119232705A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer vision, and in particular to a method and device for implementing a multicast proxy, a home gateway, and a storage medium. Background Art
[0002] At present, there are two basic implementation methods for existing home network Ethernet access technology: an access method based on the Internet Protocol over Ethernet (IPoE) and an access method based on the Point to Point Protocol over Ethernet (PPPoE). For the scenario where the router WAN port uses a static address (IP) or a Dynamic Host Configuration Protocol (DHCP) to access the upper-level router, its WAN port can use its configured / obtained IP as the source IP address to send multicast messages.
[0003] In the scenario where the WAN port is accessed using PPPoE dial-up, since the router WAN port can only obtain the point-to-point address of the PPP interface, its normal physical Ethernet port cannot be assigned an address, resulting in the multicast proxy membership message having no source IP and being unable to be sent, which in turn causes the multicast proxy function to fail.
[0004] Application Contents
[0005] The embodiments of the present application are intended to provide a method and apparatus for implementing a multicast proxy, a home gateway, and a storage medium, which can generate a source IP address through the physical address of a router to implement a multicast proxy function.
[0006] The technical solution of this application is implemented as follows:
[0007] In a first aspect, an embodiment of the present application provides a method for implementing a multicast proxy, the method comprising: when a multicast proxy function is enabled, obtaining a physical address of a router's physical Ethernet port and a plurality of membership change messages; fusing the plurality of membership change messages to obtain a final membership change message; generating a link local address based on the physical address; determining an Internet Protocol address used by the multicast proxy based on the link local address; and sending the final membership change message to a querier via the Internet Protocol address.
[0008] In a second aspect, an embodiment of the present application provides a device for implementing a multicast proxy, comprising: an acquisition unit, a generation unit, a determination unit, and a sending unit, wherein:
[0009] The acquisition unit is used to acquire the physical address of the router physical Ethernet port and multiple membership relationship transformation messages when the multicast proxy function is enabled; merge the multiple membership relationship transformation messages to obtain the final membership relationship transformation message;
[0010] The generating unit is used to generate a link local address according to the physical address;
[0011] The determining unit is used to determine the Internet Protocol address used by the multicast proxy based on the link-local address;
[0012] The sending unit is used to send the final membership change message to the querier via the Internet Protocol address.
[0013] In a third aspect, an embodiment of the present application provides a home gateway, the home gateway comprising: a processor and a memory; wherein:
[0014] The memory is used to store computer programs;
[0015] The processor is used to call and run the computer program from the memory to execute the method as described in the first aspect.
[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing executable instructions for causing a processor to execute and implement the method described in the first aspect.
[0017] The embodiment of the present application provides a method and device for implementing a multicast proxy, a home gateway, and a storage medium. The method includes: when the multicast proxy function is turned on, obtaining the physical address of the router's physical Ethernet port and multiple member relationship transformation messages; fusing the multiple member relationship transformation messages to obtain a final member relationship transformation message; generating a link local address based on the physical address; determining the Internet Protocol address used by the multicast proxy based on the link local address; and sending the final member relationship change message to the querier via the Internet Protocol address. By adopting the above scheme, a link local address can be generated based on the physical address of the router, and the Internet Protocol address used by the multicast proxy can be determined based on the link local address, so that a member relationship change message can be sent to the querier based on the Internet Protocol address, solving the problem that the physical Ethernet port cannot be assigned an address in the PPPoE scenario, so that the multicast proxy function can work normally in the PPPoE scenario. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0019] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0020] Figure 1 An optional process diagram of a method for implementing a multicast proxy is provided for an embodiment of the present application Figure 1 ;
[0021] Figure 2 A schematic diagram of a method for implementing a multicast proxy is provided for an embodiment of the present application;
[0022] Figure 3 A schematic diagram of a multicast message for implementing a method for a multicast proxy is provided for an embodiment of the present application;
[0023] Figure 4 An optional process diagram of a method for implementing a multicast proxy is provided for an embodiment of the present application Figure 2 ;
[0024] Figure 5 An optional process diagram of a method for implementing a multicast proxy is provided for an embodiment of the present application Figure 3 ;
[0025] Figure 6 The present invention provides an optional flow diagram of a method for implementing a multicast proxy. Figure 4 ;
[0026] Figure 7 A schematic diagram of the structure of a device for implementing a multicast proxy provided in an embodiment of the present application;
[0027] Figure 8 A schematic diagram of the structure of a home gateway provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the specific technical solution of the present application will be further described in detail below in conjunction with the drawings in the embodiments of the present application. The following embodiments are used to illustrate the present application, but are not used to limit the scope of the present application.
[0029] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0030] In the following description, reference is made to “some embodiments”, “this embodiment”, “embodiments of the present application” and examples, etc., which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0031] If similar descriptions of "first / second" appear in the application documents, the following instructions are added. In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0032] The present application provides a method for implementing a multicast proxy. Figure 1 This is an optional process diagram of a method for implementing a multicast proxy provided by the present application. Figure 1 , will combine Figure 1 The steps shown are explained.
[0033] S101. When the multicast proxy function is enabled, obtain the physical address of the physical Ethernet port of the router and a plurality of membership change messages.
[0034] In the embodiment of the present application, it is applicable to the multicast proxy function scenario under the IPv4 scenario, and the executing devices involve the home gateway and the querier.
[0035] In some embodiments of the present application, Figure 2 A schematic diagram of a method for implementing a multicast proxy is provided for an embodiment of the present application, such as Figure 2 As shown in the figure, IGMP Proxy is the multicast proxy function. This process includes three devices: multicast member 1 / multicast member 2, layer 3 switch and IGMP query. Figure 2 Left), all membership change messages will be sent directly to the upper-level querier (i.e., IGMP querier); after the multicast proxy is deployed (corresponding to Figure 2On the right side), all member relationship change report messages are aggregated by the router with multicast proxy function enabled (which can be understood as a layer 3 switch) and then sent to the upper-level IGMP querier (i.e., IGMP querier). The snooping mapping relationship of multicast member 1 / multicast member 2 is maintained locally on the router with multicast proxy function enabled. The upper-level querier cannot perceive the existence of multicast member 1 / multicast member 2, and can only perceive the proxy router (layer 3 switching layer). Before the multicast agent is deployed, after the three-layer switch obtains the membership change report message (Report) and the leave message (LEAVE) of multicast member 1 and multicast member 2, it sends too many IGMP membership report / leave messages to the IGMP querier. After the multicast agent is deployed, after the three-layer switch obtains the membership change report message (Report) and the leave message (LEAVE) of multicast member 1 and multicast member 2, it processes the membership change report message (Report) and the leave message (LEAVE) of multicast member 1 and multicast member 2 before sending them to the IGMP querier. After the processing, the number of IGMP membership report / leave messages is reduced, which reduces the workload of the IGMP querier.
[0036] For routers with multicast proxy function enabled, when the proxy router sends a membership change message to the upper-level querier, it will replace the Layer 2 source MAC address in the multicast message with the MAC address of its own outbound interface (WAN port), and replace the Layer 3 source IP address with the IP address of its own outbound interface; that is, the upper-level querier will record the WAN port source MAC + source IP of the router with multicast proxy function into the multicast relationship table.
[0037] It should be noted that MAC addresses can be divided into unicast addresses, multicast addresses, and broadcast addresses, and are the basis for Layer 2 switches to forward data packets. IP addresses are divided into two layers: network number and host number. The front part of the IP address represents the network number of the IP address, which indicates which network the address belongs to; the back part of the IP address represents the host number, which indicates which host in the network the address belongs to. The network number and the host number together constitute the IP address.
[0038] In the scenario where the router WAN port uses a static IP or DHCP method to access the upper-level router, the WAN port can use its configured / obtained IP as the source IP address to send multicast packets. However, in another common scenario where the WAN port uses PPPoE dial-up to access, the router WAN port can only obtain the point-to-point address of the PPP interface, and its normal physical Ethernet port cannot be assigned an address, resulting in the multicast agent membership message having no source IP and being unable to be sent, which in turn causes the multicast agent function to fail.
[0039] It should be noted that static IP refers to an IP address that is assigned to a computer or network device for long-term use. Generally speaking, only special servers or computers that use dedicated lines to access the Internet have fixed IP addresses and they require relatively expensive fees. Static IP is a must for secondary routing. DHCP is a network protocol for a local area network. It means that a range of IP addresses is controlled by a server, and the client can automatically obtain the IP address and subnet mask assigned by the server when logging in to the server. By default, DHCP, as a service component of Windows Server, will not be automatically installed by the system, and the administrator needs to manually install and perform necessary configurations.
[0040] It should be noted that the PPP interface is a virtual interface created on the physical Ethernet port, which relies on the physical Ethernet port to send and receive messages. In the PPPoE dial-up mode, only the virtual interface can obtain the point-to-point address, and the point-to-point address cannot send multicast messages.
[0041] as follows Figure 3 The multicast message shown in the figure must be filled with source IP and source MAC, that is, the area shown in the black box.
[0042] In some embodiments of the present application, the home gateway, that is, Figure 2 In the three-layer switch (also called router) in the home gateway, when the multicast proxy function is enabled and the WAN port is accessed by PPPoE dial-up, the home gateway obtains the physical address of the router and multiple member relationship transformation messages.
[0043] Exemplarily, multiple membership transformation messages may be Figure 2 The member relationship change messages corresponding to multicast member 1 and multicast member 2 are received.
[0044] S102: Merge multiple member relationship transformation messages to obtain a final member relationship transformation message.
[0045] In the embodiment of the present application, the home gateway may merge multiple member relationship transformation messages to obtain a final member relationship transformation message.
[0046] In some embodiments of the present application, the final membership relationship transformation message may be sent to the querier once, so that the querier can receive and process the membership relationship transformation message.
[0047] S103. Generate a link local address according to the physical address.
[0048] In an embodiment of the present application, in a scenario where the WAN port is accessed using PPPoE dial-up, since the home gateway does not have a source IP address, a source IP address can be generated through a physical address, that is, a link local address.
[0049] In some embodiments of the present application, the home gateway takes the last two sub-addresses from the physical address to obtain the first sub-address and the second sub-address; and generates a link-local address based on the first sub-address and the second sub-address.
[0050] The first sub-address and the second sub-address are both in hexadecimal.
[0051] In some embodiments of the present application, the first address of the link-local address is determined based on the first sub-address; the last address of the link-local address is determined based on the second sub-address; and the link-local address is determined based on the first address and the last address.
[0052] S104: Determine an Internet Protocol address used by the multicast proxy based on the link-local address.
[0053] In the embodiment of the present application, after obtaining the link-local address, it is necessary to confirm whether the link-local address has been used. Under the premise that the link-local address has not been used, the Internet Protocol address used by the multicast agent is determined.
[0054] In some embodiments of the present application, to confirm whether a link-local address has been used, the link-local address can be used as the destination address of the query request, and based on the destination address, any membership transformation message can be sent. After sending any membership transformation message, it is determined whether a response message is received.
[0055] In some embodiments of the present application, the home gateway uses the link-local address as the destination address of the query request, and sends any membership transformation message based on the destination address; if no response message is received, the link-local address is used as the Internet Protocol address used by the multicast agent.
[0056] In some embodiments of the present application, the home gateway uses the link local address as the destination address of the query request, and sends message information based on the destination address; if a response message is received, it means that the link local address is used, the link local address is updated, and the updated link local address is obtained. It continues to determine whether the updated link local address is used, until the updated link local address is not used, and the updated link local address is used as the Internet Protocol address used by the multicast agent.
[0057] S105. Send a final membership change message to the querier via the Internet Protocol address.
[0058] In an embodiment of the present application, the home gateway may send a final membership change message to the querier via an Internet Protocol address.
[0059] In some embodiments of the present application, the home gateway includes a receiving module, a multicast-to-unicast module and a sending module. Among them, sending the final membership change message to the querier through the Internet Protocol address is achieved by the sending module, and the final membership change message is obtained in the multicast-to-unicast module. And multiple membership transformation messages are obtained by the receiving module.
[0060] It can be understood that when the multicast proxy function is turned on, the home gateway obtains the physical address of the router and multiple membership change messages; merges the multiple membership change messages to obtain the final membership change message; generates a link local address based on the physical address; determines the Internet Protocol address used by the multicast proxy based on the link local address; and sends the final membership change message to the querier through the Internet Protocol address. By adopting the above scheme, a link local address can be generated according to the physical address of the router, and the Internet Protocol address used by the multicast proxy can be determined according to the link local address, so that the membership change message can be sent to the querier according to the Internet Protocol address, which solves the problem that the physical Ethernet port cannot be assigned an address in the PPPoE scenario, so that the multicast proxy function can work normally in the PPPoE scenario.
[0061] In the embodiments of the present application, Figure 4 This is an optional process diagram of a method for implementing a multicast proxy provided by the present application. Figure 2 ,like Figure 4 As shown, S103 can be implemented by S1031 and S1032 as follows:
[0062] S1031. Take the last two sub-addresses from the physical address to obtain a first sub-address and a second sub-address; the first sub-address and the second sub-address are both in hexadecimal.
[0063] In the embodiment of the present application, after obtaining the physical address, the home gateway takes the last two sub-addresses from the physical address to obtain the first sub-address and the second sub-address.
[0064] It should be noted that the physical address includes multiple bit sub-addresses, and the types of the multiple sub-addresses are all hexadecimal.
[0065] Exemplarily, the obtained physical address (i.e., the MAC address of the physical Ethernet port), such as XX:XX:XX:XX:A1:02, takes the last two digits A1 and 02, that is, the first sub-address is A1 and the second sub-address is 02.
[0066] S1032: Generate a link-local address based on the first sub-address and the second sub-address.
[0067] In an embodiment of the present application, the first address of the link-local address is determined based on the first sub-address; the last address of the link-local address is determined based on the second sub-address; and the link-local address is determined based on the first address and the last address.
[0068] In some embodiments of the present application, the home gateway may determine the first sub-address as the first address of the link-local address, determine the second sub-address as the last address of the link-local address, and then determine the link-local address based on the first address of the link-local address and the last address of the link-local address.
[0069] In the embodiment of the present application, based on the first sub-address, the hexadecimal system is converted into decimal system to obtain the third sub-address; and the third sub-address is used as the first bit address of the link local address.
[0070] In some embodiments of the present application, the home gateway may convert the hexadecimal first sub-address into a decimal third sub-address, and use the decimal third sub-address as the first bit address of the link local address.
[0071] In the embodiment of the present application, based on the second sub-address, the hexadecimal is converted into decimal to obtain the fourth sub-address; and the fourth sub-address is used as the last address of the link local address.
[0072] In some embodiments of the present application, the home gateway may convert the hexadecimal second sub-address into a decimal fourth sub-address, and use the decimal fourth sub-address as the last address of the link local address.
[0073] It can be understood that the home gateway takes the last two sub-addresses from the physical address to obtain the first sub-address and the second sub-address, and generates a link-local address based on the first sub-address and the second sub-address. This allows the link-local address to be used to send messages in the IPv4 scenario, thereby enabling the multicast proxy function to be used normally.
[0074] In the embodiments of the present application, Figure 5 This is an optional process diagram of a method for implementing a multicast proxy provided by the present application. Figure 3 ,like Figure 5 As shown, S104 can be implemented by S1041 and S1042 as follows:
[0075] S1041. Send any membership change message to the querier based on the link-local address.
[0076] In an embodiment of the present application, the home gateway may use the link-local address as the destination address of the query request.
[0077] In some embodiments of the present application, the query request is also called an address resolution protocol request, i.e., an ARP (Address Resolution Protocol) request. ARP is a TCP / IP protocol that obtains a physical address based on an IP address. When a host sends information, it broadcasts an ARP request containing the target IP address to all hosts on the local area network, and receives a return message to determine the target's physical address; after receiving the return message, the IP address and physical address are stored in the local ARP cache and retained for a certain period of time. The next time a request is made, the ARP cache is directly queried to save resources.
[0078] In some embodiments of the present application, ARP is based on mutual trust among hosts in the network. Hosts on the local area network can autonomously send ARP reply messages. When other hosts receive the reply messages, they will not detect the authenticity of the messages and will record them in the local ARP cache. Thus, an attacker can send a fake ARP reply message to a host, so that the information it sends cannot reach the expected host or reaches the wrong host, which constitutes an ARP spoof. The ARP command can be used to query the correspondence between IP addresses and MAC addresses in the local ARP cache, add or delete static correspondences, etc. Related protocols include RAR P and proxy ARP. NDP is used to replace the Address Resolution Protocol in IPv6.
[0079] In the embodiment of the present application, the home gateway can send any membership transformation message to the querier according to the link local address, that is, to detect on the LAN side and the WAN side to see whether a response message is received.
[0080] S1042: If no response information is received, use the link-local address as the Internet Protocol address used by the multicast proxy.
[0081] In the embodiment of the present application, if the home gateway does not receive a response message after sending a message, it means that the link-local address is not used, and the link-local address is used as the Internet Protocol address used by the multicast agent.
[0082] It is understandable that the home gateway can send any membership transformation message to the querier based on the link-local address. If no response information is received, the link-local address will be used as the Internet Protocol address used by the multicast agent to prevent the scenario where the link-local address cannot be used, so that the multicast proxy function in the IPv4 scenario can be used normally.
[0083] In the embodiment of the present application, S1043, S1044 and S1045 are further executed after S1041, as follows:
[0084] S1043: If a response message is received, add 1 to the last digit of the link-local address to obtain an updated link-local address.
[0085] In the embodiment of the present application, after the home gateway sends any membership change message to the querier, if it receives a response message, it means that the link-local address has been used and cannot be used as an Internet Protocol address for the multicast proxy.
[0086] In some embodiments of the present application, after receiving the response information, the home gateway adds one to the last address digit of the link-local address to obtain an updated link-local address.
[0087] S1044. Based on the updated link-local address, send any membership change message to the querier until no response information is received.
[0088] In an embodiment of the present application, the home gateway uses the updated link-local address as the destination address of the query request, and then sends any membership transformation message to the querier based on the destination address to determine whether a response message is received.
[0089] In some embodiments of the present application, after the home gateway sends any membership change message to the querier, if a response message is received, it means that the updated link-local address has been used and cannot be used as an Internet Protocol address for the multicast proxy. If no response message is received, it means that the updated link-local address has not been used.
[0090] In some embodiments of the present application, after receiving the response information, the home gateway continues to add one to the last address digit of the updated link-local address to obtain the updated link-local address, and continues to send message information based on the updated link-local address until no response information is received.
[0091] S1045: Determine the updated link-local address as the Internet Protocol address used by the multicast proxy.
[0092] In an embodiment of the present application, the home gateway may determine the updated link-local address as the Internet Protocol address used by the multicast proxy.
[0093] It is understandable that the home gateway can use the link local address as the destination address of the query request, and send message information based on the destination address. If a response message is received, the last address digit of the link local address is increased by one to obtain an updated link local address. Based on the updated link local address, message information is sent until no response message is received. The updated link local address is determined as the Internet Protocol address used by the multicast agent to prevent the scenario where the link local address cannot be used, so that the multicast proxy function in the IPv4 scenario can be used normally.
[0094] Figure 6 This is an optional process diagram of a method for implementing a multicast proxy provided by the present application. Figure 4 ,like Figure 6 As shown, the steps of implementing the method of multicast proxy are as follows:
[0095] S1. PPPoE dial-up on WAN port is successful.
[0096] S2. Start the multicast proxy function.
[0097] In the embodiment of the present application, when the home gateway WAN PPPoE dial-up is successful (PPPoE obtains the MAC address) and the multicast proxy function is turned on, the physical Ethernet port has no available IP address.
[0098] S3. Get the last two digits of the six-digit MAC address of the WAN port.
[0099] In an embodiment of the present application, the home gateway obtains the MAC address of the physical Ethernet port, such as XX:XX:XX:XX:A1:02, and takes the fifth and sixth characters, namely A1 and 02.
[0100] It should be noted that the MAC address is the physical address.
[0101] S4. Fill these two MAC addresses into the last two segments of the LLA address respectively.
[0102] In the embodiment of the present application, the home gateway generates an LLA address using the fifth and sixth characters of the MAC address, such as 169.254.161.02 (A1 is decimal 161, 02 is decimal 02); as the source IP address of the physical Ethernet port. The principle of generating an LLA address using the fifth and sixth characters of the MAC address is as follows: convert the fifth character of the MAC address into a decimal character and use it as the first character of the LLA address; convert the sixth character of the MAC address into a decimal character and use it as the last character of the LLA address; the remaining characters are randomly generated to obtain the LLA address.
[0103] S5. Generate an LLA address.
[0104] It should be noted that the LLA address, namely the Local Link Address, is a private address in the 169.254.0.0 / 16 network segment.
[0105] S6. Send an ARP resolution request to both the LAN side and the WAN side, and the destination address resolved is this LLA address.
[0106] In an embodiment of the present application, the home gateway uses the generated LLA address as the destination address of the ARP request, and simultaneously performs detection on the LAN side and the WAN side to confirm whether this address has been used by someone, so as to prevent the generation of a conflicting address.
[0107] In an embodiment of the present application, the home gateway uses the LLA address as the destination address of the ARP request and sends any message information to the IGMP querier. If the destination address and the corresponding physical address exist in the IGMP querier, a response message is sent to the home gateway. If the destination address does not exist in the IGMP querier, the IGMP querier cannot send a response message to the home gateway.
[0108] S7. Receive a response.
[0109] In the embodiment of the present application, after the home gateway sends an ARP resolution request to the LAN side and the WAN side at the same time, it determines whether a response is received (ie, whether the response information sent by the IGMP querier is received).
[0110] In the embodiment of the present application, S8 or S10 is executed after S7.
[0111] S8. No response received.
[0112] In the embodiment of the present application, if it is determined that the home gateway has not received a response (meaning that no response information has been received), then the LLA address is available and multicast proxy is performed normally using it as the source address, ie, S9 is executed.
[0113] S9. Perform multicast proxy normally.
[0114] S10. Receive a response.
[0115] In the embodiment of the present application, if the home gateway receives a response (receives the response information sent by the IGMP querier), it proves that someone has already used this LLA address, that is, this address is unavailable.
[0116] S11. Add 1 to the last bit of the LLA address to generate a new available address.
[0117] In the embodiment of the present application, when the LLA address is unavailable, the home gateway adds one to the last digit of the LLA address, that is, the above 169.254.161.02 is further evolved into 169.254.161.03, generating a new available address.
[0118] In the embodiment of the present application, after S11 is executed, S5, S6 and S7 are continuously executed until a usable LLA address is obtained.
[0119] It is understandable that by using the reserved LLA address segment, a source IP address that can be used by the multicast agent is generated according to the MAC address of the physical Ethernet port in the PPPoE scenario, which solves the problem that the multicast agent function cannot be applied in this scenario.
[0120] The embodiment of the present application also provides a device for implementing a multicast proxy, such as Figure 7 As shown, Figure 7 A schematic diagram of a structure of a device for implementing a multicast proxy provided in an embodiment of the present application, wherein the device 7 for implementing a multicast proxy includes: an acquisition unit 701, a generation unit 702, a determination unit 703 and a sending unit 704, wherein:
[0121] The acquisition unit 701 is used to acquire the physical address of the router physical Ethernet port and multiple membership relationship transformation messages when the multicast proxy function is enabled; merge the multiple membership relationship transformation messages to obtain the final membership relationship transformation message;
[0122] The generating unit 702 is used to generate a link local address according to the physical address;
[0123] The determining unit 703 is used to determine the Internet Protocol address used by the multicast proxy based on the link local address;
[0124] The sending unit 704 is configured to send the final membership change message to the querier via the Internet Protocol address.
[0125] In an embodiment of the present application, the acquisition unit 701 is further configured to obtain the last two sub-addresses from the physical address to obtain a first sub-address and a second sub-address; the first sub-address and the second sub-address are both in hexadecimal format;
[0126] The generating unit 702 is further configured to generate the link-local address based on the first sub-address and the second sub-address.
[0127] In an embodiment of the present application, the determination unit 703 is further used to determine the first address of the link local address based on the first sub-address; determine the last address of the link local address based on the second sub-address; and determine the link local address based on the first address and the last address.
[0128] In an embodiment of the present application, the acquisition unit 701 is further configured to convert the hexadecimal system into the decimal system based on the first sub-address to obtain a third sub-address;
[0129] The determining unit 703 is further configured to use the third sub-address as the first address of the link-local address.
[0130] In an embodiment of the present application, the acquisition unit 701 is further configured to convert the hexadecimal system into a decimal system based on the second sub-address to obtain a fourth sub-address;
[0131] The determining unit 703 is further configured to use the fourth sub-address as the last address bit of the link-local address.
[0132] In an embodiment of the present application, the sending unit 704 is further configured to send any one membership transformation message to the querier based on the link-local address;
[0133] The determining unit 703 is further configured to use the link-local address as the Internet Protocol address used by the multicast agent if no response information is received.
[0134] In an embodiment of the present application, the acquisition unit 701 is further configured to, after sending any membership change message to the querier based on the link-local address, if a response message is received, add one to the last address bit of the link-local address to obtain an updated link-local address;
[0135] The sending unit 704 is further configured to send any one membership change message to the querier based on the updated link-local address until no response information is received;
[0136] The determining unit 703 is further configured to determine the updated link-local address as the Internet Protocol address used by the multicast agent.
[0137] It can be understood that when the multicast proxy function is turned on, the home gateway obtains the physical address of the router and multiple membership change messages; merges the multiple membership change messages to obtain the final membership change message; generates a link local address based on the physical address; determines the Internet Protocol address used by the multicast proxy based on the link local address; and sends the final membership change message to the querier through the Internet Protocol address. By adopting the above scheme, a link local address can be generated according to the physical address of the router, and the Internet Protocol address used by the multicast proxy can be determined according to the link local address, so that the membership change message can be sent to the querier according to the Internet Protocol address, which solves the problem that the physical Ethernet port cannot be assigned an address in the PPPoE scenario, so that the multicast proxy function can work normally in the PPPoE scenario.
[0138] Based on the method for implementing a multicast proxy in the above embodiment, the embodiment of the present application also provides a home gateway, such as Figure 8 As shown, Figure 8 A schematic diagram of the structure of a home gateway provided in an embodiment of the present application, the home gateway 8 comprises: a processor 801 and a memory 802. The memory 802 is used to store a computer program; the processor 801 is used to call and run the computer program from the memory to execute the method for implementing a multicast proxy as described in the above embodiment.
[0139] In the embodiment of the present application, the processor 801 may be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, and a microprocessor. It is understandable that for different devices, the electronic device used to implement the above-mentioned processor function may also be other, and the embodiment of the present application does not specifically limit it.
[0140] An embodiment of the present application provides a computer-readable storage medium storing a computer program for implementing the method for implementing a multicast proxy as described in any of the above embodiments when executed by a processor.
[0141] Exemplarily, a program instruction corresponding to a method for implementing a multicast agent in the present embodiment may be stored on a storage medium such as a CD, a hard disk, or a USB flash drive. When the program instruction corresponding to a method for implementing a multicast agent in the storage medium is read or executed by an electronic device, the method for implementing a multicast agent as described in any of the above embodiments may be implemented.
[0142] In addition, each functional module in the embodiment of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional modules.
[0143] If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method of this embodiment. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0144] It should be understood that "one embodiment" or "an embodiment" or "some embodiments" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in one embodiment" or "in some embodiments" appearing throughout the specification may not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application. The above-mentioned sequence numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments. The above description of each embodiment tends to emphasize the differences between the various embodiments, and the same or similar aspects can be referenced to each other. For the sake of brevity, this article will not repeat them.
[0145] The modules described above as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules; they may be located in one place or distributed on multiple network units; some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.
[0146] In addition, all functional modules in the embodiments of the present application may be integrated into one processing unit, or each module may be a separate unit, or two or more modules may be integrated into one unit; the above-mentioned integrated modules may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0147] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, etc., various media that can store program codes.
[0148] The methods disclosed in several method embodiments provided in the embodiments of the present application can be arbitrarily combined without conflict to obtain new method embodiments.
[0149] The features disclosed in several product embodiments provided in the embodiments of the present application can be arbitrarily combined without conflict to obtain new product embodiments.
[0150] The features disclosed in several method or device embodiments provided in the embodiments of the present application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0151] The above is only an implementation method of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the embodiment of the present application. Therefore, the protection scope of the embodiment of the present application should be based on the protection scope of the claims.
Claims
1. A method for implementing a multicast proxy, characterized in that: include: When the multicast proxy function is enabled, the physical address of the router's physical Ethernet port and multiple membership change messages are obtained; Merging the multiple member relationship transformation messages to obtain a final member relationship transformation message; Generate a link local address according to the physical address; Determining an Internet Protocol address used by a multicast proxy based on the link-local address; The final membership change message is sent to the querier via the Internet Protocol address.
2. The method according to claim 1, characterized in that Generating a link local address according to the physical address includes: Take the last two sub-addresses from the physical address to obtain a first sub-address and a second sub-address; the first sub-address and the second sub-address are both in hexadecimal format; The link-local address is generated based on the first sub-address and the second sub-address.
3. The method according to claim 2, characterized in that The generating the link-local address based on the first sub-address and the second sub-address includes: Based on the first sub-address, determining a first address of the link-local address; Based on the second sub-address, determining the last address bit of the link-local address; The link-local address is determined based on the first address bit and the last address bit.
4. The method according to claim 3, characterized in that The determining, based on the first sub-address, a first address of the link-local address includes: Based on the first sub-address, convert the hexadecimal into decimal to obtain a third sub-address; The third sub-address is used as the first bit address of the link local address.
5. The method according to claim 3, characterized in that: The determining, based on the second sub-address, the last address bit of the link-local address includes: Based on the second sub-address, convert the hexadecimal into decimal to obtain a fourth sub-address; The fourth sub-address is used as the last address bit of the link-local address.
6. The method according to any one of claims 1 to 5, characterized in that: The step of determining the Internet Protocol address used by the multicast proxy based on the link-local address includes: Based on the link-local address, sending any membership change message to the querier; If no response information is received, the link-local address is used as the Internet Protocol address used by the multicast agent.
7. The method according to claim 6, characterized in that After sending any one membership relationship transformation message to the querier based on the link-local address, the method further includes: If a response message is received, the last address bit of the link-local address is incremented by one to obtain an updated link-local address; Based on the updated link-local address, sending any one membership change message to the querier until no response information is received; The updated link-local address is determined as the Internet Protocol address used by the multicast agent.
8. A device for implementing a multicast proxy, characterized in that: include: an acquisition unit, a generation unit, a determination unit and a sending unit, wherein: The acquisition unit is used to acquire the physical address of the router physical Ethernet port and multiple membership relationship transformation messages when the multicast proxy function is enabled; merge the multiple membership relationship transformation messages to obtain the final membership relationship transformation message; The generating unit is used to generate a link local address according to the physical address; The determining unit is used to determine the Internet Protocol address used by the multicast proxy based on the link-local address; The sending unit is used to send the final membership change message to the querier via the Internet Protocol address.
9. A home gateway, characterized in that: include: A memory for storing executable data instructions; The processor is configured to implement the method for implementing a multicast proxy as described in any one of claims 1 to 7 when executing the executable instructions stored in the memory.
10. A computer-readable storage medium, characterized in that: Executable instructions are stored, which are used to cause a processor to execute and implement the method for implementing a multicast proxy as described in any one of claims 1 to 7.
