CN113411257B - Method, device, computing equipment and storage medium for transmitting message - Google Patents

Method, device, computing equipment and storage medium for transmitting message Download PDF

Info

Publication number
CN113411257B
CN113411257B CN202010180659.5A CN202010180659A CN113411257B CN 113411257 B CN113411257 B CN 113411257B CN 202010180659 A CN202010180659 A CN 202010180659A CN 113411257 B CN113411257 B CN 113411257B
Authority
CN
China
Prior art keywords
network
node
current switch
message
routing table
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
CN202010180659.5A
Other languages
Chinese (zh)
Other versions
CN113411257A (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202010180659.5A priority Critical patent/CN113411257B/en
Publication of CN113411257A publication Critical patent/CN113411257A/en
Application granted granted Critical
Publication of CN113411257B publication Critical patent/CN113411257B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/54Organization of routing tables
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/15Interconnection of switching modules
    • H04L49/1507Distribute and route fabrics, e.g. sorting-routing or Batcher-Banyan
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/30Peripheral units, e.g. input or output ports
    • H04L49/3009Header conversion, routing tables or routing tags

Abstract

The application provides a method, a device, a computing device and a storage medium for transmitting messages, and belongs to the technical field of network communication. The method comprises the following steps: the method comprises the steps that a switch receives a message sent by a source node, a next hop output port of the message at the current switch is determined according to a node identification of a target node in the message, wherein the node identification of the target node comprises a serial number of the target node under the connected switch and a serial number of an i-th network to which the target node belongs in a corresponding i + 1-th network, n is the total number of layers of an interconnection network, i takes a value of 1-n-1, and then the switch forwards the message based on the next hop output port. By the adoption of the method and the device, the storage resources of the switch can be saved.

Description

Method, device, computing equipment and storage medium for transmitting message
Technical Field
The present application relates to the field of network communication technologies, and in particular, to a method, an apparatus, a computing device, and a storage medium for transmitting a packet.
Background
The interconnection network is composed of a plurality of interconnected switches and a framework that partial switch ports are connected with network nodes, and communication among the network nodes is realized. The communication between each network node is sent from a source node in a message with a specific format, transmitted in the internet and finally reaches a destination node.
In the related art, after a physical connection is established in an internet, a management node in the internet starts to scan the internet, discover an internet topology and assign node identifiers to each node (any node identifier is unique and depends on an algorithm for scanning the network topology, for example, the node identifiers of the sequentially scanned nodes are sequentially increased). The management node then generates routing tables to configure to the various switches in the internetwork. The routing table is a linear forwarding table which takes all node identifiers in the internet as indexes and is mapped to the serial numbers of the output ports of the switches, each port of each switch corresponds to one routing table, and the depth of each routing table is higher. For example, in a certain network (such as a symmetric network (a network with two symmetric sides according to a certain point location reference, called a symmetric network)), when the complete routing information of the whole internetwork on a certain switch is represented, the depth of a certain routing table is: the number of sub-networks of the L _ n-1 layer, the number of sub-networks of the L _ n-2 layer under the single L _ n-1 layer, the number of sub-networks of the L _ i-1 layer under the single L _ i layer, the number of sub-networks of the L _ i-1 layer, the number of nodes under the single switch, and the like.
Thus, after a message sent by a source node enters from a certain port of the switch, a routing table is inquired by using a destination node identifier carried in the header of the message as an index, and the number of the message at the output port of the current switch is obtained. The switch then outputs the message from the output port corresponding to the switch to be passed to the next switch or received by the destination node. If the message is transmitted to the switch, the switch inquires the routing table to obtain the output port information of the next hop, and continues to transmit the message downwards, so that the message finally reaches the destination node. Because each port in each switch correspondingly stores one routing table, and the depth of each routing table is relatively high, a large number of routing tables are stored in the switch, and the occupied storage resources are relatively large.
Disclosure of Invention
In order to solve the problem of large occupied storage resources, embodiments of the present application provide a method, an apparatus, a computing device, and a storage medium for transmitting a packet. The technical scheme is as follows:
in a first aspect, a method for transmitting a packet is provided, where the method includes: receiving a message sent by a source node; determining a next-hop output port of the message in the current switch according to a node identifier of a destination node in the message, wherein the node identifier of the destination node comprises a number of the destination node under the connected switch and a number of an i-th network to which the destination node belongs in a corresponding i + 1-th network, n is the total number of layers of the interconnection network, and i takes the value from 1 to n-1; and forwarding the message based on the next hop output port.
The node identification of the destination node comprises the number of the destination node under a connected switch, the number of a first-layer network to which the destination node belongs in a corresponding second-layer network, the number of a second-layer network to which the destination node belongs in a corresponding third-layer network, \ 8230, the number of an n-1-layer network to which the destination node belongs in an n-layer network corresponding to the n-layer network, and n is the total number of layers of the interconnected network. The current switch is the switch through which the message passes currently.
According to the scheme, the method for transmitting the message can be executed by a device for transmitting the message, and when the source node transmits the message to the destination node, the message carries the node identification of the destination node. Any device for transmitting the message, through which the message passes, can receive the message sent by the source node. And the device for transmitting the message acquires the node identification of the destination node in the message. The means for transmitting the message may then determine each number in the node identification based on the field length of each number of the node identification stored in advance. And then the device for transmitting the message determines the next hop output port of the message at the current switch based on each number in the node identifier of the destination node. After the device for transmitting the message determines that the message is at the next hop output port of the current switch, the message can be sent out through the next hop output port.
Thus, for any device through which the message passes to transmit the message, the output port is determined based on the node identifier of the destination node. The node identification of the destination node comprises the number of the destination node under a switch connected with the destination node, the number of a first layer network to which the destination node belongs in a corresponding second layer network, the number of a second layer network to which the destination node belongs in a corresponding third layer network, \ 8230 `, and the number of an n-1 layer network to which the destination node belongs in an n layer network (namely the whole network) corresponding to the destination node, and the routing table is actually a relation between networks.
In one possible implementation manner, in a case that the current switch is in an m-th network of the interconnection network, and m is not equal to 1, the routing table stored on the current switch includes routing tables of networks in layers from the m-th network to the n-th network, and the routing table of the h-th network from the m-th network to the n-th network is used for indicating a mapping relationship between a number of the h-1-th network in the corresponding h-th network and a next-hop output port, m is less than or equal to n, and m is greater than or equal to 2, h is less than or equal to n, and h is greater than or equal to m; in the case that the current switch is in a layer 1 network of the interconnection network, the routing table stored by the current switch includes routing tables of networks in layers from the layer 1 network to the n-1 network and a routing table used for indicating the mapping relationship between the number of each node connected by the current switch and the next hop output port.
In this way, for a certain switch, only the routing table of the m-th network where the switch is located and the routing table of the network to the upper part of the m-th network are stored, and the routing table of the network lower than the m-th network where the switch is located does not need to be stored, so that the storage space of the switch can be saved.
In a possible implementation manner, determining, according to a node identifier of a destination node in a packet, a next-hop output port of the packet at a current switch includes: and determining the next hop-out port of the message at the current switch according to the node identifier of the destination node in the message and the network identifiers of the networks of the layers to which the current switch belongs.
According to the scheme, the device for transmitting the message can acquire the network identification of each layer of network to which the message belongs, which is stored in the current switch, and then determine that the message is at the next hop output port of the current switch based on the node identification of the target node and the network identification of each layer of network to which the message belongs, which is stored in the current switch. Therefore, the routing table is actually the relationship between networks, and when the routing table is established, only the relationship between the networks needs to be established, so that the depth of the used routing table is reduced when the message is transmitted, and further the storage resource can be saved.
In a possible implementation manner, determining a next hop-out port of a packet at a current switch according to a node identifier of a destination node in the packet and a network identifier of each layer of network to which the current switch belongs, includes:
taking the initial j value as n-1; determining whether the destination node and the current switch belong to the j-th network or not according to the number of the j-th network in the corresponding j + 1-th network in the node identifier of the destination node in the message and the network identifier of each layer of network to which the current switch belongs; under the condition that a target node and a current switch belong to a j-th network, if j is equal to 1, determining a next hop-out port corresponding to the number of the target node under the connected switch as a next hop-out port of a message in a routing table for indicating the mapping relation between the number of each node connected with the current switch and a next hop-out port, if j is not equal to 1, taking the value of j as j-1, and executing processing for determining whether the target node and the current switch belong to the j-th network; and under the condition that the destination node and the current switch belong to different j-th network, determining the next hop output port corresponding to the number of the j-th network to which the destination node belongs in the corresponding j + 1-th network as the next hop output port of the message in the routing table for indicating the mapping relation between the number of the j-th network in the corresponding j + 1-th network and the next hop output port.
According to the scheme, a loop process is executed, the internet is assumed to be an n-layer network, j = n-1 is initially taken, and whether a target node and a current switch belong to the j-layer network or not is judged. If the network belongs to the j-th network, judging whether the value of j is equal to 1. And if j is equal to 1, acquiring a routing table for indicating the mapping relation between the number of each node connected with the current switch and the next hop output port. Then, the device for transmitting the message determines the next hop output port corresponding to the serial number of the destination node under the connected switch as the next hop output port of the message at the current switch in the routing table; if j is not equal to 1, let j = j-1, and return to the process of judging whether the destination node and the current switch belong to the j-th network.
And if the destination node and the current switch are different and belong to the j-th layer network, acquiring a routing table for indicating the mapping relation between the serial number of the j-th layer network and the next hop output port. And the device for transmitting the message determines the next hop output port of the message at the current switch according to the number of the j-th network to which the destination node belongs at the j + 1-th network in the routing table. Therefore, the routing table is actually the relationship between networks, and when the routing table is established, only the relationship between the networks needs to be established, so that the depth of the used routing table is reduced when the message is transmitted, and further the storage resource can be saved.
In a possible implementation manner, determining whether the destination node and the current switch belong to the j-th network according to the number of the j-th network in the corresponding j + 1-th network in the node identifier of the destination node in the message and the network identifier of each layer network to which the current switch belongs includes: if the number of the j-th network in the corresponding j + 1-th network in the node identifier of the destination node in the message to the number of the n-1-th network in the corresponding n-th network are respectively the same as the network identifiers of the j-th network to the n-1-th network to which the current switch belongs, determining that the destination node and the current switch belong to the j-th network; and if the number of the j-th network in the corresponding j + 1-th network in the node identifier of the destination node in the message is different from the network identifier of the j-th network to which the current switch belongs, determining that the destination node and the current switch belong to the j-th network differently. Therefore, whether the target node and the current switch belong to the j-th network can be accurately judged.
In a possible implementation manner, in a routing table of a layer a network stored by a current switch, when a target number in the routing table of the layer a network is the same as a network identifier of a layer a-1 network to which the current switch belongs, a next-hop output port corresponding to the target number is an invalid value; and when the target number is different from the network identifier of the a-1-th network to which the current switch belongs, the next hop output port corresponding to the target number is an effective value, the routing table of the a-th network is a routing table of any one network stored by the current switch, and the target number is the number of the a-1-th network in the corresponding a-th network in the node identifier of the target node. Thus, the next output port of the message can be determined at one time without adopting a circulating mode.
In a possible implementation manner, determining, according to a node identifier of a destination node in a packet, a next-hop output port of the packet at a current switch includes:
determining contents respectively corresponding to each number in the node identification of the destination node in a stored routing table of each layer of network according to the node identification of the destination node in the message; if the corresponding content of the number of the i-th network in the corresponding i + 1-th network in the routing table of the i + 1-th network is an effective value, and the corresponding content of the number of the i + 1-th network in the corresponding i + 2-th network in the routing table of the i + 2-th network to the corresponding content of the number of the n-1-th network in the routing table of the n-th network in the corresponding n-th network is an invalid value, determining the corresponding content of the number of the i-th network in the corresponding i + 1-th network in the routing table of the i + 1-th network as a next hop output port of the message in the current switch; if the content of the number of the destination node under the connected switch in the routing table of the first-layer network is an effective value, and the content of the number of the first-layer network in the corresponding second-layer network, which corresponds to the content of the number of the n-1-layer network in the routing table of the n-layer network, is an invalid value, determining the content of the number of the destination node under the connected switch, which corresponds to the content of the number of the destination node in the routing table of the first-layer network, as the next-hop output port of the message at the current switch.
According to the scheme, the device for transmitting the message can determine each number in the node identification of the destination node by using the node identification of the destination node and the field length of each number of the preset node identification. And then, searching the content corresponding to each number in the node identification in the stored routing table corresponding to each layer of network by using each number.
The device for transmitting the message can perform priority ranking on the content determined in the routing table of the n-th layer network, the content determined in the routing table of the n-1-th layer network, \ 8230, the content determined in the routing table of the second layer network and the content determined in the routing table of the first layer network corresponding to each node number connected with the switch. If the content of the i +1 th layer network corresponding to the number of the i +1 th layer network in the routing table of the i +1 th layer network is an effective value, and the content of the +1 th layer network corresponding to the number of the i +2 th layer network in the routing table of the i +2 th layer network to the content of the n-1 th layer network corresponding to the number of the n-1 th layer network in the routing table of the n-th layer network are invalid values, the content of the vehicle corresponding to the number of the i +1 th layer network in the routing table of the i +1 th layer network can be determined, and the content is the next hop output port of the message at the current switch. If the content of the number of the destination node under the connected switch in the routing table of the first-layer network is an effective value, and the content of the number of the first-layer network in the corresponding second-layer network in the routing table of the second-layer network to the content of the number of the n-1-layer network in the corresponding n-layer network in the routing table of the n-layer network is an invalid value, the device for transmitting the packet may determine the content of the number of the destination node under the connected switch in the routing table of the first-layer network as the next-hop output port of the packet at the current switch. Thus, the next hop output port of the message at the current switch can be determined.
In a second aspect, the present application provides an apparatus for transmitting a message, where the apparatus includes a plurality of modules, and the modules execute the method according to the first aspect by executing instructions.
In a third aspect, the present application provides a computing device comprising a memory and a processor executing computer instructions stored by the memory to cause the computing device to perform the method of the first aspect.
In a fourth aspect, the present application provides a readable computer storage medium storing a computer program which, when executed by a computing device, implements the method of the first aspect described above.
In a fifth aspect, the present application provides a computer program product comprising computer instructions which, when executed by a computing device, perform the method of the first aspect described above.
Drawings
Fig. 1 is a diagram of a network architecture provided by an embodiment of the present application;
FIG. 2 is a schematic structural diagram of a computing device according to an embodiment of the present disclosure;
FIG. 3 is a schematic structural diagram of a computing device according to an embodiment of the present application;
fig. 4 is a schematic diagram of an application scenario provided in an embodiment of the present application;
fig. 5 is a schematic flowchart of a method for transmitting a packet according to an embodiment of the present application;
fig. 6 is a schematic flowchart of determining a next hop output port according to an embodiment of the present application;
fig. 7 is a schematic flowchart of determining a next hop output port according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an apparatus for determining transmission of a packet according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
To facilitate an understanding of the embodiments of the present application, the following first introduces concepts of the terms involved:
high Speed Interconnect (HSI): more than two communication networks are connected with each other by one or more network communication devices through a certain method to form a larger network system.
Routing (Routing): forwarding of information from source address-switch/router-destination address is active in the internetwork. The routing works on a packet forwarding device at the third layer (i.e., network layer) of the Open System Interconnection (OSI) reference model. The routers implement network interconnection by forwarding packets. A router typically connects two or more Internet Protocol (IP) subnets or logical ports identified by a point-to-point Protocol (peer Protocol), and has at least 1 physical port. The router determines an output port and a next hop address according to a network layer address in the received message and a routing table maintained in the router, and rewrites a link layer message header to realize message forwarding.
Routing Table (RT): which may be referred to as a Routing Information Base (RIB), is a spreadsheet (file) or class database stored in a router or networked computer. The routing table stores the path (and in some cases, the route metric value of the path) that points to a particular network address. The routing table stored in the router generally stores the next hop interface number by using the destination address network Identifier (ID) of the packet as an index.
High-radix Router (HRR): a router with more interconnected ports. The high-order route switching chip improves the port number of a single chip, reduces the network diameter of an interconnection system, reduces the step length of communication between nodes and reduces the path delay between the nodes. In addition, the high-order route exchange chip provides richer interconnection port resources, provides more flexibility for an interconnection topological structure, can design a plurality of redundant links, supports self-adaptive routing and improves the reliability of the system.
In the related art, as shown in fig. 1, after a physical connection is established in an internet, a management node in the internet starts to scan the internet, discover an internet topology and assign a node identifier to each node, where any node identifier is unique, and depending on an algorithm for scanning the network topology, the node identifiers of the nodes scanned in sequence are sequentially increased. The management node then generates routing tables to configure to the various switches in the internetwork. The routing table is a linear forwarding table which takes all node identifiers in the internet as indexes and is mapped to the serial numbers of the output ports of the switches, and each port of each switch corresponds to one routing table. Thus, after a message sent by a source node enters from a certain port of the switch, a routing table is inquired by using a destination node identifier carried in the header of the message as an index, and the number of the message at the output port of the current switch is obtained. The switch then outputs the message from the output port corresponding to the switch, and the message is transmitted to the next switch or received by the destination node. If the message is transmitted to the switch, the switch inquires the routing table to obtain the output port information of the next hop, and continuously transmits the message downwards to finally enable the message to reach the destination node. Because each port in each switch is correspondingly stored with one routing table, the switch stores a large number of routing tables and occupies a large number of storage resources, and therefore, it is necessary to provide a method for implementing transmission of messages by using fewer routing tables.
In the embodiment of the present application, in order to reduce the routing tables stored in the switch, a method for transmitting a packet is provided. The main execution body of the method may be a device for transmitting a message, the device for transmitting a message may be hardware, such as a router or a switch implemented based on hardware, or the device for transmitting a message may be software, such as software installed in a computing device. The computing device is a hardware device, such as a router or a switch.
FIG. 2 illustratively provides one possible architecture diagram for the computing device of the present application. The computing device may include a processor 201, memory 202, a communication interface 203, and a bus 204. In a computing device, the number of processors 201 may be one or more, and fig. 2 illustrates only one of the processors 201. Alternatively, the processor 201 may be a Central Processing Unit (CPU). If the computing device has multiple processors 201, the types of the multiple processors 201 may be different, or may be the same. Optionally, multiple processors of the computing device may also be integrated into a multi-core processor.
The memory 202 stores computer instructions and data, and the memory 202 may store the computer instructions and data needed to implement the method of transmitting messages provided herein. The memory 202 may be any one or any combination of the following storage media: nonvolatile Memory (e.g., read-Only Memory (ROM), solid State Disk (SSD), hard Disk Drive (HDD), optical disc, etc.), volatile Memory.
The communication interface 203 may be any one or any combination of the following devices: network interface (such as Ethernet interface), wireless network card, etc.
The communication interface 203 is used for data communication of the computing device with other nodes or terminal devices.
Fig. 2 also illustratively depicts bus 204. The bus 204 may connect the processor 201 with the memory 202 and the communication interface 203. Thus, via bus 204, processor 201 may access memory 202 and may also utilize communication interface 203 to interact with other computing devices or terminal devices.
In the present application, the computing device executes the computer instructions in the memory 202, and the method for transmitting a message provided by the present application is implemented by using the computing device. For example, causing the computing device to perform the steps described above for the determination module in the method of transmitting a message.
As shown in FIG. 3, a schematic diagram of another computing device is provided. The computing device includes a main control board 301 and an interface board 302, the main control board 301 including a processor 3011 and a memory 3012. Interface board 302 includes a processor 3021, a memory 3022, and an interface card 3023. A communication connection is established between the main control board 301 and the interface board 302.
The processor 3011 may be a CPU, an Application Specific Integrated Circuit (ASIC), or the like. The processor 302 may include one or more chips. The Memory 3012 may be a ROM, a static Memory device, a dynamic Memory device, or a Random Access Memory (RAM). The memory 3012 may store computer instructions that, when executed by the processor 301, the processor 301 performs a method of transmitting messages stored in the memory 3012.
Processor 3021 may be a CPU, an application specific integrated circuit ASIC, or the like. Processor 3021 may include one or more chips. Memory 3022 may be ROM, static storage, dynamic storage, or RAM. The memory 3022 may store computer instructions that, when executed by the processor 3021 in the memory 3022, cause the processor 3021 to perform a method of transmitting messages. The interface board can realize the receiving and sending processing of the message.
The embodiment of the application provides a method for transmitting a message, which can be applied to an internet network, in particular to a large-scale network, and common topologies of the network, such as FAT TREE (FAT TREE), dragonfly + and the like, are layered. Even if the interconnect network is not a regular hierarchical network topology, any interconnect network can be considered as a simple two-tier network topology, the first tier network consisting of one switch (switch) and its connected nodes (e.g., accelerators, memories, processors, etc.), and the second tier network consisting of all the remaining switch interconnects. As shown in fig. 4, the interconnection network is a layer-3 network, the first layer network includes a plurality of sub-networks, each sub-network is composed of a switch and its connected nodes, the second layer network is on the upper layer of the first layer network, is composed of interconnected switches, includes a plurality of sub-networks, and realizes interconnection of sub-networks of the first layer network, and the third layer network is on the upper layer of the second layer network, is composed of interconnected switches, and realizes interconnection of sub-networks of the second layer network. It should be noted here that the third-layer network includes a second-layer network belonging to the third-layer network and a first-layer network belonging to the second-layer network, and the second-layer network includes a first-layer network belonging to the second-layer network.
In this embodiment, it is assumed that the interconnection network is divided into n layers, each node identifier in the n-layer hierarchical interconnection network is respectively composed of a plurality of domain segments, and the plurality of domain segments are respectively the number of the node under the exchange of its connection, the number of the first layer network to which the node belongs in the second layer network corresponding thereto, the number of the second layer network to which the node belongs in the third layer network corresponding thereto, \8230, and the number of the n-1 layer network to which the node belongs in the entire network. The third layer network corresponding to the second layer network refers to a network to which the second layer network belongs in a network on the upper layer of the second layer network. As shown in Table one, for a node (node 1), the node identification is L _ n-1_ID, L _ n-2_ID, \8230;, L _2_ID, L _1_ID, and node _ ID, wherein L _ n-1 _IDis the number of the n-1 layer network to which the node belongs in the n-layer network (i.e., the entire network), L _ n-2 _IDis the number of the n-2 layer network to which the node belongs in the corresponding n-1 layer network, L _1 _IDis the number of the first layer network to which the node belongs in the corresponding second layer network, and node _ ID is the number of the node under the switch to which the node is connected.
It should be noted here that, the number of the n-2 th network in the corresponding n-1 th network is emphasized, and it is mainly possible that the number of the n-2 th network under different n-1 th networks may be the same. For example, in fig. 4, the sub-network 1 of the first layer network belonging to the sub-network 1 of the second layer network is numbered the same as the sub-network 1 of the first layer network belonging to the sub-network 2 of the second layer network.
Watch 1
Figure BDA0002412422040000071
It should be noted that the number of each network in its corresponding upper layer network is unique. Subsequently, for convenience of description, the nth layer network is denoted as an L _ n layer network, and the ith layer network is denoted as an L _ i layer network.
In this embodiment, the interconnection network is composed of nodes (such as processors, memories, accelerators, etc.) and a plurality of interconnected switches. After the network topology of the internet is connected, in an initialization stage, the management node scans the whole internet, allocates node identifiers, and allocates the node identifiers according to the format of the node identifiers when allocating the node identifiers. Then, based on the topology connection information, the mapping relationship between the next hop output port of the switch and the number of the sub-network in each layer of network can be obtained, and further, a routing table of each layer of network is generated. For example, as shown in fig. 4, it is assumed that the leftmost destination node in the sub-network 1 in the first-layer network is node 1, and for node 1, the routing table of node 1 on the switch in the sub-network 2 in the second-layer network is the routing table of the L _ 3-layer network, the routing table of the L _ 2-layer network, and the routing table of the L _ 1-layer network. The routing table of the L _3 layer network includes the mapping relationship between the L _2 _idof the node 1 and the output port of the next hop, and represents the mapping relationship between the number of the L _2 layer sub-network in the L _3 layer network and the output port of the next hop. The routing table of the L _2 layer network includes the mapping relationship between the L _1 \/id of the node 1 and the output port of the next hop, and represents the mapping relationship between the number of the L _1 layer sub-network in the L _2 layer network and the output port of the next hop. In the routing table of the L _1 layer network, the mapping relationship between the node _ ID of the node 1 and the next hop output port represents the mapping relationship between the node _ ID and the next hop output port in the L _1 layer network.
And then, the management node configures the routing table of each switch, that is, the routing table corresponding to the switch is issued to the switch, and when the specific management node sends the routing table to each switch, whether all the routing tables corresponding to the switch are issued to the switch or not can be determined according to the actual needs of the switch. For example, routing tables for the L _1 network are not needed for switches in the layer three network, and then routing tables for the L _1 network need not be provided to switches in the layer three network. Specifically, in the case where the switch is in a m-th network of the interconnection network, and m is not equal to 1, the routing table stored in the switch may include routing tables of networks in respective layers of the m-th to n-th networks, where the routing table of the h-th network of the m-th to n-th networks is used to indicate a mapping relationship between a number (L _ h-1 _id) of the h-1-th network in the corresponding h-th network and a next-hop output port, m is less than or equal to n, and m is greater than or equal to 2, h is less than or equal to n, and h is greater than or equal to m, and in the case where the switch is in the 1-th network of the interconnection network, the routing table stored in the switch includes routing tables of the networks in respective layers of the 1-th to n-1-th networks and a routing table used to indicate a mapping relationship between a number (node _ ID) of each node connected to the switch and the next-hop output port. In this way, for the switches of different network layers, only the routing table required by the switches can be stored, and the storage resources of the switches can be saved because the routing tables do not need to be stored completely.
After finishing each initialization configuration work, the internet enters a normal communication phase. The communication between the nodes is realized by the transmission of the messages in the internet. After being sent from a source node, a message carrying a node identifier of a destination node enters a switch in the internet, and is then forwarded to another switch or the destination node after the switch queries a routing table (the switch is directly connected to the destination node when being sent to the destination node, otherwise, the switch is sent to another switch).
Therefore, after the node identification of each node in the internet adopts the format, the next-hop routing information of all destination nodes in the whole internet at the switch can be completely represented by using a plurality of layered routing tables in any switch. For an n-layer internetwork, n routing tables can provide complete next hop routing information for messages to any destination node, specifically: as shown in table two, the routing table of the L _ n layer network is indexed by L _ n-1 \ "id, and the mapping relationship between the number representing the L _ n-1 layer sub-network in the L _ n layer network and the next hop output port can be regarded as the routing table corresponding to the n-1 layer network. As shown in Table three, the routing table of the L _ i layer network is indexed by the L _ i-1 \uID, and represents the mapping relationship between the number of the L _ i-1 layer sub-network in the L _ i layer network and the next hop output port, wherein i =2,3, \8230;, n-1, can be regarded as the routing table corresponding to the i-1 layer network. As shown in table four, the routing table of the L _1 layer network is indexed by the node _ ID, and the mapping relationship between the number of all nodes connected under the L _1 layer network (i.e., one switch) and the next-hop output port can be regarded as a node routing table or a routing table of the first layer network. It should be noted here that the number of L _ i-1 layer sub-networks in the L _ i layer network refers to the number of L _ i-1 layer sub-networks belonging to the L _ i layer network in the L _ i layer network. For example, in FIG. 4, if i takes the value of 2, L _i-1 layer sub-network is L _1 layer sub-network, and L _1 layer sub-network is sub-network 1 of the first layer, then the L _ i layer network (i.e., L _2 layer network) is sub-network 1 of the second layer network.
Watch two
Figure BDA0002412422040000081
Watch III
Figure BDA0002412422040000082
Watch four
Figure BDA0002412422040000083
As can be seen from the above description, for the case that the internet is an n-layer network, for any switch, n routing tables representing complete routing information have the total depth: the number of sub-networks of an L _ n-1 layer network + the number of sub-networks of an L _ n-2 layer network under the sub-network of a single L _ n-1 layer network + \8230, + the number of sub-networks of an L _ i-1 layer network under the single L _ i layer network + \8230, + the number of nodes under the single switch, i being greater than or equal to 2. For example, in fig. 4, the number of subnets of L _1 layer network under subnetwork 1 where n is 3,l _2layer is 2,l _2layer, the number of subnets of L _1 layer network under subnetwork 1 is 2,l _2layer, and the number of subnets of L _1 layer network under subnetwork 2 of 2,l _2layer is 2, assuming that the number of nodes under 4 switches is 5, the total depth of n pieces of routing tables is 2+20=26. In the related art, under a symmetric network (a network with two symmetric sides according to a certain point location reference, referred to as a symmetric network), a routing table representing complete routing information of the entire network on a certain switch has a depth of: the number of sub-networks of the L _ n-1-layer network is one sub-network number of the L _ n-2-layer network under the single L _ n-1-layer network, 8230; the number of sub-networks of the L _ i-1 layer network under a single L _ i layer network \8230andthe number of nodes under a single switch. It can be seen that in a large-scale internet, the total depth of the n routing tables in the present application is much smaller than the depth of a single full routing table in the related art. It is noted that although the depth of the routing table is reduced in the present application with respect to a symmetric network, the depth of the routing table is reduced in the present application with respect to any network, because the depth of the routing table is expressed in the form of a product in the related art regardless of the network, and the depth of the routing table is expressed in the form of a "sum" in the present application.
In addition, the above description is performed on the routing table of the single-path routing, and for the multi-path routing (blind routing or adaptive routing), n different routing tables (each n routing tables maps one path) need to be queried many times to obtain a plurality of feasible output port numbers, and then an output port is selected in combination with the relevant arbitration information. Optionally, for a blind route, one output port may be randomly selected from a plurality of output ports, and for an adaptive route, the network-related state information may be used as an arbitration weight (for example, congestion information of its own port acquired by the switch, state information of a remote network connected to its own port, and the like).
The following describes the flow of transmitting the message in detail with reference to fig. 5:
step 501, a device for transmitting a message receives a message sent by a source node.
In this embodiment, when a source node sends a packet to a destination node, the packet carries a node identifier of the destination node. Any device for transmitting the message, through which the message passes, can receive the message sent by the source node.
Step 502, the device for transmitting the message determines that the message is at the next hop output port of the current switch according to the node identifier of the destination node in the message.
The node identification of the destination node comprises the number of the destination node under the connected switches and the number of the i-th network to which the destination node belongs in the corresponding i + 1-th network, n is the total number of layers of the interconnected network, and the value of i is 1 to n-1. The current switch is the switch through which the message passes currently.
In this embodiment, the device for transmitting a packet acquires the node identifier of the destination node in the packet. The means for transmitting the message may then determine each number in the node identification based on the field length of each number of the node identification stored in advance. And then the device for transmitting the message determines the next hop output port of the message at the current switch based on each number in the node identifier of the destination node.
Step 503, the device for transmitting the message forwards the message based on the next hop output port.
In this embodiment, after determining that the message is at the next-hop output port of the current switch, the device for transmitting the message may send the message to the outside through the next-hop output port.
Thus, for any device through which the message passes to transmit the message, the output port is determined based on the node identifier of the destination node. The node identification of the destination node consists of the number of the destination node under a switch connected with the destination node, the number of a first-layer network to which the destination node belongs in a second-layer network corresponding to the destination node, the number of a second-layer network to which the destination node belongs in a third-layer network corresponding to the second-layer network, \\ 8230 `, and the number of an n-1-layer network to which the destination node belongs in an n-layer network (namely the whole network) corresponding to the destination node, and the routing table is actually a relationship between networks.
In one possible implementation, the process of step 502 may be as follows:
and the device for transmitting the message determines the next hop-out port of the message at the current switch according to the node identifier of the destination node in the message and the network identifiers of the networks of the layers to which the current switch belongs.
In this embodiment, the apparatus for transmitting a packet may obtain the network identifiers of the networks in the layers that the packet belongs to, which are stored in the current switch, and then determine that the packet is at the next-hop output port of the current switch based on the node identifier of the destination node and the network identifiers of the networks in the layers that the packet belongs to, which are stored in the current switch.
In a possible implementation manner, the apparatus for transmitting a packet may determine that the packet is at the next-hop output port of the current switch by using the following manner:
in this embodiment, the process of determining the next hop output port by the apparatus for transmitting a packet is a cyclic process, and the principle is as follows:
as shown in fig. 6, step 601, initially, assuming that the internet is an n-layer network, initially take j = n-1;
step 602, judging whether the destination node and the current switch belong to an L _ j layer network (i.e. a j layer network);
step 603, if the layer belongs to the L _ j layer network, judging whether the value of j is equal to 1.
If j is equal to 1, a routing table (i.e., the aforementioned routing table of the L _1 layer network) indicating the mapping relationship between the number of each node connected to the current switch and the next hop output port is obtained. Then, the device for transmitting the message determines a next hop output port corresponding to the node _ ID of the destination node as the next hop output port of the message in the current switch in the routing table;
if j is not equal to 1, let j = j-1, and return to step 602.
Step 604, if the destination node and the current switch belong to different L _ j layer networks, a routing table (i.e., the aforementioned routing table of the L _ j +1 layer network) for indicating the mapping relationship between the number of the L _ j layer network in the corresponding L _ j layer network and the next hop output port is obtained, and the device for transmitting the packet determines the next hop output port of the packet in the routing table, which corresponds to the number (L _ j _ ID) of the L _ j layer network to which the destination node belongs in the corresponding L _ j +1 layer network, as the next hop output port of the packet in the current switch.
In the process of fig. 6, when the internet is an n-layer network, the meaning that the destination node and the current switch belong to an L _ j-layer network is as follows:
a) When j = n-1, it indicates that the target node and the current switch belong to the L _ n-1 layer network;
b) When j = n-2, the target node and the current switch belong to an L _ n-1 layer network and an L _ n-2 layer network;
c) j = k (k = n-3, \ 8230;, 1) indicates that the destination node and the current switch belong to the L _ n-1 layer network, the L _ n-2 layer network, the L _ n-3 layer network, \\ 8230;, and the L _ k layer network.
That is, when the internet is an n-layer network, if the destination node and the current switch belong to both an L _ m-layer network (m is less than or equal to n-1), the destination node and the current switch belong to both the L _ m-layer network and a network above the L _ m-layer network.
It should be noted here that, if the current switch is an edge switch in the network to which the current switch belongs, the obtained next-hop output port is a next-hop output port directly heading for the L _ j layer network, and if the current switch is not an edge switch in the network to which the current switch belongs, the obtained output port is a next-hop output port of a switch in the L _ j layer network, and may be considered as a next-hop output port indirectly heading for the L _ j layer network.
In a possible implementation manner, the present embodiment determines whether the destination node and the current switch belong to the L _ j layer network in the following manner:
in the initialization stage, the management node configures network identifiers of each layer of network to which each switch in the internet belongs. Subsequently, in the routing phase (i.e., the message forwarding phase), the device for transmitting the message may compare the number (L _ j _ ID) of the L _ j layer network in the corresponding L _ j +1 layer network in the node identifier of the destination node with the network identifier in the corresponding layer of the current switch. If the number of the L _ j layer network in the corresponding L _ j +1 layer network in the node identifier of the destination node is the same as the number of the L _ n-1 layer network in the corresponding L _ n layer network in the corresponding layer of the current switch, the destination node and the current switch belong to the L _ j layer network; and if not, determining that the target node and the current switch belong to the L _ j layer network differently.
Here, the routing table is a mapping relationship between the number in the node identifier and the next hop output port, but may be a mapping relationship between the number in the node identifier and a bitmap of the next hop output port. For example, the first switch has 8 output ports, and an output port corresponding to a certain number in the node identifier is a correct next hop output port, the output port in the bitmap is indicated as 1, and the output port is identified as the correct next hop output port; the remaining 7 output ports of the 8 output ports in the bitmap are indicated as 0, identifying the remaining output ports as erroneous next hop output ports.
In a possible implementation manner, this embodiment further provides the following manner, that is, determining that the packet is at the next-hop output port of the current switch:
in this way, in the routing table of each layer of network stored by the switch, the contents corresponding to some numbers are valid values (i.e. correct next hop output ports), and the contents corresponding to some numbers are invalid values. Specifically, in the stage of generating and configuring the routing table by the management node, the target number in the routing table of the L _ i +1 layer network on the switch is equal to the network identifier (L _ i ID) of the network to which the switch belongs, and the mapping content is an invalid value (representing that the switch and the target node belong to the L _ i layer network). Therefore, when the switch and the destination node belong to the L _ i layer network, the routing table of the L _ i +1 layer network is inquired to obtain an invalid value during routing, and the representation needs to be routed to a lower layer network. And the target number (the number of the L _ i +1 layer network corresponding to the L _ i +1 layer network in the node identifier) in the routing table of the L _ i +1 layer network on the switch is not equal to the network identifier (L _ i _ ID) of the network to which the switch belongs, and if the mapping content is a valid value, it indicates that routing can be performed to the network indicated by the L _ i _ ID. The specific routing process is as follows:
the device for transmitting the message determines the content corresponding to each number in the node identification of the destination node in each stored routing table according to the node identification of the destination node in the message; if the content of the number of the i-th network in the corresponding i + 1-th network in the routing table of the i + 1-th network is an effective value, and the content of the number of the i + 1-th network in the corresponding i + 2-th network in the routing table of the i + 2-th network to the content of the number of the n-1-th network in the routing table of the n-th network in the corresponding n-th network is an invalid value, determining the content of the number of the i-th network in the corresponding i + 1-th network in the routing table of the i + 1-th network as the next hop output port of the message of the current switch. And if the content of the serial number of the destination node under the connected switch in the routing table of the first-layer network is an effective value, and the content of the serial number of the first-layer network in the corresponding second-layer network, which corresponds to the content of the serial number of the second-layer network in the routing table of the n-1-th layer network in the corresponding n-th layer network, which corresponds to the content of the serial number of the n-th layer network in the routing table of the n-th layer network, is an invalid value, determining the content of the serial number of the destination node under the connected switch, which corresponds to the content of the serial number of the n-th layer network in the routing table of the first-layer network, as the next-hop output port of the message in the current switch.
In this embodiment, the device for transmitting a packet may determine each number in the node identifier of the destination node by using the node identifier of the destination node and a field length of each number of the preset node identifier. And then, searching the content corresponding to each number in the node identification in the stored routing table corresponding to each layer of network by using each number.
The device for transmitting the packet may prioritize the content determined in the routing table of the L _ n-layer network, the content determined in the routing table of the L _ n-1-layer network, \ 8230;, the content determined in the routing table of the L _ 2-layer network, and the content determined in the routing table of the L _ 1-layer network corresponding to each node number connected to the switch in this order. If the corresponding content of the number (L _ i _ ID) of the L _ i layer network in the L _ i +1 layer network corresponding to the L _ i layer network in the routing table of the L _ i +1 layer network is a valid value, and the corresponding content of the number of the L _ i +1 layer network in the L _ i +2 layer network corresponding to the L _ i +1 layer network in the L _ i +2 layer network in the routing table of the L _ n layer network corresponding to the L _ n-1 layer network in the L _ n layer network is an invalid value, it may be determined that the corresponding content of the number (L _ i ID) of the L _ i layer network in the routing table of the L _ i layer network is the next hop output port of the message in the current switch. If the content of the number of the destination node under the connected switch in the routing table of the L _1 layer network is an effective value, and the content of the number of the L _1 layer network in the L _2 layer network corresponding to the routing table of the L _2 layer network to the content of the number of the L _ n-1 layer network in the L _ n layer network corresponding to the routing table of the L _ n layer network are all invalid values, the device for transmitting the packet may determine the content of the number (node _ ID) of the destination node under the connected switch in the routing table of the L _1 layer network as the next hop output port of the packet at the current switch.
In this way, only the stored routing table may be used, since there is a possibility that only a part of the routing table is stored in the current switch and there is a possibility that not all the routing tables are stored.
It should be further noted here that, the fact that the content of the L _1 layer network in the routing table of the L _2 layer network corresponding to the number of the L _2 layer network to the content of the L _ n-1 layer network in the routing table of the L _ n layer network corresponding to the number of the L _ n layer network are invalid values means that: the content of the number (L _1 _ID) of the first layer network in the corresponding second layer network corresponding to the first layer network in the routing table of the second layer network, the content of the number (L _2 _ID) of the second layer network in the corresponding third layer network corresponding to the third layer network in the routing table of the third layer network, the content of the number (L _3 _ID) of the third layer network in the corresponding fourth layer network in the routing table of the fourth layer network, the content of the number (L _4 _ID) of the fourth layer network in the corresponding fifth layer network in the routing table of the fifth layer network, \\8230, and the content of the number (L _ n-1 _ID) of the n-1 layer network in the corresponding n-layer network corresponding to the nth layer network in the routing table are all invalid values.
It should be noted here that, the content of the number of the L _ s layer network in the L _ s +1 layer network (L _ s _ ID) corresponding to the L _ s +1 layer network in the routing table of the L _ s +1 layer network is an invalid value (s is greater than i and less than or equal to n-1), the content of the number of the L _ i layer network in the L _ i +1 layer network in the routing table of the L _ i +1 layer network and the content of the number of the L _ i-1 layer network in the L _ i layer network in the routing table of the L _ i layer network are both valid values, and the valid value of the number of the L _ i layer network in the L _ i +1 layer network in the routing table of the L _ i layer network is used as the next hop output port of the message in the current switch. This is because the network identifier of the network of the current switch is already different from the number of the destination node in the higher-level network at the higher-level network, which indicates that the network should be routed to the higher-level network where the destination node is located, rather than being routed to the lower-level network. As shown in fig. 7, the node id of the destination node has a higher priority than the node id of the destination node, which has a corresponding valid value in the routing table of the lower network. The upper layer network corresponds to the lower layer network, and the i-th network is an upper layer network relative to the i-1 th network, and the i-th network is a lower layer network relative to the i +1 th network.
In the embodiment of the application, the node identifiers of the nodes in the internet are given with the information of the network in each layer based on the hierarchical information in the internet, so that the mapping relation between the node identifiers and the next hop output ports of the routing table is converted into the interconnection relation between the networks, an original full routing table can be replaced by a plurality of hierarchical routing tables, the storage resources of the switch can be saved due to the low depth of the hierarchical routing tables, and meanwhile, the time overhead of routing initialization configuration of the management nodes can be reduced.
And the message is routed in the switch in a routing mode based on a plurality of routing tables with lower depths, so that the routing tables with lower depths can be quickly inquired, and the processing time is shortened.
In addition, in this embodiment, to facilitate understanding of this embodiment, a process of sending a packet to the node B by the node a is further provided:
in fig. 4, node a is located in sub-network 1 of the L _1 layer network under sub-network 1 of the L _2 layer network, and node B is located in sub-network 1 of the L _1 layer network under sub-network 2 of the L _2 layer network. The node a generates a message, where the message carries a node identifier of the node B (the number node _ ID of the switch to which the node B belongs, the number L _1 \/ID of the L _1 layer network to which the node B belongs in the sub-network 2 of the L _2 layer network, and the number L _2_ ID of the sub-network 2 of the L _2 layer network to which the node B belongs in the L _3 layer network), and the node a sends the message to the connected switch (i.e., the switch in the sub-network 1 of the L _1 layer network). The switch takes the value of j as 2, determines that the network identifier of the current switch on the L _2 layer network is different from the L _2 \/ID of the node B, and the current switch and the destination node belong to the L _2 layer network differently, and can query a routing table of the L _3 layer network to obtain a next hop output port corresponding to the L _2 \/ID of the node A. Through the next hop output port, the message enters a sub-network 1 in an L _2 layer network, an exchanger in the sub-network 1 takes the value of j as 2, the network identifier of the current exchanger in the L _2 layer network is determined to be different from the L _2 \/ID of a node B, the current exchanger and the node B belong to the L _2 layer network differently, a routing table of the L _3 layer network can be inquired, and the next hop output port corresponding to the L _2 \/ID of the node A is obtained. Through the next hop output port, the message enters the switch of the L _3 layer network, the switch determines that the network identifier of the current switch on the L _2 layer network is different from the L _2 \/ID of the node B, the current switch and the destination node belong to the L _2 layer network differently, the routing table of the L _3 layer network can be inquired, the next hop output port corresponding to the L _2 \/ID of the node A is obtained, and thus, the message enters the sub-network 2 of the L _2 layer through the next hop output port. The switch of sub-network 2 determines that the network identity of the current switch on the L _2 layer network is the same as the L _2 _idof node B, and that the current switch and node B belong to the L _2 layer network. The switch takes the value of j as 1, determines that the network identifier of the current switch on the L _1 layer network is different from the L _1 \/ID of the node B, the current switch and the node B point belong to the L _1 layer network, and queries the next hop output port corresponding to the L _1 \/ID of the node A in the routing table of the L _2 layer network. And through the next-hop output port, the message is sent to a sub-network 1 of an L _1 layer network of a sub-network 2 of the L _2 layer network, the switch in the sub-network 1 takes the value of j as 2, the current switch and the node B belong to the L _2 layer network together, then the value of j is taken as 1, and the current switch and the node B belong to the L _1 layer network together. Then, the switch in the sub-network 1 may search the routing table of the L _1 layer network, determine the next hop output port corresponding to the node _ ID of the node B under the connected switch, and send the packet to the node B through the next hop output port.
The above only assumes that there is only one switch in the L _2 layer network, sub-network 1, sub-network 2, and L _3 layer network.
Fig. 8 is a structural diagram of a transmission packet according to an embodiment of the present application. The apparatus may be implemented as part or all of an apparatus in software, hardware, or a combination of both. The apparatus provided in this embodiment of the present application may implement the process described in fig. 5 in this embodiment of the present application, and the apparatus includes: a receiving module 810, a determining module 820, and a sending module 830, wherein:
a receiving module 810, configured to receive a packet sent by a source node;
a determining module 820, configured to determine, according to a node identifier of a destination node in the message, a next-hop output port of the message at the current switch, where the node identifier of the destination node includes a number of the destination node under a connected switch and a number of an i-th network to which the destination node belongs in a corresponding i + 1-th network, n is a total number of layers of an interconnection network, and i takes a value from 1 to n-1;
a sending module 830, configured to forward the packet based on the next hop output port.
In a possible implementation manner, in a case that the current switch is in an m-th network of the internetwork, and m is not equal to 1, the routing table stored on the current switch includes routing tables of networks in layers from the m-th network to the n-th network, the routing table of the h-th network from the m-th network to the n-th network is used for indicating a mapping relationship between a number of the h-1-th network in the corresponding h-th network and a next-hop output port, m is less than or equal to n, and m is greater than or equal to 2, h is less than or equal to n, and h is greater than or equal to m;
and under the condition that the current switch is positioned in a layer 1 network of the interconnected network, the routing table stored by the current switch comprises the routing tables of all layers of networks from the layer 1 network to an n-1 network and the routing table used for indicating the mapping relation between the number of each node connected by the current switch and a next hop output port.
In a possible implementation manner, the determining module 820 is configured to:
and determining the next hop-out port of the message at the current switch according to the node identifier of the destination node in the message and the network identifiers of the networks of the layers to which the current switch belongs.
In a possible implementation manner, the determining module 820 is configured to:
taking the initial j value as n-1;
determining whether the destination node and the current switch belong to the j +1 th network or not according to the number of the j-th network in the corresponding j +1 th network in the node identifier of the destination node in the message and the network identifier of each layer network to which the current switch belongs;
under the condition that the destination node and the current switch belong to a j-th network, if j is equal to 1, determining a next hop-out port corresponding to the number of the destination node under the connected switch as a next hop-out port of the message in a routing table for indicating the mapping relation between the number of each node connected with the current switch and a next hop-out port, and if j is not equal to 1, dereferencing j to j-1, and executing processing for determining whether the destination node and the current switch belong to the j-th network;
and under the condition that the destination node and the current switch do not belong to the j-th network, determining a next hop output port corresponding to the number of the j-th network to which the destination node belongs in the corresponding j + 1-th network as the next hop output port of the message in a routing table used for indicating the mapping relation between the number of the j-th network in the corresponding j + 1-th network and the next hop output port.
In a possible implementation manner, the determining module 820 is configured to:
if the number of the j-th network in the corresponding j + 1-th network to the number of the n-1-th network in the corresponding n-th network in the node identifier of the destination node in the message is respectively the same as the network identifier of the j-th network to the n-1-th network to which the current switch belongs, determining that the destination node and the current switch belong to the j-th network;
and if the number of the j-th network in the corresponding j + 1-th network in the node identifier of the destination node in the message is different from the network identifier of the j-th network to which the current switch belongs, determining that the destination node and the current switch belong to the j-th network differently.
In a possible implementation manner, in a routing table of a layer-a network stored by the current switch, when a target number in the routing table of the layer-a network is the same as a network identifier of a layer-a-1 network to which the current switch belongs, a next-hop output port corresponding to the target number is an invalid value;
when the target number is different from the network identification of the a-1 layer network to which the current switch belongs, the next hop output port corresponding to the target number is an effective value, the routing table of the a layer network is the routing table of any layer network stored by the current switch, and the target number is the number of the a-1 layer network in the corresponding a layer network in the node identification of the destination node.
In a possible implementation manner, the determining module 820 is configured to:
determining contents corresponding to each number in the node identification of the destination node in a stored routing table of each layer of network according to the node identification of the destination node in the message;
if the corresponding content of the number of the i-th network in the corresponding i + 1-th network in the routing table of the i + 1-th network is an effective value, and the corresponding content of the number of the i + 1-th network in the corresponding i + 2-th network in the routing table of the i + 2-th network to the corresponding content of the number of the n-1-th network in the routing table of the n-th network is an invalid value, determining the corresponding content of the number of the i-th network in the corresponding i + 1-th network in the routing table of the i + 1-th network as the next hop output port of the message in the current switch;
and if the content of the number of the destination node under the connected switch in the routing table of the first-layer network is an effective value, and the content of the number of the first-layer network in the corresponding second-layer network, which corresponds to the content of the number of the n-1-layer network in the routing table of the n-layer network, is an invalid value, determining the content of the number of the destination node under the connected switch, which corresponds to the content of the number of the destination node in the routing table of the first-layer network, as the next-hop output port of the message at the current switch.
The division of the modules in the embodiments of the present application is illustrative, and is only a logical function division, and in actual implementation, there may be another division manner, and in addition, each functional module in each embodiment of the present application may be integrated in one processor, may also exist alone physically, or may also be integrated in one module by two or more modules. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
It should be noted that: in the device for transmitting a message according to the above embodiment, when a message is transmitted, only the division of the functional modules is illustrated, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the apparatus for transmitting a message and the method for transmitting a message provided in the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and will not be described herein again.
In the above embodiments, all or part of the implementation may be realized by software, hardware, firmware or any combination thereof, and when the implementation is realized by software, all or part of the implementation may be realized in the form of a computer program product. The computer program product comprises one or more computer program instructions which, when loaded and executed on a server or terminal, cause the processes or functions described in accordance with embodiments of the application to be performed, in whole or in part. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optics, digital subscriber line) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium can be any available medium that can be accessed by a server or a terminal or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (such as a floppy Disk, a hard Disk, a magnetic tape, etc.), an optical medium (such as a Digital Video Disk (DVD), etc.), or a semiconductor medium (such as a solid state Disk, etc.).

Claims (14)

1. A method for transmitting a message, the method comprising:
receiving a message sent by a source node;
determining a next-hop output port of the message in a current switch according to a node identifier of a destination node in the message, wherein the node identifier of the destination node includes a number of the destination node under a connected switch, a number of an i-th network to which the destination node belongs in a corresponding i + 1-th network, n is a total number of layers of an interconnection network, i takes values from 1 to n-1, when the current switch is in an m-th network of the interconnection network and m is not equal to 1, a routing table stored on the current switch includes routing tables of networks of layers from the m-th network to the n-th network, the routing tables of the h-th network from the m-th network to the n-th network are used for indicating a mapping relationship between the number of the h-1-th network in the corresponding h-th network and a next-hop output port, m is less than or equal to n, m is less than or equal to 2, h is less than or equal to n and h is greater than or equal to m, and when the current switch is in the 1-th network of the interconnection network, the routing table stored in the current switch includes a mapping relationship between the n-th network and a current network node for indicating a routing table of the current network and a number of the current-hop output port;
and forwarding the message based on the next hop output port.
2. The method of claim 1, wherein the determining, according to the node identifier of the destination node in the message, that the message is at a next-hop output port of a current switch comprises:
and determining the next hop-out port of the message at the current switch according to the node identifier of the destination node in the message and the network identifiers of the networks of the layers to which the current switch belongs.
3. The method according to claim 2, wherein the determining, according to the node identifier of the destination node in the message and the network identifiers of the networks of the layers to which the current switch belongs, a next hop-out port of the message at the current switch includes:
taking the initial j value as n-1;
determining whether the destination node and the current switch belong to the j-th network or not according to the number of the j-th network in the corresponding j + 1-th network in the node identifier of the destination node in the message and the network identifier of each layer of network to which the current switch belongs;
under the condition that the target node and the current switch belong to the j-th network, if j is equal to 1, determining a next hop-out port corresponding to the number of the target node under the connected switch as a next hop-out port of the message in a routing table for indicating the mapping relation between the number of each node connected with the current switch and a next hop-out port, if j is not equal to 1, taking the value of j as j-1, and executing processing for determining whether the target node and the current switch belong to the j-th network;
and under the condition that the destination node and the current switch do not belong to the j-th network, determining a next hop output port corresponding to the number of the j-th network to which the destination node belongs in the corresponding j + 1-th network as the next hop output port of the message in a routing table used for indicating the mapping relation between the number of the j-th network in the corresponding j + 1-th network and the next hop output port.
4. The method according to claim 3, wherein the determining whether the destination node and the current switch belong to the same layer j network according to a number of the layer j network in the corresponding layer j +1 network in the node identifier of the destination node in the message and the network identifiers of the layers of networks to which the current switch belongs comprises:
if the number of the j-th network in the corresponding j + 1-th network in the node identifier of the destination node in the message to the number of the n-1-th network in the corresponding n-th network are respectively the same as the network identifiers of the j-th network to the n-1-th network to which the current switch belongs, determining that the destination node and the current switch belong to the j-th network;
and if the number of the j-th network in the corresponding j + 1-th network in the node identifier of the destination node in the message is different from the network identifier of the j-th network to which the current switch belongs, determining that the destination node and the current switch belong to the j-th network differently.
5. The method according to claim 1, wherein in the routing table of the network-a network stored by the current switch, when a target number in the routing table of the network-a network is the same as the network identifier of the network-a-1 network to which the current switch belongs, a next hop output port corresponding to the target number is an invalid value;
when the target number is different from the network identification of the a-1 th network to which the current switch belongs, the next hop output port corresponding to the target number is a valid value, the routing table of the a-th network is the routing table of any network stored by the current switch, and the target number is the number of the a-1 th network in the corresponding a-th network in the node identification of the destination node.
6. The method of claim 5, wherein the determining, according to the node identifier of the destination node in the message, that the message is at a next-hop output port of a current switch comprises:
determining contents corresponding to each number in the node identification of the destination node in a stored routing table of each layer of network according to the node identification of the destination node in the message;
if the corresponding content of the number of the i-th network in the corresponding i + 1-th network in the routing table of the i + 1-th network is an effective value, and the corresponding content of the number of the i + 1-th network in the corresponding i + 2-th network in the routing table of the i + 2-th network to the corresponding content of the number of the n-1-th network in the routing table of the n-th network is an invalid value, determining the corresponding content of the number of the i-th network in the corresponding i + 1-th network in the routing table of the i + 1-th network as the next hop output port of the message in the current switch;
and if the content of the number of the destination node under the connected switch in the routing table of the first-layer network is an effective value, and the content of the number of the first-layer network in the corresponding second-layer network, which corresponds to the content of the number of the n-1-layer network in the routing table of the n-layer network, is an invalid value, determining the content of the number of the destination node under the connected switch, which corresponds to the content of the number of the destination node in the routing table of the first-layer network, as the next-hop output port of the message at the current switch.
7. An apparatus for transmitting a message, the apparatus comprising:
the receiving module is used for receiving the message sent by the source node;
a determining module, configured to determine, according to a node identifier of a destination node in the message, a next-hop output port of the message in a current switch, where the node identifier of the destination node includes a number of the destination node under a connected switch, a number of an i-th network to which the destination node belongs in a corresponding i + 1-th network, n is a total number of layers of an interconnect network, and a value of i is 1 to n-1, where, when the current switch is in an m-th network of the interconnect network and m is not equal to 1, a routing table stored on the current switch includes routing tables of networks in m-th to n-th networks, and the routing table of the h-th network in the m-th to n-th networks is used to indicate a mapping relationship between the number of the h-1-th network in the corresponding h-th network and a next-hop output port, m is less than or equal to n, and m is less than or equal to 2, h is less than or equal to n, and h is greater than or equal to m, and, when the current switch is in the 1-th network of the interconnect network, the current switch includes a mapping relationship between the n-1-th network and a number of the routing table stored in the current switch, and a routing table, which is used to indicate a number of the current network of the next-th network;
and the sending module is used for forwarding the message based on the next hop output port.
8. The apparatus of claim 7, wherein the determining module is configured to:
and determining the next hop-out port of the message at the current switch according to the node identifier of the destination node in the message and the network identifiers of the networks of the layers to which the current switch belongs.
9. The apparatus of claim 8, wherein the determining module is configured to:
taking the initial j value as n-1;
determining whether the destination node and the current switch belong to the j-th network or not according to the number of the j-th network in the corresponding j + 1-th network in the node identifier of the destination node in the message and the network identifier of each layer of network to which the current switch belongs;
under the condition that the target node and the current switch belong to the j-th network, if j is equal to 1, determining a next hop-out port corresponding to the number of the target node under the connected switch as a next hop-out port of the message in a routing table for indicating the mapping relation between the number of each node connected with the current switch and a next hop-out port, if j is not equal to 1, taking the value of j as j-1, and executing processing for determining whether the target node and the current switch belong to the j-th network;
and under the condition that the destination node and the current switch belong to different j-th network, determining a next hop output port corresponding to the number of the j-th network to which the destination node belongs in the corresponding j + 1-th network as the next hop output port of the message in a routing table for indicating the mapping relation between the number of the j-th network in the corresponding j + 1-th network and the next hop output port.
10. The apparatus of claim 9, wherein the determining module is configured to:
if the number of the j-th network in the corresponding j + 1-th network to the number of the n-1-th network in the corresponding n-th network in the node identifier of the destination node in the message is respectively the same as the network identifier of the j-th network to the n-1-th network to which the current switch belongs, determining that the destination node and the current switch belong to the j-th network;
and if the number of the j-th network in the corresponding j + 1-th network in the node identifier of the destination node in the message is different from the network identifier of the j-th network to which the current switch belongs, determining that the destination node and the current switch belong to the j-th network differently.
11. The apparatus according to claim 7, wherein in the routing table of the network-a network stored in the current switch, when a target number in the routing table of the network-a network is the same as the network identifier of the network-a-1 network to which the current switch belongs, a next hop output port corresponding to the target number is an invalid value;
when the target number is different from the network identification of the a-1 layer network to which the current switch belongs, the next hop output port corresponding to the target number is an effective value, the routing table of the a layer network is the routing table of any layer network stored by the current switch, and the target number is the number of the a-1 layer network in the corresponding a layer network in the node identification of the destination node.
12. The apparatus of claim 11, wherein the determining module is configured to:
determining contents corresponding to each number in the node identification of the destination node in a stored routing table of each layer of network according to the node identification of the destination node in the message;
if the corresponding content of the number of the i-th network in the corresponding i + 1-th network in the routing table of the i + 1-th network is an effective value, and the corresponding content of the number of the i + 1-th network in the corresponding i + 2-th network in the routing table of the i + 2-th network to the corresponding content of the number of the n-1-th network in the routing table of the n-th network is an invalid value, determining the corresponding content of the number of the i-th network in the corresponding i + 1-th network in the routing table of the i + 1-th network as the next hop output port of the message in the current switch;
and if the content of the serial number of the destination node under the connected switch in the routing table of the first-layer network is an effective value, and the content of the serial number of the first-layer network in the corresponding second-layer network, which corresponds to the content of the serial number of the second-layer network in the routing table of the n-1-th layer network in the corresponding n-th layer network, which corresponds to the content of the serial number of the n-th layer network in the routing table of the n-th layer network, is an invalid value, determining the content of the serial number of the destination node under the connected switch, which corresponds to the content of the serial number of the n-th layer network in the routing table of the first-layer network, as the next-hop output port of the message in the current switch.
13. A computing device, comprising a memory and a processor, the processor executing computer instructions stored by the memory to cause the computing device to perform the method of any of claims 1 to 6.
14. A readable computer storage medium, characterized in that the computer storage medium stores a computer program which, when executed by a computing device, implements the method of any of claims 1 to 6.
CN202010180659.5A 2020-03-16 2020-03-16 Method, device, computing equipment and storage medium for transmitting message Active CN113411257B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010180659.5A CN113411257B (en) 2020-03-16 2020-03-16 Method, device, computing equipment and storage medium for transmitting message

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010180659.5A CN113411257B (en) 2020-03-16 2020-03-16 Method, device, computing equipment and storage medium for transmitting message

