Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 illustrates an exemplary system architecture 100 to which a method for processing information or an apparatus for processing information of embodiments of the present application may be applied.
As shown in fig. 1, system architecture 100 may include a data transceiving device 101, a port management device 102, a network 103, and route distribution devices 104, 105. Network 103 is used to provide a medium for communication links between data management device 102 and route distribution devices 104, 105. Network 103 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The data-transceiving equipment 101 may be equipment that performs data transceiving based on the received routing information, such as a data exchange chip. The port management device 102 may be a device, such as a switch, that has information to monitor ports and handle port failures, etc. It should be noted that the data transceiver 101 may be located in another device outside the port management device 102, or may be located in the port management device 102.
The route distribution devices 104, 105 may be devices that perform route distribution based on various routing protocols, such as routers, route distribution servers, and the like. Route distribution device 104 may analyze the received network port failure information, and feed back the processing result (e.g., the redistributed route information) to port management device 102.
It should be noted that the method for processing information provided in the embodiment of the present application is generally executed by the port management device 102, and accordingly, the apparatus for processing information is generally disposed in the port management device 102.
It should be understood that the number of data transceiving devices, port management devices, networks and route distribution devices in fig. 1 is merely illustrative. There may be any number of data transceiving devices, port management devices, network and route distribution devices, as desired for implementation. The system architecture 100 described above may not include the route distribution devices 104, 105 when the port management device has a distribution routing function.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for processing information in accordance with the present application is shown. The method for processing information comprises the following steps:
step 201, in response to determining that the target network port is failed, determining initial output port information including the port number of the target network port from a pre-established initial output port information set as failed output port information.
In this embodiment, an electronic device (e.g., the port management device shown in fig. 1) on which the method for processing information operates may first determine whether a target network port has failed. The target network port may be one or more network ports provided in the electronic device. Then, in response to determining that the target network port is faulty, the electronic device determines, from a set of initial output port information established in advance, initial output port information including a port number of the target network port as faulty output port information. The initial output port information may include a port number and a next hop address of data forwarded by a network port corresponding to the port number.
In general, a network port may be a physical port, such as a hub, a switch, a router, or other interface for connecting other network devices; the port may be a logical port, and generally refers to a port in a TCP/IP (Transmission Control Protocol/Internet Protocol ) Protocol, for example, 80 ports for browsing a web service, 21 ports for an FTP (File Transfer Protocol) service, and the like. In this embodiment, the target network port may be a physical port or a logical port. In practice, when the target network port fails, the electronic device may determine the port number of the target network port. For example, when a target network port fails, a failure signal may be generated, and after the electronic device acquires the failure signal, the electronic device determines the port number of the network port corresponding to the failure information.
In this embodiment, output (Egress) port information may be used to indicate a next hop address of data forwarded by a network port. For example, the output port information may be: "001, 44-45-53-54-00-00", where 001 is a port number of a network port, and 44-45-53-54-00-00 is a MAC (Media Access Control) address of a device of a next hop of data. In practice, since different routes may pass through the same network port, the set of initial port information may include at least one initial port information including the port number of the destination network, and each of the at least one initial port information including the port number of the destination network includes a different next hop address.
In some optional implementations of this embodiment, the initial output port information may be output port information applicable to a preset ECMP (Equal-Cost multi path Routing) group. The ECMP group is a plurality of paths with the same cost value and reaching the same destination address. It can realize the load balance of the network, and when some paths have faults, other paths replace the paths to complete the forwarding processing, and the route redundancy backup function is realized. Each ECMP path in the ECMP group includes a plurality of network ports, each of which corresponds to an output port information, and a set of the plurality of output port information forms an output port information set applicable to the ECMP group. ECMP groups are applied to routes between switches, for example in individual switches of the access stratum of a data center.
Step 202, selecting initial output port information except for the failed output port information from the initial output port information set as non-failed output port information, and obtaining a non-failed output port information set for pushing.
In this embodiment, based on the information of the faulty output port determined in step 201, the electronic device may first select initial output port information other than the information of the faulty output port from the initial output port information set as information of a non-faulty output port, and obtain a non-faulty output port information set. Then, the electronic device can push out the information set of the fault-free output port.
Generally, the electronic device may push a set of fault-free output port information into the data transceiving device as shown in fig. 1. The data transceiver can forward data according to the received information of the fault-free output port. When a network port fails, the data transceiver shown in fig. 1 may continue to forward data according to the received information of the non-failed output port, so as to save the time taken by waiting for redistribution of the route due to the failure of the network port.
Step 203, in response to receiving the output port information set, determines whether the received output port information set and the non-faulty output port information set are equal.
In this embodiment, the electronic device may determine, in response to receiving the set of output port information, whether the received set of output port information and the set of non-faulty output port information are equal. The received output port information may be output port information obtained by performing route allocation calculation based on a preset route allocation protocol by the route allocation device shown in fig. 1.
In some optional implementations of this embodiment, the received output port information may be output port information applicable to an ECMP group. The output port information applicable to the ECMP group may be output port information obtained by performing equivalent routing calculation by the routing distribution device based on a preset routing protocol (for example, an Open Shortest Path First (OSPF) protocol) as shown in fig. 1. It should be noted that the algorithm used for calculating the equivalent route is a well-known technology widely studied and applied at present, and is not described herein again.
Step 204, in response to determining that the received set of output port information is not equal to the set of non-faulty output port information, pushing the received set of output port information.
In this embodiment, based on the output port information set received in step 203, the electronic device may push the received output port information set out in response to determining that the received output port information set is not equal to the failure-free output port information set.
Generally, the electronic device may push a set of fault-free output port information into the data transceiving device as shown in fig. 1. The data transceiver device may update the fault-free output port information set used for currently performing data forwarding to the output port information set pushed by the electronic device, so as to perform data forwarding according to the output port information set pushed by the electronic device.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the method for processing information according to the present embodiment. In the application scenario of fig. 3, the port management device 301 stores an initial output port information set 303, where the initial output port information includes a port number and a MAC address of a next hop device of data, and in response to determining that a target network port (for example, a network port corresponding to the port number 003) fails, the port management device 301 deletes initial output port information corresponding to the port number 003 from the initial output port information set, so as to obtain a failure-free output port information set 304. The port management device 301 then pushes the set of non-faulty output port information 304 to the data switch chip 302. Next, the port management apparatus 301 receives the output port information set 305, and determines whether the received output port information set 305 and the failure-free output port information set 304 are equal. Finally, the port management device 301 determines that the received output port information set 305 is not equal to the non-failed output port information set 304, and pushes the received output port information set 305 to the data switch chip 302.
In the method provided by the above embodiment of the present application, initial output port information other than the initial output port information corresponding to the failed target network port is used as fault-free output port information from the initial output port information set, then each fault-free output port information is pushed, then it is determined whether the received output port information set is equal to the fault-free output port information set, and if not, the received output port information set is pushed out, thereby improving the efficiency of data forwarding.
With further reference to FIG. 4, a flow 400 of yet another embodiment of a method for processing information is shown. The flow 400 of the method for processing information includes the steps of:
step 401, obtaining port state information of a target network port.
In this embodiment, an electronic device (e.g., the port management device shown in fig. 1) on which the method for processing information operates may acquire port state information of a target network port. The port status information may characterize the status of the target network port as non-faulty or faulty.
Step 402, in response to determining that the port state information indicates that the target network port is in a closed state, determining that the target network port has a failure.
In this embodiment, the electronic device may determine that the target network port fails when the state information indicates that the target network port is in the closed state. The port state information may characterize the target network port as an open (UP) state when the target network port is transmitting and receiving data normally, and may characterize the target network port as a closed (DOWN) state when the target network port is failed (e.g., data loss or line connection interruption).
In response to determining that the target network port is failed, initial output port information including the port number of the target network port is determined as failed output port information from the pre-established initial output port information set in step 403.
In this embodiment, step 403 is substantially the same as step 201 in the corresponding embodiment of fig. 2, and is not described herein again.
Step 404, selecting initial output port information except the failed output port information from the initial output port information set as non-failed output port information, and obtaining a non-failed output port information set for pushing.
In this embodiment, step 404 is substantially the same as step 202 in the corresponding embodiment of fig. 2, and is not described herein again.
Step 405, pushing port failure information used for representing the failure of the target network port.
In this embodiment, the electronic device may push port failure information for indicating that a target network port has a failure. The port failure information may include a port number of the target network port. For example, the port failure information may be "port failure, port number: 003". In practice, the port failure information may be sent to the data transceiver device shown in fig. 1, and the data transceiver device receives the port failure information and performs routing allocation calculation based on a preset routing protocol again to obtain a new output port information set.
Step 406, in response to receiving the set of output port information, determines whether the received set of output port information and the set of non-faulty output port information are equal.
In this embodiment, step 406 is substantially the same as step 203 in the corresponding embodiment of fig. 2, and is not described herein again.
Step 407, in response to determining that the received set of output port information is not equal to the set of non-faulty output port information, pushes the received set of output port information.
In this embodiment, step 407 is substantially the same as step 204 in the corresponding embodiment of fig. 2, and is not described herein again.
As can be seen from fig. 4, compared with the corresponding embodiment of fig. 2, the flow 400 of the method for processing information in the present embodiment highlights the step of determining whether the target network port is failed through the port status information, and the step of generating the port failure information. Therefore, the steps of fault processing are more detailed, and the efficiency of data forwarding is further improved.
With further reference to fig. 5, as an implementation of the methods shown in the above-mentioned figures, the present application provides an embodiment of an apparatus for processing information, which corresponds to the method embodiment shown in fig. 2, and which is particularly applicable in various electronic devices.
As shown in fig. 5, the apparatus 500 for processing information of the present embodiment includes: a first determining unit 501, configured to determine, in response to determining that a target network port fails, initial output port information including a port number of the target network port from a pre-established initial output port information set as failed output port information, where the initial output port information includes the port number and a next hop address of data forwarded by the network port corresponding to the port number; a selecting unit 502 configured to select initial output port information other than the failed output port information from the initial output port information set as non-failed output port information, and obtain a non-failed output port information set for pushing; a receiving unit 503 configured to determine, in response to receiving the set of output port information, whether the received set of output port information and the set of non-faulty output port information are equal; a first pushing unit 504 configured to push the received set of output port information in response to determining that the received set of output port information is not equal to the set of non-failed output port information.
In this embodiment, the first determination unit 501 of the apparatus for processing information 500 may first determine whether the target network port fails. The target network port may be one or more network ports provided in the electronic device. Then, the first determination unit 501 determines initial output port information including the port number of the target network port as failed output port information from the set of initial output port information established in advance in response to the determination that the target network port is failed. The initial output port information may include a port number and a next hop address of data forwarded by a network port corresponding to the port number. The Egress (Egress) port information may be used to indicate the next hop address of data forwarded by the network port. For example, the output port information may be: "001, 44-45-53-54-00-00", where 001 is a port number of a network port, and 44-45-53-54-00-00 is a MAC (Media Access Control) address of a device of a next hop of data. When the target network port fails, the electronic device may determine a port number of the target network port. For example, when a target network port fails, a failure signal may be generated, and after the electronic device acquires the failure signal, the electronic device determines the port number of the network port corresponding to the failure information.
In this embodiment, based on the faulty output port information determined by the first determination unit 501, the selection unit 502 may first select initial output port information other than the faulty output port information from the initial output port information set as non-faulty output port information, resulting in a non-faulty output port information set. The selection unit 502 may then push out the set of non-faulty output port information. Generally, the electronic device may push a set of fault-free output port information into the data transceiving device as shown in fig. 1. The data transceiver can forward data according to the received information of the fault-free output port.
In this embodiment, the receiving unit 503 may determine whether the received output port information set and the failure-free output port information set are equal in response to receiving the output port information set. The received output port information may be output port information obtained by performing route allocation calculation based on a preset route allocation protocol by the route allocation device shown in fig. 1.
In this embodiment, based on the output port information set received by the receiving unit 503, the first pushing unit 504 may push the received output port information set out in response to determining that the received output port information set is not equal to the failure-free output port information set. Generally, the electronic device may push a set of fault-free output port information into the data transceiving device as shown in fig. 1. The data transceiver device may update the fault-free output port information set used for currently performing data forwarding to the output port information set pushed by the electronic device, so as to perform data forwarding according to the output port information set pushed by the electronic device.
In some optional implementations of this embodiment, the apparatus 500 for processing information may further include: and a second pushing unit (not shown in the figure) configured to push port failure information used for characterizing that the target network port fails, where the port failure information includes a port number of the target network port. For example, the port failure information may be "port failure, port number: 003".
In some optional implementations of this embodiment, the initial output port information is output port information applicable to a preset equal-cost routing ECMP group. The ECMP group is a plurality of paths with the same cost value and reaching the same destination address. It can realize the load balance of the network, and when some paths have faults, other paths replace the paths to complete the forwarding processing, and the route redundancy backup function is realized.
In some optional implementations of this embodiment, the received output port information is output port information applicable to an ECMP group. The output port information applicable to the ECMP group may be output port information obtained by performing equivalent routing calculation based on a preset routing protocol by the routing distribution device shown in fig. 1.
In some optional implementations of this embodiment, the apparatus 500 for processing information may further include: an obtaining unit (not shown in the figure) configured to obtain port status information of a target network port; and a second determining unit (not shown in the figure) configured to determine that the target network port fails in response to determining that the port state information indicates that the target network port is in a closed state. The port state information may characterize the target network port as an open (UP) state when the target network port is transmitting and receiving data normally, and may characterize the target network port as a closed (DOWN) state when the target network port is failed (e.g., data loss or line connection interruption).
In the apparatus provided in the foregoing embodiment of the present application, initial output port information other than the initial output port information corresponding to the failed target network port is used as fault-free output port information from the initial output port information set, then each fault-free output port information is pushed, then it is determined whether the received output port information set is equal to the fault-free output port information set, and if not, the received output port information set is pushed out, thereby improving the efficiency of data forwarding.
Referring now to FIG. 6, shown is a block diagram of a computer system 600 suitable for use in implementing a network device of an embodiment of the present application. The network device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: a storage portion 606 including a hard disk and the like; and a communication section 607 including a network interface card such as a LAN card, a modem, or the like. The communication section 607 performs communication processing via a network such as the internet. Drivers 608 are also connected to the I/O interface 605 as needed. A removable medium 609 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 608 as necessary, so that a computer program read out therefrom is mounted into the storage section 606 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 607 and/or installed from the removable medium 609. The computer program performs the above-described functions defined in the method of the present application when executed by a Central Processing Unit (CPU) 601. It should be noted that the computer readable medium described herein can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a first determining unit, a selecting unit, a receiving unit, and a first pushing unit. Where the names of these units do not in some cases constitute a limitation of the unit itself, for example, a receiving unit may also be described as a "unit that determines whether a received set of output port information and the set of non-faulty output port information are equal in response to receiving a set of output port information".
As another aspect, the present application also provides a computer-readable medium, which may be included in the network device described in the above embodiments; or may exist separately without being assembled into the network device. The computer readable medium carries one or more programs which, when executed by the network device, cause the network device to: in response to determining that the target network port is faulty, determining initial output port information including a port number of the target network port as faulty output port information from a pre-established initial output port information set; selecting initial output port information except fault output port information from the initial output port information set as fault-free output port information to obtain a fault-free output port information set for pushing; in response to receiving the set of output port information, determining whether the received set of output port information and the set of non-faulty output port information are equal; in response to determining that the received set of output port information is not equal to the set of non-failed output port information, pushing the received set of output port information.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.