CN118101561A - Method for sending message and node equipment - Google Patents

Method for sending message and node equipment Download PDF

Info

Publication number
CN118101561A
CN118101561A CN202410232920.XA CN202410232920A CN118101561A CN 118101561 A CN118101561 A CN 118101561A CN 202410232920 A CN202410232920 A CN 202410232920A CN 118101561 A CN118101561 A CN 118101561A
Authority
CN
China
Prior art keywords
address information
message
sent
source address
default route
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410232920.XA
Other languages
Chinese (zh)
Inventor
杨立彬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Technologies Co Ltd
Original Assignee
New H3C Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Technologies Co Ltd filed Critical New H3C Technologies Co Ltd
Priority to CN202410232920.XA priority Critical patent/CN118101561A/en
Publication of CN118101561A publication Critical patent/CN118101561A/en
Pending legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present specification provides a method and a node device for sending a message, where the method includes: and acquiring a message to be transmitted, judging whether the message needs to be transmitted through a default route, if so, acquiring source address information of the message and address information of each output interface, acquiring target address information matched with the source address information from the address information of each output interface, generating a fast forwarding table by utilizing the target address information, and transmitting the message through the fast forwarding table. By the method, the condition that the message cannot be normally sent to the target equipment caused by inconsistent source address information of the sent message and an output interface for sending the message can be avoided.

Description