Publications (2)

Publication Number Publication Date
CN113411257A CN113411257A (en) 2021-09-17
CN113411257B true CN113411257B (en) 2022-10-18

Family

ID=77676074

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010180659.5A Active CN113411257B (en) 2020-03-16 2020-03-16 Method, device, computing equipment and storage medium for transmitting message

Country Status (1)

Country Link
CN (1) CN113411257B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101510845A (en) * 2009-03-27 2009-08-19 北京星网锐捷网络技术有限公司 Method and apparatus for forwarding label
CN101729365A (en) * 2008-10-27 2010-06-09 华为技术有限公司 Route establishing method, carrying network router and network system
CN109218231A (en) * 2018-09-21 2019-01-15 中国航空无线电电子研究所 A kind of RapidIO exchange network
CN110493137A (en) * 2019-09-12 2019-11-22 苏州浪潮智能科技有限公司 A kind of Tiered broadcast method, apparatus and system based on fixed route network

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8289867B2 (en) * 2008-08-01 2012-10-16 Qualcomm Atheros, Inc. Message routing mechanism for communication networks

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101729365A (en) * 2008-10-27 2010-06-09 华为技术有限公司 Route establishing method, carrying network router and network system
CN101510845A (en) * 2009-03-27 2009-08-19 北京星网锐捷网络技术有限公司 Method and apparatus for forwarding label
CN109218231A (en) * 2018-09-21 2019-01-15 中国航空无线电电子研究所 A kind of RapidIO exchange network
CN110493137A (en) * 2019-09-12 2019-11-22 苏州浪潮智能科技有限公司 A kind of Tiered broadcast method, apparatus and system based on fixed route network

