CN116346618A - Route configuration method and device of switch and electronic equipment - Google Patents

Route configuration method and device of switch and electronic equipment Download PDF

Info

Publication number
CN116346618A
CN116346618A CN202310210108.2A CN202310210108A CN116346618A CN 116346618 A CN116346618 A CN 116346618A CN 202310210108 A CN202310210108 A CN 202310210108A CN 116346618 A CN116346618 A CN 116346618A
Authority
CN
China
Prior art keywords
interface
hop
interface board
board
proxy
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310210108.2A
Other languages
Chinese (zh)
Inventor
刘铮
李友
陈翔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202310210108.2A priority Critical patent/CN116346618A/en
Publication of CN116346618A publication Critical patent/CN116346618A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/085Retrieval of network configuration; Tracking network configuration history
    • H04L41/0853Retrieval of network configuration; Tracking network configuration history by actively collecting configuration information or by backing up configuration information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/084Configuration by using pre-existing information, e.g. using templates or copying from other elements
    • H04L41/0846Configuration by using pre-existing information, e.g. using templates or copying from other elements based on copy from other elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/085Retrieval of network configuration; Tracking network configuration history
    • H04L41/0853Retrieval of network configuration; Tracking network configuration history by actively collecting configuration information or by backing up configuration information
    • H04L41/0856Retrieval of network configuration; Tracking network configuration history by actively collecting configuration information or by backing up configuration information by backing up or archiving configuration information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • H04L45/021Ensuring consistency of routing table updates, e.g. by using epoch numbers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/17Shortcut routing, e.g. using next hop resolution protocol [NHRP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a route configuration method of a switch, which comprises the following steps: the agent ports of the interface board and other interface boards are obtained from the main control board; acquiring other interface board numbers corresponding to agent ports of the other interface boards; setting a next-hop list item with an output interface as a proxy port of the other interface board for the interface board based on the number of the other interface board, so as to obtain a next-hop proxy list of the interface board; configuring a next-hop table of the interface board according to the next-hop proxy table of the interface board and the route configuration table acquired from the main control board; and configuring the routing table of the interface board according to the next hop index in the next hop table of the interface board and the routing configuration table. The invention belongs to the technical field of network communication, and the method provided by the invention is applied to an interface board, so that the problem of network communication failure caused by insufficient resources of a next-hop table of a switching chip can be solved.

Description

Route configuration method and device of switch and electronic equipment
Technical Field
The invention belongs to the technical field of network communication, and particularly relates to a route configuration method and device of a switch and electronic equipment.
Background
The routing capacity of the switch system is limited by the routing table and the next-hop table of the switch chip, and the capacity of the routing table designed by the switch chip is larger than that of the next-hop table in consideration of the fact that a plurality of routes share the next-hop table, a large number of host routes exist in a large two-layer network, each host route needs an independent next-hop table item, when the resources of the next-hop table of the switch chip are insufficient, the routing configuration of the interface board is failed, and therefore when the interface board receives a data message aiming at the routing, the interface board searches for the routing failure and the upper CPU forwards or discards the software, so that network communication failure is caused.
Disclosure of Invention
In view of the above problems, embodiments of the present invention provide a method, an apparatus, and an electronic device for route configuration of a switch, so as to overcome or at least partially solve the above problems.
In a first aspect of the embodiment of the present invention, a route configuration method of a switch is provided, and the method is applied to an interface board, and the method includes:
the agent ports of the interface board and other interface boards are obtained from the main control board;
acquiring other interface board numbers corresponding to agent ports of the other interface boards;
setting a next-hop list item with an output interface as a proxy port of the other interface board for the interface board based on the number of the other interface board, so as to obtain a next-hop proxy list of the interface board;
configuring a next-hop table of the interface board according to the next-hop proxy table of the interface board and the route configuration table acquired from the main control board; wherein, the next jump table of the interface board includes: the next-hop index points to the routing table entry of the local interface, and the next-hop index points to the routing table entry of the proxy port of other interface boards;
and configuring the routing table of the interface board according to the next hop index in the next hop table of the interface board and the routing configuration table.
Preferably, before the agent ports of the interface board and other interface boards are obtained from the main control board, the method includes:
and acquiring the cascade ports of the interface board, selecting any cascade port to be set as an agent port, and sending the agent port to the main control board.
Preferably, the configuring the next-hop table of the interface board according to the next-hop proxy table of the interface board and the route configuration table obtained from the main control board includes:
acquiring the route configuration table;
determining a local next-hop table of the interface board based on the routing configuration table;
and configuring a next-hop table of the interface board based on the local next-hop table and the next-hop proxy table.
Preferably, determining the local next-hop table of the interface board based on the routing configuration table of the main control board includes:
acquiring the interface outlet information in the route configuration table;
determining a next-hop table entry of a local interface of the interface board based on the interface outlet information;
and determining a local next-hop table of the interface board based on the next-hop table entry of the local interface.
Preferably, configuring the routing table of the interface board according to the next hop index in the next hop table of the interface board and the routing configuration table includes:
determining a next-hop table entry in a next-hop table of the interface board; wherein the next hop entry includes: the routing table entry of the local interface and the routing table entries of the proxy ports of the other interface boards;
generating a next-hop index corresponding to the next-hop table item based on the next-hop table item respectively;
and writing the next hop index into the route configuration table to configure the route table of the interface board.
Preferably, the method further comprises:
when a first data message is received through a service port, inquiring a routing table of the interface board according to a first destination IP address in the first data message, and determining a next hop index corresponding to the first destination IP address;
inquiring a next hop table of the interface board based on a next hop index corresponding to the first destination IP address, and determining a first output interface for forwarding the first data message;
forwarding the first data message by using the local interface under the condition that the first output interface is the local interface;
and under the condition that the first output interface is a proxy interface of other interface boards, packaging the information of the first output interface into the head information of the first data message, and forwarding the packaged first data message by utilizing a cascade interface of the interface boards.
Preferably, the method further comprises:
under the condition that a second data message forwarded by the other interface boards is received through the cascade port, analyzing the message header information of the second data message,
determining a second output interface for forwarding the second data message;
when the second output interface is a proxy port of the interface board, inquiring a routing table of the interface board according to a second destination IP address in the second data message, and determining a next hop index corresponding to the second destination IP address;
inquiring a next hop table of the interface board based on a next hop index corresponding to the second destination IP address, and determining a first output interface for forwarding the second data message; and forwarding the second data message by using the local interface under the condition that the second output interface is the local interface.
Preferably, the method further comprises:
and when the second output interface is not the proxy port of the interface board, forwarding the second data message by using the cascade port of the interface board.
In a second aspect of the embodiment of the present invention, a route configuration device of a switch is provided, and the route configuration device is applied to an interface board, and the device includes:
the first acquisition module is used for acquiring proxy ports of the interface board and other interface boards from the main control board;
the second acquisition module is used for acquiring other interface board numbers corresponding to the agent ports of the other interface boards;
the third acquisition module is used for respectively setting a next-hop table entry with an output interface as a proxy port of the interface board for the other interface boards based on the numbers of the other interface boards to obtain a next-hop proxy table of the interface board;
the first configuration module is used for configuring the next-hop proxy table of the interface board according to the next-hop proxy table of the interface board and the route configuration table obtained from the main control board; wherein, the next jump table of the interface board includes: the next-hop index points to the routing table entry of the local interface, and the next-hop index points to the routing table entry of the proxy port of other interface boards;
and the second configuration module is used for configuring the routing table of the interface board according to the next hop index in the next hop table of the interface board and the routing configuration table.
In a third aspect of the embodiment of the present invention, an electronic device is provided, where the electronic device includes a memory, a processor, and a computer program stored on the memory and capable of running on the processor, where the routing configuration method of the switch according to the first aspect of the embodiment of the present invention is provided when the processor executes the computer program.
The route configuration method of the exchanger is applied to the interface board, and firstly, the proxy ports of the interface board and other interface boards are obtained from the main control board; acquiring other interface board numbers corresponding to agent ports of other interface boards; based on the numbers of other interface boards, setting a next-hop proxy item of which the outgoing interface is the proxy port of the interface board for the other interface boards respectively to obtain a next-hop proxy table of the interface board.
Then configuring the next-hop proxy table of the interface board according to the next-hop proxy table of the interface board and the route configuration table obtained from the main control board; wherein, the next jump table of interface board includes: the next-hop index points to the routing table entry of the local interface, and the next-hop index points to the routing table entry of the proxy port of other interface boards; and finally, configuring the routing table of the interface board according to the next hop index and the routing configuration table in the next hop table of the interface board. The method provided by the invention can greatly reduce the number of the next-hop table items occupied by the exchange chip, avoid the condition that each route needs one next-hop table item, save the resources of the next-hop table item, not only solve the problem that when the resources of the next-hop table are insufficient, the configuration failure of the interface board route can be caused, and the interface board can cause network communication failure when receiving the data message aiming at the route, but also provide a larger expansion space for a later-stage exchange system, so that the data message forwarding of the exchange system is greatly promoted.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments of the present invention will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of a frame switch according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a routing table of a switch chip according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a next-hop table of a switch chip according to an embodiment of the present invention;
fig. 4 is a flowchart of steps of a method for configuring a route of a switch according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a next hop proxy table of a switch chip according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a routing table and a next-hop table configuration on an interface board 1 according to an embodiment of the present invention;
fig. 7 is a schematic flow chart of routing and forwarding a first data packet on the interface board 1 according to an embodiment of the present invention;
fig. 8 is a schematic flow chart of routing and forwarding a second data packet on the interface board 1 according to an embodiment of the present invention;
fig. 9 is a schematic diagram of a route configuration device of a switch according to an embodiment of the present invention.
Fig. 10 is a schematic diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings in the embodiments of the present invention. While exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
Referring to fig. 1, fig. 1 is a schematic diagram of a frame switch according to an embodiment of the present invention, which only uses a single main control board, a single switch board, an interface board 1 and an interface board 2 as an example, and the frame switch generally includes a main control board, a switch board and an interface board. The main control board is used for controlling the trend of data in the exchanger, the exchange network board is used for data exchange in the exchanger, and the interface board is responsible for receiving and sending user data messages. In order to realize the routing forwarding of the received data message on the switch system of the machine frame switch provided in fig. 1, the main control board issues the routing table entry to each interface board through the control channel, and the control channel processing unit of each interface board issues the routing configuration information from the main control board to the switching chip after receiving the routing configuration information, and forwards the data message through the routing information in the switching chip.
The setting of the switching chip for the routing information is divided into a routing table and a next-hop table, referring to fig. 2, fig. 2 is a schematic diagram of the routing table of the switching chip provided in the embodiment of the present invention, where the routing table in fig. 2 includes an IP address, a mask, and an index of the next-hop table; referring to fig. 3, fig. 3 is a schematic diagram of a next-hop table of a switch chip according to an embodiment of the present invention, where the next-hop table in fig. 3 includes a MAC address and an egress interface of a next-hop device. After the interface board 1 receives the user data message, the interface board searches the routing table of the exchange chip according to the first destination IP address to obtain the index of the next hop table, searches the next hop table according to the index to obtain the destination MAC of the next hop device and the forwarded next hop out interface, and further forwards the next hop out interface from the corresponding out interface.
Example 1
Referring to fig. 4, fig. 4 is a step flowchart of a routing configuration method of a switch according to an embodiment of the present invention; as shown in the figure, a route configuration method of a switch is provided, and the route configuration method is applied to an interface board, and the step flow includes:
step S401: and acquiring agent ports of the interface board and other interface boards from the main control board.
In this embodiment, the interface board obtains the proxy ports of the interface board and the other interface boards from the main control board, where each other interface board has a proxy port, and the interface board obtains the proxy port of each other interface board.
Step S402: and acquiring the numbers of other interface boards corresponding to the proxy ports of the other interface boards.
In this embodiment, the interface board obtains the numbers of other interface boards corresponding to the agent ports of other interface boards, so that the numbers of the interface boards where the agent ports of other interface boards are located can be determined, and the next jumping-out interfaces on other different interface boards can be distinguished, so that the agent ports of other interface boards are in one-to-one correspondence with the interface boards where the agent ports of other interface boards are located.
Step S403: and setting a next-hop list item with an output interface as a proxy port of the other interface board for the interface board based on the numbers of the other interface boards, so as to obtain a next-hop proxy list of the interface board.
In this embodiment, the interface board can know the number of other interface boards through the number of other interface boards, and the interface board can set a next-hop proxy table entry for the proxy ports of the other interface boards, and collect the next-hop proxy table entries, so as to obtain the next-hop proxy table entry of the interface board.
As an example, referring to fig. 5, fig. 5 is a schematic diagram of a next-hop proxy table of a switch chip provided in an embodiment of the present invention, where it is known that by the method provided in this embodiment, in conjunction with fig. 3, a next-hop proxy table entry is provided, and it is assumed that an interface board is an interface board 1, and other interface boards are interface boards 2, and it is known from fig. 5 that, by using one next-hop proxy table corresponding to an interface board 2 instead of three next-hop proxy tables corresponding to an interface board 2 in fig. 3, a corresponding plurality of next hops in other interface boards can reduce the number of items of a next-hop interface in the next-hop proxy table, and it can also be seen from fig. 5 that only for other interface boards 2 other than an interface board 1, one next-hop proxy table entry is provided, and the next-hop proxy entry in the next-hop proxy table entry is a three-layer MAC of the switch, if there are 8 next-hop proxy entries in the interface board 1.
Step S404: configuring a next-hop table of the interface board according to the next-hop proxy table of the interface board and the route configuration table acquired from the main control board; wherein, the next jump table of the interface board includes: the next hop index points to a routing table entry of the local interface and the next hop index points to a routing table entry of the proxy port of the other interface board.
In this embodiment, the interface board 1 obtains the route configuration table obtained in the main control board, referring to fig. 2, according to the route configuration table, obtains the next hop table corresponding to the route configuration table in the main control board, downloads the next hop table entry of the outgoing interface in the next hop table entry on the interface board 1, referring to fig. 3, and integrates the next hop proxy table obtained in step S104 together to configure the next hop proxy table of the interface board 1, and fig. 6 is a schematic diagram of the route table and the next hop table configuration on the interface board 1 provided in the embodiment of the present invention; referring to the table in the right half of fig. 6, the next-hop table of the interface board 1 is the next-hop index, and the next-hop index is regenerated, and of course, if the index is already on the original main control board, only the next-hop index corresponding to the next-hop proxy table is regenerated in the next-hop table, and it can be seen from the table that the next-hop index points to the routing table entry of the local interface, and the next-hop index points to the routing table entry of the proxy port of the other interface board, where the local interface is the outgoing interface indicating that the interface is on the interface board 1.
Step S405: and configuring the routing table of the interface board according to the next hop index in the next hop table of the interface board and the routing configuration table.
In this embodiment, the next hop index in the next hop table in the interface board 1 is obtained, and the next hop index is written into the next hop table index item beside the corresponding route key value in the route table, so as to complete the route table configuration of the interface board 1, refer to the table in the left version of fig. 6, complete the route table configuration of the interface board 1, and combine the next hop table in fig. 6, it can be seen from the figure that the local interfaces in the interface board 1 in the route table respectively have one next hop table corresponding to the next hop tables of other interface boards.
The route configuration method of the exchanger is applied to the interface board, and firstly, the proxy ports of the interface board and other interface boards are obtained from the main control board; acquiring other interface board numbers corresponding to agent ports of other interface boards; based on the numbers of other interface boards, a next-hop proxy table of the interface board is obtained by respectively setting a next-hop proxy table of the proxy port of the interface board as an outgoing interface for the other interface boards. Then configuring the next-hop proxy table of the interface board according to the next-hop proxy table of the interface board and the route configuration table obtained from the main control board; wherein, the next jump table of interface board includes: the next-hop index points to the routing table entry of the local interface, and the next-hop index points to the routing table entry of the proxy port of other interface boards; and finally, configuring the routing table of the interface board according to the next hop index and the routing configuration table in the next hop table of the interface board. By the method for route configuration, a large number of host routes exist in a large two-layer network, each host route needs an independent next-hop table item, when the resources of the next-hop table of a switching chip are insufficient, the problems that the route configuration of an interface board fails, and when the interface board receives a data message aiming at the route, the interface board searches for the route failure and goes to a CPU for software forwarding or discarding, so that network communication failure is caused are solved.
In one embodiment, before the agent ports of the interface board and other interface boards are obtained from the master control board, the method includes: and acquiring the cascade ports of the interface board, selecting any cascade port to be set as an agent port, and sending the agent port to the main control board.
In this embodiment, before the proxy ports of the interface board and other interface boards are obtained from the main control board, all the cascade ports of the interface board 1 are obtained, the cascade ports on the interface board are set to be in a hybrid search mode, any one cascade port is selected as a proxy port, information of the proxy ports is sent to the main control board, according to the mode of the interface board 1, the other interface boards also send respective proxy ports to the main control board, the main control board has proxy port information of each interface board, the cascade ports can be used for forwarding data messages without the interface boards, and the cascade ports can be used for forwarding data passing through the cascade ports on the exchange network board.
In one embodiment, configuring the next-hop table of the interface board according to the next-hop proxy table of the interface board and the route configuration table obtained from the main control board includes: acquiring the route configuration table; determining a local next-hop table of the interface board based on the routing configuration table; and configuring a next-hop table of the interface board based on the local next-hop table and the next-hop proxy table.
In this embodiment, an exchange chip is disposed in the interface board 1, and the exchange chip obtains a route configuration table from the main control board, and in combination with fig. 2 and 3, from the route tables in fig. 2, the local next-hop table of the interface board 1 can be searched through the next-hop table index, so as to obtain the local next-hop table, and in combination with the previously obtained next-hop proxy table of the interface board 1, the next-hop table of the interface board 1 is jointly configured through the local next-hop table and the next-hop proxy table.
In one embodiment, determining the local next-hop table of the interface board based on the routing configuration table of the master control board includes: acquiring the interface outlet information in the route configuration table; determining a next-hop table entry of a local interface of the interface board based on the interface outlet information; and determining a local next-hop table of the interface board based on the next-hop table entry of the local interface.
In this embodiment, the interface board 1 obtains the outgoing interface information in the routing configuration table, where the outgoing interface information includes an interface board number, and in combination with fig. 3, it can be seen that there is a corresponding interface board number in each next outgoing interface, through the interface board number, it can be known whether the corresponding next outgoing interface is a local interface of the interface board 1, and further determine a next hop table entry of the local interface in the interface board 1, and the exchange chip in the interface board 1 downloads the next hop table entry of the local interface, so as to obtain the local next hop table of the interface board 1.
In one embodiment, configuring the routing table of the interface board according to the next hop index in the next hop table of the interface board and the routing configuration table includes: determining a next-hop table entry in a next-hop table of the interface board; wherein the next hop entry includes: the routing table entry of the local interface and the routing table entries of the proxy ports of the other interface boards; generating a next-hop index corresponding to the next-hop table item based on the next-hop table item respectively; and writing the next hop index into the route configuration table to configure the route table of the interface board.
In this embodiment, the routing table of the interface board is configured, first, the next-hop table entry in the next-hop table of the interface board needs to be determined, where the next-hop table entry includes the routing table entry of the local interface and the routing table entry of the proxy port of the other interface board, according to the next-hop table entry, the next index corresponding to the next-hop table entry is generated respectively, and the next-hop index is written into the routing table according to the IP address and the mask corresponding to the routing table respectively, so as to complete the routing table configuration of the interface board 1.
In one embodiment, referring to fig. 7, fig. 7 is a schematic flow chart of routing and forwarding a data packet on an interface board 1 according to an embodiment of the present invention; when the method for configuring the route of the switch provided by the invention is used for forwarding the data message of the interface board 1, the specific route forwarding is as follows:
step S701: when a first data message is received through a service port, a routing table of the interface board is queried according to a first destination IP address in the first data message, and a next hop index corresponding to the first destination IP address is determined.
In this embodiment, the service port of the interface board 1 receives a user data message in the network, that is, a first data message, and queries the master control board for a routing table to be downloaded to the exchange chip of the interface board 1 according to a first destination IP address corresponding to the first data message, and can obtain a next hop index corresponding to the first destination IP address through the routing table.
Step S702: and inquiring a next hop table of the interface board based on the next hop index corresponding to the first destination IP address, and determining a first output interface for forwarding the first data message.
In this embodiment, the next hop index corresponding to the first destination IP address may query the next hop table in the interface board 1, and determine the first outgoing interface for forwarding the first data packet by querying the content of the next hop table, where the first outgoing interface includes a device number and a port number, the device number may be understood as a corresponding interface board number, and the port number is an outgoing port number on the interface board.
Step S703: and forwarding the first data message by utilizing the local interface under the condition that the first output interface is the local interface.
In this embodiment, after the first outgoing interface information is determined, whether the interface is a local interface or not may be determined through the interface board number, a port number corresponding to the local interface is obtained, and after the first data packet is processed by the switch chip in the switch, the first data packet is forwarded by using the local interface corresponding to the port number. The processing of the switching chip is to set the source MAC and the destination MAC of the first data message as the three-layer interface MAC of the switch.
Step S704: and under the condition that the first output interface is a proxy interface of other interface boards, packaging the information of the first output interface into the head information of the first data message, and forwarding the packaged first data message by utilizing a cascade interface of the interface boards.
In this embodiment, when the first outgoing interface is the proxy port (interface board 2) of the other interface board, the information of the first outgoing interface is encapsulated into the header information of the first data packet, and the encapsulated first data packet is forwarded by using the cascade port of the interface board 1, and forwarded to the cascade port of the other interface board (interface board 2), and then the other interface board performs the subsequent forwarding operation.
In one embodiment, further comprising: under the condition that a second data message forwarded by other interface boards is received through a cascade port, analyzing message header information of the second data message, and determining a second output interface for forwarding the second data message; when the second output interface is a proxy port of the interface board, inquiring a routing table of the interface board according to a second destination IP address in the second data message, and determining a next hop index corresponding to the second destination IP address; inquiring a next hop table of the interface board based on a next hop index corresponding to the second destination IP address, and determining a first output interface for forwarding the second data message; and forwarding the second data message by using the local interface under the condition that the second output interface is the local interface.
In this embodiment, referring to fig. 8, fig. 8 is a schematic flow chart of routing and forwarding a second data packet on the interface board 1 according to the embodiment of the present invention; when the method for configuring the route of the switch provided by the invention is used for forwarding the data message of the interface board 1, the specific route forwarding is as follows:
step S801: and under the condition that a second data message forwarded by the other interface boards is received through the cascade port, analyzing the message header information of the second data message, and determining a second output interface for forwarding the second data message.
In this embodiment, when the cascade port of the interface board 1 receives the second data packet forwarded by another interface board, the cascade port first analyzes header information of the second data packet, and according to the header information of the packet, a second outgoing interface for forwarding the second data packet may be determined, where the second outgoing interface includes an interface board number and an outgoing interface type.
Step S802: and when the second output interface is the proxy port of the interface board, inquiring a routing table of the interface board according to a second destination IP address in the second data message, and determining a next hop index corresponding to the second destination IP address.
In this embodiment, when it is determined that the second output interface is the proxy interface of the interface board 1, the second destination IP address in the second data packet is obtained, the routing table of the interface board is queried, and the next hop index corresponding to the second destination IP address is determined.
Step S803: and inquiring a next hop table of the interface board based on the next hop index corresponding to the second destination IP address, and determining a first output interface for forwarding the second data message.
In this embodiment, the next hop index corresponding to the second destination IP address may query the next hop table in the interface board 1, and determine the first outgoing interface for forwarding the first data packet by querying the content of the next hop table, where the first outgoing interface includes a device number and a port number, the device number may be understood as a corresponding interface board number, and the port number is an outgoing port number on the interface board.
Step S804: and forwarding the second data message by using the local interface under the condition that the second output interface is the local interface.
In this embodiment, after the first outgoing interface information is determined, whether the interface is a local interface may be determined through the interface board number, a port number corresponding to the local interface may be obtained, and after the second data packet is processed by the switch chip in the switch, the second data packet is forwarded by using the local interface corresponding to the port number.
In one embodiment, referring to fig. 8, further comprising:
step S805: and when the second output interface is not the proxy port of the interface board, forwarding the second data message by using the cascade port of the interface board.
In this embodiment, when the second outgoing interface is not the proxy port of the interface board 1, the interface board number (assumed to be the interface board 2) for forwarding the second data packet is obtained according to the header information of the second data packet, and after the second data packet is processed by the switch chip in the switch through the cascade port of the interface board 1, the second data packet is forwarded to the interface board 2 through the cascade port in the interface board 1 via the data channel, and then the interface board 2 performs the subsequent forwarding operation.
Example 2
In a second aspect of the embodiment of the present invention, a route configuration device of a switch is provided, and referring to fig. 9, fig. 9 is a schematic diagram of a route configuration device of a switch provided in the embodiment of the present invention; applied to an interface board, the device comprises: a first acquisition module 901, a second acquisition module 902, a third acquisition module 903, a first configuration module 904, and a second configuration module 905.
The first obtaining module 901 is configured to obtain agent ports of the interface board and other interface boards from a main control board;
a second obtaining module 902, configured to obtain other interface board numbers corresponding to agent ports of the other interface boards;
a third obtaining module 903, configured to set a next-hop proxy table entry with an output interface being a proxy port of the interface board for the other interface boards based on the other interface board numbers, to obtain a next-hop proxy table of the interface board;
a first configuration module 904, configured to configure a next-hop table of the interface board according to the next-hop proxy table of the interface board and a routing configuration table obtained from the main control board; wherein, the next jump table of the interface board includes: the next-hop index points to the routing table entry of the local interface, and the next-hop index points to the routing table entry of the proxy port of other interface boards;
and a second configuration module 905, configured to configure the routing table of the interface board according to the next hop index in the next hop table of the interface board and the routing configuration table.
In one embodiment, the first configuration module further comprises a first configuration sub-module.
A first configuration sub-module, configured to obtain the routing configuration table;
determining a local next-hop table of the interface board based on the routing configuration table;
and configuring a next-hop table of the interface board based on the local next-hop table and the next-hop proxy table.
In one embodiment, the first configuration submodule includes a first determination submodule.
A first determining submodule, configured to obtain outgoing interface information in the routing configuration table;
determining a next-hop table entry of a local interface of the interface board based on the interface outlet information;
and determining a local next-hop table of the interface board based on the next-hop table entry of the local interface.
In one embodiment, the apparatus further comprises a first forwarding module.
The first forwarding module is used for inquiring a routing table of the interface board according to a first destination IP address in the first data message when the first data message is received through a service port, and determining a next hop index corresponding to the first destination IP address;
inquiring a next hop table of the interface board based on a next hop index corresponding to the first destination IP address, and determining a first output interface for forwarding the first data message;
forwarding the first data message by using the local interface under the condition that the first output interface is the local interface;
and under the condition that the first output interface is a proxy interface of other interface boards, packaging the information of the first output interface into the head information of the first data message, and forwarding the packaged first data message by utilizing a cascade interface of the interface boards.
In one embodiment, the apparatus further comprises a second forwarding module.
A second forwarding module, configured to parse header information of a second data packet forwarded by the other interface board when the second data packet is received through a cascade port,
determining a second output interface for forwarding the second data message;
when the second output interface is a proxy port of the interface board, inquiring a routing table of the interface board according to a second destination IP address in the second data message, and determining a next hop index corresponding to the second destination IP address;
inquiring a next hop table of the interface board based on a next hop index corresponding to the second destination IP address, and determining a second output interface for forwarding the second data message; and forwarding the second data message by using the local interface under the condition that the second output interface is the local interface.
And the second forwarding module is used for forwarding the second data message by using the cascade port of the interface board when the second output interface is not the proxy port of the interface board.
Example 3
In a third aspect of the embodiment of the present invention, an electronic device is provided, where the electronic device includes a memory, a processor, and a computer program stored on the memory and capable of running on the processor, where the routing configuration method of the switch according to the first aspect of the embodiment of the present invention is provided when the processor executes the computer program.
In this embodiment, referring to fig. 10, fig. 10 is a schematic diagram of an electronic device according to an embodiment of the present invention; as shown in fig. 4, the electronic device 100 includes: the memory 110 and the processor 120 are connected through bus communication, and a computer program is stored in the memory 110 and can run on the processor 120, so as to implement the routing configuration method of the switch according to the first aspect of the embodiment of the present application.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described by differences from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or terminal device comprising the element.
The foregoing describes in detail a method, an apparatus and an electronic device for configuring a route of a switch, and specific examples are applied to illustrate the principles and embodiments of the present invention, where the foregoing examples are only used to help understand the method and core idea of the present invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.

Claims (10)

1. A method of route configuration for a switch, applied to an interface board, the method comprising:
the agent ports of the interface board and other interface boards are obtained from the main control board;
acquiring other interface board numbers corresponding to agent ports of the other interface boards;
setting a next-hop list item with an output interface as a proxy port of the other interface board for the interface board based on the number of the other interface board, so as to obtain a next-hop proxy list of the interface board;
configuring a next-hop table of the interface board according to the next-hop proxy table of the interface board and the route configuration table acquired from the main control board; wherein, the next jump table of the interface board includes: the next-hop index points to the routing table entry of the local interface, and the next-hop index points to the routing table entry of the proxy port of other interface boards;
and configuring the routing table of the interface board according to the next hop index in the next hop table of the interface board and the routing configuration table.
2. The method of claim 1, comprising, prior to said obtaining the proxy port of the interface board and other interface boards from the master control board:
and acquiring the cascade ports of the interface board, selecting any cascade port to be set as an agent port, and sending the agent port to the main control board.
3. The method of claim 1, wherein configuring the next hop table of the interface board according to the next hop proxy table of the interface board and the routing configuration table obtained from the master control board comprises:
acquiring the route configuration table;
determining a local next-hop table of the interface board based on the routing configuration table;
and configuring a next-hop table of the interface board based on the local next-hop table and the next-hop proxy table.
4. The method of claim 3, wherein determining the local next-hop table of the interface board based on the routing configuration table of the master board comprises:
acquiring the interface outlet information in the route configuration table;
determining a next-hop table entry of a local interface of the interface board based on the interface outlet information;
and determining a local next-hop table of the interface board based on the next-hop table entry of the local interface.
5. The method of claim 1, wherein configuring the routing table of the interface board based on the next hop index in the next hop table of the interface board and the routing configuration table comprises:
determining a next-hop table entry in a next-hop table of the interface board; wherein the next hop entry includes: the routing table entry of the local interface and the routing table entries of the proxy ports of the other interface boards;
generating a next-hop index corresponding to the next-hop table item based on the next-hop table item respectively;
and writing the next hop index into the route configuration table to configure the route table of the interface board.
6. The method as recited in claim 1, further comprising:
when a first data message is received through a service port, inquiring a routing table of the interface board according to a first destination IP address in the first data message, and determining a next hop index corresponding to the first destination IP address;
inquiring a next hop table of the interface board based on a next hop index corresponding to the first destination IP address, and determining a first output interface for forwarding the first data message;
forwarding the first data message by using the local interface under the condition that the first output interface is the local interface;
and under the condition that the first output interface is a proxy interface of other interface boards, packaging the information of the first output interface into the head information of the first data message, and forwarding the packaged first data message by utilizing a cascade interface of the interface boards.
7. The method as recited in claim 1, further comprising:
under the condition that a second data message forwarded by the other interface boards is received through the cascade port, analyzing the message header information of the second data message,
determining a second output interface for forwarding the second data message;
when the second output interface is a proxy port of the interface board, inquiring a routing table of the interface board according to a second destination IP address in the second data message, and determining a next hop index corresponding to the second destination IP address;
inquiring a next hop table of the interface board based on a next hop index corresponding to the second destination IP address, and determining a second output interface for forwarding the second data message; and forwarding the second data message by using the local interface under the condition that the second output interface is the local interface.
8. The method as recited in claim 7, further comprising:
and when the second output interface is not the proxy port of the interface board, forwarding the second data message by using the cascade port of the interface board.
9. A routing configuration apparatus for a switch, for application to an interface board, the apparatus comprising:
the first acquisition module is used for acquiring proxy ports of the interface board and other interface boards from the main control board;
the second acquisition module is used for acquiring other interface board numbers corresponding to the agent ports of the other interface boards;
the third acquisition module is used for respectively setting a next-hop table entry with an output interface as a proxy port of the interface board for the other interface boards based on the numbers of the other interface boards to obtain a next-hop proxy table of the interface board;
the first configuration module is used for configuring the next-hop proxy table of the interface board according to the next-hop proxy table of the interface board and the route configuration table obtained from the main control board; wherein, the next jump table of the interface board includes: the next-hop index points to the routing table entry of the local interface, and the next-hop index points to the routing table entry of the proxy port of other interface boards;
and the second configuration module is used for configuring the routing table of the interface board according to the next hop index in the next hop table of the interface board and the routing configuration table.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of route configuration of a switch according to any of claims 1 to 8 when executing the computer program.
CN202310210108.2A 2023-03-07 2023-03-07 Route configuration method and device of switch and electronic equipment Pending CN116346618A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310210108.2A CN116346618A (en) 2023-03-07 2023-03-07 Route configuration method and device of switch and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310210108.2A CN116346618A (en) 2023-03-07 2023-03-07 Route configuration method and device of switch and electronic equipment

Publications (1)

Publication Number Publication Date
CN116346618A true CN116346618A (en) 2023-06-27

Family

ID=86878302

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310210108.2A Pending CN116346618A (en) 2023-03-07 2023-03-07 Route configuration method and device of switch and electronic equipment

Country Status (1)

Country Link
CN (1) CN116346618A (en)

Similar Documents

Publication Publication Date Title
US11245620B2 (en) Method for forwarding packet and network device
CN108768866B (en) Cross-card forwarding method and device for multicast message, network equipment and readable storage medium
CN105262683B (en) Network system and route control method
US6496503B1 (en) Device initialization and operation using directed routing
CN108429680B (en) Route configuration method, system, medium and equipment based on virtual private cloud
US20210320863A1 (en) Packet processing method, apparatus, and device, and packet forwarding method, apparatus, and device
CN109412951B (en) Method and device for sending routing information
CN103931147A (en) Path diversity in a connection-oriented network
JP2005167761A (en) Packet communication node apparatus
CN113098770B (en) Message sending method, route table item generating method, device and storage medium
CN112887229B (en) Session information synchronization method and device
CN110365553B (en) IPv6 network flow monitoring method and system based on SDN
CN111614505B (en) Message processing method and gateway equipment
EP1699247A1 (en) Multiple isp local area network egress selecting method
US20220345400A1 (en) Packet sending method and apparatus, and storage medium
CN116346618A (en) Route configuration method and device of switch and electronic equipment
US11784919B2 (en) Method for sending BIERv6 packet and first network device
CN112637285B (en) Edge cloud communication method, management system, computer device and storage medium
CN110545240B (en) Method for establishing label forwarding table and forwarding message based on distributed aggregation system
CN112910783B (en) Message forwarding method and device and distributed equipment
CN111385215B (en) Method and device for transmitting message
JP3173467B2 (en) Data processing device and data processing method
KR20060035080A (en) System for forwarding ipv6 source specific multicast data in linux router and a method for the same
CN115412475A (en) Route control method, device, computer equipment and storage medium
CN116827861A (en) Message forwarding method and device

Legal Events

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