CN107547391B - Message transmission method and device - Google Patents

Message transmission method and device Download PDF

Info

Publication number
CN107547391B
CN107547391B CN201710426222.3A CN201710426222A CN107547391B CN 107547391 B CN107547391 B CN 107547391B CN 201710426222 A CN201710426222 A CN 201710426222A CN 107547391 B CN107547391 B CN 107547391B
Authority
CN
China
Prior art keywords
routing
address
routing table
message
network device
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.)
Active
Application number
CN201710426222.3A
Other languages
Chinese (zh)
Other versions
CN107547391A (en
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 CN201710426222.3A priority Critical patent/CN107547391B/en
Publication of CN107547391A publication Critical patent/CN107547391A/en
Application granted granted Critical
Publication of CN107547391B publication Critical patent/CN107547391B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a message transmission method and a device, and the method comprises the following steps: acquiring a first routing configuration identifier corresponding to a host connected with network equipment, acquiring a first routing configuration corresponding to the first routing configuration identifier, and sending first routing information to the network equipment, wherein the first routing information comprises an IP address of the host and the first routing configuration, so that the network equipment generates a first routing table item according to the first routing information; and acquiring a second routing configuration identifier corresponding to the network segment configured by the network device, acquiring a second routing configuration corresponding to the second routing configuration identifier, and sending second routing information to the network device, wherein the second routing information comprises the network segment address of the network segment and the second routing configuration, so that the network device generates a second routing table item according to the second routing information. By the technical scheme, the bandwidth resource of each next hop can be reasonably utilized, congestion of a link is avoided, and loss of a message is avoided.

Description

Message transmission method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for transmitting a packet.
Background
As shown in fig. 1, which is a networking diagram of an SDN (Software Defined Network), in order to enable a host to access a destination device, a controller may store a routing configuration, where the routing configuration may include an IP address of the destination device (an IP address X is taken as an example in the following), and an IP address of a next hop. Where this next hop is a user-specified next hop, such as user-specified network device 112 as the next hop. Based on this routing configuration, the controller may then send routing information to network device 111, which may include the IP address X of the destination device, and the IP address of the next hop (e.g., IP address 112 of network device 112). Moreover, network device 111 may also generate routing table entries based on the routing information.
In the application scenario, when the host 101 sends a packet with a destination IP address of IP address X, the network device 111 may query the routing table through the IP address X to obtain the next-hop IP address 112, and send the packet through the outgoing interface (i.e., interface a) corresponding to the IP address 112, and the network device 112 forwards the packet to the destination device. Similarly, the messages sent by the host 102/the host 103 and having the destination IP address of IP address X are all sent by the network device 111 to the network device 112 through the interface a.
In the above manner, the messages of all the hosts are transmitted through the network device 112, which occupies a large amount of bandwidth resources of the network device 112, and the bandwidth resources of the network device 113 and the network device 114 are idle, so that the bandwidth resources cannot be reasonably utilized, and the processing pressure of the network device 112 is too large. Furthermore, it may cause congestion on the link between network device 111 and network device 112 and cause loss of messages.
Disclosure of Invention
The application provides a message transmission method, which is applied to a controller, wherein the controller stores at least two routing configurations of network equipment, each routing configuration comprises an IP address of target equipment and an IP address of a next hop, and the IP addresses of the next hops in the routing configurations with the same IP addresses of the target equipment are uneven and the same; the method comprises the following steps:
acquiring a first routing configuration identifier corresponding to a host connected with the network equipment, acquiring a first routing configuration corresponding to the first routing configuration identifier, and sending first routing information to the network equipment, wherein the first routing information comprises an IP address of the host and the first routing configuration, so that the network equipment generates a first routing table item according to the first routing information and transmits a message according to the first routing table item;
and acquiring a second routing configuration identifier corresponding to a network segment configured by the network device, acquiring a second routing configuration corresponding to the second routing configuration identifier, and sending second routing information to the network device, wherein the second routing information comprises a network segment address of the network segment and the second routing configuration, so that the network device generates a second routing table item according to the second routing information and transmits a message according to the second routing table item.
The application provides a message transmission method, which is applied to network equipment and comprises the following steps:
receiving first routing information sent by a controller, and generating a first routing table item according to the first routing information; the first routing information is sent by the controller according to a first routing configuration corresponding to a first routing configuration identifier corresponding to a host connected to the network device, and the first routing information includes an IP address of the host and the first routing configuration;
receiving second routing information sent by a controller, and generating a second routing table item according to the second routing information; the second routing information is sent by the controller according to a second routing configuration corresponding to a second routing configuration identifier corresponding to a network segment configured by the network device, and the second routing information includes a network segment address of the network segment and the second routing configuration;
transmitting a message according to the first routing table entry or the second routing table entry;
the controller stores at least two routing configurations of the network device, each routing configuration comprises an IP address of the destination device and an IP address of a next hop, and the IP addresses of the next hops in the routing configurations with the same IP addresses of the destination devices are uneven and the same.
The application provides a message transmission device, which is applied to a controller, wherein the controller stores at least two routing configurations of network equipment, each routing configuration comprises an IP address of target equipment and an IP address of a next hop, and the IP addresses of the next hops in the routing configurations with the same IP addresses of the target equipment are uneven and the same; the method comprises the following steps:
an obtaining module, configured to obtain a first routing configuration identifier corresponding to a host connected to the network device, and obtain a first routing configuration corresponding to the first routing configuration identifier; acquiring a second routing configuration identifier corresponding to the network segment configured by the network equipment, and acquiring a second routing configuration corresponding to the second routing configuration identifier;
a sending module, configured to send first routing information to the network device, where the first routing information includes an IP address of the host and a first routing configuration, so that the network device generates a first routing table according to the first routing information, and transmits a packet according to the first routing table; and sending second routing information to the network equipment, wherein the second routing information comprises a network segment address of the network segment and the second routing configuration, so that the network equipment generates a second routing table item according to the second routing information and transmits a message according to the second routing table item.
The application provides a message transmission device, is applied to network equipment, the device includes:
the receiving module is used for receiving the first routing information and the second routing information sent by the controller; the first routing information is sent by a controller according to a first routing configuration corresponding to a first routing configuration identifier corresponding to a host connected with the network device, and the first routing information includes an IP address of the host and the first routing configuration; the second routing information is sent by the controller according to a second routing configuration corresponding to a second routing configuration identifier corresponding to a network segment configured by the network equipment, and the second routing information comprises a network segment address of the network segment and the second routing configuration;
a generating module, configured to generate a first routing table entry according to the first routing information, and generate a second routing table entry according to the second routing information;
a sending module, configured to transmit a packet according to the first routing table entry or the second routing table entry;
the controller stores at least two routing configurations of the network device, each routing configuration comprises an IP address of the destination device and an IP address of a next hop, and the IP addresses of the next hops in the routing configurations with the same IP addresses of the destination devices are uneven and the same.
Based on the above technical solution, in the embodiment of the present application, when the network device has multiple next hops, the next hops corresponding to the messages of different hosts may be different, so that the messages of all hosts are prevented from being sent to the same next hop, load sharing may be implemented between the multiple next hops, and bandwidth resources of each next hop may be reasonably utilized. Moreover, because the message can be shared to a plurality of next hops for processing, the congestion of the link can be avoided, and the loss of the message can be avoided.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments of the present application or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art according to the drawings of the embodiments of the present application.
Figure 1 is a networking schematic of an SDN;
FIG. 2 is a schematic diagram of an application scenario in an embodiment of the present application;
fig. 3 is a flowchart of a message transmission method according to an embodiment of the present application;
fig. 4 is a block diagram of a message transmission apparatus according to an embodiment of the present application;
FIG. 5 is a hardware block diagram of a controller in one embodiment of the present application;
fig. 6 is a block diagram of a message transmission apparatus according to another embodiment of the present application;
fig. 7 is a hardware configuration diagram of a network device according to an embodiment of the present application.
Detailed Description
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the examples and claims of this application, 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 is meant to encompass any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. Depending on the context, moreover, the word "if" may be used is interpreted as "at … …," or "at … …," or "in response to a determination.
The embodiment of the application provides a message transmission method, which can be applied to a network (such as an SDN) comprising a controller (such as an SDN controller) and a network device. The network device is a device connected to the host, and there are multiple next hops between the network device and a destination device (e.g., a traffic server, etc.). Referring to fig. 2, which is a schematic view of an application scenario of the embodiment of the present application, a network device 211 connected to a host may be connected to a destination device through multiple next hops. For example, the outgoing interface of the first next hop of network device 211 is interface a, and the address of the next hop is the IP address of network device 212; the outgoing interface of the second next hop of the network device 211 is interface B, and the address of the next hop is the IP address of the network device 213; the third next-hop outbound interface of network device 211 is interface C and the next-hop address is the IP address of network device 214.
In one example, the controller may store at least two routing configurations of the network device, each routing configuration including an IP address of the destination device and an IP address of a next hop, and the IP addresses of the next hops in the routing configurations where the IP addresses of the destination devices are the same are not uniform. For example, the controller may store route configuration 1, route configuration 2, route configuration 3, and route configuration 4; route configuration 1 includes the IP address of the destination device, the IP address of the next hop (IP address of network device 212); route configuration 2 includes the IP address of the destination device, the IP address of the next hop (IP address of network device 213); route configuration 3 includes the IP address of the destination device, the IP address of the next hop (IP address of network device 213); routing configuration 4 includes the IP address of the destination device, the IP address of the next hop (IP address of network device 214). In summary, the IP addresses of the next hops are not uniform in the 4 routing configurations with the same IP address of the destination device.
In this embodiment of the present application, the routing configuration of the network device may be three types of routing configurations, where the first type is a routing configuration corresponding to a host connected to the network device, the second type is a routing configuration corresponding to a network segment configured by the network device, and the third type is a routing configuration for the network device.
In order to implement the above-mentioned routing configuration of the host connected to the corresponding network device, a routing configuration identifier may be set in configuration information for the host of the network device stored on the controller. When a route needs to be configured for the network device, the route configuration identifier may be obtained from the configuration information for the host. For example, the routing configuration identifier of routing configuration 1 is set in the configuration information of the network device for host 201. As another example, the routing configuration identification of routing configuration 2 is set in the configuration information of the network device for host 204. In this way, the controller may obtain the routing configuration identifier from the configuration information of the network device for the host, thereby obtaining the routing configuration of the host connected to the corresponding network device.
The configuration information of the network device for the host may include: IP address of the host, Network segment to which the host belongs, VXLAN (Virtual Extensible Local Area Network) to which the host belongs, VPN (Virtual Private Network) to which the host belongs, and the like.
In order to implement the above-mentioned routing configuration of the network segment configured by the corresponding network device, a routing configuration identifier may be set in configuration information of the network device for the network segment, which is stored on the controller. When a route needs to be configured for the network device, the route configuration identifier may be obtained from the configuration information for the network segment. For example, the routing configuration identifier of routing configuration 3 is set in the configuration information of the network device for network segment X. In this way, the controller may obtain the routing configuration identifier from the configuration information of the network device for the network segment, thereby obtaining the routing configuration of the network segment configured by the corresponding network device. The configuration information of the network device for the network segment may include the specific range of the network segment, the VXLAN to which the network device belongs, the VPN to which the network device belongs, and the like.
In order to implement the above-mentioned routing configuration for the network device, a routing configuration identifier may be set in the configuration information of the network device stored on the controller. When a route needs to be configured for a network device, a route configuration identifier may be obtained from configuration information of the network device. For example, the routing configuration identifier of the routing configuration 4 is set in the configuration information of the network device. In this way, the controller may obtain the routing configuration identifier from the configuration information of the network device, thereby obtaining the routing configuration for the network device. The configuration information for the network device may include content such as an IP address and a VPN of the network device.
The configuration information of the network device includes a routing configuration identifier. The configuration information of the network device for the network segment may include a routing configuration identifier, or may not include the routing configuration identifier, for example, the configuration information of the network device for the network segment X includes the routing configuration identifier, and the configuration information of the network device for the network segment Y does not include the routing configuration identifier. The configuration information of the network device for the host may or may not include a routing configuration identifier, for example, the configuration information of the network device for the host 201 and the host 204 includes a routing configuration identifier, and the configuration information of the network device for the other hosts does not include a routing configuration identifier.
In a conventional SDN, the host may be a virtual machine or a PC (Personal Computer), the network segment may be network segment information such as 192.168.10.0/24, 192.168.20.0/24, and the like, and the network device may be a router, a switch, and the like. In an SDN + OpenStack network, the host may be a virtual port, and the virtual port may correspond to a virtual machine or a PC; the network segment can be a virtual subnet, and the virtual subnet can correspond to network segment information of 192.168.10.0/24, 192.168.20.0/24 and the like; the network device may be a virtual router, and the virtual router may correspond to a router, a switch, or the like.
In the application scenario, referring to fig. 3, a flowchart of the message transmission method is shown.
Step 301, the controller obtains a first routing configuration identifier corresponding to the host, obtains a first routing configuration corresponding to the first routing configuration identifier, and sends first routing information to the network device, where the first routing information includes an IP address of the host and the first routing configuration (an IP address of the destination device, an IP address of a next hop).
The host is a host connected to the network device (e.g., the network device 211), and the hosts in the subsequent process are all hosts connected to the network device, and will not be described in the subsequent process.
In an example, the controller may first obtain configuration information of the network device for the host, and if the configuration information includes a first routing configuration identifier, may parse the first routing configuration identifier from the configuration information, and query a first routing configuration corresponding to the first routing configuration identifier.
Step 302, the network device generates a first routing table entry according to the first routing information. In the subsequent process, when the network device receives the message sent by the host, the network device may transmit the message according to the first routing table entry.
Step 303, the controller obtains a second routing configuration identifier corresponding to the network segment, obtains a second routing configuration corresponding to the second routing configuration identifier, and sends second routing information to the network device, where the second routing information includes the network segment address of the network segment and the second routing configuration (the IP address of the destination device, the IP address of the next hop).
The network segment is a network segment configured by the network device (such as the network device 211), and the network segments in the subsequent process are all network segments configured by the network device and are not introduced in the subsequent process.
In an example, the controller may first obtain configuration information of the network device for the network segment, and if the configuration information includes a second routing configuration identifier, may parse the second routing configuration identifier from the configuration information, and query a second routing configuration corresponding to the second routing configuration identifier.
Step 304, the network device generates a second routing table entry according to the second routing information. In the subsequent process, when the network device receives the message sent by the host, the network device may transmit the message according to the second routing table entry.
Wherein, there is no precedence relationship between the steps 301 and 303.
In one example, the controller may further obtain a third routing configuration identifier corresponding to the network device, obtain a third routing configuration corresponding to the third routing configuration identifier, and send third routing information to the network device, where the third routing information includes the third routing configuration (i.e., the IP address of the destination device, the IP address of the next hop). For example, the controller may first obtain configuration information of the network device, and if the configuration information includes a third routing configuration identifier, the controller may parse the third routing configuration identifier from the configuration information and query a third routing configuration corresponding to the third routing configuration identifier.
Then, the network device generates a third routing table entry according to the third routing information. In the subsequent process, when the network device receives the message sent by the host, the network device can transmit the message according to the third routing table entry.
The above process is described in detail below with reference to the application scenario shown in fig. 2.
After acquiring the configuration information of the network device for the host 201, the controller acquires the routing configuration identifier of routing configuration 1 from the configuration information, and acquires the routing configuration 1 corresponding to the routing configuration identifier, so that the controller sends first routing information to the network device 211, where the first routing information may include an IP address of the host 201 (e.g., 192.168.10.10), an IP address of the destination device (e.g., 20.10.10.10), and an IP address of the next hop (e.g., IP address 100.20.20.212 of the network device 212). After receiving the first routing information, the network device adds a first routing table entry in the routing table, as shown in table 1.
After acquiring the configuration information of the network device for the host 204, the controller acquires the routing configuration identifier of the routing configuration 2 from the configuration information, and acquires the routing configuration 2 corresponding to the routing configuration identifier, so that the controller sends the first routing information to the network device 211, where the first routing information may include an IP address (e.g., 192.168.20.10) of the host 204, an IP address 20.10.10.10 of the destination device, and an IP address (e.g., 100.20.20.213) of the next hop. After receiving the first routing information, the network device adds a first routing table entry in the routing table, as shown in table 1.
After acquiring the configuration information of the network segment X configured by the network device, the controller acquires the routing configuration identifier of routing configuration 3 from the configuration information, and acquires the routing configuration 3 corresponding to the routing configuration identifier, so that the controller sends second routing information to the network device 211, where the second routing information may include a network segment address (e.g., 192.168.10.0/24) of the network segment X, an IP address 20.10.10.10 of the destination device, and an IP address of the next hop (e.g., IP address 100.20.20.213 of the network device 213). After receiving the second routing information, the network device may add a second routing table entry in the routing table, as shown in table 1.
After acquiring the configuration information of the network device 211, the controller acquires the routing configuration identifier of the routing configuration 4 from the configuration information, and acquires the routing configuration 4 corresponding to the routing configuration identifier, so that third routing information is sent to the network device 211, where the third routing information may include the IP address 20.10.10.10 of the destination device and the IP address of the next hop (e.g., the IP address 100.20.20.214 of the network device 214). Further, after receiving the third routing information, the network device may add a third routing table entry in the routing table, as shown in table 1.
TABLE 1
Host address/network segment address Destination IP address Next hop IP address
192.168.10.10 20.10.10.10 100.20.20.212
192.168.20.10 20.10.10.10 100.20.20.213
192.168.10.0/24 20.10.10.10 100.20.20.213
20.10.10.10 100.20.20.214
Based on the above process, the network device may add a routing table entry (e.g., a first routing table entry, a second routing table entry, a third routing table entry, etc.) corresponding to each routing configuration in the routing table. And after receiving the message sent by the host, the network device can transmit the message according to the routing table entry in the routing table. For example,
the network equipment transmits the message according to the first routing table item, the second routing table item or the third routing table item.
In one example, if a message matches only one routing table entry in the routing table, the message may be transmitted using the routing table entry. If the message is matched with at least two routing table entries in the routing table, selecting a routing table entry from the at least two routing table entries, and transmitting the message by using the selected routing table entry. In order to select a routing table entry from at least two routing table entries, the following method may be further adopted:
in the first mode, the first routing information sent to the network device by the controller further includes a first priority, the second routing information sent to the network device by the controller further includes a second priority, and the third routing information sent to the network device by the controller further includes a third priority. Based on this, when the network device generates the first routing table entry, the first routing table entry may further include a first priority; when the network device generates the second routing table entry, the second routing table entry may further include a second priority; when the network device generates the third routing table entry, the third routing table entry may further include a third priority. As shown in table 2, is an example of a routing table that includes priorities.
TABLE 2
Figure BDA0001316239960000091
Figure BDA0001316239960000101
On this basis, the process of "the network device transmits the packet according to the first routing table entry, the second routing table entry, or the third routing table entry" may include: after receiving a message sent by a host, a network device determines each routing table item (such as one routing table item or at least two routing table items) matched with the message according to a destination address and a source address of the message; then, the network device selects the routing table item with the optimal priority from each determined routing table item, and transmits the message through the selected routing table item.
In one example, in order to enable different network segments under the same network device to be matched with different routing table entries, the second priority may be set to be superior to the third priority; in order to match different hosts in the same network segment to different routing table entries, the first priority may be set to be higher than the second priority.
The first embodiment will be described in detail below with reference to the application scenario shown in fig. 2.
After receiving the packet 1 sent by the host 201, the network device 211 may match the packet 1 with the first routing table entry, the third routing table entry, and the fourth routing table entry in the table 2 because the source IP address of the packet 1 is 192.168.10.10 and the destination IP address is 20.10.10.10. Since the priority of the first routing table entry is the first priority, the priority of the third routing table entry is the second priority, the priority of the fourth routing table entry is the third priority, the first priority is higher than the second priority, and the second priority is higher than the third priority, the routing table entry with the optimal priority selected by the network device 211 is the first routing table entry, and the message 1 is transmitted through the first routing table entry. For example, the outgoing interface corresponding to the next-hop IP address (100.20.20.212) is queried as interface a, and then message 1 is sent through interface a.
After receiving the packet 2 sent by the host 202, the network device 211 may match the packet 2 with the third routing table entry and the fourth routing table entry in table 2, because the source IP address of the packet 2 is 192.168.10.11 and the destination IP address is 20.10.10.10. Since the priority of the third routing table entry is the second priority, the priority of the fourth routing table entry is the third priority, and the second priority is higher than the third priority, the routing table entry with the optimal priority selected by the network device 211 is the third routing table entry, and the message 2 is transmitted through the third routing table entry. For example, network device 211 queries the outgoing interface corresponding to the next-hop IP address (100.20.20.213) as interface B, and then sends message 2 through interface B.
When the network device 211 receives the message 3 sent by the host 203, the processing flow is similar to the processing of the message 2, and details are not described here again. After receiving the message 4 sent by the host 204, the network device 211 may match the message 4 to the second routing table entry and the fourth routing table entry in table 2 because the source IP address of the message 4 is 192.168.20.10 and the destination IP address is 20.10.10.10. Since the priority of the second routing table entry is the first priority and the priority of the fourth routing table entry is the third priority, the message 4 is transmitted through the second routing table entry. For example, network device 211 queries the outgoing interface corresponding to the next-hop IP address (100.20.20.213) as interface B, and then sends message 4 through interface B.
After receiving the message 5 sent by the host 205, the network device 211 matches the message 5 only to the fourth routing table entry in table 2, that is, transmits the message 5 through the fourth routing table entry, because the source IP address of the message 5 is 192.168.20.11 and the destination IP address is 20.10.10.10. For example, the outgoing interface corresponding to the next hop IP address (100.20.20.214) is queried as interface C, and message 5 is sent through interface C.
In a second mode, if the destination address of the message is matched with the IP address of the destination device in the first routing table item, and the source address of the message is matched with the IP address of the host in the first routing table item, the network device transmits the message according to the first routing table item; if the source address of the message is not matched with the IP address of the host in the first routing table item, the destination address of the message is matched with the IP address of the destination device in the second routing table item, and the source address of the message is matched with the network segment address in the second routing table item, the network device transmits the message according to the second routing table item; and if the source address of the message is not matched with the IP address of the host in the first routing table item, the source address of the message is not matched with the network segment address in the second routing table item, and the destination address of the message is matched with the IP address of the destination device in the third routing table item, the network device transmits the message according to the third routing table item.
The second embodiment will be described in detail below with reference to the application scenario shown in fig. 2 and table 1.
After receiving the message 1 sent by the host 201, the network device 211 matches the destination IP address in the first routing table entry with the destination IP address of the message 1 being 192.168.10.10 and the destination IP address being 20.10.10.10, so that the network device 211 transmits the message 1 through the first routing table entry.
After the network device 211 receives the message 2 sent by the host 202, since the source IP address of the message 2 is 192.168.10.11 and the destination IP address is 20.10.10.10, the source IP address of the message 2 does not match with each host address in the routing table, but the source IP address of the message 2 matches with the network segment address in the third routing table entry, and the destination IP address of the message 2 matches with the destination IP address in the third routing table entry, so the network device 211 transmits the message 2 through the third routing table entry.
When the network device 211 receives the message 3 sent by the host 203, the processing flow is similar to the processing of the message 2, and details are not described here again. After receiving the message 4 sent by the host 204, the network device 211 matches the destination IP address in the second routing table entry with the destination IP address of the message 4 because the source IP address of the message 4 is 192.168.20.10 and the destination IP address is 20.10.10.10, that is, the message 4 is transmitted through the second routing table entry.
After the network device 211 receives the message 5 sent by the host 205, since the source IP address of the message 5 is 192.168.20.11 and the destination IP address is 20.10.10.10, the source IP address of the message 5 is not matched with each host address in the routing table, the source IP address of the message 5 is not matched with each network segment address in the routing table, but the destination IP address of the message 5 is matched with the destination IP address in the fourth routing table entry, and therefore the network device 211 transmits the message 5 through the fourth routing table entry.
Based on the above technical solution, in the embodiment of the present application, when the network device has multiple next hops, the next hops corresponding to the messages of different hosts may be different, so that the messages of all hosts are prevented from being sent to the same next hop, load sharing may be implemented between the multiple next hops, and bandwidth resources of each next hop may be reasonably utilized. Moreover, because the message can be shared to a plurality of next hops for processing, the congestion of the link can be avoided, and the loss of the message can be avoided.
Based on the same application concept as the method, the embodiment of the present application further provides a message transmission apparatus, which can be applied to a controller. The controller stores at least two routing configurations of the network equipment, each routing configuration comprises an IP address of the destination equipment and an IP address of a next hop, and the IP addresses of the next hops in the routing configurations with the same IP addresses of the destination equipment are uneven and the same; referring to fig. 4, the apparatus may include:
an obtaining module 401, configured to obtain a first routing configuration identifier corresponding to a host connected to the network device, and obtain a first routing configuration corresponding to the first routing configuration identifier; acquiring a second routing configuration identifier corresponding to the network segment configured by the network equipment, and acquiring a second routing configuration corresponding to the second routing configuration identifier; a sending module 402, configured to send first routing information to the network device, where the first routing information includes an IP address of the host and a first routing configuration, so that the network device generates a first routing table according to the first routing information, and transmits a packet according to the first routing table; and sending second routing information to the network equipment, wherein the second routing information comprises a network segment address of the network segment and the second routing configuration, so that the network equipment generates a second routing table item according to the second routing information and transmits a message according to the second routing table item.
In an example, the obtaining module 401 is further configured to obtain a third routing configuration identifier corresponding to the network device, and obtain a third routing configuration corresponding to the third routing configuration identifier;
the sending module 402 is further configured to send third routing information to the network device, where the third routing information includes the third routing configuration, so that the network device generates a third routing table according to the third routing information, and transmits a packet according to the third routing table.
The first routing information sent by the sending module 402 further includes a first priority, the second routing information further includes a second priority, and the third routing information further includes a third priority; the first priority is superior to the second priority, and the second priority is superior to the third priority, so that when the network device receives a message matched with a plurality of routing table items, the network device selects a routing table item with the optimal priority from the plurality of routing table items, and sends the message according to the selected routing table item.
For the controller provided in the embodiment of the present application, from a hardware level, a schematic diagram of a hardware architecture may specifically refer to fig. 5. The method comprises the following steps: a machine-readable storage medium and a processor, wherein:
a machine-readable storage medium: the instruction code is stored.
A processor: the message transmission operation disclosed in the above example of the present application is realized by communicating with a machine-readable storage medium, reading and executing the instruction codes stored in the machine-readable storage medium.
Here, a machine-readable storage medium may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and so forth. For example, the machine-readable storage medium may be: a RAM (random access Memory), a volatile Memory, a non-volatile Memory, a flash Memory, a storage drive (e.g., a hard drive), a solid state drive, any type of storage disk (e.g., an optical disk, a dvd, etc.), or similar storage medium, or a combination thereof.
Based on the same application concept as the method, the embodiment of the present application further provides a message transmission apparatus, which can be applied to a network device. Referring to fig. 6, the apparatus may include:
a receiving module 601, configured to receive first routing information and second routing information sent by a controller; the first routing information is sent by a controller according to a first routing configuration corresponding to a first routing configuration identifier corresponding to a host connected with the network device, and the first routing information includes an IP address of the host and the first routing configuration; the second routing information is sent by the controller according to a second routing configuration corresponding to a second routing configuration identifier corresponding to a network segment configured by the network equipment, and the second routing information comprises a network segment address of the network segment and the second routing configuration; a generating module 602, configured to generate a first routing table entry according to the first routing information, and generate a second routing table entry according to the second routing information; a sending module 603, configured to transmit a packet according to the first routing table entry or the second routing table entry;
the controller stores at least two routing configurations of the network device, each routing configuration comprises an IP address of the destination device and an IP address of a next hop, and the IP addresses of the next hops in the routing configurations with the same IP addresses of the destination devices are uneven and the same.
The receiving module 601 is further configured to receive third routing information sent by the controller; the third routing information is sent by the controller according to a third routing configuration corresponding to a third routing configuration identifier corresponding to the network device, and the third routing information includes the third routing configuration;
the generating module 602 is further configured to generate a third routing table entry according to the third routing information;
the sending module 603 is further configured to transmit the packet according to the first routing table entry, the second routing table entry, or the third routing table entry in the process of transmitting the packet.
The first routing information received by the receiving module 601 further includes a first priority, the second routing information further includes a second priority, and the third routing information further includes a third priority; wherein the first priority is better than the second priority, and the second priority is better than the third priority;
the sending module 603 is specifically configured to determine, according to a destination address and a source address of a packet, each routing table entry matching the packet in a process of transmitting the packet according to the first routing table entry, the second routing table entry, or the third routing table entry; selecting a routing table entry with the optimal priority from each determined routing table entry; and transmitting the message through the selected routing list item.
The sending module 603 is specifically configured to, in the process of transmitting a packet according to the first routing table entry, the second routing table entry, or the third routing table entry, transmit the packet according to the first routing table entry if a destination address of the packet matches an IP address of a destination device in the first routing table entry and a source address of the packet matches an IP address of a host in the first routing table entry;
if the source address of the message is not matched with the IP address of the host in the first routing table item, the destination address of the message is matched with the IP address of the destination equipment in the second routing table item, and the source address of the message is matched with the network segment address in the second routing table item, transmitting the message according to the second routing table item;
and if the source address of the message is not matched with the IP address of the host in the first routing table item, the source address of the message is not matched with the network segment address in the second routing table item, and the destination address of the message is matched with the IP address of the destination equipment in the third routing table item, transmitting the message according to the third routing table item.
In the network device provided in the embodiment of the present application, from a hardware level, a schematic diagram of a hardware architecture may specifically refer to fig. 7. The method comprises the following steps: a machine-readable storage medium and a processor, wherein:
a machine-readable storage medium: the instruction code is stored.
A processor: the message transmission operation disclosed in the above example of the present application is realized by communicating with a machine-readable storage medium, reading and executing the instruction codes stored in the machine-readable storage medium.
Here, a machine-readable storage medium may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and so forth. For example, the machine-readable storage medium may be: a RAM (random access Memory), a volatile Memory, a non-volatile Memory, a flash Memory, a storage drive (e.g., a hard drive), a solid state drive, any type of storage disk (e.g., an optical disk, a dvd, etc.), or similar storage medium, or a combination thereof.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Furthermore, these computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (which may include, but is not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (14)

1. A message transmission method is characterized in that the message transmission method is applied to a controller, at least two routing configurations of network equipment are stored in the controller, each routing configuration comprises an IP address of target equipment and an IP address of a next hop, and the IP addresses of the next hops in the routing configurations with the same IP addresses of the target equipment are uneven and the same; the method comprises the following steps:
acquiring a first routing configuration identifier corresponding to a host connected with the network equipment, acquiring a first routing configuration corresponding to the first routing configuration identifier, and sending first routing information to the network equipment, wherein the first routing information comprises an IP address of the host and the first routing configuration, so that the network equipment generates a first routing table item according to the first routing information and transmits a message according to the first routing table item;
and acquiring a second routing configuration identifier corresponding to a network segment configured by the network device, acquiring a second routing configuration corresponding to the second routing configuration identifier, and sending second routing information to the network device, wherein the second routing information comprises a network segment address of the network segment and the second routing configuration, so that the network device generates a second routing table item according to the second routing information and transmits a message according to the second routing table item.
2. The method of claim 1, further comprising:
acquiring a third routing configuration identifier corresponding to the network device, acquiring a third routing configuration corresponding to the third routing configuration identifier, and sending third routing information to the network device, where the third routing information includes the third routing configuration, so that the network device generates a third routing table according to the third routing information, and transmits a message according to the third routing table.
3. The method of claim 2,
the first routing information further comprises a first priority, the second routing information further comprises a second priority, and the third routing information further comprises a third priority; the first priority is superior to the second priority, and the second priority is superior to the third priority, so that when the network device receives a message matched with a plurality of routing table items, the network device selects a routing table item with the optimal priority from the plurality of routing table items, and sends the message according to the selected routing table item.
4. A message transmission method is applied to network equipment, and the method comprises the following steps:
receiving first routing information sent by a controller, and generating a first routing table item according to the first routing information; the first routing information is sent by the controller according to a first routing configuration corresponding to a first routing configuration identifier corresponding to a host connected to the network device, and the first routing information includes an IP address of the host and the first routing configuration;
receiving second routing information sent by a controller, and generating a second routing table item according to the second routing information; the second routing information is sent by the controller according to a second routing configuration corresponding to a second routing configuration identifier corresponding to a network segment configured by the network device, and the second routing information includes a network segment address of the network segment and the second routing configuration;
transmitting a message according to the first routing table entry or the second routing table entry;
the controller stores at least two routing configurations of the network device, each routing configuration comprises an IP address of the destination device and an IP address of a next hop, and the IP addresses of the next hops in the routing configurations with the same IP addresses of the destination devices are uneven and the same.
5. The method of claim 4, further comprising:
receiving third routing information sent by the controller, and generating a third routing table item according to the third routing information; the third routing information is sent by the controller according to a third routing configuration corresponding to a third routing configuration identifier corresponding to the network device, and the third routing information includes the third routing configuration;
the transmitting the packet according to the first routing table entry or the second routing table entry specifically includes: and transmitting the message according to the first routing table item, the second routing table item or the third routing table item.
6. The method of claim 5,
the first routing information further comprises a first priority, the second routing information further comprises a second priority, and the third routing information further comprises a third priority; wherein the first priority is better than the second priority, and the second priority is better than the third priority; the process of transmitting the packet according to the first routing table entry, the second routing table entry, or the third routing table entry specifically includes:
determining each routing table item matched with the message according to the destination address and the source address of the message;
selecting a routing table entry with the optimal priority from each determined routing table entry;
and transmitting the message through the selected routing list item.
7. The method according to claim 5, wherein the process of transmitting the packet according to the first routing table entry, the second routing table entry, or the third routing table entry specifically includes:
if the destination address of the message is matched with the IP address of the destination equipment in the first routing table item, and the source address of the message is matched with the IP address of the host in the first routing table item, transmitting the message according to the first routing table item;
if the source address of the message is not matched with the IP address of the host in the first routing table item, the destination address of the message is matched with the IP address of the destination equipment in the second routing table item, and the source address of the message is matched with the network segment address in the second routing table item, transmitting the message according to the second routing table item;
and if the source address of the message is not matched with the IP address of the host in the first routing table item, the source address of the message is not matched with the network segment address in the second routing table item, and the destination address of the message is matched with the IP address of the destination equipment in the third routing table item, transmitting the message according to the third routing table item.
8. A message transmission device is characterized in that the message transmission device is applied to a controller, at least two routing configurations of network equipment are stored in the controller, each routing configuration comprises an IP address of destination equipment and an IP address of a next hop, and the IP addresses of the next hops in the routing configurations with the same IP addresses of the destination equipment are uneven and the same; the method comprises the following steps:
an obtaining module, configured to obtain a first routing configuration identifier corresponding to a host connected to the network device, and obtain a first routing configuration corresponding to the first routing configuration identifier; acquiring a second routing configuration identifier corresponding to the network segment configured by the network equipment, and acquiring a second routing configuration corresponding to the second routing configuration identifier;
a sending module, configured to send first routing information to the network device, where the first routing information includes an IP address of the host and a first routing configuration, so that the network device generates a first routing table according to the first routing information, and transmits a packet according to the first routing table; and sending second routing information to the network equipment, wherein the second routing information comprises a network segment address of the network segment and the second routing configuration, so that the network equipment generates a second routing table item according to the second routing information and transmits a message according to the second routing table item.
9. The apparatus of claim 8,
the obtaining module is further configured to obtain a third routing configuration identifier corresponding to the network device, and obtain a third routing configuration corresponding to the third routing configuration identifier;
the sending module is further configured to send third routing information to the network device, where the third routing information includes the third routing configuration, so that the network device generates a third routing table according to the third routing information, and transmits a packet according to the third routing table.
10. The apparatus of claim 9,
the first routing information sent by the sending module further comprises a first priority, the second routing information further comprises a second priority, and the third routing information further comprises a third priority; the first priority is superior to the second priority, and the second priority is superior to the third priority, so that when the network device receives a message matched with a plurality of routing table items, the network device selects a routing table item with the optimal priority from the plurality of routing table items, and sends the message according to the selected routing table item.
11. A message transmission apparatus, applied to a network device, the apparatus comprising:
the receiving module is used for receiving the first routing information and the second routing information sent by the controller; the first routing information is sent by a controller according to a first routing configuration corresponding to a first routing configuration identifier corresponding to a host connected with the network device, and the first routing information includes an IP address of the host and the first routing configuration; the second routing information is sent by the controller according to a second routing configuration corresponding to a second routing configuration identifier corresponding to a network segment configured by the network equipment, and the second routing information comprises a network segment address of the network segment and the second routing configuration;
a generating module, configured to generate a first routing table entry according to the first routing information, and generate a second routing table entry according to the second routing information;
a sending module, configured to transmit a packet according to the first routing table entry or the second routing table entry;
the controller stores at least two routing configurations of the network device, each routing configuration comprises an IP address of the destination device and an IP address of a next hop, and the IP addresses of the next hops in the routing configurations with the same IP addresses of the destination devices are uneven and the same.
12. The apparatus of claim 11,
the receiving module is further configured to receive third routing information sent by the controller; the third routing information is sent by the controller according to a third routing configuration corresponding to a third routing configuration identifier corresponding to the network device, and the third routing information includes the third routing configuration;
the generating module is further configured to generate a third routing table entry according to the third routing information;
the sending module is further configured to transmit the packet according to the first routing table entry, the second routing table entry, or the third routing table entry in a process of transmitting the packet.
13. The apparatus of claim 12,
the first routing information received by the receiving module further comprises a first priority, the second routing information further comprises a second priority, and the third routing information further comprises a third priority; wherein the first priority is better than the second priority, and the second priority is better than the third priority;
the sending module is specifically configured to determine, according to a destination address and a source address of a packet, each routing table entry matching the packet in a process of transmitting the packet according to the first routing table entry, the second routing table entry, or the third routing table entry; selecting a routing table entry with the optimal priority from each determined routing table entry; and transmitting the message through the selected routing list item.
14. The apparatus of claim 12,
the sending module is specifically configured to, in a process of transmitting a message according to the first routing table entry, the second routing table entry, or the third routing table entry, transmit the message according to the first routing table entry if a destination address of the message matches an IP address of a destination device in the first routing table entry and a source address of the message matches an IP address of a host in the first routing table entry;
if the source address of the message is not matched with the IP address of the host in the first routing table item, the destination address of the message is matched with the IP address of the destination equipment in the second routing table item, and the source address of the message is matched with the network segment address in the second routing table item, transmitting the message according to the second routing table item;
and if the source address of the message is not matched with the IP address of the host in the first routing table item, the source address of the message is not matched with the network segment address in the second routing table item, and the destination address of the message is matched with the IP address of the destination equipment in the third routing table item, transmitting the message according to the third routing table item.
CN201710426222.3A 2017-06-08 2017-06-08 Message transmission method and device Active CN107547391B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710426222.3A CN107547391B (en) 2017-06-08 2017-06-08 Message transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710426222.3A CN107547391B (en) 2017-06-08 2017-06-08 Message transmission method and device

Publications (2)

Publication Number Publication Date
CN107547391A CN107547391A (en) 2018-01-05
CN107547391B true CN107547391B (en) 2020-01-03

Family

ID=60970140

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710426222.3A Active CN107547391B (en) 2017-06-08 2017-06-08 Message transmission method and device

Country Status (1)

Country Link
CN (1) CN107547391B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108600099B (en) * 2018-04-19 2020-04-03 新华三技术有限公司 Message forwarding method and device and leaf equipment
CN110661711B (en) * 2018-06-29 2021-01-29 华为技术有限公司 Method for generating label forwarding table, message sending method, device and equipment
CN111629386B (en) * 2019-02-28 2023-04-07 阿里巴巴集团控股有限公司 Communication method, system and equipment
CN110401594B (en) * 2019-07-02 2022-03-25 杭州迪普科技股份有限公司 Message forwarding method and device, electronic equipment and machine-readable storage medium
CN110445719B (en) * 2019-07-16 2021-08-17 中国第一汽车股份有限公司 Routing table management method, device, equipment and storage medium
CN112448900B (en) * 2019-09-02 2023-05-19 华为技术有限公司 Data transmission method and device
CN113014489B (en) * 2020-12-31 2022-02-22 腾讯科技(深圳)有限公司 Data forwarding method and device, server and storage medium
CN113746730B (en) * 2021-08-25 2023-05-16 新华三大数据技术有限公司 Routing information processing method and device
CN114615208B (en) * 2022-03-09 2024-02-23 新华三半导体技术有限公司 Back pressure information transmission and request sending method and device and network chip

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4803116B2 (en) * 2007-05-31 2011-10-26 富士ゼロックス株式会社 Virtual network connection device and program
CN101420382A (en) * 2008-12-11 2009-04-29 华为技术有限公司 Method for relating next hop, method and apparatus for service flow switching
CN101753462B (en) * 2010-01-19 2012-04-18 中国人民解放军信息工程大学 Method and device for realizing multi-next-hop routes
CN103259720B (en) * 2013-05-31 2017-06-27 杭州华三通信技术有限公司 A kind of data transmission method and equipment based on MTR
US20160099859A1 (en) * 2014-10-06 2016-04-07 Futurewei Technologies, Inc. Reverse Path Validation for Source Routed Networks
CN106713140B (en) * 2016-12-22 2019-05-24 烽火通信科技股份有限公司 Support the cooperative retransmission method of a variety of label distribution protocols and MPLS equipment

Also Published As

Publication number Publication date
CN107547391A (en) 2018-01-05

Similar Documents

Publication Publication Date Title
CN107547391B (en) Message transmission method and device
US10581700B2 (en) Service flow processing method, apparatus, and device
CN108259347B (en) Message transmission method and device
CN108718278B (en) Message transmission method and device
CN111934990B (en) Message transmission method and device
US10182091B2 (en) Decentralized, hierarchical, and overlay-driven mobility support architecture for information-centric networks
CN107786450B (en) Data message transmission method and device and machine-readable storage medium
CN108259346B (en) Equivalent routing table item establishing method and device
CN106878194B (en) Message processing method and device
CN108848034B (en) Network equipment and table entry learning method
CN109104364B (en) Designated forwarder election method and device
KR20170009927A (en) Method, device, and system for configuring flow entries
CN108600109B (en) Message forwarding method and device
CN108123901B (en) Message transmission method and device
CN108390954B (en) Message transmission method and device
CN109714274B (en) Method for acquiring corresponding relation and routing equipment
CN106921578B (en) Method and device for generating forwarding table item
US20180198643A1 (en) Packet transmission method and apparatus
JP6618610B2 (en) Routing management
EP3723329A1 (en) Data transmission method, node and system
CN109412926B (en) Tunnel establishment method and device
CN108667888B (en) Load balancing method and device
CN107547346B (en) Message transmission method and device
CN108259348B (en) Message transmission method and device
CN110768917B (en) Message transmission method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant