IPv6 real source address black-and-white list generation method based on trusted route classification
Technical Field
The invention relates to a method for generating an IPv6 real source address black-and-white list based on trusted route classification, belonging to the technical field of computer network research.
Background
The router is a main node device of the Internet, the router decides the forwarding of data through the route, the forwarding strategy is called routing (routing), which is also the source of the router name, and is used as a junction for interconnection between different networks, the router system forms the main context of the Internet based on TCP/IP, and the router forms the skeleton of the Internet.
The main task of the router is to find an optimal transmission path for each data frame passing through the router and to efficiently transmit the data to the destination site. It follows that the strategy of selecting the best path, i.e. the routing algorithm, is the key place for routers. In order to accomplish this, a router Table (Routing Table), which is related data of various transmission paths, is stored in the router, and is used for Routing, and the router Table stores contents such as the identification information of the subnet, the number of routers on the network, and the name of the next router, and may be fixedly set by a system administrator, or may be learned through a dynamic Routing protocol.
The generation of the IPv6 real source address black-and-white list needs to judge the real inlet of the data traffic according to the routing table stored in the router, so that the IPv6 real source address verification is realized at the inlet of the data traffic into the router, and the credibility of the selected routing information plays a role in the accuracy of the implementation result of the generated IPv6 real source address black-and-white list.
Therefore, how to select the route information with the highest credibility from various sources in the router provides a reliable basis for generating the black-and-white list of the IPv6 real source address, realizes the verification of the IPv6 real source address, has little or no error blocking, and is a problem to be solved in the Internet routing system. For this purpose, the present invention is proposed.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a method for generating an IPv6 real source address black-and-white list based on trusted route classification, which classifies the reliability degree of the collected route prefix information based on the router, and marks the routes from different sources in the router in a classified manner, thereby providing accurate trusted route information for generating an IPv6 real source address verified black-and-white list and achieving the aim of accurately verifying the IPv6 real source address.
Specifically, the router collects network prefix information acquired by various approaches, classifies and labels each network prefix according to the origin after analysis and arrangement, traverses a plurality of origin labels corresponding to each network prefix when the router generates an IPv6 real source address black-and-white list, scores the credibility of the classification labels of each origin, takes out route origin information with the highest credibility score, generates an IPv6 real source address black-and-white list, and realizes the function of accurately verifying the IPv6 real source address by the router.
The technical scheme of the invention is as follows:
A method for generating IPv6 real source address black-and-white list based on trusted route classification comprises the following steps:
(1) The router software system initializes a trusted IPv6 routing prefix classification table;
(2) The router software system initializes an IPv6 real source address black-and-white list;
(3) The router software system initializes a trusted route scoring table;
(4) Each module of the router assembles a trusted IPv6 prefix report message to a black-and-white list generation module;
(5) The black-and-white list generation module starts to collect trusted IPv6 prefix report messages from each module of the router and generates an IPv6 real source address black-and-white list;
(6) The black-and-white list generation module receives the trusted IPv6 prefix report message, scans the trusted IPv6 routing prefix classification table, and creates a trusted IPv6 routing prefix classification table entry and a prefix information node;
(7) Scanning and updating the information of the reliable IPv6 routing prefix classification table by utilizing the table item of the reliable IPv6 routing prefix classification table obtained in the step (6);
(8) Scanning a black-and-white list of the IPv6 real source address by utilizing the table entry of the trusted IPv6 routing prefix classification table obtained in the step (6) and updating the black-and-white list;
(9) And (5) generating prompt information in the system, and returning to the step (5) for continuous execution.
In the step (1), the reliable IPv6 routing prefix classification table comprises an IPv6 network prefix, a network prefix length and a prefix information node, wherein the IPv6 network prefix is an IPv6 network prefix of the reliable IPv6 routing, and the network prefix length is the reliable IPv6 routing prefix length;
The stored data structure of the prefix information node is a linked list and comprises a plurality of records, each record comprises a route grading value, an output interface index value, a black-and-white list type to be generated and a network identifier, the grading value is a grading value given by a system according to a trusted IPv6 route source mode, the output interface index value is an output interface index value of a trusted route, the black-and-white list type to be generated is informed of generating a black list or a white list identifier when a route module announces a prefix, the network identifier is that route prefix information of the current source is optimal trusted IPv6 route prefix information, and a trusted IPv6 route prefix classification table is initialized to be empty.
According to the preferred embodiment of the present invention, in the step (2), the black-and-white list of the IPv6 real source address includes an IPv6 real source address prefix, a prefix length, a black-and-white list identifier, and an interfacing index, where the IPv6 real source address prefix is an IPv6 source prefix of the black-and-white list, the prefix length is a mask value of the black-and-white list IPv6 source address prefix, the black-and-white list identifier is a category of a record of the current list, 0 represents the white list, 1 represents the black list, the interfacing index is an interfacing index value of entering the device when the IPv6 source address of the data stream hits the IPv6 real source address prefix, and the initial IPv6 real source address black-and-white list is null.
According to the invention, in the step (3), the trusted route scoring table comprises route types and scores, wherein the route types are route sources, the value range is 0-6, the scores are scores set by a system for the current route sources, the score value range is 0-10, the higher the scores are high in reliability of the current route types, the trusted route scoring table is initialized, information in a configuration file is read for initialization, and different route types have corresponding scores, for example, BGP route type 1, OSPF route type 2, static route type 3, direct connection route type 4 and SPA route type 5;
In step (4), the router modules assemble the reliable IPv6 prefix report message, where the message includes the IPv6 routing prefix, the prefix length, the module name, the outbound interface index value, and the black-and-white list identifier, and send the reliable IPv6 prefix report message to the black-and-white list generating module.
According to the preferred embodiment of the present invention, in step (6), specifically, an IPv6 routing prefix, a prefix length, a module name, an outgoing interface index value, and a black-and-white list identifier are extracted from a trusted IPv6 prefix report message, and the IPv6 routing prefix classification table is scanned by using the IPv6 routing prefix and the prefix length, and if no record is found, step (6.1) and step (6.2) are performed, and if a record is found, step (6.3) is performed;
(6.1) creating a trusted IPv6 routing prefix classification table entry, and filling IPv6 routing prefixes and prefix lengths obtained from the message in the step (6) into IPv6 network prefixes and network prefix length fields in the table entry;
(6.2) creating a prefix information node, filling the outlet interface index value and the black-and-white list identification obtained in the step (6) into the outlet interface index value and the type of the black-and-white list to be generated of the prefix information node, filling a network identification field into 1, and setting the newly created prefix information node as a head node of a linked list;
And (6.3) creating a prefix information node, filling the outlet interface index value and the black-and-white list identification obtained in the step (6) into the outlet interface index value and the type of the black-and-white list to be generated of the prefix information node, filling the network identification field into 0, traversing the prefix information node linked list, and putting the newly created prefix information node into the tail part of the linked list.
According to the preferred embodiment of the present invention, in the step (7), specifically, the table entry of the trusted IPv6 routing prefix classification table obtained in the step (6) is used to scan the score of the prefix information linked list, and the prefix information node record with the highest current score is taken out;
Scanning the network identification of the prefix information linked list by utilizing the list item of the trusted IPv6 routing prefix classification list in the step (6), and taking out the prefix information node record with the network identification of 1;
comparing the obtained 2 prefix information node records, if the obtained 2 prefix information node records are not the same record, executing the step (7.1), and if the obtained 2 prefix information node records are the same record, executing the step (7.2);
(7.1) changing a prefix information node record with a network identification field of 1 to 0, changing a network identification field of another prefix information node record to 1, and recording a prefix node record with a network identification field of 1;
(7.2) recording a prefix node record with a network identification field of 1.
According to the preferred embodiment of the present invention, in step (8), specifically, the IPv6 network prefix and prefix length recorded in the trusted IPv6 routing prefix classification table in step (6) are used to scan the black-and-white list of the IPv6 real source address, if the record is matched, step (8.1) is performed, and if the record is not matched, step (8.2) is performed;
(8.1) updating an interface entering index field and a black-and-white list identification field of the black-and-white list record of the IPv6 real source address acquired in the step (8) by utilizing the interface exiting index value and the type of the black-and-white list to be generated in the prefix information node record acquired in the step (7);
And (8.2) creating a black-and-white list record of the IPv6 real source address, and updating the IPv6 real source address prefix, prefix length, black-and-white list identification and interface index of the created black-and-white list record of the IPv6 real source address by utilizing the IPv6 network prefix and prefix length recorded in the trusted IPv6 routing prefix classification table in the step (6) and the type of the black-and-white list to be generated and the interface index value in the latest prefix information node obtained in the step (7).
The invention has the beneficial effects that:
The invention provides a method for generating an IPv6 real source address black-and-white list based on trusted route classification, which classifies the reliability degree of the collected route prefix information based on a router, classifies and labels routes from different sources in the router, provides accurate trusted route information for generating an IPv6 real source address verified black-and-white list, and achieves the aim of accurately verifying an IPv6 real source address.
Drawings
FIG. 1 is a schematic architecture diagram of the present invention;
FIG. 2 is a diagram of a trusted IPv6 routing prefix class representation of the present invention;
FIG. 3 is a schematic diagram of a black and white list of IPv6 real source addresses in accordance with the present invention;
FIG. 4 is a schematic diagram of a trusted routing scoring table of the present invention;
FIG. 5 is a diagram of a trusted IPv6 prefix report message according to the present invention;
FIG. 6 is a flow chart of a method according to an embodiment of the invention.
Detailed Description
The invention will now be further illustrated by way of example, but not by way of limitation, with reference to the accompanying drawings.
Example 1:
The embodiment provides a method for generating a black-and-white list of an IPv6 real source address based on trusted route classification, the schematic diagram of an architecture is shown in fig. 1, the left side of fig. 1 is a module for statically generating a trusted route prefix of a router, the module is used for marking the action position of the static generated trusted route in the architecture, the right side is a module for dynamically learning and releasing the trusted route prefix, the action position of the dynamic generated trusted route in the architecture is marked, the middle of fig. 1 is a core module for generating the black-and-white list, after the static trusted route prefix module and the dynamic trusted route prefix module report respective trusted route information, the static trusted route prefix module and the dynamic trusted route prefix module record the respective trusted route information in a trusted IPv6 route prefix classification table, and the optimal trusted IPv6 route prefix information is selected through score comparison to generate the black-and-white list of the IPv6 real source address, and the method comprises the following steps:
S100, starting a router software system, creating a trusted IPv6 routing prefix classification table and configuring an initial value;
The trusted IPv6 routing prefix classification table is shown in fig. 2, in which each IPv6 prefix and prefix mask generates a record, and each recorded prefix information node is in a linked list structure, and possibly multiple records are generated due to multiple routing sources, and each record includes an IPv6 network prefix field occupying 128 bits, a network prefix length field occupying 32 bits, and a prefix information node linked list, and each prefix information node includes a routing score value field occupying 32 bits, an outgoing interface index value field occupying 32 bits, a black-and-white list type field occupying 32 bits, and a network identification field occupying 32 bits.
S200, establishing an IPv6 real source address black-and-white list and configuring an initial value;
The black-and-white list of the IPv6 real source address is shown in fig. 3, each black-and-white list occupies a table item, and in each table item, an IPv6 real source address prefix field occupying 128 bits, a prefix length field occupying 32 bits, a black-and-white list identification field occupying 32 bits and an interface index field occupying 32 bits are respectively used.
S300, establishing a trusted route scoring table and configuring an initial value;
the trusted route scoring table is shown in fig. 4 as a routing type field occupying 8 bits and a score field occupying 8 bits, respectively.
S400, each module of the router assembles a trusted IPv6 prefix report message to a black-and-white list generation module;
The trusted IPv6 prefix report message is shown in fig. 5, and is an IPv6 routing prefix field occupying 128 bits, a prefix length field occupying 32 bits, a module name field occupying 8 bits, an outgoing interface index field occupying 16 bits, and a black-and-white list identifier field occupying 16 bits, respectively.
S500, a black-and-white list generation module starts to receive the trusted IPv6 prefix report message and generates a black-and-white list;
S600, a black-and-white list generation module receives the trusted IPv6 prefix report message sent by the step S400, extracts relevant information, scans the trusted IPv6 routing prefix classification table, executes S601 and S602 if no record exists, and executes S603 if record exists;
S601, creating a trusted IPv6 routing prefix classification table entry, and filling IPv6 network prefix and network prefix length fields in the table entry according to the information acquired in the S600;
S602, creating a prefix information node, filling the information acquired in the step S600 into the newly created prefix information node, and setting the node as a head node;
And S603, creating a prefix information node, filling the information acquired in the step S600 into the newly created prefix information node, and placing the node into the tail of a linked list.
S700, according to the obtained list item of the reliable IPv6 routing prefix classification list in S600, scanning the score field of the prefix information linked list, and taking out the prefix information node record with the highest score;
s800, according to the acquired list item of the trusted IPv6 routing prefix classification list in S600, scanning a network identification field of a prefix information linked list, and taking out a prefix information node record with a network identification of 1;
S900, comparing the two prefix information node records obtained in the S700 and the S800, if the two prefix information node records are not the same record, executing the S901, and if the two prefix information node records are the same record, executing the S902;
s901, updating network identification fields of two records, and recording prefix information node records with a preferred field of 1;
s902, recording a prefix information node record with a preferred field of 1;
s1000, scanning an IPv6 real source address black-and-white list according to the information recorded in the S600, executing the S1001 if the record exists, and executing the S1002 if the record does not exist;
s1001, updating the black-and-white list record of the IPv6 real source address acquired in S1000 according to the information acquired in S900;
S1002, creating an IPv6 real source address black-and-white list record, and updating the content of the created IPv6 real source address black-and-white list record according to the information acquired in S600 and S900;
and S1100, generating prompt information in the system, and returning to S500 for continuous execution.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.