Link communication method and system and electronic equipment
By resolving client addresses through routers and forwarding data packets using routing tables, the link-layer communication challenges in point-to-point communication are solved, enabling efficient and reliable network communication and improving network performance and user experience.
Patent Information
- Application Number
- CN202511452438.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-11
- Publication Date
- 2025-11-18
AI Technical Summary
In point-to-point communication scenarios, servers typically do not proactively send response or query messages, making it difficult for clients and routers to communicate at the link layer. Existing technologies have not effectively addressed this issue.
Routers obtain the client's address by parsing the client's target message and forward data packets at the link layer interface using the routing table, including constructing simulated response messages or updating the routing table, to ensure that link layer communication can be completed even without a server response in point-to-point communication.
It enables efficient and reliable link-layer communication in a point-to-point communication environment, improves network performance and user experience, avoids dependence on server response, and improves packet forwarding speed and stability.
Smart Images

Figure CN120980059A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of communication, in particular to a link communication method, system and electronic device. BACKGROUND
[0002] In the related art, with the development of IPv6, more and more operators no longer provide IPv6 address and prefix delegation parameters at the same time when dialing. When the operator only provides the IPv6 address, the router generally solves the problem of the lack of prefix delegation through a proxy program. However, since the PPPoEv6 dialing is a point-to-point communication dialing mode, in the point-to-point communication scenario, the server generally does not actively send a response message or actively send a query message, that is, broadcast or multicast is not supported on the link layer, which makes it difficult for the client and the router to communicate and transmit. Therefore, in the related art, in the point-to-point communication scenario, there is a technical problem that it is difficult to communicate on the link layer.
[0003] At present, no effective solution has been proposed for the above problems. SUMMARY
[0004] Embodiments of the present application provide a link communication method, system and electronic device to at least solve the technical problem that it is difficult to communicate on the link layer in the point-to-point communication scenario in the related art.
[0005] According to an aspect of an embodiment of the present application, a link communication method is provided, applied to a router, including: receiving a target message sent by a client, wherein the target message is used to request an address of a server; in the case that a communication mode corresponding to the target message is a point-to-point communication mode, analyzing the target message to obtain a client address of the client; forwarding a data packet to a predetermined terminal through a link layer interface according to the client address and a routing table, wherein the predetermined terminal includes at least one of the following: the client, the server.
[0006] Optionally, in the same prefix communication scenario, forwarding the data packet to the predetermined terminal through the link layer interface according to the client address and the routing table comprises: in the case that the data packet comprises a first data packet, constructing a simulated response message, wherein the simulated response message is a message simulated by the server to reply, and the simulated response message carries a network layer address of the router; sending the simulated response message to the client according to the client address; receiving the first data packet sent by the client, wherein the first data packet is sent by the client to the router after the client receives the simulated response message and analyzes the network layer address of the router; and forwarding the first data packet to the server through the link layer interface according to the routing table.
[0007] Optionally, in the non-same prefix communication scenario, forwarding the data packet to the predetermined terminal through the link layer interface according to the client address and the routing table comprises: in the case that the data packet comprises a second data packet, writing the client address into the routing table; receiving the second data packet sent by the server; and forwarding the second data packet to the client through the link layer interface according to the routing table.
[0008] Optionally, the constructing the simulated response message comprises: sending an inquiry message to the client at a predetermined period, wherein the inquiry message is used to determine the validity of the client address; receiving a reply message sent by the client; and deleting the client address from the routing table in the case that the reply message indicates that the client address is invalid.
[0009] Optionally, the receiving the second data packet sent by the server comprises: forwarding a third data packet to the server through the link layer interface according to the routing table, so that the server processes the third data packet to obtain the second data packet; and receiving the second data packet sent by the server.
[0010] Optionally, the forwarding the data packet to the predetermined terminal through the link layer interface according to the client address and the routing table comprises: determining a target prefix communication scenario according to the target message, wherein the target prefix communication scenario comprises a same prefix communication scenario and a non-same prefix communication scenario, the same prefix indicating that the address prefix of the client is the same as that of the server, and the non-same prefix indicating that the address prefix of the client is different from that of the server; and forwarding the data packet to the predetermined terminal through the link layer interface according to the target prefix communication scenario, the client address and the routing table.
[0011] According to an aspect of the embodiments of the present application, a link communication system is provided, comprising a client, a server, and a router, wherein the router is configured to receive a target message sent by the client, wherein the target message is used to request an address of the server; in a case that a communication mode corresponding to the target message is a point-to-point communication mode, the target message is parsed to obtain a client address of the client; and a data packet is forwarded to a predetermined terminal through a link layer interface according to the client address and a routing table, wherein the predetermined terminal comprises at least one of the client and the server.
[0012] According to an aspect of the embodiments of the present application, a computer readable storage medium is provided, comprising a stored executable program, wherein the computer readable storage medium is configured to perform any of the above methods when the executable program is executed.
[0013] According to an aspect of the embodiments of the present application, an electronic device is provided, comprising a memory storing an executable program, and a processor configured to execute the program, wherein the program is configured to perform any of the above methods when executed.
[0014] According to an aspect of the embodiments of the present application, a computer program product is provided, comprising a computer program configured to perform the steps of any of the above methods when executed by a processor.
[0015] In the embodiments of the present application, a target message sent by a client is received, wherein the target message is used to request an address of a server; in a case that a communication mode corresponding to the target message is a point-to-point communication mode, the target message is parsed to obtain a client address of the client; and a data packet is forwarded to a predetermined terminal through a link layer interface according to the client address and a routing table, wherein the predetermined terminal comprises at least one of the client and the server. Since in a point-to-point communication scenario, the server usually does not actively send a response message or a query message, it is difficult for the client and the router to communicate and transmit. The embodiments of the present application avoid the restriction that a response message or a query message needs to be actively sent for communication, overcome the difficulty of link layer communication, and enable the link layer communication to be completed according to the client address and the routing table without actively sending a response message or a query message for communication. Even in a point-to-point communication environment, the data packet can be forwarded at the link layer, efficient and reliable link layer communication is achieved, and the network performance and user experience are significantly improved, thereby solving the technical problem that it is difficult to communicate at the link layer in a point-to-point communication scenario in the related art. BRIEF DESCRIPTION OF DRAWINGS
[0016] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:
[0017] Figure 1 is a flow chart of a link communication method according to an embodiment of the present application;
[0018] Figure 2 is a communication diagram of same-prefix communication in the prior art;
[0019] Figure 3 is a communication diagram of non-same-prefix communication in the prior art;
[0020] Figure 4 is a communication diagram of same-prefix communication provided by an optional embodiment of the present application;
[0021] Figure 5 is a communication diagram of same-prefix communication provided by an optional embodiment of the present application. DETAILED DESCRIPTION
[0022] In order to make the technical personnel of the present application better understand the present application, the following will be combined with the drawings of the embodiments of the present application, the technical solutions in the embodiments of the present application are described clearly and completely, obviously, the described embodiments are only a part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor should belong to the scope of protection of the present application.
[0023] It should be noted that the terms "first", "second" and the like in the description and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in other than the order illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units need not be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0024] First, some of the nouns or terms appearing in the description of the embodiments of the present application are applicable to the following explanations:
[0025] IPv6: The full name is "Internet Protocol Version 6", commonly known as "Internet Protocol Version 6" in Chinese.
[0026] WAN: The full name is "Wide Area Network", commonly known as "Wide Area Network" in Chinese.
[0027] LAN port: The full name of LAN port in Chinese is "Local Area Network Port", which is "Local Area Network Port". LAN port is used for the connection of internal local area network of the device, and is usually used to connect computers, printers, smart devices or other local area network devices in the home or office.
[0028] WAN port: The full name of WAN port in Chinese is "Wide Area Network Port", which is "Wide Area Network Port". WAN port is used for the device to connect to external wide area network, such as Internet, or for connecting different local area networks to form a wide area network.
[0029] IPv6 address: IPv6 address is an address used to uniquely identify network nodes in IPv6 network.
[0030] Prefix delegation: Prefix delegation or prefix allocation is part of the IPv6 stateless address auto-configuration mechanism, which allows routers in the network to delegate IPv6 address prefixes to lower-level network devices (such as clients or downstream routers). Prefix delegation allows clients or downstream routers to use the prefix to generate their own IPv6 addresses without server allocation, greatly simplifying the management of IPv6 addresses.
[0031] PPPoEv6: IPv6 Point-to-Point Protocol over Ethernet (PPPoE over IPv6), or simply PPPoEv6 dial-up. PPPoEv6 is a broadband access technology that combines the features of PPPoE (Point-to-Point Protocol over Ethernet) and IPv6 protocol, used to implement point-to-point network connection in IPv6 environment. Traditional PPPoE is mainly aimed at IPv4 environment, while PPPoEv6 is developed in the context of IPv6 popularization, used to solve the problems of IPv6 access authentication and address allocation.
[0032] LAN client: The full name of LAN client in Chinese is "Local Area Network Client", which refers to terminal devices connected to the local area network (Local Area Network, LAN), such as personal computers (PC), smartphones, game consoles, printers and any other devices with network access capabilities.
[0033] MAC address: The full name of MAC address in Chinese is "Media Access Control Address", which is a hardware address used to identify devices on the network at the link layer (i.e. the second layer of OSI model).
[0034] DHCPv6: The full name of DHCPv6 in Chinese is "Dynamic Host Configuration Protocol, Version 6". DHCPv6 is a version of DHCP (Dynamic Host Configuration Protocol) protocol specifically designed for IPv6 network environment.
[0035] RA message: The full name of RA message in Chinese is "Router Advertisement message", which is "Router Advertisement" in English. RA message is part of IPv6 Neighbor Discovery Protocol (ND) and is broadcast or directed by routers to their adjacent devices.
[0036] NS message: The full name of NS message in Chinese is "Neighbor Solicitation Message". NS message is used to request the link layer address of a neighbor node. When a node wants to send a packet to another node with the same prefix but does not know its link layer address (such as MAC address), it will send NS message for address resolution of the neighbor node. NS message is usually sent in multicast mode, with the target address being a specific neighbor request multicast address.
[0037] NA message: The full name of NA message in Chinese is "Neighbor Advertisement Message". When a node receives an NS message or needs to actively advertise its link layer address, it will send an NA message. NA message contains the IPv6 address and link layer address of the node, allowing neighbor nodes to map the IPv6 address to the link layer address. NA message can be a response to NS message or a node actively broadcasted periodically to maintain neighbor relationships.
[0038] DNS message: The full name of DNS message in Chinese is "Domain Name System Message". DNS message is used in the Internet to resolve domain names to IP addresses.
[0039] DAD message: the full name of DAD message in Chinese is "Duplicate Address Detection Message". DAD message is an important mechanism in the process of IPv6 Stateless Address Auto-configuration (SLAAC), which is used to ensure that the IPv6 address generated by a network interface is unique in the local link (i.e. the same broadcast domain). After generating an IPv6 address, a node will send a DAD message to check whether there is another node using the same address.
[0040] Embodiment 1
[0041] According to the embodiment of the present application, an embodiment of a link communication method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in a different order.
[0042] Figure 1 is a flowchart of a link communication method according to an embodiment of the present application, as shown in Figure 1 The method comprises the following steps:
[0043] Step S102, receiving a target message sent by a client, wherein the target message is used to request the address of a server;
[0044] In the step S102 provided in the present application, a specific message sent by the client for requesting the address of the server is received.
[0045] Among them, the client refers to those terminal devices that need to access the server and obtain its address information, such as personal computers, smart phones, Internet of Things devices, etc.
[0046] Among them, the target message refers to a specific type of message sent by the client for requesting the address of the server. In the present application, the target message can be a DNS request message, a NS (Neighbor Solicitation) message, or a DAD (Duplicate Address Detection) message, which is not limited here, and can be customized according to the actual application and scene (such as prefix communication or non-prefix communication).
[0047] Among them, the address of the server refers to the identification information of the destination server in network communication, including network layer address such as IPv6 address, link layer address such as MAC address, etc.
[0048] In this step, in a point-to-point communication scenario (such as PPPoEv6), the server may not actively respond to the address information, making it difficult for the client to obtain the link layer address of the server under the traditional method, thereby affecting the communication efficiency. In this application, by receiving the target message sent by the client, the router can analyze the request of the client, thereby determining the subsequent operation, and the operation can be different according to the scene.
[0049] For example, in the same prefix communication scenario, the router can directly simulate the NA (Neighbor Advertisement) message response of the server to help the client complete address resolution without waiting for the server's reply. In the non-same prefix communication scenario, the router can update and maintain the routing table based on the information in the client message to ensure that the data packet can correctly reach the destination even if the client and the server are located in different subnets.
[0050] By actively analyzing and responding to the server address request of the client, the router can quickly establish a communication path, avoiding the delay of waiting for the server response, and significantly improving the forwarding speed of the data packet. This method is suitable for various communication scenarios, whether it is the same prefix or the non-same prefix communication, the router can maintain the direct communication of the link layer or efficiently forward the data packet between different networks by intelligently processing the client message.
[0051] Step S104, in the case where the communication mode corresponding to the target message is a point-to-point communication mode, analyzing the target message to obtain the client address of the client;
[0052] In step S104 provided in this application, the target message is analyzed to obtain the client address of the client.
[0053] Among them, the point-to-point communication mode refers to a communication mode in which two terminals in network communication directly establish a communication connection without other devices intervening in forwarding data. PPPoE (Point-to-Point Protocol over Ethernet) and PPPoEv6 (its v6 version) belong to point-to-point communication protocols and are mainly used in dial-up Internet scenarios.
[0054] Among them, the client address refers to the identification information of the client initiating the communication request in the network, specifically referring to the IPv6 address. In a point-to-point communication scenario, the client address is very important to the router, which can help send a response message to the client in a same prefix scenario, and in a non-same prefix scenario, it helps the router to establish or update link layer routing information to enable subsequent data packet transmission.
[0055] In this step, when the router faces the target message of the point-to-point communication mode, it parses the message to obtain the address of the client. For this communication mode, especially the PPPoEv6 scenario, the server usually does not reply to the NA (Neighbor Advertisement) message or actively query the NS (Neighbor Solicitation) message, which causes the failure of the traditional link layer communication mechanism.
[0056] By parsing the target message and obtaining the client address, the router can compensate for this defect. In the same prefix communication scenario, the router can directly construct the NA message to simulate the server response and help the client complete the address resolution process, even if the server is not involved. In the non-same prefix communication scenario, the router can use the DAD message and DNS request message sent by the client when dialing to extract the client address information and add it to the routing table to maintain the stability and integrity of the link layer routing information.
[0057] Even in the point-to-point communication scenario, the router can master the client address information by parsing the target message, ensure that the data packet is accurately forwarded to the predetermined terminal through the link layer interface, and improve the stability and success rate of communication.
[0058] In step S106, the data packet is forwarded to the predetermined terminal through the link layer interface according to the client address and the routing table, wherein the predetermined terminal includes at least one of the following: client, server.
[0059] In the step S106 provided in the present application, the data packet is forwarded to the predetermined terminal through the link layer interface according to the client address and the routing table.
[0060] Among them, the routing table refers to the data structure used by network devices (such as routers) to determine the data packet forwarding path. It contains a series of routing entries, each entry usually includes destination network address, next hop address, interface information, etc., guiding the data packet to reach the destination through the link in the network.
[0061] Among them, the data packet refers to the basic unit of information transmission in network communication, which contains two parts: header and payload. The header contains source address, destination address, protocol type and other information, which is used to guide the transmission of data packets in the network.
[0062] Among them, the link layer interface refers to the interface of network devices used to directly interact with physical transmission media, which is the starting point and end point of data packet transmission on a specific link in the network. In IPv6 communication, the MAC address and IPv6 address of the link layer interface can be used for link layer forwarding of data packets.
[0063] Wherein, the predetermined terminal refers to the destination of the data packet, which can be a client (the party initiating communication) or a server (the party responding to the request). The address information of the predetermined terminal is a key basis for data packet forwarding decision.
[0064] The sentence describes how the router uses client address information and routing table to complete the link layer forwarding of the data packet in a point-to-point communication scenario. In this step, the use of client address and routing table is explained to overcome the limitations of link layer transmission in the existing technology under the limitations of point-to-point communication, and to forward the data packet to the predetermined terminal.
[0065] The router can immediately determine the optimal link layer interface according to the client address and the maintained routing table information, and directly forward the data packet, avoiding the delay of traditional link layer address resolution. Even in the case where the server does not actively participate in link layer communication, the router can reliably deliver the data packet to the predetermined terminal through the resolved client address and routing table information, reducing the communication interruption caused by address resolution failure. By intelligently analyzing and updating the routing table, the router reduces the excessive dependence on server response at the link layer, optimizes the allocation and utilization of link layer resources, and improves the overall communication efficiency of the network.
[0066] Through the above steps S102-S106, the target message sent by the client is received, wherein the target message is used to request the address of the server; in the case where the communication mode corresponding to the target message is a point-to-point communication mode, the target message is parsed to obtain the client address of the client; according to the client address and the routing table, the data packet is forwarded to the predetermined terminal through the link layer interface, wherein the predetermined terminal includes at least one of the following: the client, the server. Since in a point-to-point communication scenario, the server usually does not actively send response messages or actively send query messages, it is difficult for the client and the router to communicate and transmit, the present application avoids the limitation that active sending of response messages or query messages is required for communication, overcomes the difficulty of link layer communication, and enables link layer communication according to the client address and the routing table in the case where active sending of response messages or query messages is not required for communication. Even in the limited environment of point-to-point communication, link layer forwarding of the data packet can be completed, efficient and reliable link layer communication is realized, network performance and user experience are significantly improved, and thus the technical problem of difficult communication at the link layer in a point-to-point communication scenario in related technologies is solved.
[0067] It should be noted that in specific implementation, different steps will be performed for the same prefix communication scenario and the non-same prefix communication scenario.
[0068] For example, in IPv6 network, the processing manner of same prefix communication and non-same prefix communication is different, mainly due to the difference of the design mechanism of IPv6 neighbor discovery protocol and routing decision.
[0069] For same prefix communication scenario:
[0070] In same prefix communication, the client and the destination server share the same IPv6 address prefix, which means they are located on the same link or belong to the same subnet. According to the IPv6 NDP mechanism, when the client wants to communicate with the destination device, it first needs to resolve the link layer address (usually MAC address) of the destination device by sending NS (Neighbor Solicitation) message. This is because the original intention of IPv6 design is to simplify routing, and communication within the same link or subnet usually does not need to go through the routing decision of the router, but directly communicates at the link layer.
[0071] For non-same prefix communication scenario:
[0072] In non-same prefix communication, the IPv6 address prefix of the client and the destination server is different, which indicates that they belong to different subnets or links. In this case, the forwarding of the data packet needs the intervention of the router, because the router is responsible for the routing decision between different networks. The client does not need to send NS message to resolve the address as in the same prefix scenario, because it defaults that the data packet will be forwarded to the destination through the router, instead of directly communicating at the link layer. When the reply data packet is returned, the router decides the best path of the data packet according to the routing table it maintains and the prefix of the destination address, to forward the data packet to the predetermined terminal through the link layer interface.
[0073] The following describes optional embodiments based on different scenarios.
[0074] As an optional embodiment, in the same prefix communication scenario, forwarding the data packet to the predetermined terminal through the link layer interface according to the client address and the routing table includes: in the case that the data packet includes a first data packet, constructing a simulated response message, wherein the simulated response message is a message for the simulated server to reply, and the simulated response message carries the network layer address of the router; sending the simulated response message to the client according to the client address; receiving the first data packet sent by the client, wherein the first data packet is sent by the client to the router after receiving the simulated response message and analyzing the network layer address of the router; forwarding the first data packet to the server through the link layer interface according to the routing table.
[0075] In this embodiment, the specific communication transmission steps in the same prefix communication scenario are described.
[0076] Involving the same prefix communication scenario, which means that the two communication terminals (client and server) share the same prefix of IPv6 address, implying that they theoretically belong to the same network or subnet, but may need additional link layer resolution mechanism due to network design (such as point-to-point communication).
[0077] Involving the first data packet, which is the data packet sent by the client to the server, and can be a data packet sent by the client to the router after completing address resolution for actual communication.
[0078] Involving the simulation response message, which is a message constructed and sent by the router to simulate or replace the NA (Neighbor Advertisement) message that the server should send to help the client complete address resolution. The message contains the network layer address of the router. Avoids the problem of being unable to communicate due to the server not sending NA message.
[0079] Involving the network layer address of the router, which refers to the IPv6 address of the router, used for data packet forwarding in the network layer outside the link layer.
[0080] Involving the server, which is a node in the network that provides specific services or resources, and here refers to a server with an IPv6 address different from the client's but in the same prefix communication scenario.
[0081] In the same prefix communication scenario, especially when the server does not send NA message to reply the client's NS message, the router plays a crucial role. It first constructs a simulation response message, which is similar to the NA message that the server should send, but contains the router's own IPv6 address. Then, the router sends this simulation response message back to the client according to the client's address information. After receiving and analyzing the simulation response message, the client obtains the network layer address of the router, and then sends the first data packet to the router to start the actual communication process. Finally, the router forwards the first data packet to the server through the link layer interface according to the routing table information it maintains, completing the data packet transmission between the link layer and the network layer.
[0082] In this step, the link layer address resolution problem is solved, even in the environment where the server does not participate in link layer response, the client can complete address resolution through the simulation response message of the router, ensuring the normal operation of the same prefix communication. By constructing the simulation response message, the router simplifies the originally complex link layer communication process, improves the reliability and stability of communication.
[0083] As an optional embodiment, in the non-same prefix communication scenario, forwarding the data packet to the predetermined terminal through the link layer interface according to the client address and the routing table comprises: in the case that the data packet comprises a second data packet, writing the client address into the routing table; receiving the second data packet sent by the server; forwarding the second data packet to the client through the link layer interface according to the routing table.
[0084] In this embodiment, the specific communication transmission steps in the non-same prefix communication scenario are illustrated.
[0085] In this embodiment, the non-same prefix communication scenario refers to the case that the IPv6 addresses of the client and the server are not the same, i.e., they are not in the same subnet.
[0086] In this embodiment, the second data packet refers to a data packet sent by the server to the router and then forwarded to the client by the router, which can be a data packet comprising response information of the server to the request of the client or a data packet comprising the communication with the client.
[0087] In the non-same prefix communication scenario, the router parses the client address by receiving the DNS request message or the DAD message of the client, and writes the address information into the routing table to maintain the reachability of the client. When the server sends the second data packet (i.e., the data packet responding to the request of the client or the communication data packet), the router forwards the data packet to the client through the link layer interface according to the client address information maintained in the routing table, which ensures that the client can successfully receive the response of the server even in the non-same prefix case, and avoids the problem that the second data packet cannot be fed back to the client due to the fact that the server does not actively send the NS query message or does not reply the NA message.
[0088] Through this step, the stability of the link layer communication is improved, i.e., even if the address prefixes of the client and the server are different, the router can still ensure that the data packet returned by the server can correctly and accurately reach the client through the link layer by maintaining accurate routing entries. By writing the client address into the routing table, the router can reduce the dependence on the link layer broadcast, avoid unnecessary resource consumption, and improve the network efficiency.
[0089] As an optional embodiment, the step of constructing the simulation response message comprises: sending an inquiry message to the client at a predetermined period, wherein the inquiry message is used to determine the validity of the client address; receiving a reply message sent by the client; and in the case that the reply message indicates that the client address is invalid, deleting the client address from the routing table.
[0090] In this embodiment, the steps of maintaining the accuracy of the link layer routing table by the router through the construction of the simulation response message in the non-same prefix communication scenario are illustrated.
[0091] wherein the predetermined period refers to a time interval preset in the network management or communication protocol for triggering certain periodic operations, which is the time period for the router to periodically send the query message to the client.
[0092] wherein the query message refers to a message used to request status or information, specifically the message sent by the router to the client to verify the validity of the client address.
[0093] wherein the reply message refers to the response message of the client to the query message, used to confirm the validity of the client address or inform the address change status.
[0094] In the non-same prefix communication scenario, the router maintains the accuracy of the link layer routing table by constructing a simulated response message. The specific operation includes sending a query message to the client at a predetermined period, and the function of the query message is to verify whether the client address is still valid, i.e., whether the client can normally receive and respond to network communication. Then, the router waits to receive the reply message of the client. If the reply message indicates that the client address is invalid, for example, the client does not respond or returns invalid address information, then the router will delete the client address from the routing table to update the information of the routing table, ensuring the accuracy of link layer forwarding.
[0095] By periodically verifying the validity of the client address, the router can update the routing table, avoid using invalid addresses for link layer forwarding of data packets, and improve the accuracy and efficiency of forwarding. The validity check of the client address enhances the monitoring and adaptive ability of the network, so that even if the client address changes or becomes invalid, the router can respond in time to maintain the robustness and stability of network communication. Invalid client addresses will occupy the space of the routing table, and by deleting invalid addresses, the router can reasonably allocate and utilize limited memory resources, optimizing the management of network resources. Periodic address validity check reduces the packet loss or delay caused by address change or invalidity of the client, improving the user's network communication experience.
[0096] As an optional embodiment, receiving the second data packet sent by the server includes: forwarding the third data packet to the server through the link layer interface according to the routing table, so that the server processes the third data packet to obtain the second data packet; and receiving the second data packet sent by the server.
[0097] In this embodiment, the specific process of receiving the second data packet in the non-same prefix scenario is described.
[0098] The third data packet refers to a request data packet sent by the router or the client to the server. Its goal is to trigger server processing, thereby generating a second data packet (a response data packet).
[0099] In this step, the server processes the request data packet (the third data packet) and returns a response data packet (the second data packet). The router forwards the request data packet (the third data packet) sent by the client to the server through the link layer interface according to the routing table it maintains. After receiving the third data packet, the server processes it and generates a response data packet (the second data packet) containing the processing result, and sends it back to the router through the link layer interface. The router again forwards the second data packet to the client through the corresponding link layer interface according to the routing table, completing the data transmission cycle from the client to the server and then to the client.
[0100] The router quickly forwards the request data packet to the server through intelligent routing, reducing the delay time of the data packet in the network and improving the overall efficiency of data transmission. Fast data packet forwarding and reliable communication quality directly improve the user's network experience, reduce the service response time, and ensure the continuity of data and services.
[0101] As an optional embodiment, forwarding the data packet to the predetermined terminal through the link layer interface according to the client address and the routing table includes: determining a target prefix communication scenario according to the target message, wherein the target prefix communication scenario includes: a same prefix communication scenario, a different prefix communication scenario, the same prefix indicating that the address prefix of the client and the server is the same, and the different prefix indicating that the address prefix of the client and the server is different; forwarding the data packet to the predetermined terminal through the link layer interface according to the target prefix communication scenario, the client address and the routing table.
[0102] In this embodiment, the step of determining the target prefix communication scenario is explained.
[0103] The target prefix communication scenario is classified into a same prefix communication scenario and a different prefix communication scenario according to whether the prefix of the client address and the server address is the same, and the target prefix communication scenario is which scenario will directly affect the forwarding strategy of the data packet.
[0104] In this step, it is described how the router intelligently determines the target prefix communication scenario based on the client address, routing table, and characteristics of the target message, and adopts the corresponding forwarding strategy to efficiently forward the data packet to the intended terminal. Specifically, the router first determines whether the communication scenario between the client and the server is same-prefix or non-same-prefix by analyzing the target message. This determination can be based on a comparison of the IPv6 address prefix. If the prefix is the same, it belongs to the same-prefix communication scenario; otherwise, it is a non-same-prefix communication scenario.
[0105] According to the judgment result of the communication scenario, the router will use the information in the routing table to forward the data packet to the intended terminal through the correct link layer interface. In the same-prefix communication scenario, the data packet can be sent directly to the server through the link layer interface, because they are in the same subnet; while in the non-same-prefix communication scenario, the router needs to select the appropriate next hop and link layer interface according to the destination network prefix recorded in the routing table, to ensure that the data packet can cross different subnets and accurately reach the server.
[0106] Through accurate judgment of the communication scenario, the router can adopt the most suitable forwarding strategy, avoiding unnecessary data retransmission and delay, and improving the efficiency and accuracy of data forwarding. Intelligent scenario recognition and forwarding strategy ensure that data packets can be successfully transmitted even in the case of network topology changes or client / server address changes, enhancing the robustness and adaptability of the network to abnormal situations.
[0107] Based on the above embodiments and optional embodiments, an optional implementation is provided, which is described in detail as follows.
[0108] In related technologies, with the development of IPv6, more and more operators no longer provide IPv6 address and prefix delegation parameters at the same time when dialing. When the operator only provides IPv6 address, the router generally solves the problem of missing prefix delegation through a proxy program. However, since PPPoEv6 dialing is a point-to-point communication dialing method, the PPPoEv6 server generally does not actively reply to NA messages or actively send NS queries when designed. Therefore, in the same-prefix communication, the LAN client cannot normally obtain the destination MAC of the next hop, and the router cannot learn and establish the routing entry of the LAN client through the interaction of NS / NA. Therefore, when the operator only issues IPv6 address under PPPoEv6 dialing, the devices on the LAN side of the router cannot normally perform IPv6 communication.
[0109] Generally in the case that the operator does not provide prefix delegation, the prefix proxy is usually carried out by using a proxy program in the prior art. From the perspective of the client, the communication process of the general LAN-WAN is mainly divided into two categories:
[0110] Scenario one: same prefix communication. When the IPv6 address of the LAN client is the same as the IPv6 address prefix of the destination, the LAN client actively sends an NS message to query the MAC of the opposite side before sending a data packet. After the address resolution process is completed, the LAN client starts to send data.
[0111] The communication process of this scenario is described in detail as follows:
[0112] For example, the IP address of the LAN client (PC) is 2404:7a80::1000, the address prefix obtained by the router (DUT) is 2404:7a80:: / 64, and the address of the accessed destination (Server) is 2404:7a80::23, Figure 2 is a communication diagram of the same prefix communication in the prior art, and the communication process is as shown in Figure 2 .
[0113] ①: Before the PC accesses the Server, a multicast NS is sent to perform address resolution. At this time, after the DUT obtains the NS message, the target address 2404:7a80::23 of the NS message is compared with the prefix condition 2404:7a80:: / 64 of the proxy rule. If the target address meets the prefix condition, the proxy is entered, and the source address 2404:7a80::1000 of the NS message is judged. If the source address meets the prefix condition of the proxy rule, the source address, i.e., the PC address, is added to the route.
[0114] ②: The DUT sends the NS message from the lan port to the Server through the wan port.
[0115] ③: The Server sends a NA message to the wan port of the DUT.
[0116] ④: The DUT sends the NA message to the PC through the established route, and the address resolution process is completed. Normal communication can be started.
[0117] Scenario two: non-same prefix communication. That is, the IPv6 address of the LAN client is not the same as the IPv6 address prefix of the destination. At this time, the LAN client directly sends a data packet to the default gateway without caring about the specific MAC of the destination address.
[0118] The communication process of this scenario is described in detail as follows:
[0119] For example, the LAN client (PC) is assigned an IP address of 2404:7a80::1000, the router (DUT) obtains an address prefix of 2404:7a80:: / 64, and the accessed destination (Server) address is 2404:7a81::23, Figure 3 is a communication diagram of non-same prefix communication in the prior art, and the communication process is as shown in Figure 3 .
[0120] 1: The PC sends a data packet to the DNS of a different prefix of the Server 2404:7a81::23.
[0121] 2: The DUT normally forwards the data packet from the wan port to the Server.
[0122] 3: The Server sends a multicast NS to find neighbors, and the target address is the PC address 2404:7a80::1000 (in this scenario, the target address is the Target Address field in the NS and NA messages, not the destination address).
[0123] 4: The DUT receives the NS at the wan port, judges that the target address of the NS and the proxy rule prefix 2404:7a80:: / 64 are consistent, and then sends a multicast NS message through the lan port proxy to perform address resolution.
[0124] 5: The PC replies to the NA message after receiving the request for address resolution, and the target address is 2404:7a80::1000. The DUT receives the NA message, judges that the target address of the NA message is consistent with the target address of the previous NS message, and is consistent with the proxy rule prefix, and then adds the NA target address, i.e., the PC address, to the route.
[0125] 6: The DUT sends the NA message to the Server through the wan port proxy, and normal communication can begin.
[0126] The working process of the proxy is as described above, but since PPPoEv6 is point-to-point communication, the server side (Server) will not reply to the NA message, nor will it actively send an NS query, which will cause the two scenarios described above, and the proxy program cannot work normally. Details are as follows:
[0127] For scenario one:
[0128] Since the server will not normally reply to the NA message, the communication process fails at process ③, the client cannot normally complete the address resolution process, and therefore cannot send a data packet.
[0129] For scenario two:
[0130] Because the server does not actively send the NS query, the communication fails at process ③, the router fails to acquire the address of the client through the NS / NA interaction, and therefore fails to successfully establish the LAN client routing entry, so that the return packet is discarded at the router end and cannot be successfully forwarded to the client.
[0131] In view of this, the optional embodiment of the application provides a link communication method, and the optional embodiment of the application is suitable for most scenarios of the operator dialing the PPPoEv6: for the scenario in which the operator only issues the IPv6 address but does not issue the prefix delegation, the problem that the user cannot normally perform IPv6 surfing through the router is solved; for the scenario in which the operator normally issues the IPv6 address and the prefix delegation, the user can also use the application and can realize IPv6 surfing without configuring the LAN IPv6 prefix. The following introduces the same.
[0132] For the above scenario one:
[0133] In the method provided by the optional embodiment of the application, the router directly constructs the NA packet to simulate the server end reply after receiving the NS packet from the client, so that the LAN client can normally complete the address resolution process and can normally send the packet when communicating with the same prefix, and the address communication process with the same prefix is completed.
[0134] For the above scenario two:
[0135] In the method provided by the optional embodiment of the application, in view of the problem that the LAN side routing entry cannot be generated, the mechanism that the DAD packet is sent to broadcast the address of the client after dialing to acquire the address is used, the target address of the DAD is added to the LAN side routing table for maintenance, but because the DAD packet is only sent when the address is acquired and the sending times are limited, in order to avoid the influence caused by the missing of the DAD packet, the DNS request packet sent from the LAN side is additionally filtered, the source address of the DNS request packet is added to the maintenance of the LAN side routing entry, and the completeness and stability of the LAN routing table are maintained.
[0136] The following introduces the complete steps of the optional embodiment of the application in combination with the above improvement points:
[0137] 1) dialing process:
[0138] After the user configures the IPv6 dial-up of the router as the PPPoEv6 dial-up, the router first performs the negotiation and authentication process of the PPP, and then the router sends an RS message to the server to request a default route and a configuration state of the current server. The server returns an RA to the router. After the router receives the RA message returned by the server, the router obtains the address / prefix delegation / DNS and other contents through the message interaction of the DHCPv6. In the DHCPv6 interaction, the router does not obtain the reply of the prefix delegation, and needs to start the proxy program.
[0139] When the router judges that only the address is obtained and the prefix delegation is not obtained, the router initiates the address allocation process, writes the prefix of the address obtained from the server into the RA message, and then sends the RA message to the client on the LAN side through the address allocation process. After the LAN client receives the RA message sent by the router, the LAN client generates an IPv6 address according to the prefix information in the RA. In this way, the client obtains the address with the same prefix as the router.
[0140] 2) Communication process:
[0141] For scenario one:
[0142] Figure 4 is the communication schematic diagram of the same prefix communication provided by the optional implementation manner of the application, as shown in Figure 4
[0143] 1: Before the LAN client accesses the server, the LAN client sends a multicast NS to perform address resolution (same as the above-mentioned receiving the target message sent by the client, wherein the target message is used to request the address of the server).
[0144] 2: After the router receives the NS message from the client, the router judges whether the current dial-up is the PPPoEv6 dial-up. If yes, the router directly constructs a NA message to simulate the reply of the server (same as the above-mentioned in the case that the communication mode corresponding to the target message is the point-to-point communication mode, the data packet includes the first data packet, and the simulated response message is constructed, wherein the simulated response message is the message for simulating the reply of the server, and the network layer address of the router is carried in the simulated response message).
[0145] 3: After the LAN client receives the NA message sent by the router, the LAN client completes the address resolution and sends the data packet to the router (same as the above-mentioned router analyzing the target message to obtain the client address of the client; according to the client address, the simulated response message is sent to the client; the first data packet is received by the router; after the client receives the simulated response message and analyzes the network layer address of the router, the first data packet is sent to the router).
[0146] IV. The router forwards the data packet sent by the LAN client to the SERVER (as described above, the first data packet is forwarded to the server through the link layer interface according to the routing table).
[0147] For scenario two:
[0148] Figure 5 is a communication diagram of the same prefix communication provided by the optional embodiment of the present application, as shown in Figure 5
[0149] I. After the LAN client obtains the address, the LAN client sends a DAD message and a DNS request message to the router. The router filters the DAD message and the DNS request message from the received messages, extracts the address of the LAN client from the messages, and then writes the address into the routing table on the LAN side (as described above, the target message is used to request the address of the server; in the case of the data packet including the second data packet, the address of the client is written into the routing table).
[0150] II. The LAN client sends a data packet to the SERVER address 2404:7a81::23 different from the prefix of the LAN client (as described above, the third data packet is forwarded to the server through the link layer interface according to the routing table).
[0151] III. The DUT forwards the data packet from the wan port to the SERVER after receiving the data packet sent by the LAN.
[0152] IV. The SERVER replies to the router after receiving the data packet (as described above, the server processes the third data packet to obtain the second data packet; the router receives the second data packet sent by the server).
[0153] V. The router forwards the data packet to the LAN client after receiving the reply packet, and completes the data packet communication process (as described above, the router receives the second data packet sent by the server; the second data packet is forwarded to the client through the link layer interface according to the routing table).
[0154] VI. The router sends an NS message to the LAN client at a predetermined period to inquire whether the address of the LAN client is still valid (as described above, the inquiry message is used to determine the validity of the address of the client).
[0155] ⑦: LAN client receives the NS inquiry of the router, and replies to the router with the NA message indicating that the address is still valid. If the LAN client does not reply, the router will delete the address from the routing table after a period of time (same as receiving the reply message sent by the client; in the case where the reply message indicates that the client address is invalid, the client address is deleted from the routing table).
[0156] Through the above optional implementation, at least the following beneficial effects can be achieved:
[0157] (1) The LAN-side client address is confirmed through the DAD and DNS messages sent by the client, and the LAN-side routing table is established, so that the server-side reply packet can correctly reach the LAN-side client.
[0158] (2) For a point-to-point communication scenario, when the LAN-side client accesses a non-LAN-side address with the same prefix, the router replies to the NA instead of the server side, helping the client to complete the address resolution process, thereby completing normal communication.
[0159] It should be noted that, for the above-mentioned method embodiments, in order to simply describe, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other order or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily necessary for the present application.
[0160] From the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and the necessary general hardware platform, of course, it can also be realized by hardware, but in many cases the former is a better implementation. Based on such understanding, the technical solutions of the present application or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes a plurality of instructions to make a terminal device (which can be a mobile phone, computer, server, or network device, etc.) execute the method of each embodiment of the present application.
[0161] Embodiment 2
[0162] According to an embodiment of the present application, a system for implementing the link communication method is also provided, which comprises a client, a server and a router, wherein the router is configured to receive a target message sent by the client, and the target message is used to request an address of the server; in the case that a communication mode corresponding to the target message is a point-to-point communication mode, the target message is parsed to obtain a client address of the client; and a data packet is forwarded to a predetermined terminal through a link layer interface according to the client address and a routing table, wherein the predetermined terminal comprises at least one of the client and the server.
[0163] It should be noted that the functions of the router correspond to steps S102-S106 in the implementation of the link communication method, and the examples and application scenarios realized by the corresponding steps are the same, but are not limited to the content disclosed in Embodiment 1.
[0164] Embodiment 3
[0165] According to another aspect of the embodiments of the present application, an electronic device is also provided, which comprises a memory storing an executable program, and a processor configured to execute the program, wherein the program is configured to execute any one of the methods when executed.
[0166] Embodiment 4
[0167] According to another aspect of the embodiments of the present application, a computer readable storage medium is also provided, which comprises a stored executable program, wherein the executable program is configured to control a device where the computer readable storage medium is located to execute any one of the methods when executed.
[0168] Embodiment 5
[0169] According to another aspect of the embodiments of the present application, a computer program is also provided, which is configured to implement the steps of any one of the methods when executed by a processor.
[0170] The above-mentioned embodiment numbers of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0171] In the above-mentioned embodiments of the present application, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.
[0172] In several embodiments provided in the present application, it should be understood that the disclosed technology can be implemented by other ways. Among them, the above-described device embodiments are only schematic, for example, the division of the units can be a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed units can be indirect coupling or communication connection through some interfaces, units or modules, and can be electrical or other forms.
[0173] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, they can be located in one place, or they can be distributed to multiple units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
[0174] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically, or two or more units can be integrated into one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0175] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a plurality of instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.
[0176] The above is only the preferred embodiment of the present application, and it should be pointed out that for ordinary skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be considered as the protection scope of the present application.
Claims
1. A method of link communication, characterized by, The application is applied to a router, and comprises the following steps of: receiving a target message sent by a client, wherein the target message is used for requesting an address of a server; in a case that a communication mode corresponding to the target message is a point-to-point communication mode, analyzing the target message to obtain a client address of the client; transferring a data packet to a predetermined terminal through a link layer interface according to the client address and a routing table, wherein the predetermined terminal comprises at least one of the client and the server.
2. The method of claim 1, wherein, In a same prefix communication scenario, transferring a data packet to a predetermined terminal through a link layer interface according to the client address and a routing table comprises the following steps of: in a case that the data packet comprises a first data packet, constructing a simulated response message, wherein the simulated response message is a message simulated by the server to reply, and the simulated response message carries a network layer address of the router; sending the simulated response message to the client according to the client address; receiving the first data packet sent by the client, wherein the first data packet is sent by the client to the router after the client receives the simulated response message and analyzes the network layer address of the router; transferring the first data packet to the server through the link layer interface according to the routing table.
3. The method of claim 1, wherein, In a non-same prefix communication scenario, transferring a data packet to a predetermined terminal through a link layer interface according to the client address and a routing table comprises the following steps of: in a case that the data packet comprises a second data packet, writing the client address into the routing table; receiving the second data packet sent by the server; transferring the second data packet to the client through the link layer interface according to the routing table.
4. The method of claim 3, wherein, Constructing a simulated response message comprises the following steps of: sending an inquiry message to the client at a predetermined period, wherein the inquiry message is used for determining validity of the client address; receiving a reply message sent by the client; in a case that the reply message indicates that the client address is invalid, deleting the client address from the routing table.
5. The method of claim 3, wherein, Receiving the second data packet sent by the server comprises the following steps of: transferring a third data packet to the server through the link layer interface according to the routing table, so that the server processes the third data packet to obtain the second data packet; receiving the second data packet sent by the server.
6. The method according to any one of claims 1 to 5, characterized in that, Transferring a data packet to a predetermined terminal through a link layer interface according to the client address and a routing table comprises the following steps of: determining a target prefix communication scenario according to the target message, wherein the target prefix communication scenario comprises a same prefix communication scenario and a non-same prefix communication scenario, the same prefix indicates that an address prefix of the client is same as that of the server, and the non-same prefix indicates that the address prefix of the client is different from that of the server; transferring a data packet to the predetermined terminal through the link layer interface according to the target prefix communication scenario, the client address and the routing table.
7. A link communication system, characterized by comprises the following steps of: a client, a server and a router, wherein the router is used for Receiving a target message sent by a client, wherein the target message is used to request an address of a server; In a case where a communication mode corresponding to the target message is a point-to-point communication mode, analyzing the target message to obtain a client address of the client; Forwarding a data packet to a predetermined terminal through a link layer interface according to the client address and a routing table, wherein the predetermined terminal includes at least one of the client and the server.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium includes a stored executable program, wherein the executable program controls a device where the computer readable storage medium is located to execute the method in any one of claims 1 to 6 when the executable program is running.
9. An electronic device, comprising: Comprise: A memory storing an executable program; A processor configured to execute the program, wherein the program executes the method in any one of claims 1 to 6 when the program is running.
10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 6.
Citation Information
Patent Citations
Router and method for implementing unnumbered broadcasting ports of router
CN103236980A
Message transmission method and device, equipment and storage medium
CN114500379A
Data transmission link establishment method and device, equipment and medium
CN119031026A
Automatic discovering method for IPV6 internet network topology
CN1588884A
A method of managing one or more services over a communications network
EP1111840A2