技术领域technical field
本发明涉及数据处理技术领域,特别涉及一种交换机配置模拟下发的方法、系统及计算机。The invention relates to the technical field of data processing, in particular to a method, system and computer for simulated distribution of switch configuration.
背景技术Background technique
近年来,随着互联网流量的激增,众多公司纷纷开始对机房中的交换机设备进行换代升级,因此网络设备生产商接收到的客户订单也越来越多。受实验环境所限,设备厂商不可能对所有用户提出的需求都进行实际的组网验证。在这种背景下,急需要一种简单高效的辅助验证系统,快速的为客户反馈出当前配置的下发效果来帮助用户进行网络设备选购。因此,如何实现简单快速的交换机配置模拟下发,是本领域技术人员需要解决的技术问题。In recent years, with the surge of Internet traffic, many companies have begun to upgrade the switch equipment in the computer room, so network equipment manufacturers have received more and more customer orders. Due to the limitation of the experimental environment, it is impossible for equipment manufacturers to conduct actual networking verification for all the requirements put forward by users. In this context, there is an urgent need for a simple and efficient auxiliary verification system that can quickly provide customers with feedback on the delivery effect of the current configuration to help users purchase network equipment. Therefore, how to implement simple and fast simulated distribution of switch configuration is a technical problem to be solved by those skilled in the art.
发明内容Contents of the invention
本发明的目的是提供一种交换机配置模拟下发的系统、方法及计算机,能够脱离真实的物理设备,通过软件仿真的形式进行配置下发,并且能够方便快捷的查看当前配置在不同设备上的下发效果以此来评估单台设备性能。The purpose of the present invention is to provide a system, method and computer for simulated distribution of switch configurations, which can be separated from real physical devices, and can be configured and distributed in the form of software simulation, and can conveniently and quickly view the configurations currently configured on different devices. The delivery effect is used to evaluate the performance of a single device.
为解决上述技术问题,本发明提供一种交换机配置模拟下发的系统,包括:In order to solve the above technical problems, the present invention provides a system for simulated distribution of switch configuration, including:
MQC配置命令解析模块,用于将接收到的配置文件中MQC策略配置命令进行提取并解析,生成符合规则标准的数据信息,利用HASH表进行存储;The MQC configuration command analysis module is used to extract and analyze the MQC policy configuration commands in the received configuration file, generate data information that meets the rules and standards, and use the HASH table for storage;
端口下发配置命令解析模块,用于查找接收到的所述配置文件端口下发命令,提取端口配置信息,并创建下发实例数据结构和全局下发链表;A port delivery configuration command parsing module, configured to search for the received configuration file port delivery command, extract port configuration information, and create a delivery instance data structure and a global delivery link list;
ACL规则解析模块,用于将接收到的所述配置文件中ACL规则配置命令进行提取并解析,生成符合预定规则标准的数据结构,并利用HASH表进行存储;The ACL rule parsing module is used for extracting and parsing the ACL rule configuration command in the received configuration file, generating a data structure conforming to predetermined rule standards, and storing it in a HASH table;
底层模拟下发模块,用于根据所述HASH表、下发实例数据结构、全局下发链表及用户选择的单板类型及单板数量进行参数二次解析操作及参数匹配操作,并调用底层SDK层代码库模拟配置下发到硬件过程并返回下发结果。The bottom layer simulates the distribution module, which is used to perform parameter secondary analysis and parameter matching operations according to the HASH table, the distribution instance data structure, the global distribution list, and the board type and number selected by the user, and call the bottom layer The SDK layer code library simulates the process of sending the configuration to the hardware and returns the sending result.
其中,所述MQC配置命令解析模块,包括:Wherein, the MQC configuration command parsing module includes:
MQC class命令解析单元,用于将所述配置文件中MQC class命令进行提取并解析,使每条配置信息生成符合预定规则标准的数据结构,并创建对应的HASH节点存入HASH表中;The MQC class command parsing unit is used to extract and parse the MQC class command in the configuration file, so that each piece of configuration information generates a data structure that meets predetermined rules and standards, and creates a corresponding HASH node and stores it in the HASH table;
MQC behavior命令解析单元,用于将所述配置文件中MQC behavior命令进行提取并解析,使每条配置信息生成符合预定规则标准的数据结构,并创建对应的HASH节点存入HASH表中;The MQC behavior command analysis unit is used to extract and analyze the MQC behavior command in the configuration file, so that each piece of configuration information generates a data structure that meets predetermined rules and standards, and creates a corresponding HASH node and stores it in the HASH table;
MQC policy命令解析单元,用于根据MQC class命令及MQC behavior命令的配置信息,将所述配置文件中MQC policy命令进行提取并解析,使每条配置信息生成符合预定规则标准的数据结构,并创建对应的HASH节点存入HASH表中。The MQC policy command parsing unit is used to extract and parse the MQC policy command in the configuration file according to the configuration information of the MQC class command and the MQC behavior command, so that each piece of configuration information generates a data structure that meets predetermined rules and standards, and creates The corresponding HASH nodes are stored in the HASH table.
其中,所述端口下发配置命令解析模块具体为查找接收到的所述配置文件端口下发命令,提取端口配置信息,根据配置信息中端口号计算全局端口索引,建立端口映射关系,解析端口下发配置子命令并构建全局下发链表的模块。Wherein, the port delivery configuration command parsing module specifically searches for the port delivery command of the configuration file received, extracts port configuration information, calculates the global port index according to the port number in the configuration information, establishes a port mapping relationship, and analyzes the port delivery command. A module that distributes configuration subcommands and builds a global distribution list.
其中,所述底层模拟下发模块,包括:Wherein, the underlying simulation delivery module includes:
SAL驱动参数解析单元,用于根据所述HASH表、下发实例数据结构、全局下发链表对所述下发实例数据结构进行二次解析;The SAL drive parameter analysis unit is used to perform secondary analysis on the delivered instance data structure according to the HASH table, the delivered instance data structure, and the global delivered linked list;
ADAPT驱动适配单元,用于创建并维护一个全局ACL ENTRY下发链表;The ADAPT driver adaptation unit is used to create and maintain a global ACL ENTRY distribution list;
SOC芯片参数匹配单元,用于对各种芯片特性进行参数匹配操作;The SOC chip parameter matching unit is used to perform parameter matching operations on various chip characteristics;
SDK底层代码单元,用于调用底层SDK层代码库模拟配置下发到硬件过程并返回所选设备的ACL使用情况信息表。SDK underlying code unit, which is used to call the underlying SDK layer code library to simulate the process of sending the configuration to the hardware and return the ACL usage information table of the selected device.
本发明还提供一种交换机配置模拟下发的方法,包括:The present invention also provides a method for simulated delivery of switch configuration, including:
接收用户输入的配置文件及参数信息;其中,所述参数信息包括单板类型、槽位数量;Receive configuration files and parameter information input by the user; wherein, the parameter information includes the type of single board and the number of slots;
将所述配置文件中MQC策略配置命令进行提取并解析,生成符合规则标准的数据信息,利用HASH表进行存储;Extracting and analyzing the MQC policy configuration command in the configuration file, generating data information that meets the rules and standards, and storing it in a HASH table;
查找所述配置文件端口下发命令,提取端口配置信息,并创建下发实例数据结构和全局下发链表;Find the port delivery command in the configuration file, extract the port configuration information, and create a delivery instance data structure and a global delivery linked list;
将所述配置文件中ACL规则配置命令进行提取并解析,生成符合预定规则标准的数据结构,并利用HASH表进行存储;Extracting and parsing the ACL rule configuration command in the configuration file, generating a data structure conforming to the predetermined rule standard, and storing it in a HASH table;
根据所述HASH表、下发实例数据结构、全局下发链表及用户选择的单板类型及单板数量进行参数二次解析操作及参数匹配操作,并调用底层SDK层代码库模拟配置下发到硬件过程并返回下发结果。According to the HASH table, the delivery instance data structure, the global delivery link list, and the board type and number of boards selected by the user, the parameter secondary analysis operation and parameter matching operation are performed, and the underlying SDK layer code library is called to simulate the configuration delivery to the hardware process and return the delivery result.
其中,将所述配置文件中MQC策略配置命令进行提取并解析,生成符合规则标准的数据信息,利用HASH表进行存储,包括:Wherein, the MQC policy configuration command in the configuration file is extracted and parsed, and the data information conforming to the rules and standards is generated, and the HASH table is used for storage, including:
将所述配置文件中MQC class命令进行提取并解析,使每条配置信息生成符合预定规则标准的数据结构,并创建对应的HASH节点存入HASH表中;Extracting and analyzing the MQC class command in the configuration file, so that each piece of configuration information generates a data structure conforming to predetermined rules and standards, and creating a corresponding HASH node and storing it in the HASH table;
将所述配置文件中MQC behavior命令进行提取并解析,使每条配置信息生成符合预定规则标准的数据结构,并创建对应的HASH节点存入HASH表中;Extracting and parsing the MQC behavior command in the configuration file, so that each piece of configuration information generates a data structure that meets predetermined rules and standards, and creates a corresponding HASH node and stores it in the HASH table;
根据MQC class命令及MQC behavior命令的配置信息,将所述配置文件中MQCpolicy命令进行提取并解析,使每条配置信息生成符合预定规则标准的数据结构,并创建对应的HASH节点存入HASH表中。According to the configuration information of the MQC class command and the MQC behavior command, the MQCpolicy command in the configuration file is extracted and parsed, so that each configuration information generates a data structure that meets the predetermined rules and standards, and the corresponding HASH node is created and stored in the HASH table .
其中,查找所述配置文件端口下发命令,提取端口配置信息,并创建下发实例数据结构和全局下发链表,包括:Wherein, search for the configuration file port delivery command, extract port configuration information, and create a delivery instance data structure and a global delivery linked list, including:
查找接收到的所述配置文件端口下发命令,提取端口配置信息,根据配置信息中端口号计算全局端口索引,建立端口映射关系,解析端口下发配置子命令并构建全局下发链表。Find the received configuration file port delivery command, extract the port configuration information, calculate the global port index according to the port number in the configuration information, establish the port mapping relationship, analyze the port delivery configuration subcommand and build the global delivery linked list.
其中,根据所述HASH表、下发实例数据结构、全局下发链表及用户选择的单板类型及单板数量进行参数二次解析操作及参数匹配操作,并调用底层SDK层代码库模拟配置下发到硬件过程并返回下发结果,包括:Among them, according to the HASH table, the issued instance data structure, the global issued linked list, and the type and quantity of the single board selected by the user, the parameter secondary analysis operation and parameter matching operation are performed, and the underlying SDK layer code library is called to simulate the configuration Deliver to the hardware process and return the delivery result, including:
根据所述HASH表、下发实例数据结构、全局下发链表对所述下发实例数据结构进行二次解析;performing secondary analysis on the delivered instance data structure according to the HASH table, the delivered instance data structure, and the global delivered linked list;
创建并维护一个全局ACL ENTRY下发链表;Create and maintain a global ACL ENTRY distribution list;
对各种芯片特性进行参数匹配操作;Perform parameter matching operations on various chip characteristics;
调用底层SDK层代码库模拟配置下发到硬件过程并返回所选设备的ACL使用情况信息表。Call the underlying SDK layer code library to simulate the process of sending the configuration to the hardware and return the ACL usage information table of the selected device.
本发明还提供一种计算机,包括:根据上述任一项所述的交换机配置模拟下发的系统。The present invention also provides a computer, including: the system for issuing switch configuration simulation according to any one of the above.
本发明所提供的交换机配置模拟下发的系统,可提供多种交换机单板类型的选择,使用户脱离真实的物理设备,通过软件仿真的形式进行配置下发,并且能够方便快捷的查看当前配置在不同设备上的下发效果,以此来评估单个交换机的性能,通过比较挑选出最适合自己需求的产品;节省了大量利用物理设备进行测试的时间,可以显著缩短项目周期,节约项目成本,能够使设备公司更合理的进行人员安排,在兼顾小型客户单台设备需求的同时,还能保证充足的研发力量对大型客户的复杂需求进行验证,提高工作效率;本发明还提供了交换机配置模拟下发的方法及计算机,具有上述有益效果,在此不再赘述。The switch configuration simulation delivery system provided by the present invention can provide a variety of switch board types to choose, so that users can separate from the real physical equipment, perform configuration delivery in the form of software simulation, and can view the current configuration conveniently and quickly The delivery effect on different devices is used to evaluate the performance of a single switch, and the product that best suits your needs is selected through comparison; it saves a lot of time for testing with physical devices, which can significantly shorten the project cycle and save project costs. It can make the equipment company arrange personnel more reasonably, and while taking into account the needs of small customers for a single device, it can also ensure sufficient research and development strength to verify the complex needs of large customers and improve work efficiency; the invention also provides switch configuration simulation The distribution method and the computer have the beneficial effects mentioned above, and will not be repeated here.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only It is an embodiment of the present invention, and those skilled in the art can also obtain other drawings according to the provided drawings on the premise of not paying creative efforts.
图1为本发明实施例所提供的交换机配置模拟下发的系统的结构框图;FIG. 1 is a structural block diagram of a system for simulated distribution of switch configuration provided by an embodiment of the present invention;
图2为本发明实施例所提供的解析层的解析过程示意图;Fig. 2 is a schematic diagram of the parsing process of the parsing layer provided by the embodiment of the present invention;
图3为本发明实施例所提供的交换机配置模拟下发的方法的流程图。FIG. 3 is a flow chart of a method for simulated distribution of switch configuration provided by an embodiment of the present invention.
具体实施方式Detailed ways
本发明的核心是提供一种交换机配置模拟下发的系统、方法及计算机,能够脱离真实的物理设备,通过软件仿真的形式进行配置下发,并且能够方便快捷的查看当前配置在不同设备上的下发效果以此来评估单台设备性能。The core of the present invention is to provide a system, method and computer for simulated distribution of switch configurations, which can be separated from real physical devices, and can be configured and distributed in the form of software simulation, and can conveniently and quickly view the configurations currently configured on different devices. The delivery effect is used to evaluate the performance of a single device.
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
请参考图1,图1为本发明实施例所提供的交换机配置模拟下发的系统的结构框图;该系统可以包括:解析层设置MQC配置命令解析模块100、端口下发配置命令解析模块200及ACL规则解析模块300及底层模拟下发模块400;Please refer to Fig. 1, Fig. 1 is the structural block diagram of the system of switch configuration simulation delivery provided by the embodiment of the present invention; ACL rule parsing module 300 and underlying simulation delivery module 400;
该系统之所以在解析层设置MQC配置命令解析模块100、端口下发配置命令解析模块200及ACL规则解析模块300是由于要将一个依赖于实际硬件环境的过程,完全使用软件形式仿真出来。根据系统整体性分析,从宏观上将系统分为上层配置命令解析部分(即解析层)以及底层模拟下发部分(即底层模拟下发模块)。结合MQC配置以及配置文件中的命令行组织顺序,由于ACL规则命令位于整个配置文件的最后的位置,而在class视图的匹配规则配置中,有很大可能会提前应用到ACL规则。ACL规则的特殊位置,给解析层软件的设计带来了一定的困难,为了使得位置靠后的ACL模块配置能够提前解析,提出了“预解析,后下发”的设计思路,在应用到ACL规则的class匹配规则命令解析中,class实例结构数据仅仅记录了当前ACL组号与ACL组类型,此时并不关心当前ACL组内到底有何种规则配置,而是将对ACL规则实例结构的查找放到了底层模拟下发流程之中。由此当解析程序遇到端口下发命令行时,并不直接调用驱动接口进入模拟下发,而是将每一个待下发配置当作一个实例对象,定义一种数据结构来表示,每个字段储存着已经解析好的、要传给模拟下发接口函数的参数,并将这些下发实例数据结构以全局链表的形式组织到一起。当后续所有命令包括ACL规则配置全部解析完毕之后,遍历全局下发链表中的内容来调用驱动接口,使每项配置依次进入模拟下发阶段。The reason why the system sets the MQC configuration command analysis module 100, the port delivery configuration command analysis module 200 and the ACL rule analysis module 300 in the analysis layer is that a process that depends on the actual hardware environment is completely simulated in the form of software. According to the overall analysis of the system, the system is macroscopically divided into the upper-level configuration command analysis part (ie, the analysis layer) and the bottom-level simulation delivery part (ie, the bottom-level simulation delivery module). Combined with the MQC configuration and the order of the command line in the configuration file, since the ACL rule command is located at the end of the entire configuration file, in the matching rule configuration of the class view, it is very likely that the ACL rule will be applied in advance. The special position of the ACL rule brings certain difficulties to the design of the analysis layer software. In order to enable the ACL module configuration at a later position to be analyzed in advance, the design idea of "pre-analysis, and later delivery" is proposed. When applied to the ACL In the rule class matching rule command analysis, the class instance structure data only records the current ACL group number and ACL group type. At this time, it does not care what kind of rule configuration is in the current ACL group, but the ACL rule instance structure The search is placed in the underlying simulation delivery process. Therefore, when the parsing program encounters a port delivery command line, it does not directly call the driver interface to enter the simulation delivery, but treats each configuration to be delivered as an instance object, and defines a data structure to represent each configuration. The field stores the parsed parameters to be passed to the simulation delivery interface function, and organizes these delivery instance data structures in the form of a global linked list. After all subsequent commands including the ACL rule configuration are parsed, traverse the content in the global distribution list to call the driver interface, so that each configuration enters the simulation distribution stage in turn.
其中,ACL(Access Control List,访问控制列表)是路由器和交换机接口的指令列表,用来控制端口进出的数据包。ACL适用于所有的被路由协议,如IP、IPX、AppleTalk等。Wherein, ACL (Access Control List, access control list) is a list of instructions on the router and switch interface, and is used to control the data packets entering and leaving the port. ACL applies to all routed protocols, such as IP, IPX, AppleTalk, etc.
MQC配置命令解析模块100,用于将接收到的配置文件中MQC策略配置命令进行提取并解析,生成符合规则标准的数据信息(即预先约定的数据结构),利用HASH表进行存储;The MQC configuration command analysis module 100 is used to extract and analyze the MQC policy configuration command in the received configuration file, generate data information (i.e. a pre-agreed data structure) that meets the rules and standards, and store it using a HASH table;
具体的,由于MQC命令由class、behavior、policy三个部分组成,因此解析过程可以包括:Specifically, since the MQC command consists of three parts: class, behavior, and policy, the parsing process can include:
MQC class命令解析单元,用于将所述配置文件中MQC class命令进行提取并解析,使每条配置信息生成符合预定规则标准的数据结构,并创建对应的HASH节点存入HASH表中;The MQC class command parsing unit is used to extract and parse the MQC class command in the configuration file, so that each piece of configuration information generates a data structure that meets predetermined rules and standards, and creates a corresponding HASH node and stores it in the HASH table;
MQC behavior命令解析单元,用于将所述配置文件中MQC behavior命令进行提取并解析,使每条配置信息生成符合预定规则标准的数据结构,并创建对应的HASH节点存入HASH表中;The MQC behavior command analysis unit is used to extract and analyze the MQC behavior command in the configuration file, so that each piece of configuration information generates a data structure that meets predetermined rules and standards, and creates a corresponding HASH node and stores it in the HASH table;
MQC policy命令解析单元,用于根据MQC class命令及MQC behavior命令的配置信息,将所述配置文件中MQC policy命令进行提取并解析,使每条配置信息生成符合预定规则标准的数据结构,并创建对应的HASH节点存入HASH表中。The MQC policy command parsing unit is used to extract and parse the MQC policy command in the configuration file according to the configuration information of the MQC class command and the MQC behavior command, so that each piece of configuration information generates a data structure that meets predetermined rules and standards, and creates The corresponding HASH nodes are stored in the HASH table.
其中,在整个模拟配置下发过程中,实际要下发的数据是在MQC命令中配置好的policy策略信息,因此,在经过解析模块的处理之后,就能够建立好将要下发的数据实例信息为后续工作打下基础。Among them, in the whole simulation configuration delivery process, the actual data to be delivered is the policy policy information configured in the MQC command. Therefore, after processing by the analysis module, the data instance information to be delivered can be established. Lay the foundation for follow-up work.
端口下发配置命令解析模块200,用于查找接收到的所述配置文件端口下发命令,提取端口配置信息,并创建下发实例数据结构和全局下发链表;The port issue configuration command parsing module 200 is used to search for the received configuration file port issue command, extract port configuration information, and create an issue instance data structure and a global issue linked list;
其中,对输入的命令行配置文件进行关键字判断,用于提取出端口相关配置;若为普通端口port视图,则除了对视图命令解析之外,还要根据端口号计算全局端口索引,建立端口映射关系,为后续模拟下发过程中的端口查找奠定基础;解析下发配置子命令,并构建全局下发链表,等待调用底层驱动接口进入模拟下发阶段。输入的命令行配置文件即用户输入的配置文件,该配置文件是解析的基础。这里的下发实例数据结构即为MQC policy命令解析单元处理生成的HASH表中的节点。Among them, keyword judgment is performed on the input command line configuration file to extract port-related configuration; if it is a common port port view, in addition to parsing the view command, it is also necessary to calculate the global port index based on the port number and establish a port The mapping relationship lays the foundation for port search in the subsequent simulation delivery process; parses the delivery configuration subcommands, and builds a global delivery list, waiting to call the underlying driver interface to enter the simulation delivery stage. The input command line configuration file is the configuration file entered by the user, which is the basis for parsing. The data structure of the delivery instance here is the node in the HASH table generated by the processing of the MQC policy command parsing unit.
具体的,所述端口下发配置命令解析模块200具体用于查找接收到的所述配置文件端口下发命令,提取端口配置信息,根据配置信息中端口号计算全局端口索引,建立端口映射关系,解析端口下发配置子命令并构建全局下发链表。Specifically, the port delivery configuration command parsing module 200 is specifically configured to search for the received port delivery command of the configuration file, extract port configuration information, calculate a global port index according to the port number in the configuration information, and establish a port mapping relationship. Analyze the port delivery configuration subcommands and build a global delivery list.
ACL规则解析模块300,用于将接收到的所述配置文件中ACL规则配置命令进行提取并解析,生成符合预定规则标准的数据结构,并利用HASH表进行存储;The ACL rule parsing module 300 is configured to extract and parse the ACL rule configuration command in the received configuration file, generate a data structure conforming to predetermined rule standards, and store it in a HASH table;
其中,对命令行配置文件中ACL规则配置命令进行提取并解析,使用合理的数据结构进行存储。在底层模拟下发阶段,驱动软件会根据MQC中的class视图下的ACL匹配规则命令进行ACL组规则的查找操作。配置文件中ACL组规则命令在经过此功能模块的解析之后,就能够很方便的为后续ACL相关信息的查找操作提供遍历条件和数据,是模拟下发流程能够正确运行的重要基础。Among them, the ACL rule configuration command in the command line configuration file is extracted and parsed, and a reasonable data structure is used for storage. In the underlying simulation delivery stage, the driver software will search for ACL group rules according to the ACL matching rule command in the class view of MQC. After the ACL group rule command in the configuration file is parsed by this function module, it can easily provide traversal conditions and data for the subsequent search operation of ACL related information, which is an important basis for the correct operation of the simulation delivery process.
其中,前三个模块属于上层命令行解析模块即解析层,即根据用户输入的配置文件,以及单板类型、槽位数量等参数信息,具体的参数信息类型和种类可以根据用户实际需求进行确认,参数信息为执行配置文件的载体硬件的信息。对配置文件中的相关ACL命令进行解析,包括MQC、ACL规则和端口下发命令。MQC命令由class、behavior、policy三个部分组成,有三个对应的单元对其进行分类提取和数据解析,生成符合一定规则标准的数据结构。考虑到配置众多,因此采用HASH表的形式对解析后的数据进行存储,方便后续模拟下发过程中对相关内容进行查找。解析层的流程如图2所示,用户输入配置文件之后,图2的解析顺序,对相关配置命令依照次序进行提取解析。根据关键词提取和判断,首先进行MQC下的class、behavior两种命令的解析操作,为每一条配置信息创建一条HASH节点存入HASH表中,然后解析policy命令,依赖于class和behavior的相关配置。然后查找配置文件中的端口下发命令,记录下发端口类型、端口号等信息,创建下发实例数据结构和全局下发链表;最后解析配置文件中的ACL规则信息,同样以HASH表的形式存储。Among them, the first three modules belong to the upper-level command line analysis module, that is, the analysis layer, that is, according to the configuration file input by the user, as well as parameter information such as the type of board and the number of slots, the specific parameter information type and type can be confirmed according to the actual needs of the user. , the parameter information is the information of the carrier hardware that executes the configuration file. Analyze the related ACL commands in the configuration file, including MQC, ACL rules and port delivery commands. The MQC command consists of three parts: class, behavior, and policy. There are three corresponding units to classify, extract and analyze data to generate a data structure that meets certain rules and standards. Considering that there are many configurations, the parsed data is stored in the form of a HASH table, which is convenient for searching related content in the subsequent simulation delivery process. The flow of the parsing layer is shown in Figure 2. After the user enters the configuration file, the parsing sequence in Fig. 2 extracts and parses the relevant configuration commands in order. According to the keyword extraction and judgment, first perform the parsing operation of the class and behavior commands under MQC, create a HASH node for each piece of configuration information and store it in the HASH table, and then parse the policy command, depending on the relevant configuration of class and behavior . Then find the port delivery command in the configuration file, record the delivery port type, port number and other information, create a delivery instance data structure and a global delivery link list; finally analyze the ACL rule information in the configuration file, also in the form of a HASH table storage.
底层模拟下发模块400,用于根据所述HASH表、下发实例数据结构、全局下发链表及用户选择的单板类型及单板数量进行参数二次解析操作及参数匹配操作,并调用底层SDK层代码库模拟配置下发到硬件过程并返回下发结果。The underlying simulation delivery module 400 is used to perform parameter secondary parsing operations and parameter matching operations according to the HASH table, the delivery instance data structure, the global delivery link list, and the board type and number of boards selected by the user, and call The underlying SDK layer code library simulates the process of sending the configuration to the hardware and returns the sending result.
具体的,底层模拟下发模块400属于模拟下发层包括:Specifically, the underlying simulation delivery module 400 belongs to the simulation delivery layer and includes:
SAL驱动参数解析单元,用于根据所述HASH表、下发实例数据结构、全局下发链表对所述下发实例数据结构进行二次解析,主要完成二次解析。The SAL drive parameter parsing unit is configured to perform secondary analysis on the delivered instance data structure according to the HASH table, the delivered instance data structure, and the global delivered linked list, mainly to complete the secondary analysis.
ADAPT驱动适配单元,用于创建并维护一个全局ACL ENTRY下发链表;The ADAPT driver adaptation unit is used to create and maintain a global ACL ENTRY distribution list;
其中,此链表是传递给最底层SDK库函数的数据结构。根据SAL解析层传入的“生效范围信息”,选择是否需要扩展链表节点,即“外扩”。比如选择对单板所有外部端口生效,需要针对每个芯片复制链表节点并将匹配端口掩码设置为E_PORT。Among them, this linked list is the data structure passed to the bottom SDK library function. According to the "effective scope information" passed in by the SAL analysis layer, it is selected whether to expand the linked list nodes, that is, "outward expansion". For example, if you choose to take effect on all external ports of the board, you need to copy the linked list nodes for each chip and set the matching port mask to E_PORT.
SOC芯片参数匹配单元,用于对各种芯片特性进行参数匹配操作;The SOC chip parameter matching unit is used to perform parameter matching operations on various chip characteristics;
SDK底层代码单元,用于调用底层SDK层代码库模拟配置下发到硬件过程并返回所选设备的ACL使用情况信息表。SDK underlying code unit, which is used to call the underlying SDK layer code library to simulate the process of sending the configuration to the hardware and return the ACL usage information table of the selected device.
在执行上述几个单元时,首先对它们进行初始化操作。When executing the above-mentioned several units, initialize them first.
底层模拟下发模块400的具体工作过程如下:The specific working process of the underlying simulation delivery module 400 is as follows:
当解析层正确执行后,会调用底层模拟下发模块,通过底层模拟下发模块的接口进入模拟下发阶段。首先模拟系统的初始化阶段,包括SAL驱动参数解析单元中的令行解析初始化、ADAPT驱动适配单元中驱动软件初始化、SDK底层代码单元中SDK软件初始化。然后进入SAL驱动参数解析单元对上层传入的下发配置实例进行二次解析,创建并维护一个全局ACL ENTRY下发链表,此链表是传递给最底层SDK库函数的数据结构。SOC芯片参数匹配单元主要负责对各种芯片特性进行适配操作,主要作用是维护slice的划分,group、entry、meter、counter的申请和释放。SDK底层代码单元主要就是引用了最底层的下发模块代码进行模拟物理下发操作,如果SDK层能够正常返回,则说明模拟下发过程成功,并返回当前所选设备的ACL使用情况信息表。When the parsing layer is executed correctly, it will call the underlying simulation delivery module, and enter the simulation delivery stage through the interface of the bottom simulation delivery module. Firstly, simulate the initialization phase of the system, including the command line analysis initialization in the SAL driver parameter analysis unit, the driver software initialization in the ADAPT driver adaptation unit, and the SDK software initialization in the SDK underlying code unit. Then enter the SAL driver parameter parsing unit to perform secondary parsing on the issued configuration instance passed in from the upper layer, create and maintain a global ACL ENTRY issued linked list, which is the data structure passed to the bottom SDK library function. The SOC chip parameter matching unit is mainly responsible for adapting various chip characteristics. Its main function is to maintain the division of slices, apply and release group, entry, meter, and counter. The underlying code unit of the SDK mainly refers to the lowest-level delivery module code to simulate the physical delivery operation. If the SDK layer can return normally, it means that the simulation delivery process is successful, and returns the ACL usage information table of the currently selected device.
基于上述技术方案,本发明实施例提供的交换机配置模拟下发的系统,该系统摒弃了在物理交换机上进行测试的传统方法,以用户提供的配置文件为基础,用软件仿真的形式以最快的速度为客户反馈出当前配置的下发效果。ACL具有强大的规则过滤功能,在交换机软件系统中应用范围极广,因此优先在ACL模块上实现模拟配置下发,有着更为重要的实用价值。Based on the above technical solution, the embodiment of the present invention provides a switch configuration simulation delivery system, which abandons the traditional method of testing on a physical switch, and uses software simulation as the fastest Feedback the delivery effect of the current configuration to the customer at a faster speed. ACL has a powerful rule filtering function and has a wide range of applications in the switch software system. Therefore, it is more important to implement analog configuration delivery on the ACL module first, which has more important practical value.
下面对本发明实施例提供的交换机配置模拟下发的方法及计算机进行介绍,下文描述的交换机配置模拟下发的方法及计算机与上文描述的交换机配置模拟下发的系统可相互对应参照。The method and computer for simulated delivery of switch configurations provided by the embodiments of the present invention are introduced below. The method for simulated delivery of switch configurations and the computer described below and the system for simulated delivery of switch configurations described above can be referred to in correspondence.
请参考图3,图3为本发明实施例所提供的交换机配置模拟下发的方法的流程图;该方法可以包括:Please refer to FIG. 3. FIG. 3 is a flowchart of a method for simulated distribution of switch configuration provided by an embodiment of the present invention; the method may include:
S100、接收用户输入的配置文件及参数信息;其中,所述参数信息包括单板类型、槽位数量;S100. Receive the configuration file and parameter information input by the user; wherein, the parameter information includes the type of the board and the number of slots;
S110、将所述配置文件中MQC策略配置命令进行提取并解析,生成符合规则标准的数据信息,利用HASH表进行存储;S110. Extract and analyze the MQC policy configuration command in the configuration file, generate data information conforming to the rules and standards, and store it in a HASH table;
S120、查找所述配置文件端口下发命令,提取端口配置信息,并创建下发实例数据结构和全局下发链表;S120. Search for the port delivery command in the configuration file, extract port configuration information, and create a delivery instance data structure and a global delivery linked list;
S130、将所述配置文件中ACL规则配置命令进行提取并解析,生成符合预定规则标准的数据结构,并利用HASH表进行存储;S130. Extract and parse the ACL rule configuration command in the configuration file, generate a data structure conforming to predetermined rule standards, and store it in a HASH table;
S140、根据所述HASH表、下发实例数据结构、全局下发链表及用户选择的单板类型及单板数量进行参数二次解析操作及参数匹配操作,并调用底层SDK层代码库模拟配置下发到硬件过程并返回下发结果。S140. According to the HASH table, the delivery instance data structure, the global delivery link list, and the board type and number of boards selected by the user, perform parameter secondary analysis and parameter matching operations, and call the underlying SDK layer code library to simulate configuration Send to the hardware process and return the sending result.
可选的,将所述配置文件中MQC策略配置命令进行提取并解析,生成符合规则标准的数据信息,利用HASH表进行存储,包括:Optionally, the MQC policy configuration commands in the configuration file are extracted and parsed to generate data information conforming to the rules and standards, and stored in a HASH table, including:
将所述配置文件中MQC class命令进行提取并解析,使每条配置信息生成符合预定规则标准的数据结构,并创建对应的HASH节点存入HASH表中;Extracting and analyzing the MQC class command in the configuration file, so that each piece of configuration information generates a data structure conforming to predetermined rules and standards, and creating a corresponding HASH node and storing it in the HASH table;
将所述配置文件中MQC behavior命令进行提取并解析,使每条配置信息生成符合预定规则标准的数据结构,并创建对应的HASH节点存入HASH表中;Extracting and parsing the MQC behavior command in the configuration file, so that each piece of configuration information generates a data structure that meets predetermined rules and standards, and creates a corresponding HASH node and stores it in the HASH table;
根据MQC class命令及MQC behavior命令的配置信息,将所述配置文件中MQCpolicy命令进行提取并解析,使每条配置信息生成符合预定规则标准的数据结构,并创建对应的HASH节点存入HASH表中。According to the configuration information of the MQC class command and the MQC behavior command, the MQCpolicy command in the configuration file is extracted and parsed, so that each configuration information generates a data structure that meets the predetermined rules and standards, and the corresponding HASH node is created and stored in the HASH table .
可选的,查找所述配置文件端口下发命令,提取端口配置信息,并创建下发实例数据结构和全局下发链表,包括:Optionally, search for the port delivery command in the configuration file, extract the port configuration information, and create a delivery instance data structure and a global delivery linked list, including:
查找接收到的所述配置文件端口下发命令,提取端口配置信息,根据配置信息中端口号计算全局端口索引,建立端口映射关系,解析端口下发配置子命令并构建全局下发链表。Find the received configuration file port delivery command, extract the port configuration information, calculate the global port index according to the port number in the configuration information, establish the port mapping relationship, analyze the port delivery configuration subcommand and build the global delivery linked list.
可选的,根据所述HASH表、下发实例数据结构、全局下发链表及用户选择的单板类型及单板数量进行参数二次解析操作及参数匹配操作,并调用底层SDK层代码库模拟配置下发到硬件过程并返回下发结果,包括:Optionally, according to the HASH table, the issued instance data structure, the global issued linked list, and the board type and number of boards selected by the user, perform parameter secondary parsing operations and parameter matching operations, and call the underlying SDK layer code library The simulated configuration is delivered to the hardware process and returns the delivery result, including:
根据所述HASH表、下发实例数据结构、全局下发链表对所述下发实例数据结构进行二次解析;performing secondary analysis on the delivered instance data structure according to the HASH table, the delivered instance data structure, and the global delivered linked list;
创建并维护一个全局ACL ENTRY下发链表;Create and maintain a global ACL ENTRY distribution list;
对各种芯片特性进行参数匹配操作;Perform parameter matching operations on various chip characteristics;
调用底层SDK层代码库模拟配置下发到硬件过程并返回所选设备的ACL使用情况信息表。Call the underlying SDK layer code library to simulate the process of sending the configuration to the hardware and return the ACL usage information table of the selected device.
本发明还提供一种计算机,包括:根据上述任意实施例所述的交换机配置模拟下发的系统。The present invention also provides a computer, including: the system for issuing switch configuration simulation according to any of the above embodiments.
说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。Each embodiment in the description is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same and similar parts of each embodiment can be referred to each other. As for the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and for the related information, please refer to the description of the method part.
专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Professionals can further realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software or a combination of the two. In order to clearly illustrate the possible For interchangeability, in the above description, the composition and steps of each example have been generally described according to their functions. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present invention.
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of the methods or algorithms described in connection with the embodiments disclosed herein may be directly implemented by hardware, software modules executed by a processor, or a combination of both. Software modules can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other Any other known storage medium.
以上对本发明所提供的交换机配置模拟下发的系统、方法及计算机进行了详细介绍。本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想。应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以对本发明进行若干改进和修饰,这些改进和修饰也落入本发明权利要求的保护范围内。The system, method and computer for simulated distribution of switch configuration provided by the present invention have been introduced in detail above. In this paper, specific examples are used to illustrate the principle and implementation of the present invention, and the descriptions of the above embodiments are only used to help understand the method and core idea of the present invention. It should be pointed out that for those skilled in the art, without departing from the principle of the present invention, some improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610701798.1ACN106375109B (en) | 2016-08-22 | 2016-08-22 | A kind of method, system and computer that interchanger configuration simulation issues |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610701798.1ACN106375109B (en) | 2016-08-22 | 2016-08-22 | A kind of method, system and computer that interchanger configuration simulation issues |
| Publication Number | Publication Date |
|---|---|
| CN106375109A CN106375109A (en) | 2017-02-01 |
| CN106375109Btrue CN106375109B (en) | 2019-09-24 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201610701798.1AActiveCN106375109B (en) | 2016-08-22 | 2016-08-22 | A kind of method, system and computer that interchanger configuration simulation issues |
| Country | Link |
|---|---|
| CN (1) | CN106375109B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109558142B (en)* | 2019-01-14 | 2021-10-29 | 郑州云海信息技术有限公司 | Method and device for transplanting an open network installation environment |
| CN114567581B (en)* | 2022-01-14 | 2023-12-26 | 新华三技术有限公司合肥分公司 | Method and equipment for configuring table items |
| CN117201315B (en)* | 2023-11-03 | 2024-01-30 | 之江实验室 | A command issuing method and device in a multi-modal network programming environment |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103997414A (en)* | 2013-02-18 | 2014-08-20 | 华为技术有限公司 | Method and network control unit for generating configuration information |
| WO2014209265A1 (en)* | 2013-06-24 | 2014-12-31 | Hewlett Packard Development Company, L.P. | Hard zoning corresponding to flow |
| CN104394008A (en)* | 2014-10-10 | 2015-03-04 | 广东电网有限责任公司电力科学研究院 | A method for configuring uniformly different types of intelligent electronic devices and the system thereof |
| CN105634986A (en)* | 2014-11-30 | 2016-06-01 | 中国科学院沈阳自动化研究所 | Switch implementation method and system |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103997414A (en)* | 2013-02-18 | 2014-08-20 | 华为技术有限公司 | Method and network control unit for generating configuration information |
| WO2014209265A1 (en)* | 2013-06-24 | 2014-12-31 | Hewlett Packard Development Company, L.P. | Hard zoning corresponding to flow |
| CN104394008A (en)* | 2014-10-10 | 2015-03-04 | 广东电网有限责任公司电力科学研究院 | A method for configuring uniformly different types of intelligent electronic devices and the system thereof |
| CN105634986A (en)* | 2014-11-30 | 2016-06-01 | 中国科学院沈阳自动化研究所 | Switch implementation method and system |
| Title |
|---|
| ACL、QoS和策略路由在数据中心的应用;赵云飞 等;《信息通信》;20130531;第74-76页* |
| Publication number | Publication date |
|---|---|
| CN106375109A (en) | 2017-02-01 |
| Publication | Publication Date | Title |
|---|---|---|
| CN107516895B (en) | Distribution network rapid simulation method, device, storage medium and computer equipment thereof | |
| CN110535831A (en) | Cluster safety management method, device and storage medium based on Kubernetes and network domains | |
| CN103138981B (en) | A kind of social network analysis method and apparatus | |
| US20200092168A1 (en) | Production software application performance and resiliency testing | |
| CN109840533A (en) | A kind of applied topology figure recognition methods and device | |
| CN106375109B (en) | A kind of method, system and computer that interchanger configuration simulation issues | |
| CN108108466A (en) | Distributed system log query analysis method and device | |
| CN109033109A (en) | Data processing method and system | |
| CN102902547A (en) | Command construction and analysis method of command line interface | |
| US20210089426A1 (en) | Parsing hierarchical session log data for search and analytics | |
| CN112311571A (en) | Network topology generation method and device, electronic equipment and non-transient storage medium | |
| CN114817389A (en) | Data processing method, data processing device, storage medium and electronic equipment | |
| CN113364631B (en) | Network topology management method, device, equipment and computer storage medium | |
| CN106559498A (en) | Air control data collection platform and its collection method | |
| US20250265049A1 (en) | Systems, Methods, And Devices for Automatic Application Programming Interface Model Generation Based on Network Traffic | |
| CN103152212B (en) | A kind of alarm correlation analysis method, device and network management system | |
| CN103218682A (en) | Multi-part collaborative service process monitoring system based on Web service arranging description language | |
| US9767170B2 (en) | Storage area network zone optimization | |
| CN106776275B (en) | A method for automatic generation of test flow based on packet multiplexing | |
| CN106330556B (en) | A kind of method and apparatus calling related information for generating service module | |
| CN118713857A (en) | Asset identification method, device and processing equipment based on flow log | |
| CN115878713B (en) | A fast query method and platform for complex large-scale SDN network entities | |
| CN107770188B (en) | Efficient automatic message mirroring method based on universal server | |
| CN104243234A (en) | Method and system for constructing user relationship in social network communication topology | |
| CN104715087A (en) | Novel interactive simulation state traveling operating method synthetic system |
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |