WO2024159954A1 - 一种上行出口识别方法、装置及设备、介质和产品 - Google Patents
一种上行出口识别方法、装置及设备、介质和产品 Download PDFInfo
- Publication number
- WO2024159954A1 WO2024159954A1 PCT/CN2023/139955 CN2023139955W WO2024159954A1 WO 2024159954 A1 WO2024159954 A1 WO 2024159954A1 CN 2023139955 W CN2023139955 W CN 2023139955W WO 2024159954 A1 WO2024159954 A1 WO 2024159954A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- information
- switch
- vrf
- port
- uplink
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 89
- 238000011144 upstream manufacturing Methods 0.000 claims description 31
- 238000004590 computer program Methods 0.000 claims description 25
- 230000002776 aggregation Effects 0.000 claims description 24
- 238000004220 aggregation Methods 0.000 claims description 24
- 238000012545 processing Methods 0.000 claims description 12
- 230000008569 process Effects 0.000 description 15
- 238000012423 maintenance Methods 0.000 description 11
- 238000010586 diagram Methods 0.000 description 10
- 230000006870 function Effects 0.000 description 10
- 238000012544 monitoring process Methods 0.000 description 8
- 238000005516 engineering process Methods 0.000 description 4
- 230000004044 response Effects 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 2
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 230000001419 dependent effect Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 1
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 1
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/74—Address processing for routing
- H04L45/745—Address table lookup; Address filtering
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L49/00—Packet switching elements
- H04L49/10—Packet switching elements characterised by the switching fabric construction
- H04L49/111—Switch interfaces, e.g. port details
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L49/00—Packet switching elements
- H04L49/35—Switches specially adapted for specific applications
- H04L49/354—Switches specially adapted for specific applications for supporting virtual local area networks [VLAN]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/10—Mapping addresses of different types
- H04L61/103—Mapping addresses of different types across network layers, e.g. resolution of network layer into physical layer addresses or address resolution protocol [ARP]
Definitions
- the present application relates to the field of communication technology, and in particular to an uplink exit identification method, device and equipment, medium and product.
- the traditional method of identifying the upstream port of a switch is to use a specific field in the port description for manual identification when configuring the port.
- the scanning program identifies the relevant identification, the corresponding port is marked as the upstream port of the switch.
- the embodiments of the present application provide an uplink egress identification method, device and equipment, medium and product to overcome the above problems or at least partially solve the above problems.
- a method for identifying an uplink egress comprising:
- ARP address resolution protocol
- each default route record and each arp table determine the port information corresponding to each VRF information
- the port information corresponding to each VRF information is determined according to each default route record and each arp table, including:
- identifying the uplink egress of the switch according to each port information includes:
- the uplink exit corresponding to each VRF information in the switch is identified.
- determining the target physical port corresponding to each piece of port information includes:
- a physical port corresponding to the physical port information is determined as a target physical port
- a physical port configured with the VLAN information or a physical port member in an aggregation port configured with the VLAN information is determined as a target physical port.
- the method further includes:
- the first VRF information corresponding to the first public network IP segment set exists in the first public network segment set, determining that the identification result of the uplink egress corresponding to the first VRF information is correct;
- the first public network IP segment set corresponding to the VRF information is determined by the following steps:
- the first public network IP segment set corresponding to the VRF information is determined.
- the method further includes:
- alarm information is generated.
- the method further includes:
- the method further includes:
- the method before obtaining the default route record and the arp table corresponding to each VRF information configured in the switch from the routing table and the address resolution protocol arp table of the switch, the method further includes:
- the basic information of the switch is collected by using a scanning script.
- the basic information includes at least the VRF information configured in the switch, and the basic information also includes at least one of the switch port information, the routing table corresponding to each VRF information, and the ARP table corresponding to each VRF information.
- a scanning script is used to collect basic information of a switch, including:
- an uplink exit identification device comprising:
- the acquisition module is used to obtain the default route record and arp table corresponding to each VRF information configured in the switch from the routing table and address resolution protocol arp table of the switch;
- a processing module used for determining the port information corresponding to each VRF information according to each default route record and each arp table;
- the identification module is used to identify the uplink outlet of the switch according to the information of each port.
- an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the uplink exit identification method according to the first aspect are implemented.
- a computer-readable storage medium on which a computer program/instruction is stored.
- the steps of the uplink egress identification method according to the first aspect are implemented.
- a fifth aspect of the embodiments of the present application provides a computer program product, including a computer program/instruction.
- the computer program/instructions are executed by a processor, the steps of the uplink exit identification method of the first aspect are implemented.
- the default forwarding port (i.e., the upstream exit of the switch) of the data packet corresponding to each VRF information can be found, thereby realizing automatic identification of the upstream exit of the switch based on the default route, which can improve the accuracy of upstream exit identification.
- FIG1 is a flowchart of an implementation method of an uplink egress identification method according to an embodiment of the present application
- FIG. 2 is a flowchart of an implementation method for automatically identifying an uplink egress of a three-layer network switch according to an embodiment of the present application
- FIG. 3 is a flowchart of another method for automatically identifying an uplink egress of a three-layer network switch in an embodiment of the present application
- FIG4 is a schematic diagram of the structure of an uplink exit identification device according to an embodiment of the present application.
- FIG. 5 is a schematic diagram of an electronic device in an embodiment of the present application.
- a network switch is a type of network hardware that receives and forwards data to a target device through message exchange. It can connect different devices on a computer network and is generally referred to as a switch.
- a layer 3 switch is a switch with partial routing functions, i.e., layer 2 switching technology + layer 3 forwarding technology. The most important use of a layer 3 switch is to speed up data exchange within a large local area network. Its routing function also serves this purpose, and it can route once and forward multiple times. Regular processes such as packet forwarding are implemented by hardware at high speed, while functions such as routing information update, routing table maintenance, routing calculation, and routing determination are implemented by software. It solves the network bottleneck problem caused by the low speed and complexity of traditional routers, so it is widely used in edge computing.
- Edge computing refers to the use of an open platform that integrates network, computing, storage, and application core capabilities to provide the nearest service on the side close to the user or data source. To meet the requirements of edge computing, each edge needs to build a corresponding edge computing cluster. Edge computing clusters are often small in scale, and the traffic of physical servers in the cluster is eventually converged to a three-layer network switch (i.e., a three-layer switch), through which the Internet is accessed from the Internet Data Center (IDC) computer room. This switch is usually called an egress/core switch. The port where the egress switch is connected to the IDC device in the IDC computer room is the uplink egress of the switch.
- a three-layer network switch i.e., a three-layer switch
- This switch is usually called an egress/core switch.
- the port where the egress switch is connected to the IDC device in the IDC computer room is the uplink egress of the switch.
- Each node in edge computing is distributed at the edge of each city. When the business grows, there will be hundreds or thousands of edge nodes.
- the maximum egress bandwidth of each node is basically the uplink bandwidth of the egress switch of the corresponding cluster, that is, the uplink bandwidth of the egress switch is the sum of the available bandwidths of all uplink egresses.
- the mainstream method of identifying the upstream exit is to use a specific field in the port description to identify the port when configuring it as the upstream exit.
- the scanning program identifies the identifier, it will identify the port as the upstream exit of the switch. Since the identification of the upstream exit is mainly based on the identifier set in advance on the switch port during the integrated maintenance, this method is too dependent on manual identification.
- the manual operation is wrong, the identification of the upstream port will be wrong.
- the service is adjusted or a certain upstream exit fails, causing the upstream exit of the switch to change but the port identifier is not adjusted manually in time, it will cause errors in the final cluster service traffic monitoring and billing, resulting in considerable losses.
- the switch port description can be easily adjusted manually, such as when the service is already in a stable operation process, the switch port description can still be adjusted, making the existing upstream port identification program very easy to cause identification errors due to manual operation errors.
- the present application proposes a method for identifying the uplink exit of the switch based on the default route.
- the uplink exit can be automatically identified without manual intervention.
- the switch has multiple VRFs of the public network (i.e., multiple operator lines)
- the uplink exit of the switch corresponding to each public network VRF can also be identified, and the exit traffic corresponding to each VRF can be monitored separately.
- the VRF cannot be adjusted after the service is launched, unless the service is offline.
- FIG. 1 a flowchart of an implementation method of an uplink egress identification method provided by an embodiment of the present application is provided.
- the method may include the following steps:
- Step S11 Obtain the default route record and arp table corresponding to each virtual routing forwarding VRF information configured in the switch from the routing table and address resolution protocol arp table of the switch.
- the switch referred to in this embodiment is an export/core switch (i.e., a three-layer network switch), which accesses the Internet through the IDC computer room via the uplink export.
- the VRF information can be a global VRF name agreed in advance with the integrator and network operation and maintenance.
- the switch in order to meet the business needs of different operators, the switch is usually configured with the global VRF name corresponding to the lines of different operators, so that the switch can establish routing tables corresponding to the lines of different operators.
- the routing tables are isolated from each other, so that the switch is logically divided into multiple virtual switches, which have multi-route forwarding capabilities, so as to distinguish the business traffic of different operators.
- Different businesses use different routing tables, which are independent of each other, and achieve the purpose of controlling the direction of global routing traffic of the device.
- VRF information can be configured for the switch so that the switch can establish routing tables corresponding to different VRF information, and then forward the traffic packets to the corresponding operator's line according to the operator corresponding to the target IP of the data packet flow in and out, so as to reduce the transmission time of the data packet.
- the default route records and ARP tables corresponding to the one or more VRF information can be found according to the one or more VRF information configured in the switch through the simple network management protocol (snmp, simple network management protocol) and/or the secure shell protocol (ssh, secure shell).
- simple network management protocol simple network management protocol
- secure shell protocol secure shell
- Step S12 Determine the port information corresponding to each VRF information according to each default route record and each arp table.
- the egress switch of the edge cluster usually uses the default forwarding port of the corresponding data packet of each public network (i.e. each operator line) as the uplink egress to connect to the IDC equipment in the IDC room, and the public network VRF information (such as VRF name) of the egress switch is basically fixed. Therefore, the port information corresponding to the VRF information can be found through the default routing table record corresponding to the fixed VRF information and the corresponding arp table.
- the port information describes The default forwarding port for the corresponding data packet is described, and the default forwarding port is the uplink exit of the switch.
- the scanning program can automatically identify and update the uplink exit information of the switch without human intervention.
- Step S13 Identify the uplink exit of the switch according to the information of each port.
- the physical ports and/or logical ports (such as aggregation ports, virtual local area network (VLAN) ports, etc.) of the switch can be determined according to the information of each port, and each determined physical port and/or logical port can be directly identified as the uplink exit of the switch; or according to business needs, the corresponding physical port or the corresponding logical port can be further found through the determined physical ports and/or logical ports, that is, all physical ports and/or logical ports are converted into physical ports or logical ports, and then each converted physical port or each logical port is identified as the uplink exit of the switch, so as to subsequently realize corresponding cluster traffic monitoring and billing functions.
- VLAN virtual local area network
- the present application can identify each upstream exit of the switch and can distinguish the public network VRF corresponding to each upstream exit, so as to facilitate the subsequent monitoring of the export traffic corresponding to each of the multiple public network VRFs, thereby optimizing the traffic monitoring and billing functions of the public network VRF.
- the default forwarding port (i.e., the upstream exit of the switch) of the data packet corresponding to each VRF information can be found, thereby realizing automatic identification of the upstream exit of the switch based on the default route, which can improve the accuracy of upstream exit identification.
- the embodiment of the present application provides a method for automatically identifying an uplink egress of a three-layer network switch, comprising:
- Step S21 Determine each VRF information configured in the switch, and obtain the next hop IP corresponding to each VRF information from the default route record corresponding to each VRF information.
- the agreed VRF name of each operator line can be recorded in the database in advance, and the operator lines of the edge cluster can be recorded in the database during each cluster maintenance, including the public network segment corresponding to each line.
- This basic information can include Including switch port information (such as the switch's physical port, aggregation port, VLAN port and other port information), each VRF information configured on the switch, the routing table and ARP table corresponding to each VRF information, etc.
- the VRF name corresponding to each operator line is obtained sequentially from the VRF list in the database, and based on the basic information of the switch collected, it is determined whether the VRF name exists in the switch. If the VRF name exists in the switch, the next hop IP corresponding to the VRF name is determined according to the default route record, and the public network segment corresponding to the VRF name can be obtained from the database, so as to subsequently verify the correspondence between the VRF name recorded in the database and the operator line; if the VRF name does not exist in the switch, the VRF name corresponding to the next operator line is obtained from the VRF list (or the network operation and maintenance is notified to specify another VRF name from the VRF list), and it is determined whether the VRF name exists in the switch, until each VRF name in the VRF list is traversed to obtain the next hop IP and public network segment corresponding to each VRF information configured in the switch.
- the switch X is configured with only one VRF information, which is _public_.
- the public network segment corresponding to the VRF information is 117.31.42.1/28.
- the destination address of the default route is 0.0.0.0, so you can get the default route record corresponding to the row where the value of the Destination/Mask field is 0.0.0.0/0 from the routing table, and determine the IP value of the NextHoop field in the default route record as the next hop IP corresponding to _public_ (denoted as A).
- Step S22 After obtaining the next hop IP corresponding to each VRF information, obtain the port information corresponding to each next hop IP from the ARP table corresponding to each VRF information.
- the interface information (also referred to as port information) associated with the next hop IP corresponding to the VRF information can be determined according to the interface field in the ARP table corresponding to the VRF information.
- Step S23 Identify the uplink exit of the switch according to the information of each port.
- the port information In the specific implementation, in order to facilitate the subsequent flow monitoring and billing functions, it is possible to determine the port information The target physical ports corresponding to the respective VRF information are identified, and the uplink exits corresponding to the respective VRF information in the switch are identified according to the respective target physical ports.
- the port information obtained from the ARP table is mainly one of the physical port information, the aggregation port information, and the VLAN information of the VLAN port. Therefore, for the physical port information in each port information, the physical port corresponding to the physical port information can be determined as the target physical port; for the aggregation port information in each port information, the physical port member in the aggregation port corresponding to the aggregation port information can be determined as the target physical port; for the virtual local area network VLAN information in each port information, the physical port configured with the VLAN information or the physical port member in the aggregation port configured with the VLAN information can be determined as the target physical port.
- the port information is the information of the switch port (i.e., the physical port); if the port information is the physical port information, then the corresponding target physical port is found according to the physical port information; if the port information is not the physical port information, then it is determined whether the port information is the aggregation port information; if the port information is the aggregation port information, then the corresponding physical port member (i.e., multiple physical ports) is found according to the aggregation port information, and the found physical port member is determined as the corresponding target physical port; if the port information is not the aggregation port information, then it is determined whether the port information is the vlan information of the vlan port (such as vlan id); if the port information is the vlan information of the vlan port, then the physical port configured with the vlan information (which may be a physical port member in the aggregation port)
- Step S24 Verify the identified uplink exit.
- the identified upstream exit can be verified based on the public network segment of the operator line to verify the correctness of the identification result.
- the first public network segment of the operator line corresponding to each VRF information recorded in the database can be obtained, and the first public network IP segment set corresponding to each VRF information configured by the switch can be obtained.
- all vlan ports corresponding to the VRF information can be obtained, and the first public network ip segment set corresponding to the VRF information can be determined according to the public network ip and mask configured for each vlan port.
- each VLAN configuration information is the public IP and mask configured for the VLAN in the switch.
- each first public network IP segment set and the first public network segment After obtaining each first public network IP segment set and the first public network segment, it is determined whether the first public network segment exists in the first public network segment set corresponding to each VRF information, that is, it is determined whether the public network segment of the corresponding operator line recorded in the database exists in the corresponding public network segment set. Taking the above switch X as an example, it is necessary to determine whether the network segment 117.31.42.1/28 is in the first public network segment set corresponding to _public_.
- the identification result of the uplink exit corresponding to the first VRF information is correct.
- all public network IP segment sets configured by the switch for the operator line should at least include the public network segment of the operator line recorded in the database. If the public network segment of the corresponding operator line recorded in the database exists in the corresponding public network IP segment set, it means that the VRF related information configured on the switch is consistent with the VRF related information recorded in the database, so it can be determined that the uplink exit corresponding to the identified VRF information (i.e., the first VRF information) is the correct uplink exit of the corresponding operator line recorded in the database (i.e., the identification result is correct).
- the public network segment of the corresponding operator line recorded in the database does not exist in the corresponding public network IP segment set, it means that the VRF-related information configured on the switch is inconsistent with the VRF-related information recorded in the database, so that this identification did not find the correct upstream exit of the corresponding operator line recorded in the database. Therefore, it is determined that the identification result corresponding to the VRF information (i.e., the second VRF information) is wrong, and an alarm information corresponding to the second VRF information is generated, so that the network operation and maintenance can correct the relevant information of the second VRF information recorded in the database (such as the correspondence between the VRF name and the operator line).
- Step S25 Alarm the VRF information of the failed upstream egress identification.
- the relevant information of the identification failure can be alarmed, waiting for the network operation and maintenance to record the correct VRF information of the corresponding line of the switch in the database, and then re-execute the above identification process.
- the third VRF information corresponding to the switch in the database is obtained, and the third VRF information may be: VRF information existing in the VRF list corresponding to the switch in the database. Then, for the third VRF information whose corresponding uplink exit is not identified (such as VRF information existing in the corresponding VRF list but not in the switch), an alarm message is generated.
- the VRF information corresponding to the alarm information generated above can be determined as the fourth VRF information. Since the VRF-related information configured in the switch cannot be changed, the correspondence between the fourth VRF information and the operator line can be adjusted in the database according to the VRF-related information configured in the switch, so that the VRF-related information configured in the switch is consistent with the VRF-related information recorded in the database, thereby ensuring the correct identification of the upstream exit.
- Step S26 compare the uplink egress of the switch identified this time with the uplink egress of the switch identified last time, and generate alarm information when the uplink egress of the switch identified this time is different from the uplink egress of the switch identified last time.
- a scheduled task can be set to periodically execute the above identification process for the switch.
- the identified uplink exit information can be saved to the database.
- Each subsequent identified uplink exit needs to be compared with the uplink exit identified last time.
- the relevant information (such as the uplink exits identified twice, and the VRF information corresponding to the uplink exit, etc.) will be displayed as an alarm to remind the network operation and maintenance to handle it.
- the update operation is triggered to update the relevant information of the uplink exit identified this time to the database. Therefore, combined with the automated scanning script and the issuance of scheduled tasks, it is possible to realize the real-time identification of the uplink exit of the switch and the real-time correction of the uplink exit information recorded in the database.
- the traditional method for identifying the uplink exit of a switch is to manually add a keyword to the description of the uplink exit of the switch when the switch is integrated.
- the scanning program recognizes that the description of the switch port contains the keyword, it considers that the switch port is the uplink exit of the switch.
- this identification method is simple, it relies too much on manual intervention.
- the scanning program will not be able to identify the correct uplink exit.
- this application proposes a new switch uplink exit identification solution, which finds the corresponding uplink exit through the default route and arp table corresponding to the switch's VRF information.
- This solution does not require manual intervention and is accurate in identification.
- the scanning program can also automatically identify the uplink exit without manual intervention. And update the corresponding uplink export information in the database.
- the uplink export of each public network VRF can also be identified separately, and then the corresponding export traffic can be monitored separately.
- the VRF cannot be adjusted after the service is online, the corresponding adjustment can only be made after the service is offline. Therefore, the automatic identification procedure of the identification process of the above embodiment is executed, and the uplink export identification of the edge cluster that has been online is very accurate, and the data will not be inaccurate due to manual intervention, which will ultimately affect the business revenue.
- FIG4 is a schematic diagram of the structure of an uplink exit identification device according to an embodiment of the present application, the device comprising:
- the acquisition module is used to obtain the default route record and arp table corresponding to each VRF information configured in the switch from the routing table and address resolution protocol arp table of the switch;
- a processing module used for determining the port information corresponding to each VRF information according to each default route record and each arp table;
- the identification module is used to identify the uplink outlet of the switch according to the information of each port.
- the default forwarding port (i.e., the upstream exit of the switch) of the data packet corresponding to each VRF information can be found, thereby realizing automatic identification of the upstream exit of the switch based on the default route, which can improve the accuracy of upstream exit identification.
- the processing module includes:
- the first processing submodule is used to obtain the next hop IP corresponding to each VRF information from each default route record;
- the second processing submodule is used to obtain the port information corresponding to each next-hop IP from each ARP table.
- the identification module includes:
- a first identification submodule is used to determine the target physical port corresponding to each piece of port information
- the second identification submodule is used to identify the uplink exits corresponding to each VRF information in the switch according to each target physical port.
- the second identification submodule includes:
- a first determination module is used to determine, for each piece of port information, a physical port corresponding to the physical port information as a target physical port;
- the second determination module is used to determine the physical port member in the aggregation port corresponding to the aggregation port information as the target physical port for the aggregation port information in each port information;
- the third determination module is used to determine, for the virtual local area network (VLAN) information in each port information, a physical port configured with VLAN information or a physical port member in an aggregation port configured with VLAN information as a target physical port.
- VLAN virtual local area network
- the device after identifying the uplink egress of the switch according to each port information, the device further includes:
- the network segment acquisition module is used to obtain the first public network segment of the operator line corresponding to each VRF information recorded in the database, and obtain the first public network IP segment set corresponding to each VRF information configured by the switch;
- the first judgment module is used to judge whether there is a corresponding first public network segment in the first public network IP segment set corresponding to each VRF information;
- a first response module is used to determine that the identification result of the uplink egress corresponding to the first VRF information is correct for the first VRF information corresponding to the first public network segment in the first public network IP segment set in each VRF information;
- the second response module is used to determine that the identification result of the upstream exit corresponding to the second VRF information is wrong for the second VRF information whose corresponding first public network segment does not exist in the corresponding first public network IP segment set in each VRF information, and generate alarm information for the second VRF information.
- the network segment acquisition module includes:
- the first network segment acquisition submodule is used to obtain all vlan ports corresponding to the VRF information in the switch;
- the second network segment acquisition submodule is used to determine the first public network IP segment set corresponding to the VRF information according to the public network IP and mask configured for each VLAN port
- the device further includes:
- An information acquisition module used to acquire the third VRF information corresponding to the switch in the database
- the first generating module is used to generate alarm information for the third VRF information whose corresponding uplink exit is not identified.
- the device further includes:
- An information processing module used for determining the VRF information corresponding to the alarm information as the fourth VRF information
- the data processing module is used to adjust the corresponding relationship between the fourth VRF information and the operator line in the database.
- the device after identifying the uplink egress of the switch according to each port information, the device further includes:
- a result comparison module used to compare the uplink export of the switch identified this time with the uplink export of the switch identified last time
- the second generating module is used to generate alarm information when the uplink exit of the switch identified this time is different from the uplink exit of the switch identified last time.
- the device before obtaining the default route record and the arp table corresponding to each VRF information configured in the switch from the routing table and the address resolution protocol arp table of the switch, the device further includes:
- the automatic scanning module is used to collect basic information of the switch using a scanning script.
- the basic information at least includes the VRF information configured by the switch.
- the basic information also includes the switch port information, the routing table corresponding to each VRF information, and at least one of the ARP tables corresponding to each VRF information.
- the automatic scanning module includes:
- the scanning submodule is used to collect basic information of the switch by using a scanning script through the simple network management protocol snmp and/or the secure shell protocol ssh.
- the device embodiment is similar to the method embodiment, so the description is relatively simple, and the relevant parts can be referred to the method embodiment.
- the embodiment of the present application also provides an electronic device, referring to Figure 5, which is a schematic diagram of the electronic device proposed in the embodiment of the present application.
- the electronic device 100 includes: a memory 110 and a processor 120, the memory 110 and the processor 120 are connected via a bus communication, the memory 110 stores a computer program, and the computer program can be run on the processor 120 to implement the steps in the uplink exit identification method disclosed in the embodiment of the present application.
- the embodiment of the present application further provides a computer-readable storage medium on which a computer program/instruction is stored.
- the computer program/instruction is executed by a processor, the uplink egress identification method disclosed in the embodiment of the present application is implemented.
- the embodiment of the present application further provides a computer program product, including a computer program/instruction, which, when executed by a processor, implements the uplink egress identification method disclosed in the embodiment of the present application.
- the embodiments of the present application can be provided as methods, devices or computer program products. Therefore, the embodiments of the present application can be implemented in full hardware, full software, or a combination of software. Moreover, the embodiments of the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
- computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
- These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate a device for implementing the functions specified in one process or multiple processes in the flowchart and/or one box or multiple boxes in the block diagram.
- These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
- These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce computer-implemented processing, so that the instructions executed on the computer or other programmable terminal device provide steps for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本申请提供了一种上行出口识别方法、装置及设备、介质和产品,旨在提高上行出口的识别准确性。所述方法包括:从交换机的路由表和地址解析协议arp表中,获取所述交换机配置的各个虚拟路由转发VRF信息各自对应的默认路由记录和arp表;根据各个所述默认路由记录和各个所述arp表,确定各个所述VRF信息各自对应的端口信息;根据各个所述端口信息,识别所述交换机的上行出口。
Description
相关申请的交叉引用
本申请要求于2023年01月31日提交中国专利局,申请号为202310048000.8,申请名称为“一种上行出口识别方法、装置及设备、介质和产品”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及通信技术领域,特别是涉及一种上行出口识别方法、装置及设备、介质和产品。
传统的交换机上行出口识别方法是在配置端口时在端口描述上使用特定的字段进行人工标识,当扫描程序识别到相关标识时,即将对应端口标记成交换机的上行出口。
然而,上述识别方法过于依赖人工干预,当端口描述更新不及时或人工操作出错时,上行出口的识别也会随之出错。
发明内容
鉴于上述问题,本申请实施例提供了一种上行出口识别方法、装置及设备、介质和产品,以便克服上述问题或者至少部分地解决上述问题。
本申请实施例的第一方面,提供了一种上行出口识别方法,方法包括:
从交换机的路由表和地址解析协议arp表中,获取交换机配置的各个虚拟路由转发VRF信息各自对应的默认路由记录和arp表;
根据各个默认路由记录和各个arp表,确定各个VRF信息各自对应的端口信息;
根据各个端口信息,识别交换机的上行出口。
在本申请一些实施例中,根据各个默认路由记录和各个arp表,确定各个VRF信息各自对应的端口信息,包括:
从各个默认路由记录中,获取各个VRF信息各自对应的下一跳ip;
从各个arp表中,获取各个下一跳ip各自对应的端口信息。
在本申请一些实施例中,根据各个端口信息,识别交换机的上行出口,包括:
确定各个端口信息各自对应的目标物理端口;
根据各个目标物理端口,识别交换机中各个VRF信息各自对应的上行出口。
在本申请一些实施例中,确定各个端口信息各自对应的目标物理端口,包括:
针对各个端口信息中的物理端口信息,将物理端口信息对应的物理端口,确定为目标物理端口;
针对各个端口信息中的汇聚端口信息,将汇聚端口信息对应的汇聚口中的物理端口成员,确定为目标物理端口;
针对各个端口信息中的虚拟局域网vlan信息,将配置了vlan信息的物理端口或配置了vlan信息的汇聚端口中的物理端口成员,确定为目标物理端口。
在本申请一些实施例中,根据各个端口信息,识别交换机的上行出口之后,方法还包括:
获取数据库中记录的各个VRF信息各自对应的运营商线路的第一公网网段,并获取交换机配置的各个VRF信息各自对应的第一公网ip段集合;
判断各个VRF信息各自对应的第一公网ip段集合中是否存在对应的第一公网网段;
对于各个VRF信息中对应的第一公网ip段集合中存在对应的第一公网网段的第一VRF信息,判定第一VRF信息对应的上行出口的识别结果正确;
对于各个VRF信息中对应的第一公网ip段集合中不存在对应的第一公网网段的第二VRF信息,判定第二VRF信息对应的上行出口的识别结果错误,并针对第二VRF信息生成告警信息。
在本申请一些实施例中,对于每个VRF信息,VRF信息对应的第一公网ip段集合通过以下步骤确定:
获取交换机中VRF信息对应的所有vlan端口;
根据各个vlan端口配置的公网ip和掩码,确定VRF信息对应的第一公网ip段集合。
在本申请一些实施例中,方法还包括:
获取数据库中交换机对应的第三VRF信息;
针对未识别出对应的上行出口的第三VRF信息,生成告警信息。
在本申请一些实施例中,方法还包括:
将告警信息对应的VRF信息确定为第四VRF信息;
在数据库中调整第四VRF信息与运营商线路之间的对应关系。
在本申请一些实施例中,根据各个端口信息,识别交换机的上行出口之后,方法还包括:
将本次识别出的交换机的上行出口与上一次识别出的交换机的上行出口进行比较;
在本次识别出的交换机的上行出口与上一次识别出的交换机的上行出口存在不同的情况下,生成告警信息。
在本申请一些实施例中,从交换机的路由表和地址解析协议arp表中,获取交换机配置的各个VRF信息各自对应的默认路由记录和arp表之前,方法还包括:
利用扫描脚本采集交换机的基本信息,基本信息至少包括交换机配置的各个VRF信息,基本信息还包括交换机端口信息、各个VRF信息各自对应的路由表、以及各个VRF信息各自对应的arp表中的至少一者。
在本申请一些实施例中,利用扫描脚本采集交换机的基本信息,包括:
利用扫描脚本通过简单网络管理协议snmp和/或安全外壳协议ssh的方式,采集交换机的基本信息。
本申请实施例的第二方面,提供了一种上行出口识别装置,装置包括:
获取模块,用于从交换机的路由表和地址解析协议arp表中,获取交换机配置的各个VRF信息各自对应的默认路由记录和arp表;
处理模块,用于根据各个默认路由记录和各个arp表,确定各个VRF信息各自对应的端口信息;
识别模块,用于根据各个端口信息,识别交换机的上行出口。
本申请实施例的第三方面,提供了一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行程序时实现第一方面的上行出口识别方法的步骤。
本申请实施例的第四方面,提供了一种计算机可读存储介质,其上存储有计算机程序/指令,该计算机程序/指令被处理器执行时实现如第一方面的上行出口识别方法的步骤。
本申请实施例的第五方面,提供了一种计算机程序产品,包括计算机程序/指令,该
计算机程序/指令被处理器执行时实现第一方面的上行出口识别方法的步骤。
本申请实施例包括以下优点:
本实施例中,根据交换机的各个VRF信息对应的默认路由记录和arp表,可以找到各个VRF信息各自所对应数据包的默认转发端口(即交换机的上行出口),从而基于默认路由实现对交换机上行出口的自动识别,能够提高上行出口识别的准确性。
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例的一种上行出口识别方法的实施流程图;
图2是本申请实施例的一种三层网络交换机的上行出口自动识别方法的实施流程图;
图3是本申请实施例中另一种三层网络交换机的上行出口自动识别方法的实施流程图;
图4是本申请实施例的一种上行出口识别装置的结构示意图;
图5是本申请实施例中一种电子设备的示意图。
为使本申请的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本申请作进一步详细的说明。
网络交换机是一种网络硬件,通过报文交换以接收和转发数据到目标设备,它能够在计算机网络上连接不同的设备,一般也简称为交换机。三层交换机就是具有部分路由功能的交换机,即二层交换技术+三层转发技术。三层交换机最重要的用途是加快大型局域网内部的数据交换,其所具有的路由功能也是为该目的服务,能够做到一次路由,多次转发。对于数据包转发等规律性的过程由硬件高速实现,而像路由信息更新、路由表维护、路由计算、路由确定等功能,由软件实现。解决了传统路由器低速、复杂所造成的网络瓶颈问题,故被广泛应用于边缘计算中。
边缘计算,是指在靠近用户或数据源头的一侧,采用网络、计算、存储、应用核心能力为一体的开放平台,就近提供最近端服务。为满足边缘计算要求,各个边缘需要分布建设对应的边缘计算集群。边缘计算集群往往规模不大,集群内物理服务器的流量最终都汇聚到一台三层网络交换机(即三层交换机),通过这台交换机从互联网数据中心(IDC,Internet Data Center)机房访问互联网,这台交换机通常被称为出口/核心交换机。出口交换机与IDC机房的IDC设备连接的端口即为该交换机的上行出口。
边缘计算中各个节点都分布在各个地市边缘,当业务发展壮大时,会有成百上千个边缘节点。每个节点的最大出口带宽基本就是对应集群的出口交换机的上行带宽,即出口交换机的上行带宽为所有上行出口的可用带宽之和。通过监控交换机的上行出口,可以准确地统计该边缘集群的所有的流入和流出的数据包流量,从而实现集群流量监控和计费等功能。因此能否对出口交换机的上行出口进行准确识别是十分重要的。
目前主流的上行出口的识别方式是在配置作为上行出口的端口时在端口描述上使用特定的字段进行标识,当扫描程序识别到该标识即将该端口识别成交换机的上行出口。由于主要根据集成交维时提前在交换机端口设定好的标识进行上行出口的识别,使得该方式过于依赖人工标识,当人工操作出错时,上行端口的识别就会出错。特别是当业务调整或者某个上行出口发生故障,造成交换机的上行出口变化却没有及时人工调整端口标识时,会导致最终集群业务流量监控计费出错而造成不小的损失。同时,在上述方式下,由于交换机端口描述可以轻易通过人工调整,如在业务已经进行稳定运行的过程时仍可以调整交换机端口描述,使得现有上行端口的识别程序极易因人工操作失误而造成识别错误。
针对上述相关技术中存在的问题,本申请提出了一种基于默认路由识别交换机的上行出口的方式,根据交换机所配置虚拟路由转发(VRF,Virtual Routing and Forwarding)信息对应的默认路由记录和地址解析协议(arp,address resolution protocol)表,能够在没有人工干预的情况下自动识别上行出口,且当交换机有多个公网(即多个运营商线路)的VRF时,也可以识别到每个公网的VRF分别对应的交换机上行出口,进而分别监控每个VRF对应的出口流量。同时VRF在业务上线后是无法调整的,除非将业务下线后才可,因此对于执行本申请所提供识别方法的自动识别程序,其对已经上线后的各VRF对应的上行出口识别是十分准确的,不会因为人工干预造成上行出口识别及后续流量监
控数据的不准确而最终影响业务收入。
下面结合附图,通过一些实施例及其应用场景对本申请实施例提供的上行出口识别方法进行详细地说明。
第一方面,参照图1所示,为本申请实施例所提供的一种上行出口识别方法的实施流程图,该方法可以包括以下步骤:
步骤S11:从交换机的路由表和地址解析协议arp表中,获取交换机配置的各个虚拟路由转发VRF信息各自对应的默认路由记录和arp表。
其中,本实施例中所指的交换机为出口/核心交换机(即三层网络交换机),该交换机通过上行出口经IDC机房访问互联网,VRF信息可以是提前与集成商和网络运维约定好的全局VRF名称。
可以理解的是,为满足不同运营商的业务需求,通常会对交换机配置不同运营商线路各自对应的全局VRF名称,使得交换机能够建立不同运营商线路对应的路由表,路由表间相互隔离从而把该交换机在逻辑上分成多台虚拟交换机,使其具有多路由转发实力,以便区分不同运营商的业务流量,不同的业务走不同的路由表,从而互相独立,达到控制设备全局路由流量走向的目的。
例如,当一个边缘集群的出口交换机同时配置了多个运营商线路,每个运营商线路配置一个公网网段。此时就可以对该交换机配置多个VRF信息,以便交换机建立不同VRF信息对应的路由表,从而根据数据包流量出入的目标ip所对应的运营商,将流量包转发到该对应运营商的线路上,以减少数据包的传输耗时。
在具体实施时,可以根据交换机配置的一个或多个VRF信息,通过简单网络管理协议(snmp,simple network management protocol)和/或安全外壳协议(ssh,secure shell)的方式,找到该一个或多个VRF信息各自对应的默认路由记录和arp表。
步骤S12:根据各个默认路由记录和各个arp表,确定各个VRF信息各自对应的端口信息。
在具体实施时,考虑到边缘集群的出口交换机通常是将各个公网(即各个运营商线路)对应数据包的默认转发端口作为上行出口,以与IDC机房的IDC设备连接,且出口交换机的公网VRF信息(如VRF名称)基本是固定的。故通过固定的VRF信息对应的默认路由表记录和相应的arp表,即可找到该VRF信息对应的端口信息,该端口信息描
述了对应数据包的默认转发端口,而该默认转发端口即为交换机的上行出口。
可以理解的是,当某个上行出口发生了调整时,交换机中对应的默认路由记录也会自动进行相应调整,故通过这种基于默认路由的上行出口识别方式,扫描程序能够在没有人工干预的情况下自动识别并更新交换机的上行出口信息。
步骤S13:根据各个端口信息,识别交换机的上行出口。
在具体实施时,可以根据各个端口信息确定交换机的物理端口和/或逻辑端口(如汇聚端口、虚拟局域网(vlan,virtual local area network)端口等),将确定出的各个物理端口和/或逻辑端口直接识别为该交换机的上行出口;也可以根据业务需求,通过确定出的各个物理端口和/或逻辑端口,进一步找到对应的物理端口或找到对应的逻辑端口,也即是将各个物理端口和/或逻辑端口全部转换为物理端口或逻辑端口,再将转换得到的各个物理端口或各个逻辑端口识别为该交换机的上行出口,以便后续实现相应的集群流量监控和计费等功能。
可以理解的是,在交换机配置了多个公网VRF的情况下,本申请可以识别出交换机的每个上行出口,并能够对每个上行出口所对应的公网VRF进行区分,便于后续分别监控多个公网VRF各自对应的出口流量,从而能够优化公网VRF的流量监控及计费等功能。
采用本申请实施例的技术方案,根据交换机的各个VRF信息对应的默认路由记录和arp表,可以找到各个VRF信息各自所对应数据包的默认转发端口(即交换机的上行出口),从而基于默认路由实现对交换机上行出口的自动识别,能够提高上行出口识别的准确性。
以下结合图2,对上述技术方案作进一步说明。如图2所示,本申请实施例提供了一种三层网络交换机的上行出口自动识别方法,包括:
步骤S21:确定交换机配置的各个VRF信息,并从各个VRF信息各自对应的默认路由记录中,获取各个VRF信息各自对应的下一跳ip。
在具体实施时,可以预先在数据库中记录约定好的每种运营商线路的VRF名称,且可以在每次集群交维时在数据库中记录边缘集群的运营商线路,包括每条线路对应的公网网段。
利用扫描脚本通过snmp和/或ssh的方式采集交换机的基本信息,该基本信息可以包
括交换机端口信息(如交换机的物理端口、汇聚端口和vlan端口等所有端口的信息)、交换机配置的各个VRF信息、各个VRF信息对应的路由表以及arp表等。
从数据库的VRF列表中顺序获取每个运营商线路对应的VRF名称,并根据采集到的交换机的基本信息,确定该VRF名称在交换机中是否存在,如果该VRF名称在交换机中存在,则根据默认路由记录确定该VRF名称对应的下一跳ip,且可以从数据库中获取该VRF名称对应的公网网段,以便后续对数据库中记录的VRF名称与运营商线路之间的对应关系进行验证;如果该VRF名称在交换机中不存在,则从VRF列表中获取下一个运营商线路对应的VRF名称(或通知网络运维从VRF列表中指定另一个VRF名称),并判断该VRF名称在交换机中是否存在,直至遍历该VRF列表中的每个VRF名称,得到交换机配置的各个VRF信息各自对应的下一跳ip和公网网段。
示例性地,对于没有配置其它VRF信息,即用的是默认VRF信息的交换机X,该交换机X配置的VRF信息仅一个,为_public_,该VRF信息对应的公网网段为117.31.42.1/28。
在交换机X上执行命令display ip routing-table可以获得_public_对应的路由表,进而找到对应的默认路由记录。如:默认路由的目的地址为0.0.0.0,故可以从路由表中获得目的地(Destination)/掩码(Mask)字段所在列的值为0.0.0.0/0的那一行对应的默认路由记录,将该默认路由记录中的下一跳转发地址(NextHoop)字段所在列的ip值确定为_public_对应的下一跳ip(记为A)。
步骤S22:在获取到各个VRF信息各自对应的下一跳ip之后,从各个VRF信息对应的arp表中,获取各个下一跳ip各自对应的端口信息。
在具体实施时,可以根据VRF信息对应的arp表中的接口字段,确定该VRF信息对应的下一跳ip所关联的接口信息(也可称作端口信息)。
以上述交换机X为例,在交换机X上执行display arp命令,可以得到_public_对应的arp表。找到arp表中IP地址(IP ADDRESS)字段所在列中ip等于A的那一行,该行中接口(INTERFACE)字段所在列的值即为_public_对应的接口信息。后续可以根据该接口信息的信息类型,找到具体的物理端口,这些物理端口就是交换机的上行出口。
步骤S23:根据各个端口信息,识别交换机的上行出口。
在具体实施时,为便于后续的流量监控及计费等功能的实现,可以确定各个端口信
息各自对应的目标物理端口,根据各个目标物理端口,识别交换机中各个VRF信息各自对应的上行出口。
作为一种可能的实施方式,考虑到从arp表中获取到的端口信息主要为物理端口信息、汇聚端口信息、以及vlan端口的vlan信息中的一者。故针对各个端口信息中的物理端口信息,可以将物理端口信息对应的物理端口,确定为目标物理端口;针对各个端口信息中的汇聚端口信息,可以将汇聚端口信息对应的汇聚口中的物理端口成员,确定为目标物理端口;针对各个端口信息中的虚拟局域网vlan信息,可以将配置了vlan信息的物理端口或配置了vlan信息的汇聚端口中的物理端口成员,确定为目标物理端口。
示例性地,如图3所示,在获取到任一VRF信息对应的端口信息之后,可以先判断该端口信息是否为交换机端口(即物理端口)的信息,若该端口信息是物理端口信息,则根据该物理端口信息找到对应的目标物理端口,若该端口信息不是物理端口信息,则判断该端口信息是否为汇聚端口信息,若该端口信息是汇聚端口信息,则根据该汇聚端口信息找到对应的物理端口成员(即多个物理端口),将找到的物理端口成员确定为对应的目标物理端口,若该端口信息不是汇聚端口信息,则判断该端口信息是否为vlan端口的vlan信息(如vlan id),若该端口信息是vlan端口的vlan信息,则将配置了该vlan信息的物理端口(可以是汇聚端口中的物理端口成员),确定为对应的目标物理端口。
步骤S24:对识别出的上行出口进行校验。
可以理解的是,考虑到交换机上配置的VRF相关信息(如VRF名称与运营商线路之间的对应关系)与数据库中记录的VRF相关信息可能存在不一致的情况,从而导致上行出口识别出错,故可以基于运营商线路的公网网段对识别出的上行出口进行校验,以验证识别结果的正确性。
在具体实施时,可以获取数据库中记录的各个VRF信息各自对应的运营商线路的第一公网网段,并获取交换机配置的各个VRF信息各自对应的第一公网ip段集合。
其中,可以获取VRF信息对应的所有vlan端口,根据各个vlan端口配置的公网ip和掩码,确定VRF信息对应的第一公网ip段集合。
以上述交换机X为例,可以在交换机X上执行display interface Vlanif命令,从而获得_public_下绑定的所有vlan的配置信息,每个vlan配置信息中的网络地址(Internet Address)即为交换机中对该vlan配置的公网ip和掩码。通过该公网ip和掩码即可计算
ip网段,通过将_public_下绑定的所有vlan被配置的公网ip网段存储在同一集合中,即可得_public_对应的第一公网ip段集合。
在得到各个第一公网ip段集合和第一公网网段之后,判断各个VRF信息各自对应的第一公网ip段集合中是否存在对应的第一公网网段,也即是判断数据库记录的对应的运营商线路的公网网段是否在对应的公网ip段集合中存在。以上述交换机X为例,此时需要判断117.31.42.1/28的网段是否在_public_对应的第一公网ip段集合中。
对于各个VRF信息中对应的第一公网ip段集合中存在对应的第一公网网段的第一VRF信息,判定第一VRF信息对应的上行出口的识别结果正确。
可以理解的是,对于同一运营商线路,交换机对该运营商线路配置的所有公网ip段集合应至少包含数据库记录的该运营商线路的公网网段。若数据库记录的对应的运营商线路的公网网段在对应的公网ip段集合中存在,则说明交换机上配置的VRF相关信息与数据库中记录的VRF相关信息一致,故可以判定识别出的该VRF信息(即第一VRF信息)对应的上行出口,为数据库所记录的对应运营商线路的正确上行出口(即识别结果正确)。
对于各个VRF信息中对应的第一公网ip段集合中不存在对应的第一公网网段的第二VRF信息,判定第二VRF信息对应的上行出口的识别结果错误,并针对第二VRF信息生成告警信息。
可以理解的是,若数据库记录的对应的运营商线路的公网网段在对应的公网ip段集合中不存在,则说明交换机上配置的VRF相关信息与数据库中记录的VRF相关信息不一致,以致此次识别并未找到数据库中所记录的对应运营商线路的正确上行出口,故判定该VRF信息(即第二VRF信息)对应的识别结果错误,并生成该第二VRF信息对应的告警信息,以便网络运维对数据库中记录的该第二VRF信息的相关信息(如VRF名称与运营商线路之间的对应关系)进行更正。
步骤S25:对上行出口识别失败的VRF信息进行告警。
可以理解的是,如果在上面的识别过程中出现识别不到某一VRF信息的上行出口的情况,则说明在集成商和网络运维阶段没有配置正确的VRF相关信息,此时可以将识别失败的相关信息(如VRF名称、及其对应的运营商线路等信息)告警出来,等待网络运维在数据库里记录下该交换机对应线路正确的VRF信息,然后重新执行上述识别流程。
在具体实施时,获取数据库中交换机对应的第三VRF信息,该第三VRF信息可以是:数据库中该交换机对应的VRF列表中存在的VRF信息。再针对未识别出对应的上行出口的第三VRF信息(如对应VRF列表中存在但在该交换机中不存在的VRF信息),生成告警信息。
作为一种可能的实施方式,可以将上述生成的告警信息所对应的VRF信息确定为第四VRF信息,由于交换机配置的VRF相关信息不能变更,故可以根据交换机配置的VRF相关信息,在数据库中调整该第四VRF信息与运营商线路之间的对应关系,以使交换机配置的VRF相关信息与数据库中记录的VRF相关信息保持一致,从而保证上行出口的正确识别。
步骤S26:将本次识别出的交换机的上行出口与上一次识别出的交换机的上行出口进行比较,在本次识别出的交换机的上行出口与上一次识别出的交换机的上行出口存在不同的情况下,生成告警信息。
在具体实施时,可以设置定时任务以对交换机定时执行上述识别流程。对于同一交换机,除第一次执行上行出口识别时,可以将识别出的上行出口信息保存至数据库之外,后续每次识别出的上行出口都需与上一次识别出的上行出口进行对比,在识别出的上行出口发生变化的情况下,将相关信息(如两次识别出的上行出口、以及上行出口对应的VRF信息等)进行展示告警,以提醒网络运维处理,当网络运维确认该上行出口的变更正确后,触发更新操作以将本次识别出的上行出口的相关信息更新到数据库。从而结合自动化扫描脚本和定时任务下发,能够实现对交换机的上行出口的实时识别、以及对数据库中记录的上行出口信息的实时纠正。
基于上述实施例,传统的交换机上行出口识别方法是在交换机集成的时候,手动在交换机的上行出口的描述里加上关键字,当扫描程序识别到交换机端口的描述包含该关键字时,即认为该交换机端口是交换机的上行出口。这种识别方式虽然简单,但过于依赖人工干预。当网络运维同事更新端口描述不及时的时候,扫描程序将识别不到正确的上行出口。
针对上述问题,本申请提出了一种新的交换机上行出口识别方案,通过交换机的VRF信息对应的默认路由和arp表找到对应的上行出口,该方案不需要人工干预且识别准确。当某个上行出口发生了调整,扫描程序也能在没有人工干预的情况下自动识别上行出口
并更新数据库中对应的上行出口信息。当交换机有多个公网VRF的情况下,也可以分别识别到每个公网VRF的交换机上行出口,进而分别监控对应的出口流量。同时,由于VRF在业务上线后是无法调整的,除非将业务下线后才可以进行相应调整,因此执行了上述实施例识别流程的自动识别程序,对已经上线后的边缘集群的上行出口识别是十分准确的,不会因为人工的干预造成数据的不准确而最终影响业务收入。
对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请实施例并不受所描述的动作顺序的限制,因为依据本申请实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本申请实施例所必须的。
第二方面,图4是本申请实施例的一种上行出口识别装置的结构示意图,装置包括:
获取模块,用于从交换机的路由表和地址解析协议arp表中,获取交换机配置的各个VRF信息各自对应的默认路由记录和arp表;
处理模块,用于根据各个默认路由记录和各个arp表,确定各个VRF信息各自对应的端口信息;
识别模块,用于根据各个端口信息,识别交换机的上行出口。
采用本申请实施例的技术方案,根据交换机的各个VRF信息对应的默认路由记录和arp表,可以找到各个VRF信息各自所对应数据包的默认转发端口(即交换机的上行出口),从而基于默认路由实现对交换机上行出口的自动识别,能够提高上行出口识别的准确性。
在本申请一些实施例中,处理模块包括:
第一处理子模块,用于从各个默认路由记录中,获取各个VRF信息各自对应的下一跳ip;
第二处理子模块,用于从各个arp表中,获取各个下一跳ip各自对应的端口信息。
在本申请一些实施例中,识别模块包括:
第一识别子模块,用于确定各个端口信息各自对应的目标物理端口;
第二识别子模块,用于根据各个目标物理端口,识别交换机中各个VRF信息各自对应的上行出口。
在本申请一些实施例中,第二识别子模块包括:
第一确定模块,用于针对各个端口信息中的物理端口信息,将物理端口信息对应的物理端口,确定为目标物理端口;
第二确定模块,用于针对各个端口信息中的汇聚端口信息,将汇聚端口信息对应的汇聚口中的物理端口成员,确定为目标物理端口;
第三确定模块,用于针对各个端口信息中的虚拟局域网vlan信息,将配置了vlan信息的物理端口或配置了vlan信息的汇聚端口中的物理端口成员,确定为目标物理端口。
在本申请一些实施例中,根据各个端口信息,识别交换机的上行出口之后,装置还包括:
网段获取模块,用于获取数据库中记录的各个VRF信息各自对应的运营商线路的第一公网网段,并获取交换机配置的各个VRF信息各自对应的第一公网ip段集合;
第一判断模块,用于判断各个VRF信息各自对应的第一公网ip段集合中是否存在对应的第一公网网段;
第一响应模块,用于对于各个VRF信息中对应的第一公网ip段集合中存在对应的第一公网网段的第一VRF信息,判定第一VRF信息对应的上行出口的识别结果正确;
第二响应模块,用于对于各个VRF信息中对应的第一公网ip段集合中不存在对应的第一公网网段的第二VRF信息,判定第二VRF信息对应的上行出口的识别结果错误,并针对第二VRF信息生成告警信息。
在本申请一些实施例中,对于每个VRF信息,网段获取模块包括:
第一网段获取子模块,用于获取交换机中VRF信息对应的所有vlan端口;
第二网段获取子模块,用于根据各个vlan端口配置的公网ip和掩码,确定VRF信息对应的第一公网ip段集合
在本申请一些实施例中,装置还包括:
信息获取模块,用于获取数据库中交换机对应的第三VRF信息;
第一生成模块,用于针对未识别出对应的上行出口的第三VRF信息,生成告警信息。
在本申请一些实施例中,装置还包括:
信息处理模块,用于将告警信息对应的VRF信息确定为第四VRF信息;
数据处理模块,用于在数据库中调整第四VRF信息与运营商线路之间的对应关系。
在本申请一些实施例中,根据各个端口信息,识别交换机的上行出口之后,装置还包括:
结果比较模块,用于将本次识别出的交换机的上行出口与上一次识别出的交换机的上行出口进行比较;
第二生成模块,用于在本次识别出的交换机的上行出口与上一次识别出的交换机的上行出口存在不同的情况下,生成告警信息。
在本申请一些实施例中,从交换机的路由表和地址解析协议arp表中,获取交换机配置的各个VRF信息各自对应的默认路由记录和arp表之前,装置还包括:
自动扫描模块,用于利用扫描脚本采集交换机的基本信息,基本信息至少包括交换机配置的各个VRF信息,基本信息还包括交换机端口信息、各个VRF信息各自对应的路由表、以及各个VRF信息各自对应的arp表中的至少一者。
在本申请一些实施例中,自动扫描模块包括:
扫描子模块,用于利用扫描脚本通过简单网络管理协议snmp和/或安全外壳协议ssh的方式,采集交换机的基本信息。
需要说明的是,装置实施例与方法实施例相近,故描述的较为简单,相关之处参见方法实施例即可。
本申请实施例还提供了一种电子设备,参照图5,图5是本申请实施例提出的电子设备的示意图。如图5所示,电子设备100包括:存储器110和处理器120,存储器110与处理器120之间通过总线通信连接,存储器110中存储有计算机程序,该计算机程序可在处理器120上运行,进而实现本申请实施例公开的上行出口识别方法中的步骤。
本申请实施例还提供了一种计算机可读存储介质,其上存储有计算机程序/指令,该计算机程序/指令被处理器执行时实现如本申请实施例公开的上行出口识别方法。
本申请实施例还提供了一种计算机程序产品,包括计算机程序/指令,该计算机程序/指令被处理器执行时实现如本申请实施例公开的上行出口识别方法。
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。
本领域内的技术人员应明白,本申请实施例的实施例可提供为方法、装置或计算机程序产品。因此,本申请实施例可采用完全硬件实施例、完全软件实施例、或结合软件
和硬件方面的实施例的形式。而且,本申请实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本申请实施例是参照根据本申请实施例的方法、系统、设备、存储介质及程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设备上,使得在计算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本申请实施例的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请实施例范围的所有变更和修改。
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、物品或者终端设备中还存在另
外的相同要素。
以上对本申请所提供的一种上行出口识别方法、装置及设备、介质和产品,进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上,本说明书内容不应理解为对本申请的限制。
Claims (15)
- 一种上行出口识别方法,其特征在于,所述方法包括:从交换机的路由表和地址解析协议arp表中,获取所述交换机配置的各个虚拟路由转发VRF信息各自对应的默认路由记录和arp表;根据各个所述默认路由记录和各个所述arp表,确定各个所述VRF信息各自对应的端口信息;根据各个所述端口信息,识别所述交换机的上行出口。
- 根据权利要求1所述的方法,其特征在于,所述根据各个所述默认路由记录和各个所述arp表,确定各个所述VRF信息各自对应的端口信息,包括:从各个所述默认路由记录中,获取各个所述VRF信息各自对应的下一跳ip;从各个所述arp表中,获取各个所述下一跳ip各自对应的端口信息。
- 根据权利要求1所述的方法,其特征在于,所述根据各个所述端口信息,识别所述交换机的上行出口,包括:确定各个所述端口信息各自对应的目标物理端口;根据各个所述目标物理端口,识别所述交换机中各个所述VRF信息各自对应的上行出口。
- 根据权利要求3所述的方法,其特征在于,所述确定各个所述端口信息各自对应的目标物理端口,包括:针对各个所述端口信息中的物理端口信息,将所述物理端口信息对应的物理端口,确定为所述目标物理端口;针对各个所述端口信息中的汇聚端口信息,将所述汇聚端口信息对应的汇聚口中的物理端口成员,确定为所述目标物理端口;针对各个所述端口信息中的虚拟局域网vlan信息,将配置了所述vlan信息的物理端口或配置了所述vlan信息的汇聚端口中的物理端口成员,确定为所述目标物理端口。
- 根据权利要求1所述的方法,其特征在于,所述根据各个所述端口信息,识别所述交换机的上行出口之后,所述方法还包括:获取数据库中记录的各个所述VRF信息各自对应的运营商线路的第一公网网段,并获取所述交换机配置的各个所述VRF信息各自对应的第一公网ip段集合;判断各个所述VRF信息各自对应的第一公网ip段集合中是否存在对应的第一公网网 段;对于各个所述VRF信息中对应的第一公网ip段集合中存在对应的第一公网网段的第一VRF信息,判定所述第一VRF信息对应的上行出口的识别结果正确;对于各个所述VRF信息中对应的第一公网ip段集合中不存在对应的第一公网网段的第二VRF信息,判定所述第二VRF信息对应的上行出口的识别结果错误,并针对所述第二VRF信息生成告警信息。
- 根据权利要求5所述的方法,其特征在于,对于每个VRF信息,所述VRF信息对应的第一公网ip段集合通过以下步骤确定:获取所述交换机中所述VRF信息对应的所有vlan端口;根据各个所述vlan端口配置的公网ip和掩码,确定所述VRF信息对应的第一公网ip段集合。
- 根据权利要求1-6任一所述的方法,其特征在于,所述方法还包括:获取数据库中所述交换机对应的第三VRF信息;针对未识别出对应的上行出口的第三VRF信息,生成告警信息。
- 根据权利要求7所述的方法,其特征在于,所述方法还包括:将所述告警信息对应的VRF信息确定为第四VRF信息;在所述数据库中调整所述第四VRF信息与运营商线路之间的对应关系。
- 根据权利要求1-6任一所述的方法,其特征在于,所述根据各个所述端口信息,识别所述交换机的上行出口之后,所述方法还包括:将本次识别出的交换机的上行出口与上一次识别出的交换机的上行出口进行比较;在本次识别出的交换机的上行出口与上一次识别出的交换机的上行出口存在不同的情况下,生成告警信息。
- 根据权利要求1-6任一所述的方法,其特征在于,所述从交换机的路由表和地址解析协议arp表中,获取所述交换机配置的各个VRF信息各自对应的默认路由记录和arp表之前,所述方法还包括:利用扫描脚本采集所述交换机的基本信息,所述基本信息至少包括所述交换机配置的各个所述VRF信息,所述基本信息还包括交换机端口信息、各个所述VRF信息各自对应的路由表、以及各个所述VRF信息各自对应的arp表中的至少一者。
- 根据权利要求10所述的方法,其特征在于,所述利用扫描脚本采集所述交换机的基本信息,包括:利用扫描脚本通过简单网络管理协议snmp和/或安全外壳协议ssh的方式,采集所述交换机的基本信息。
- 一种上行出口识别装置,其特征在于,所述装置包括:获取模块,用于从交换机的路由表和地址解析协议arp表中,获取所述交换机配置的各个VRF信息各自对应的默认路由记录和arp表;处理模块,用于根据各个所述默认路由记录和各个所述arp表,确定各个所述VRF信息各自对应的端口信息;识别模块,用于根据各个所述端口信息,识别所述交换机的上行出口。
- 一种电子设备,包括存储器、处理器及存储在所述存储器上的计算机程序,其特征在于,所述处理器执行所述计算机程序以实现如权利要求1至11中任一项所述的上行出口识别方法。
- 一种计算机可读存储介质,其上存储有计算机程序/指令,其特征在于,该计算机程序/指令被处理器执行时实现如权利要求1至11中任一项所述的上行出口识别方法。
- 一种计算机程序产品,包括计算机程序/指令,其特征在于,该计算机程序/指令被处理器执行时实现如权利要求1至11中任一项所述的上行出口识别方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310048000.8A CN115883456B (zh) | 2023-01-31 | 2023-01-31 | 一种上行出口识别方法、装置及设备、介质和产品 |
CN202310048000.8 | 2023-01-31 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2024159954A1 true WO2024159954A1 (zh) | 2024-08-08 |
Family
ID=85758596
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2023/139955 WO2024159954A1 (zh) | 2023-01-31 | 2023-12-19 | 一种上行出口识别方法、装置及设备、介质和产品 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN115883456B (zh) |
WO (1) | WO2024159954A1 (zh) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115883456B (zh) * | 2023-01-31 | 2023-06-23 | 天翼云科技有限公司 | 一种上行出口识别方法、装置及设备、介质和产品 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102217253A (zh) * | 2011-05-05 | 2011-10-12 | 华为技术有限公司 | 报文转发方法、装置及网络设备 |
US20140229631A1 (en) * | 2013-02-11 | 2014-08-14 | Avaya Inc. | Optimized distributed routing for stretched data center models through updating route advertisements based on changes to address resolution protocol (arp) tables |
CN115225604A (zh) * | 2022-07-15 | 2022-10-21 | 北京天融信网络安全技术有限公司 | 网络设备信息获取的方法、装置、电子设备及存储介质 |
CN115426326A (zh) * | 2022-08-09 | 2022-12-02 | 中国电信股份有限公司 | 识别上行中继端口的方法、装置、设备、介质及程序产品 |
CN115883456A (zh) * | 2023-01-31 | 2023-03-31 | 天翼云科技有限公司 | 一种上行出口识别方法、装置及设备、介质和产品 |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101707617B (zh) * | 2009-12-04 | 2012-08-15 | 福建星网锐捷网络有限公司 | 报文过滤方法、装置及网络设备 |
CN104301229B (zh) * | 2014-09-26 | 2016-05-04 | 深圳市腾讯计算机系统有限公司 | 数据包转发方法、路由表生成方法及装置 |
CN108809847B (zh) * | 2017-05-05 | 2021-11-19 | 华为技术有限公司 | 实现负载均衡的方法、装置和网络系统 |
CN107222436A (zh) * | 2017-05-26 | 2017-09-29 | 上海携程商务有限公司 | 基于mac地址的网络端口管理方法及系统 |
US11206212B2 (en) * | 2019-12-16 | 2021-12-21 | Vmware, Inc. | Disambiguating traffic in networking environments with multiple virtual routing and forwarding (VRF) logical routers |
CN112910776B (zh) * | 2021-01-18 | 2022-10-18 | 北京火山引擎科技有限公司 | 一种数据转发方法、装置、设备及介质 |
-
2023
- 2023-01-31 CN CN202310048000.8A patent/CN115883456B/zh active Active
- 2023-12-19 WO PCT/CN2023/139955 patent/WO2024159954A1/zh unknown
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102217253A (zh) * | 2011-05-05 | 2011-10-12 | 华为技术有限公司 | 报文转发方法、装置及网络设备 |
US20140229631A1 (en) * | 2013-02-11 | 2014-08-14 | Avaya Inc. | Optimized distributed routing for stretched data center models through updating route advertisements based on changes to address resolution protocol (arp) tables |
CN115225604A (zh) * | 2022-07-15 | 2022-10-21 | 北京天融信网络安全技术有限公司 | 网络设备信息获取的方法、装置、电子设备及存储介质 |
CN115426326A (zh) * | 2022-08-09 | 2022-12-02 | 中国电信股份有限公司 | 识别上行中继端口的方法、装置、设备、介质及程序产品 |
CN115883456A (zh) * | 2023-01-31 | 2023-03-31 | 天翼云科技有限公司 | 一种上行出口识别方法、装置及设备、介质和产品 |
Also Published As
Publication number | Publication date |
---|---|
CN115883456B (zh) | 2023-06-23 |
CN115883456A (zh) | 2023-03-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP2904745B1 (en) | Method and apparatus for accelerating forwarding in software-defined networks | |
US9331910B2 (en) | Methods and systems for automatic generation of routing configuration files | |
TW202026896A (zh) | 在網路路由環境中的非同步物件管理機制 | |
WO2021007963A1 (zh) | 路由分发方法及控制器、信息路由方法及网络节点设备 | |
US9544217B2 (en) | Identification of paths in a network of mixed routing/switching devices | |
US9391886B2 (en) | Identification of the paths taken through a network of interconnected devices | |
EP3854064B1 (en) | Unique identities of endpoints across layer 3 networks | |
WO2024159954A1 (zh) | 一种上行出口识别方法、装置及设备、介质和产品 | |
US9559909B2 (en) | Identifying an egress port of a device | |
US9537760B2 (en) | Executing loops | |
WO2021169290A1 (zh) | 配置性能探测指示信息的方法及相关设备 | |
WO2020114017A1 (zh) | 数据中心流量互通方法、装置、设备及存储介质 | |
WO2021047011A1 (zh) | 数据处理方法及装置、计算机存储介质 | |
US20220158937A1 (en) | Initiator-based data-plane validation for segment routed, multiprotocol label switched (mpls) networks | |
US20140314086A1 (en) | Querying a traffic forwarding table | |
CN113518045B (zh) | 一种流量采集配置方法、流量采集方法及设备 | |
US12028246B2 (en) | Collection of segment routing IPV6 (SRV6) network telemetry information | |
JP2000278264A (ja) | データネットワーク監視方法 | |
CN114095383B (zh) | 网络流量采样方法、系统和电子设备 | |
WO2019123093A1 (en) | Oss dispatcher for policy-based customer request management | |
US20230118989A1 (en) | Collection of segment routing ipv6 (srv6) network telemetry information | |
WO2019001101A1 (zh) | 路由路径分析方法及设备 | |
US10439866B2 (en) | Network event locus descriptor | |
US11855832B1 (en) | Multicast flow restoration following network failure detection | |
US11979293B2 (en) | Centralized network multicast state publication |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 23919516 Country of ref document: EP Kind code of ref document: A1 |