Method for sending message and node equipment
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a method and a node device for sending a message.
Background
Default routing: in a communication network, a Default Route (Default Route) is a special static Route in a routing table, and when the Route of a message in the network cannot be matched with the Route record in the current routing table, the Default Route is used to instruct a router or a network host to send the message to a designated location. In other words, if the destination address of the data packet cannot match the routing record in the routing table, the packet will be forwarded using the default route by the router or network host.
Equivalent routing: in the network environment that a plurality of different links reach the same destination address, if the traditional routing technology is used, the data packet sent to the destination address can only use one link, the other links are in a backup state or an invalid state, and the mutual switching in the dynamic routing environment needs a certain time, while the equivalent multipath routing protocol can use a plurality of links simultaneously in the network environment, thereby not only increasing the transmission bandwidth, but also backing up the data transmission of the invalid link without delay and packet loss.
As shown in fig. 1, the device 1 has two interfaces to access the internet network for communication with the outside. After accessing the internet, the device 1 generates two equivalent default routes, namely, a route with an outgoing interface being an interface 1 and a next hop being an internet1 gateway address, and a route with an outgoing interface being an interface 2 and a next hop being an internet2 gateway address. When the device 1 wants to access the device 2 by taking the ip address of the interface 1 as the source address, the device searches the detailed route according to the longest matching principle, and when the detailed route is not found, the device forwards the message according to the default route. Because the default route is an equivalent route of two different outgoing interfaces, the message may go out from any one of the interfaces, and it may cause that the message with the ip address of the interface 1 as the source address is sent out from the interface 2, so that the message cannot be sent to the device 2, and the device 1 cannot normally access the device 2.
Disclosure of Invention
In order to overcome the problems in the related art, the present specification provides a method and node device for sending a message.
According to a first aspect of embodiments of the present disclosure, there is provided a method of sending a message, the method being applied to a first node device, the first node device including an equivalent route of at least two outgoing interfaces, the method comprising:
Acquiring a message to be sent, and judging whether the message needs to be sent through a default route or not;
If yes, acquiring the source address information of the message and the address information of each output interface, and acquiring target address information matched with the source address information from the address information of each output interface;
And generating a fast forwarding table by utilizing the target address information, and sending the message through the fast forwarding table.
Wherein the determining whether the message needs to be sent through a default route includes:
judging whether a matched detailed route exists or not according to the source address information and the destination address information of the message;
If not, determining that the message needs to be sent through a default route;
If so, it is determined that the message does not need to be sent through the default route.
And if the message is judged not to be transmitted through the default route, transmitting according to the detailed route corresponding to the message.
The step of obtaining the source address information of the message and the address information of each output interface, and obtaining the target address information matched with the source address information from the address information of each output interface comprises the following steps:
And matching the source address information of the message with the address information of each outgoing interface one by one, and taking the address information of the outgoing interfaces which are matched consistently as target address information.
If it is determined that the message needs to be sent through a default route, and if no target address information matched with the source address information exists in the address information of each outgoing interface, sending and determining the message by the interfaces through a HASH result.
Wherein the generating a fast forwarding table by using the target address information includes:
and generating a fast forwarding table by taking the target address information as the source address information of the message.
According to the embodiments, it can be seen that, for the message to be sent through the default route, the source address information of the message fast forwarding table is ensured to be consistent with the address information of the outgoing interface for sending the message through the identification judgment of the source address and the outgoing interface address of the message, so that the condition that the message caused by the inconsistent source address information of the sent message and the outgoing interface for sending the message cannot be normally sent to the destination device is avoided.
According to a second aspect of embodiments of the present specification, there is provided a node apparatus comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the following method when executing the program:
Acquiring a message to be sent, and judging whether the message needs to be sent through a default route or not;
If yes, acquiring the source address information of the message and the address information of each output interface, and acquiring target address information matched with the source address information from the address information of each output interface;
And generating a fast forwarding table by utilizing the target address information, and sending the message through the fast forwarding table.
According to a third aspect of embodiments of the present specification, there is provided a node device comprising an equivalent route of at least two egress interfaces, the node device comprising:
the acquisition module is used for acquiring the message to be sent;
the judging module is used for judging whether the message is required to be sent through a default route or not;
And the processing module is used for acquiring the source address information of the message and the address information of each output interface when judging that the message needs to be sent through a default route, acquiring the target address information matched with the source address information from the address information of each output interface, generating a fast forwarding table by utilizing the target address information, and sending the message through the fast forwarding table.
The judging module is specifically configured to judge whether a matched detailed route exists according to the source address information and the destination address information of the message, if not, determine that the message needs to be sent through a default route, and if so, determine that the message does not need to be sent through the default route.
If the judging module judges that the message does not need to be sent through a default route;
the processing module is used for sending according to the detailed route corresponding to the message.
The processing module is specifically configured to match the source address information of the message with the address information of each outgoing interface one by one, and take the address information of the outgoing interfaces with the same match as the target address information.
And the processing module is further configured to send the determined interface to send the message through a HASH result if it is determined that the message needs to be sent through a default route and there is no target address information matched with the source address information in the address information of each outgoing interface.
The processing module is further configured to generate a fast forwarding table by using the target address information as source address information of the message.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the specification and together with the description, serve to explain the principles of the specification.
Fig. 1 is a schematic diagram of a network architecture according to an exemplary embodiment of the present description.
Fig. 2 is a flow chart illustrating a method of sending a message according to an exemplary embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the present specification. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present description as detailed in the accompanying claims.
The terminology used in the description presented herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the description. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in this specification to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information, without departing from the scope of the present description. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "in response to a determination" depending on the context.
As shown in fig. 1, because the default route is an equivalent route of two different interfaces, a message may go out from any one of the interfaces, and a message with the ip address of the interface 1 as the source address may be sent out from the interface 2, so that the message cannot be sent to the device 2, and the device 1 cannot normally access the device 2.
The prior method for solving the technical problems is mainly realized by a strategy routing mode, and the strategy routing is a mechanism for routing and forwarding according to a strategy formulated by a user, unlike the forwarding according to a destination address lookup routing table of an IP message. Policy routing may perform specified operations (set the next hop of the message, egress interface, SRv TE Policy, etc.) on the message that satisfies certain conditions (ACL rules, message length, etc.). If a policy routing configuration is added to the device 1, the source address of the interface 1 is matched, the operation is performed to output the interface as the interface 1, and the policy routing is applied to the device. Then when there is a message with an interface 1-bit source address to be sent out, the message is sent out from the interface 1.
However, the policy routing requires an administrator to perform a large amount of routing policy configuration, which wastes labor cost, and meanwhile, the policy routing requires to occupy an additional cpu process, so that cpu overhead is increased, and further, the device configuration amount is increased.
To solve the above technical problem, an embodiment of the present disclosure provides a method for sending a message, where the method is applied to a first node device, as shown in fig. 2, and the first node device includes at least two equal-cost routes of outgoing interfaces, and the method includes:
s201, acquiring a message to be sent, and judging whether the message needs to be sent by a default route or not;
S202, if yes, acquiring source address information of the message and address information of each output interface, and acquiring target address information matched with the source address information from the address information of each output interface;
s203, generating a fast forwarding table by utilizing the target address information, and sending the message through the fast forwarding table.
In this embodiment, the first node device may be a network device having data exchange capability, such as a router, a switch, or the like.
In step S201, after receiving the message to be sent, the first node device may determine a destination device to be accessed according to a destination address in the message, specifically, the first node device may find a detailed route according to a longest matching rule, if a matching detailed route is found, send the message according to the detailed route, and if a matching detailed route is not found, determine that the message needs to be sent through a default route;
In step S202, the first node device queries the number of outgoing interfaces of its own equivalent route (equivalent outgoing interfaces), obtains address information (IP address information) of each outgoing interface, performs attention matching with the address information of each outgoing interface by using the source address information of the message, and uses the address information of the outgoing interface with the same matching as the target address information.
And generating a fast forwarding table by utilizing the target address information, wherein the source address information in the fast forwarding table is target address information, and the target address is address information of target equipment to be accessed by the message.
In this embodiment, if it is found that the address information of each outgoing interface does not have the target address information matched with the source address information, the message is sent and determined by the HASH result, and the message is sent by the interface.
For a detailed description of the present solution, embodiments of the present disclosure are described in detail with reference to fig. 1:
In this embodiment, the first node device is device 1, and device 1 wants to send a message to device 2, where the source address in the message is the address of the output interface 1, and it is determined that the message needs to be sent through a default route by querying that the detail route does not find a matching item.
The device 1 recognizes that the outbound interface 1 and the outbound interface 2 exist, the outbound interface 1 and the outbound interface 2 correspond to equivalent routes, the device 1 obtains the address information of the outbound interface 1 and the address information of the outbound interface 2, and the source address information in the message is found to be the address information of the outbound interface 1 by matching the source address information carried by the message with the address information of the outbound interface 1 and the address information of the outbound interface 2.
The device 1 generates a fast forwarding table by using the address information of the outbound interface 1, and sends the message to the device 2 by using the fast forwarding table through the outbound interface 1.
According to the embodiments, it can be seen that, for the message to be sent through the default route, the source address information of the message fast forwarding table is ensured to be consistent with the address information of the outgoing interface for sending the message through the identification judgment of the source address and the outgoing interface address of the message, so that the condition that the message caused by the inconsistent source address information of the sent message and the outgoing interface for sending the message cannot be normally sent to the destination device is avoided.
The embodiment of the disclosure also provides a node device, which includes at least two equivalent routes of the outgoing interfaces, and the node device includes:
the acquisition module is used for acquiring the message to be sent;
the judging module is used for judging whether the message is required to be sent through a default route or not;
And the processing module is used for acquiring target address information matched with the source address information from the address information of each output interface when judging that the message needs to be sent through a default route, generating a fast forwarding table by utilizing the target address information, and sending the message through the fast forwarding table.
The judging module is specifically configured to judge whether a matched detailed route exists according to the source address information and the destination address information of the message, if not, determine that the message needs to be sent through a default route, and if so, determine that the message does not need to be sent through the default route.
If the judging module judges that the message does not need to be sent through a default route;
the processing module is used for sending according to the detailed route corresponding to the message.
The processing module is specifically configured to match the source address information of the message with the address information of each outgoing interface one by one, and take the address information of the outgoing interface with the same match as the target address information.
And the processing module is further used for sending and determining the interface to send the message through the HASH result if the message is determined to need to be sent through the default route and the address information of each outgoing interface does not have the target address information matched with the source address information.
The processing module is further configured to generate a fast forwarding table by using the target address information as source address information of the message.
For the device embodiments, reference is made to the description of the method embodiments for the relevant points, since they essentially correspond to the method embodiments. The apparatus embodiments described above are merely illustrative, wherein the modules illustrated as separate components may or may not be physically separate, and the components shown as modules may or may not be physical, i.e., may be located in one place, or may be distributed over a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purposes of the present description. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Other embodiments of the present description will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This specification is intended to cover any variations, uses, or adaptations of the specification following, in general, the principles of the specification and including such departures from the present disclosure as come within known or customary practice within the art to which the specification pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the specification being indicated by the following claims.
It is to be understood that the present description is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present description is limited only by the appended claims.
The foregoing description of the preferred embodiments is provided for the purpose of illustration only, and is not intended to limit the scope of the disclosure, since any modifications, equivalents, improvements, etc. that fall within the spirit and principles of the disclosure are intended to be included within the scope of the disclosure.

