A method for configuring a next-hop routing table of a switch and related devices
By receiving ELP requests in Fibre Channel switches and automatically configuring the next-hop routing table using the switch name mapping table, the problem of cumbersomeness and high error rate of manually configuring routing information in a static network environment is solved, and intelligence and convenience are achieved The routing configuration improves network management efficiency and accuracy.
Patent Information
- Application Number
- CN202411095030.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-08-09
AI Technical Summary
In the static networking environment of Fibre Channel switches, administrators need to manually configure the next hop routing information, resulting in large configuration workloads and prone to misconfiguration or misconfiguration, especially in the case of large network scale.
When the target switch receives an ELP request sent by a non-target switch, check the legality of the request, and find the domain identification code corresponding to the switch name from the pre-built switch name mapping table, replace and set a valid ID, so as to automatically obtain the One-hop routing table to reduce user configuration work and avoid misconfiguration and misconfiguration.
It realizes automatic acquisition of the next-hop domain controller address, improves configuration accuracy and reliability, simplifies the administrator's workflow, improves network diagnosis capabilities, and avoids errors during the configuration process.
Smart Images

Figure CN118631770B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of switch configuration, and in particular to a configuration method and related device for a next-hop routing table of a switch. Background Art
[0002] In a Fibre Channel Switch (FC), when a user needs to view the data interaction path from a device A to a destination device B, a common method is to use the TraceRoute command. Therefore, the switching device needs to support the TraceRoute function.
[0003] FC switching network supports two modes: dynamic networking and static networking. In FC dynamic networking environment, switches support Fabric Shortest Path First (FSPF) protocol. Adjacent switches in FC switching network directly obtain each other's domain controller address through FSPF protocol interaction, thereby realizing TraceRoute function.
[0004] In a FC static networking environment, since the switch does not support the FSPF protocol, adjacent switches cannot directly obtain each other's domain controller address through FC protocol interaction. If the TraceRoute function is required, users need to manually configure additional domain identification codes (Domain Identifie, DID) and other next-hop routing information. It is a lot of work for administrators to manually configure next-hop routing information and it is easy to make mistakes. Especially when the network scale is large, the number of next-hop routes that need to be configured will be very large, which is prone to omission or misconfiguration.
[0005] Therefore, how to avoid missing or misconfiguration of next-hop routing information during the configuration process is a technical problem that those skilled in the art need to solve urgently. Summary of the invention
[0006] Based on the above problems, the present application provides a method and related device for configuring the next-hop routing table of a switch, which can avoid omission and misconfiguration of next-hop routing information during the configuration process.
[0007] The embodiments of the present application disclose the following technical solutions:
[0008] A method for configuring a next-hop routing table of a switch, the method comprising:
[0009] When the target switch receives the exchange link parameter ELP request sent by the non-target switch, the legitimacy of the ELP request is checked; the target switch and the non-target switch belong to the same Fibre Channel static networking environment;
[0010] When the ELP request is legal, the switch name in the initialization routing table of the target switch is replaced with the requesting party switch name field in the ELP request to obtain a first target routing table;
[0011] Searching the domain identification code corresponding to the switch name in the first target routing table from the pre-built switch name mapping table as the first target identifier;
[0012] The domain identification code in the first target routing table is replaced with the first target identifier, and the valid identifier in the first target routing table is set to be valid, so as to obtain the next hop routing table of the target switch.
[0013] In a possible implementation, the method for obtaining the initialization routing table includes:
[0014] Selecting N target switch ports from the target switch, and configuring the target switch ports as extended ports; N is a positive integer;
[0015] Initialize the next hop routing table of the extended port to obtain an initialized routing table.
[0016] In a possible implementation, the next-hop routing table includes an interface index, a valid identifier, a domain identification code, and a switch name;
[0017] Initializing the next hop routing table of the extended port to obtain an initialized routing table includes:
[0018] Setting the valid flag of the next hop routing table of the extended port to invalid;
[0019] Setting the domain identification code of the next hop routing table of the extended port to 0;
[0020] The switch name of the next hop routing table of the extended port is set to 0.
[0021] In a possible implementation, the process of constructing the pre-constructed switch name mapping table includes:
[0022] Configure domain identification codes for all switches in a Fibre Channel static networking environment; establish a mapping relationship between the domain identification code of each switch and its switch name;
[0023] The mapping relationships between the domain identification codes of all switches and their switch names are combined into a switch name mapping table.
[0024] In a possible implementation, the method further includes:
[0025] When the ELP request is legitimate, the switch name in the initialization routing table of the target switch is replaced with the switch name field of the non-target switch to obtain a second target routing table;
[0026] Searching the domain identification code corresponding to the switch name in the second target routing table from the pre-built switch name mapping table as the second target identifier;
[0027] The domain identification code in the second target routing table is replaced with the second target identifier, and the valid identifier in the second target routing table is set to valid, so as to obtain the next hop routing table of the target switch.
[0028] In a possible implementation, the method further includes:
[0029] If the domain identifier corresponding to the switch name in the target routing table is not found in the pre-built switch name mapping table, the switch name in the target routing table is updated until the domain identifier corresponding to the switch name in the target routing table can be found in the switch name mapping table.
[0030] In a possible implementation, the method further includes:
[0031] When the ELP request is illegal, the target switch is controlled to send a message rejecting the request to the non-target switch.
[0032] A device for configuring a next-hop routing table of a switch, the device comprising:
[0033] A first query unit, when the target switch receives the ELP request sent by the non-target switch, is used to check the legitimacy of the ELP request; the target switch and the non-target switch belong to the same Fibre Channel static networking environment;
[0034] A first replacement unit, when the ELP request is legal, is used to replace the switch name in the initialization routing table of the target switch with the requesting party switch name field in the ELP request to obtain a first target routing table;
[0035] A second query unit, configured to search a pre-built switch name mapping table for a domain identification code corresponding to the switch name in the first target routing table as a first target identifier;
[0036] The second replacement unit is used to replace the domain identification code in the first target routing table with the first target identifier, set the valid identifier in the first target routing table to valid, and obtain the next hop routing table of the target switch.
[0037] A configuration system for a next-hop routing table of a switch comprises a plurality of switches, each of which is used as a target switch to execute the configuration method for the next-hop routing table of the switch as described above.
[0038] A computer-readable storage medium stores instructions, and when the instructions are executed on a switch, the switch executes the method for configuring the next-hop routing table of the switch as described above.
[0039] Compared with the prior art, this application has the following beneficial effects:
[0040] The present application provides a configuration method and related device for the next-hop routing table of a switch. Specifically, when executing the attack behavior detection method provided in the embodiment of the present application, first query whether the target switch has received the exchange link parameter ELP request sent by the non-target switch in the same fiber channel static networking environment, and check the legitimacy of the ELP request when the target switch receives the exchange link parameter ELP request sent by the non-target switch. When the ELP request is legal, replace the switch name in the initialization routing table of the target switch with the requester switch name field in the ELP request to obtain the first target routing table. Then, find the domain identification code corresponding to the switch name in the first target routing table from the pre-built switch name mapping table as the first target identifier. Then replace the domain identification code in the first target routing table with the first target identifier, and set the valid identifier in the first target routing table to valid, so as to obtain the next-hop routing table of the target switch. The present application provides a method for automatically obtaining the address of the next-hop domain controller of a port to reduce the user's additional next-hop routing configuration work, thereby achieving the purpose of supporting the TraceRoute function. At the same time, it avoids the omission and mismatching that may occur in the configuration process of the next-hop routing information, and improves the accuracy and reliability of the configuration. Compared with the traditional static routing configuration method, this method is more intelligent and convenient, can greatly improve the administrator's work efficiency and network diagnostic capabilities, and can effectively avoid errors that are easy to occur during the configuration process. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in this embodiment or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0042] Figure 1A method flow chart of a method for configuring a next-hop routing table of a switch provided in an embodiment of the present application;
[0043] Figure 2 A method flow chart of a method for constructing a switch name mapping table provided in an embodiment of the present application;
[0044] Figure 3 A method flow chart of another method for configuring a next-hop routing table of a switch provided in an embodiment of the present application;
[0045] Figure 4 A schematic diagram of the structure of a device for configuring a next-hop routing table of a switch provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] To facilitate understanding of the technical solutions provided by the embodiments of the present application, the background technology involved in the embodiments of the present application will be described below.
[0047] TraceRoute is a tool for diagnosing problems and testing network connectivity in computer networks. It determines the routers and switches that a data packet passes through from the source device to the destination device by sending a data packet to the destination device and examining the path of the return data packet.
[0048] In the FC network environment, the user initiates a Fabric TraceRoute Request (FTR request) from end A, and exchanges the full name of the Switch Trace Route Response (STR message) between the switching devices on the routing path, receives the STR message returned by the destination device B, and finally parses the switching device information on the path from the returned STR message to implement TraceRoute (refer to the Fibre Channel Generic Services (FC-GS) protocol). During the STR message exchange process, the switching device that receives the STR message is required to send the message to the Fibre Channel Protocol Level 4 (FC-4 layer) to fill in the path information, and specify the DID as the next-hop device domain controller address in the FC frame header, otherwise the next-hop device cannot send the STR message to the FC-4 layer to fill in the path information, resulting in the failure of the TraceRoute function.
[0049] In FC, if the user needs to view the data interaction path between a device A and a destination device B, the TraceRoute command can be used, and the switching device needs to support this function. In the FC dynamic networking environment, the switch supports the FSPF protocol. Through the FSPF protocol, adjacent switches interact to obtain each other's domain controller address, thereby realizing the TraceRoute function. In the FC static networking environment, since the switch does not support the FSPF protocol, the administrator needs to manually configure the next-hop routing information, such as DID, which is a large workload and prone to errors, especially when the network scale is large, it is easy to miss or misconfiguration.
[0050] In order to solve this problem, an embodiment of the present application provides a method and related device for configuring the next-hop routing table of a switch. When the target switch receives an ELP request sent by a non-target switch, the legality of the ELP request is checked. If the ELP request is legal, the switch name in the initialization routing table of the target switch is replaced with the requesting switch name field in the ELP request to obtain the first target routing table. The domain identification code corresponding to the switch name in the first target routing table is searched from the switch name mapping table as the target identifier, and the domain identification code in the first target routing table is replaced with the target identifier, and the valid identifier in the first target routing table is set to valid, thereby obtaining the next-hop routing table of the target switch. The present application can avoid omission and mismatching of next-hop routing information during the configuration process.
[0051] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0052] See also Figure 1 , which is a flow chart of a method for configuring a next-hop routing table of a switch provided in an embodiment of the present application, such as Figure 1 As shown, the configuration method of the next-hop routing table of the switch may include steps S101-S104:
[0053] S101: When a target switch receives an exchange link parameter ELP request sent by a non-target switch, the target switch checks the legitimacy of the ELP request.
[0054] In the same Fibre Channel static networking environment, when the target switch (i.e., the receiving switch) receives an Exchange Link Parameters (ELP) request from a non-target switch (i.e., the sending switch), the target switch needs to perform two queries:
[0055] Check the legitimacy of the ELP request: The target switch checks whether the format and content of the ELP request comply with regulations to ensure that the request is valid.
[0056] It should be noted that the ELP request is a protocol used to initialize a link in a Fibre Channel network. In a Fibre Channel network, each switch needs to understand the connection relationship and communication parameters with other switches so that data forwarding and network communication can be performed correctly. ELP requests are usually sent by one switch to another to request link parameter information, such as port status, rate, and transmission distance.
[0057] It should be noted that ELP requests are only applicable to Fibre Channel networks. Different types of networks may use different protocols or mechanisms for link initialization and routing table updates.
[0058] Optionally, the target switch can be any switch in the Fibre Channel static networking environment. As long as the switch receives the ELP request from other switches, the switch can be used as the target switch. The non-target switch can also be any switch in the Fibre Channel static networking environment. As long as the switch sends an ELP request to other switches, the switch can be used as a non-target switch. For example, assuming that there are four switches A, B, C, and D in the Fibre Channel static networking environment, and at the current moment, switch A receives the ELP request from switch B, then A is used as the target switch and B is used as the non-target switch. The next moment is when switch B receives the ELP request from switch A, then B is used as the target switch and A is used as the non-target switch.
[0059] S102: When the ELP request is legal, the switch name in the initialization routing table of the target switch is replaced with the requesting party switch name field in the ELP request to obtain a first target routing table.
[0060] When the ELP request is legitimate, in order to obtain the next-hop routing table of the target switch, the switch name in the initialization routing table of the target switch can be replaced with the requesting switch name field in the ELP request.
[0061] In a Fibre Channel static networking environment, ELP requests are used to negotiate switching link parameters. The ELP request includes multiple fields, one of which is the requesting switch name field, which is used to identify the name of the switch that sends the ELP request. This field usually contains the switch's globally unique identifier (World Wide Name, WWN), which is unique and identifying and can be used for identification, communication, and routing calculations between switches. When obtaining the next-hop routing table of the target switch, it is necessary to extract the requesting switch name field from the ELP request and replace it with the switch name of the port to which it belongs in the target switch's initialization routing table. Doing so allows the target switch to use the requesting switch as its directly adjacent node, facilitating routing calculations and determination of the next-hop address.
[0062] In a possible implementation, the initialization routing table can be obtained by:
[0063] First, select N target switch ports from the target switch, configure all of the N target switch ports as extended ports, and then initialize the next-hop routing table of the extended port to obtain an initialized routing table. N is a positive integer. It should be noted that the target switch port is a port in the target switch that can be configured as an extended port, but not all ports in the target switch that can be configured as an extended port are configured as extended ports. The specific number of selected target switch ports can be selected according to actual conditions.
[0064] The next-hop routing table includes an interface index (Interface Index, ifindex), a valid flag (ValidFlag, valid), a domain identifier (Domain Identifier, DID), and a switch name (Switch Name, SWN).
[0065] ifindex: represents the port index corresponding to the routing table entry, which is used to identify the unique identifier of the port and link. It is an integer value that is calculated and set when the device is initialized and does not change while the device is running. Each interface index is usually calculated based on the physical location and properties of the port to which it is connected, so as to enable fast matching and selection in routing calculation and data forwarding. In Fibre Channel networks, the interface index of a switch is usually used to describe the port number and map it to the WWN for routing calculation and packet forwarding. Therefore, the interface index is crucial to ensure the correct transmission and routing selection of data packets, and plays an important role in both network devices and protocols.
[0066] valid: an identifier indicating whether the routing table entry is valid. If the valid value is false, it means that the routing table entry is invalid; if the valid value is true, it means that the routing table entry is valid. When initializing the next-hop routing table, the initial value of the valid field of all routing table entries is false, indicating that these routing information is not yet valid. Only after the configuration is completed will it be marked as valid.
[0067] domain_id: indicates the domain identification code DID of the next-hop device corresponding to the routing table entry, which is used to identify the destination domain of the data packet. In the FC network, each device needs to be configured with a unique DID to identify the domain to which it belongs so that other devices can send data packets to it.
[0068] SWN: Indicates the Switch Name of the next-hop device corresponding to the routing table entry, which is used to identify the address of the next-hop device of the data packet. In the FC network, each switch has a unique Switch Name to identify its position in the FC network. When a data packet needs to be forwarded to the next-hop device, the SWN of the corresponding device is needed to determine the forwarding direction of the data packet.
[0069] Specifically, initializing the next hop routing table of the extended port can be achieved by the following steps:
[0070] The valid identifier of the next hop routing table of the extended port is set to invalid, and the domain identification code and the switch name of the next hop routing table of the extended port are both set to 0.
[0071] S103: Searching for a domain identification code corresponding to the switch name in the first target routing table from a pre-built switch name mapping table as a first target identifier.
[0072] After the first target routing table is obtained, the domain identification code corresponding to the switch name in the first target routing table is searched from the pre-built switch name mapping table as the first target identifier.
[0073] This step is to obtain network topology information. In a Fibre Channel static networking environment, the connection and layout relationship between switches is very important because this information can be used to calculate the best path and next-hop routing. The switch name mapping table is a table that stores the mapping relationship between switch names and domain identifiers. The information in it can be used to determine the node to which each switch belongs and its corresponding domain identifier. Therefore, when obtaining the next-hop routing table of the target switch, it is necessary to extract the switch name from the first target routing table and look up its corresponding domain identifier (i.e., the first target identifier) in the switch name mapping table. In this way, the previous-hop switch information of the target switch can be obtained, and the entire network topology and routing calculation scheme can be further determined.
[0074] See also Figure 2 , Figure 2 A method flow chart of a method for constructing a switch name mapping table provided in an embodiment of the present application. Accordingly, the construction process of the pre-constructed switch name mapping table can be implemented through steps A1-A3:
[0075] A1: Configure domain identification codes for all switches in a Fibre Channel static networking environment.
[0076] In a Fibre Channel static networking environment, each switch needs to be configured with a unique domain identifier. This is because there may be multiple independent storage area networks (SANs) in a Fibre Channel network, and each SAN needs to have a unique identifier that is separate from other networks. At the same time, the switch also needs to communicate the network domain identifier to which it belongs with other switches to facilitate routing calculation and data forwarding. Therefore, when configuring a switch, you need to assign it a unique domain identifier and associate it with the domain identifiers of other switches.
[0077] A2: Build a mapping relationship between the domain identification code of each switch and its switch name.
[0078] In order to facilitate communication and route calculation between switches, it is necessary to establish a mapping relationship between the domain identifier of each switch and its switch name. In this way, when performing route calculation, the corresponding domain identifier can be quickly found by the switch name, and the best path and next-hop route can be further determined. In addition, this mapping relationship also helps in identification, management and troubleshooting between switches.
[0079] A3: The mapping relationships between the domain identification codes of all switches and their switch names are combined into a switch name mapping table.
[0080] The mapping relationship between the domain identification codes of all switches and their switch names is formed into a switch name mapping table to facilitate routing calculation and data forwarding. This table contains the names and domain identification code information of all switches and can be used for communication and routing calculation between switches. When obtaining the next-hop routing table of the target switch, it is necessary to find the domain identification code corresponding to the switch name from the mapping table and use this information to calculate the best path and next-hop address.
[0081] S104: Replace the domain identification code in the first target routing table with the first target identifier, set the valid identifier in the first target routing table to valid, and obtain the next hop routing table of the target switch.
[0082] The domain identification code in the first target routing table is replaced with the first target identifier, and the valid identifier in the first target routing table is set to valid, so that the next-hop routing table of the target switch can be obtained. In a Fibre Channel static networking environment, when using a routing protocol for data forwarding and path selection, switches need to communicate and negotiate with each other in order to correctly calculate the best path and next-hop routing. Moreover, when performing routing calculations, it is also necessary to consider information such as the network topology and the domain identification code in order to achieve interconnection and communication between switches. Therefore, when obtaining the next-hop routing table of the target switch, it needs to be processed. The specific steps are as follows:
[0083] (1) Replace the domain identifier in the first target routing table with the first target identifier:
[0084] The first target routing table stores the routing information of all switches from the source switch to the target switch. Since each switch has a unique domain identifier and name, all domain identifiers in the routing table need to be replaced with corresponding target identifiers to determine the node and path information to which they belong.
[0085] (2) Set the valid flag in the first target routing table to valid:
[0086] The first target routing table stores the routing information of all switches from the source switch to the target switch. Because some switches may not work properly due to abnormal conditions or failures, the valid flag in the routing table needs to be set to valid to filter out available paths and jump information.
[0087] After processing according to the above two steps, the next-hop routing table of the target switch can be obtained, which contains information such as the shortest path from the source switch to the target switch and the next-hop address, which can be used for data packet forwarding and routing selection.
[0088] See also Figure 4, Figure 3 A method flow chart of another method for configuring a next-hop routing table of a switch provided in an embodiment of the present application can be implemented specifically through steps B1-B3:
[0089] B1: When the ELP request is legal, the switch name in the initialization routing table of the target switch is replaced with the switch name field of the non-target switch to obtain a second target routing table.
[0090] In a Fibre Channel network, the best path and next-hop routing can be selected as needed by modifying the next-hop routing table of the switch. In another configuration method of the next-hop routing table of a switch provided in an embodiment of the present application, it can also be implemented by replacing the switch name in the initialization routing table of the target switch with the name field of the non-target switch. That is, when the ELP request is legal, the switch name in the initialization routing table of the target switch can also be replaced with the name field of the non-target switch, thereby obtaining a second target routing table.
[0091] It should be noted that, because the target switch and the non-target switch are physically connected, the interface index can describe the port number of the non-target switch and map it to the WWN. Therefore, the WWN can be replaced with the switch name position in the initialization routing table of the target switch to obtain the second target routing table.
[0092] B2: Searching the pre-built switch name mapping table for the domain identification code corresponding to the switch name in the second target routing table as the second target identifier.
[0093] According to the topology of the Fibre Channel network, each switch has a unique domain identification code and name. In another method for configuring the next-hop routing table of a switch provided in an embodiment of the present application, it is necessary to first search the domain identification code corresponding to the switch name in the second target routing table from the pre-built switch name mapping table, so as to further determine the optimal path and the next-hop address.
[0094] B3: Replace the domain identification code in the second target routing table with the second target identifier, set the valid identifier in the second target routing table to valid, and obtain the next hop routing table of the target switch.
[0095] By replacing the domain identifier in the second target routing table with the second target identifier and setting the valid identifier to valid, the next hop routing table of the target switch can be obtained. This routing table contains information such as the shortest path from the source switch to the target switch and the next hop address, which can be used for data packet forwarding and routing selection.
[0096] In a possible implementation, the method further includes: if the domain identification code corresponding to the switch name in the first target routing table or the second target routing table is not found in the pre-constructed switch name mapping table, updating the switch name in the first target routing table or the second target routing table until the domain identification code corresponding to the switch name in the target routing table can be found in the switch name mapping table.
[0097] In the Fibre Channel static networking environment, the pre-built switch name mapping table plays an important role. It can associate the domain identification code of each switch with its switch name, which is convenient for unified management and identification. However, in actual use, due to changes in the network structure or other reasons, some switch information in the switch name mapping table may be missing or inaccurate, which will affect the correctness of routing calculation and data forwarding. Therefore, if the domain identification code corresponding to the switch name in the target routing table is not found in the pre-built switch name mapping table, the switch name in the target routing table is updated until the domain identification code corresponding to the switch name in the target routing table can be found from the switch name mapping table.
[0098] Specifically, step 1: search the domain identification code corresponding to the switch name in the target routing table from the pre-built switch name mapping table. First, search the corresponding domain identification code in the pre-built switch name mapping table according to the switch name in the target routing table. If it can be found, it means that the routing table can be used and directly proceed to the next step; otherwise, it is necessary to perform the subsequent steps.
[0099] Step 2: Update the switch name in the target routing table. If the domain identifier corresponding to the switch name in the target routing table is not found in the pre-built switch name mapping table, the switch name in the target routing table needs to be updated. Specifically, the switch name can be replaced continuously until the corresponding domain identifier can be found in the switch name mapping table. When updating the switch name, you can try to use the physical connection information between adjacent switches and other available information for matching and correction to improve the update success rate.
[0100] Step 3: Search and replace again. After updating the switch name in the target routing table, call the switch name mapping table again to find the corresponding domain ID and update it to the target routing table. If it still cannot be found, repeat step 2 until the switch name in the target routing table is successfully updated and the corresponding domain ID is found.
[0101] In a possible implementation, the method further includes:
[0102] When the ELP request is illegal, the target switch is controlled to send a message rejecting the request to the non-target switch.
[0103] In a possible implementation, the message rejecting the request may include, but is not limited to, the following information:
[0104] Request type: The message should indicate that it is a message to reject the request so that the non-target switch can process and respond correctly;
[0105] Request reason: The message should clearly state the reason why the ELP request cannot be processed, such as the target switch or non-target switch does not exist, does not belong to the same domain, the network topology has changed, etc.
[0106] Target address: The message should specify the target address of the rejection request, that is, the address information of the non-target switch;
[0107] Optional fields: Messages may contain some optional fields to provide more information or data support, such as additional error codes, timestamps, payload data, etc. These fields should be formulated and configured according to specific circumstances.
[0108] By sending a message of rejecting the request to the non-target switch, the non-target switch can be informed of the current network status and problems and take corresponding measures to handle and correct them. This helps to ensure the normal operation of the Fibre Channel network and the accuracy of data transmission.
[0109] Based on the contents of S101-S104, it can be known that first, the target switch is queried whether it has received the ELP request sent by the non-target switch, and the legality of the ELP request is checked. When the ELP request is legal, the switch name in the initialization routing table of the target switch is replaced with the requesting switch name field in the ELP request to obtain the first target routing table. Then, the domain identification code corresponding to the switch name in the first target routing table is searched from the pre-built switch name mapping table as the first target identifier. Finally, the domain identification code in the first target routing table is replaced with the first target identifier, and the valid identifier is set to valid, thereby obtaining the next hop routing table of the target switch. The present application provides a method for automatically obtaining the next hop domain controller address of a port to realize the TraceRoute function of the switch. The method can reduce the user's additional next hop routing configuration work, avoid missing and mismatching, improve the accuracy and reliability of the configuration, and greatly improve the administrator's work efficiency and network diagnostic capabilities. Compared with the traditional static routing configuration method, this method is more intelligent and convenient, can effectively optimize the switch configuration process and can effectively prevent errors, thereby improving the efficiency and accuracy of network management.
[0110] See also Figure 4 , Figure 4A schematic diagram of the structure of a device for configuring a next-hop routing table of a switch provided in an embodiment of the present application. Figure 4 As shown, the configuration device of the next hop routing table of the switch includes:
[0111] The first query unit 401 is used to check the legitimacy of the ELP request when the target switch receives the ELP request sent by the non-target switch; the target switch and the non-target switch belong to the same Fibre Channel static networking environment;
[0112] A first replacing unit 402, when the ELP request is legal, is used to replace the switch name in the initialization routing table of the target switch with the requesting party switch name field in the ELP request to obtain a first target routing table;
[0113] The second query unit 403 is used to search the domain identification code corresponding to the switch name in the first target routing table from the pre-built switch name mapping table as the first target identifier;
[0114] The second replacement unit 404 is configured to replace the domain identification code in the first target routing table with the first target identifier, set the valid identifier in the first target routing table to valid, and obtain the next hop routing table of the target switch.
[0115] In a possible implementation manner, the device further includes:
[0116] A configuration unit, configured to select N target switch ports from the target switch and configure the target switch ports as extended ports; N is a positive integer;
[0117] The initialization unit is used to initialize the next hop routing table of the extended port to obtain an initialized routing table.
[0118] In a possible implementation, the next-hop routing table includes an interface index, a valid identifier, a domain identification code, and a switch name.
[0119] In a possible implementation, the initialization unit specifically includes:
[0120] A valid flag setting unit, used to set the valid flag of the next hop routing table of the extended port to be invalid;
[0121] A first domain identification code setting unit, configured to set the domain identification code of the next hop routing table of the extended port to 0;
[0122] The switch name setting unit is used to set the switch name of the next hop routing table of the extended port to 0.
[0123] In a possible implementation manner, the device further includes:
[0124] A second domain identification code setting unit, used for configuring domain identification codes for all switches in a Fibre Channel static networking environment;
[0125] A mapping relationship building unit, used to build a mapping relationship between the domain identification code of each switch and its switch name;
[0126] The switch name mapping table construction unit is used to form a switch name mapping table by combining the mapping relationships between the domain identification codes of all switches and their switch names.
[0127] In a possible implementation manner, the device further includes:
[0128] A third replacement unit, when the ELP request is legal, is used to replace the switch name in the initialization routing table of the target switch with the switch name field of the non-target switch to obtain a second target routing table;
[0129] A third query unit, configured to search a pre-built switch name mapping table for a domain identification code corresponding to the switch name in the second target routing table as a second target identifier;
[0130] The fourth replacement unit is used to replace the domain identification code in the second target routing table with the second target identifier, set the valid identifier in the second target routing table to valid, and obtain the next hop routing table of the target switch.
[0131] In a possible implementation manner, the device further includes:
[0132] The updating unit is used to update the switch name in the target routing table until the domain identification code corresponding to the switch name in the target routing table can be found from the switch name mapping table if the domain identification code corresponding to the switch name in the target routing table is not found in the pre-built switch name mapping table.
[0133] In a possible implementation manner, the device further includes:
[0134] The control unit is used to control the target switch to send a message of rejecting the request to the non-target switch when the ELP request is illegal.
[0135] In addition, an embodiment of the present application also provides a switch next-hop routing table configuration system, the switch next-hop routing table configuration system includes multiple switches, each of the multiple switches is used as a target switch to execute the switch next-hop routing table configuration method as described above.
[0136] In addition, an embodiment of the present application further provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a switch, the switch executes the method for configuring the next-hop routing table of the switch as described above.
[0137] The embodiment of the present application provides a device for configuring the next-hop routing table of a switch. When the target switch receives an ELP request sent by a non-target switch, the first query unit 401 is used to check the legality of the ELP request, and the first replacement unit 402 is used to replace the switch name in the initialization routing table of the target switch with the requesting switch name field in the ELP request when the ELP request is legal to obtain the first target routing table. Then, the second query unit 403 is used to search the domain identification code corresponding to the switch name in the first target routing table from the pre-built switch name mapping table as the first target identifier, so that the second replacement unit 404 can replace the domain identification code in the first target routing table with the first target identifier, set the valid identifier in the first target routing table to valid, and obtain the next-hop routing table of the target switch. The present application can avoid the omission and mismatch of the next-hop routing information during the configuration process.
[0138] The above is a detailed introduction to a configuration method for a next-hop routing table of a switch and related devices provided by the present application. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can refer to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can refer to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
[0139] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
Claims
1. A method for configuring a next-hop routing table of a switch, characterized in that: The method comprises: When the target switch receives the exchange link parameter ELP request sent by the non-target switch, the legitimacy of the ELP request is checked; the target switch and the non-target switch belong to the same Fibre Channel static networking environment; When the ELP request is legal, the switch name in the initialization routing table of the target switch is replaced with the requesting party switch name field in the ELP request to obtain a first target routing table; Searching the domain identification code corresponding to the switch name in the first target routing table from the pre-built switch name mapping table as the first target identifier; The domain identification code in the first target routing table is replaced with the first target identifier, and the valid identifier in the first target routing table is set to valid, so as to obtain the next hop routing table of the target switch.
2. The method according to claim 1, characterized in that The method for obtaining the initialization routing table includes: Selecting N target switch ports from the target switch, and configuring the target switch ports as extended ports; N is a positive integer; Initialize the next hop routing table of the extended port to obtain an initialized routing table.
3. The method according to claim 2, characterized in that The next hop routing table includes an interface index, a valid identifier, a domain identification code, and a switch name; Initializing the next hop routing table of the extended port to obtain an initialized routing table includes: Setting the valid flag of the next hop routing table of the extended port to invalid; Setting the domain identification code of the next hop routing table of the extended port to 0; The switch name of the next hop routing table of the extended port is set to 0.
4. The method according to claim 1, characterized in that: The construction process of the pre-built switch name mapping table includes: Configure domain identification codes for all switches in a Fibre Channel static networking environment; Constructing a mapping relationship between the domain identification code of each switch and its switch name; The mapping relationships between the domain identification codes of all switches and their switch names are combined into a switch name mapping table.
5. The method according to claim 1, characterized in that The method further comprises: When the ELP request is legitimate, the switch name in the initialization routing table of the target switch is replaced with the switch name field of the non-target switch to obtain a second target routing table; Searching the domain identification code corresponding to the switch name in the second target routing table from the pre-built switch name mapping table as the second target identifier; The domain identification code in the second target routing table is replaced with the second target identifier, and the valid identifier in the second target routing table is set to valid, so as to obtain the next hop routing table of the target switch.
6. The method according to claim 1, characterized in that The method further comprises: If the domain identifier corresponding to the switch name in the target routing table is not found in the pre-built switch name mapping table, the switch name in the target routing table is updated until the domain identifier corresponding to the switch name in the target routing table can be found in the switch name mapping table.
7. The method according to claim 1, characterized in that The method further comprises: When the ELP request is illegal, the target switch is controlled to send a message rejecting the request to the non-target switch.
8. A device for configuring a next-hop routing table of a switch, characterized in that: The device comprises: A first query unit, when the target switch receives the ELP request sent by the non-target switch, is used to check the legitimacy of the ELP request; the target switch and the non-target switch belong to the same Fibre Channel static networking environment; A first replacement unit, when the ELP request is legal, is used to replace the switch name in the initialization routing table of the target switch with the requesting party switch name field in the ELP request to obtain a first target routing table; A second query unit, configured to search a pre-built switch name mapping table for a domain identification code corresponding to the switch name in the first target routing table as a first target identifier; The second replacement unit is used to replace the domain identification code in the first target routing table with the first target identifier, set the valid identifier in the first target routing table to valid, and obtain the next hop routing table of the target switch.
9. A configuration system for a next-hop routing table of a switch, characterized in that: The switch next-hop routing table configuration system includes multiple switches, and each of the multiple switches is used as a target switch to execute the switch next-hop routing table configuration method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on the switch, the switch executes the method for configuring the next-hop routing table of the switch according to any one of claims 1 to 7.