Also Published As

Publication number Publication date
CN113411257A (en) 2021-09-17

Similar Documents

Publication Publication Date Title
KR102162730B1 (en) Technologies for distributed routing table lookup
US9787586B2 (en) Location-based network routing
US9385949B2 (en) Routing controlled by subnet managers
US9225628B2 (en) Topology-based consolidation of link state information
CN107925613A (en) It is used for the methods, devices and systems to E-Packet in business function chain SFC
CN104871145A (en) Memory sharing in network device
CN108123901B (en) Message transmission method and device
CN104717081A (en) Gateway function realization method and device
US8149840B2 (en) Method, system and processor for processing network address translation service
TWI759571B (en) Data transfer method based on flow table
CN111147372B (en) Downlink message sending and forwarding method and device
CN114844827B (en) Shared storage-based spanning tree routing hardware architecture and method for network-on-chip
KR101754618B1 (en) A method and apparatus for generating dinamic virtual network based on software defined networks
CN113098770A (en) Message sending method, routing table entry generating method, device and storage medium
CN105812257A (en) Business chain router management system and use method thereof
JP6437694B2 (en) Packet forwarding
US6631421B1 (en) Recursive partitioning of networks
US20100238942A1 (en) Lookup engine with programmable memory topology
WO2023093513A1 (en) Path sensing method, apparatus and system
CN113691445B (en) Message forwarding backup path determining method and related equipment
CN113411257B (en) Method, device, computing equipment and storage medium for transmitting message
CN116055446B (en) Cross-network message forwarding method, electronic equipment and machine-readable storage medium
CN114615179A (en) Message transmission method, device and system
CN112671941A (en) Message processing method, device, equipment and medium
CN108111414B (en) Label deployment method and device based on segment routing

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