Claims (13)

1. A method of sending a message, the method being applied to a first node device, the first node device comprising an equivalent route of at least two outgoing interfaces, the method comprising:
Acquiring a message to be sent, and judging whether the message needs to be sent through a default route or not;
If yes, acquiring the source address information of the message and the address information of each output interface, and acquiring target address information matched with the source address information from the address information of each output interface;
And generating a fast forwarding table by utilizing the target address information, and sending the message through the fast forwarding table.
2. The method of claim 1, wherein the determining whether the message needs to be sent via a default route comprises:
judging whether a matched detailed route exists or not according to the source address information and the destination address information of the message;
If not, determining that the message needs to be sent through a default route;
If so, it is determined that the message does not need to be sent through the default route.
3. The method of claim 1, wherein if it is determined that the message does not need to be sent through a default route, sending the message according to a detailed route corresponding to the message.
4. The method of claim 1, wherein the step of obtaining the source address information of the message and the address information of each outgoing interface, and obtaining the destination address information matched with the source address information from the address information of each outgoing interface comprises:
And matching the source address information of the message with the address information of each outgoing interface one by one, and taking the address information of the outgoing interfaces which are matched consistently as target address information.
5. The method of claim 1 wherein if it is determined that the message needs to be sent through a default route and there is no destination address information matching the source address information in the address information of each outgoing interface, sending the message through a HASH result sending determination interface.
6. The method of claim 1, wherein generating a fast forwarding table using the destination address information comprises:
and generating a fast forwarding table by taking the target address information as the source address information of the message.
7. A node device, the node device comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the following method when executing the program:
Acquiring a message to be sent, and judging whether the message needs to be sent through a default route or not;
If yes, acquiring the source address information of the message and the address information of each output interface, and acquiring target address information matched with the source address information from the address information of each output interface;
And generating a fast forwarding table by utilizing the target address information, and sending the message through the fast forwarding table.
8. A node device comprising an equivalent route of at least two outgoing interfaces, the node device comprising:
the acquisition module is used for acquiring the message to be sent;
the judging module is used for judging whether the message is required to be sent through a default route or not;
And the processing module is used for acquiring the source address information of the message and the address information of each output interface when judging that the message needs to be sent through a default route, acquiring the target address information matched with the source address information from the address information of each output interface, generating a fast forwarding table by utilizing the target address information, and sending the message through the fast forwarding table.
9. The node apparatus of claim 8, wherein,
The judging module is specifically configured to judge whether a matched detailed route exists according to the source address information and the destination address information of the message, if not, determine that the message needs to be sent through a default route, and if so, determine that the message does not need to be sent through the default route.
10. The node apparatus of claim 8, wherein,
If the judging module judges that the message does not need to be sent through a default route;
the processing module is used for sending according to the detailed route corresponding to the message.
11. The node apparatus of claim 8, wherein,
The processing module is specifically configured to match the source address information of the message with the address information of each outgoing interface one by one, and take the address information of the outgoing interface with the same match as the target address information.
12. The node apparatus of claim 8, wherein,
And the processing module is further used for sending and determining the interface to send the message through the HASH result if the message is determined to need to be sent through the default route and the address information of each outgoing interface does not have the target address information matched with the source address information.
13. The node apparatus of claim 8, wherein,
The processing module is further configured to generate a fast forwarding table by using the target address information as source address information of the message.
CN202410232920.XA 2024-02-29 2024-02-29 Method for sending message and node equipment Pending CN118101561A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410232920.XA CN118101561A (en) 2024-02-29 2024-02-29 Method for sending message and node equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410232920.XA CN118101561A (en) 2024-02-29 2024-02-29 Method for sending message and node equipment

Publications (1)

Publication Number Publication Date
CN118101561A true CN118101561A (en) 2024-05-28

Family

ID=91162878

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410232920.XA Pending CN118101561A (en) 2024-02-29 2024-02-29 Method for sending message and node equipment

Country Status (1)

Country Link
CN (1) CN118101561A (en)

Similar Documents

Publication Publication Date Title
CN106470158B (en) Message forwarding method and device
JP4623317B2 (en) Communication apparatus, routing method and program
CN118101561A (en) Method for sending message and node equipment
JP2003258859A (en) Communication system, communicating method, transferring device and network managing device
Cisco Configuring XNS
Cisco Configuring XNS
Cisco Configuring XNS
Cisco Configuring XNS
Cisco Configuring XNS
Cisco Configuring XNS
Cisco Configuring XNS
Cisco Configuring XNS
Cisco Configuring XNS
Cisco Configuring XNS
Cisco Configuring XNS
Cisco Configuring XNS
Cisco Configuring XNS
Cisco Configuring XNS
Cisco Configuring XNS
Cisco Configuring XNS
Cisco Configuring XNS
Cisco Configuring XNS
Cisco Configuring XNS
Cisco Configuring XNS
Cisco Configuring XNS

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication