US20070038775A1 - Rule engine - Google Patents

Rule engine Download PDF

Info

Publication number
US20070038775A1
US20070038775A1 US11/584,051 US58405106A US2007038775A1 US 20070038775 A1 US20070038775 A1 US 20070038775A1 US 58405106 A US58405106 A US 58405106A US 2007038775 A1 US2007038775 A1 US 2007038775A1
Authority
US
United States
Prior art keywords
rule
graph
executable instructions
session
node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Abandoned
Application number
US11/584,051
Inventor
Pankaj Parekh
Sandeep Gupta
Vijay Mamtani
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
iPolicy Networks Inc
Original Assignee
iPolicy Networks Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by iPolicy Networks Inc filed Critical iPolicy Networks Inc
Priority to US11/584,051 priority Critical patent/US20070038775A1/en
Assigned to IPOLICY NETWORKS INC. reassignment IPOLICY NETWORKS INC. ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: MAMTANI, VIJAY, GUPTA, SANDEEP, PAREKH, PANKAJ
Publication of US20070038775A1 publication Critical patent/US20070038775A1/en
Abandoned legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/48Routing tree calculation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/02Network architectures or network communication protocols for network security for separating internal from external traffic, e.g. firewalls
    • H04L63/0227Filtering policies
    • H04L63/0254Stateful filtering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/02Network architectures or network communication protocols for network security for separating internal from external traffic, e.g. firewalls
    • H04L63/0227Filtering policies
    • H04L63/0263Rule management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Definitions

  • the invention relates to integrated policy enforcement systems for computer networks.
  • the invention provides a method and system for evaluating data packets against configured rules and mapping the packets to the rules that have matched for an integrated policy enforcement system.
  • a network may be defined as a group of computers and associated devices that are connected via communication links. These communication links can be wireless communication links. All the devices connected over a network are capable of communicating (i.e. sending and receiving information) with other devices connected to the network.
  • a network can range from one that connects a few devices in a single office to one that spans continents and connects several thousand computers and associated devices.
  • Networks are generally classified as Local Area Networks (LANs) and Wide Area Networks (WANs) based on the geographic area they cover.
  • a LAN is a network connecting servers, computers and associated devices within a small geographic area. LANs are widely used to connect servers, computers and devices in organizations to exchange information.
  • a WAN is a network that links at least two LANs, which are spread over a wide geographic area.
  • a network of an organization connecting devices and resources of the organization is called an intranet. The devices and resources in an intranet may be connected over a LAN or WAN.
  • the globally interlinked collection of LANs, WANs and intranets is called Internet.
  • the Internet can thus be called a network of networks.
  • the Internet allows exchange of information between LANs, WANs and intranets that are connected to it.
  • Network traffic comprises data packets flowing through the network.
  • the policy comprises a set of rules that checks data packets flowing though the network for irregularities.
  • the rules comprise conditions that are checked based on properties of data packets. Based on this check, the security solution regulates network traffic.
  • Firewalls are installed between an organization's intranet and the Internet. Firewalls, being policy-based security devices, selectively allow or disallow data packets from entering or leaving the organization's intranet.
  • Firewalls inspect each data packet entering or leaving the intranet against a set of rules. Hence, the performance of a firewall suffers with an increase in the number of rules, because each data packet has to be checked against an increased number of rules. This decreases the number of packets that the firewall can process per unit time. Moreover, an increase in the volume of network traffic increases the number of packets that have to be checked against the rules per unit time. Due to these limitations, conventional firewall systems are capable of implementing only a limited number of rules and can handle only a limited volume of network traffic.
  • firewalls are not provide a complete security solution. This is because firewalls can be circumvented through various techniques such as “tunneling” and “back doors”. Moreover, a firewall alone cannot provide information regarding any attack that is successfully repelled. Such information can be used to block future such attacks. Intrusion Detection Systems (IDS) are thus used as a protection against such attempts to exploit the devices connected over the network.
  • IDS Intrusion Detection Systems
  • Intrusion Detection Systems adopt either a network or a host based approach to recognize and stop attacks. In both cases, the IDS looks for attack signatures. Attack signatures are patterns that indicate any harmful intent. If an IDS checks for such patterns in network traffic, then it is said to be following a network-based approach. Whereas, if an IDS searches for attack signatures in log files then it is said to be following a host based approach. Log files contain records of events and activities taking place at individual computers and associated devices. If an attack is detected, the IDS may take corrective measures like administrator notification and connection termination. Network-based IDS is essentially used for detecting attacks that emanate from outside the organization's intranet. Typically, network-based IDS use two approaches to analyze the network traffic, viz.
  • Pattern matching involves comparison of network traffic with signatures of known attacks. These signatures are generally stored in a database and serve as a basis of comparison with the network traffic.
  • anomaly detection the IDS checks for any unusual activity in the network traffic. An unusual activity is defined as one that deviates to a large extent from the normal state of the network traffic. In case IDS finds any such activity, it generates an alert such as administrator notification.
  • the above-mentioned security systems may be deployed by Internet Service Providers (ISPs) to ensure safety of their customer's intranets.
  • ISPs provide these security services to their customers in addition to various other services like ‘Quality of Service’.
  • Quality of Service refers to the ability of an ISP to provide a customer with the best available services based on the terms and conditions of their agreement.
  • the ISPs need to implement policies in order to take a decision for the same.
  • the above-mentioned policy enforcement systems have some inherent advantages. For ISPs and big organizations it becomes necessary to integrate two or more of the above systems to provide enhanced security and services. For example, an organization may like to have network-based IDS behind a firewall. This configuration will provide enhanced security as it would raise an alert in case of incoming network packets that may have circumvented the firewall. Thus, integrated systems have the potential of offering enhanced security.
  • the packet is passed to the second security device for possible processing using security rules defined for the second device.
  • the process of passing the data packet to the next security device is repeated until the data packet is processed or until the last security device passes the data packet as unprocessed.
  • This system requires a plurality of security devices to have rules of descending strictness.
  • processing of data packets by every security device involves rechecking of some conditions defined in the rules. This is because some conditions that were already checked may be rechecked again when the data packet passes through subsequent security devices. This reprocessing will make the above system inefficient if there are a large number of policies to be implemented or if the volume of network traffic increases.
  • a network security system that offers the capability of integrating two or more security devices to offer enhanced security.
  • the system should also be capable of implementing a large number of rules over a large volume of network traffic without adversely affecting its performance.
  • An object of the present invention is to perform traversal of a rule mesh for checking packets against nodes in the rule mesh; the nodes signifying rules or parts of configured rules.
  • Another object of the present invention is to provide information for every packet regarding rules matched by each packet.
  • Still another object of the present invention is to improve efficiency of rule mesh traversal for subsequent packets of a session by ensuring that subsequent packets having same expression values as an already checked packet are not rechecked against same nodes.
  • Yet another object of the present invention is to resume path traversal from any intermediate node of the rule mesh, for most of the packets on the Internet to gain in performance.
  • a rule engine traverses a rule mesh having path nodes and path edges arranged in form of a tree part and a graph part.
  • the rule engine evaluates packets flowing through a network to determine rules matched for every packet.
  • the rule engine flags a node in the rule mesh for subsequent packets of a session to start traversal from this flagged node.
  • the information regarding flagged node is stored in a session entry. Subsequent packets having same expression values as an already checked packet are not rechecked against the same nodes in the rule mesh. This is achieved through the use of this information stored in session entry.
  • the rule engine while traversing the rule mesh for a packet performs a search on every path node to determine the next path edge to traverse.
  • the path edge leads to another path node where the process of search is repeated.
  • the rule mesh consists of rule tree on the top followed by the rule graph at the leaf edge of each rule tree.
  • RCB Rule Confirmation Bitmap
  • GTB Graph Traversal Bitmap
  • the values of RCB and GTB are computed at every path edge during graph traversal.
  • RCB gets formed into a bitmap that indicates the rules confirmed or matched amongst the pending rules in the graph, while GTB degenerates to NULL as all pending rules get either eliminated or confirmed into RCB.
  • Tree-Id and RCB generated at the end of rule mesh traversal are indicative of path traversed and rules matched by a packet.
  • the tree-Id and RCB together are referred to as rule lookup-Id. These are appended in the packet extension for subsequent modules of integrated policy enforcement system.
  • FIG. 1 is a schematic diagram that illustrates the functional modules of an exemplary Policy Agent.
  • FIG. 2 is a flowchart illustrating a method for processing of packets by a Rule Engine Module.
  • FIG. 3 is a flowchart illustrating steps involved in rule mesh traversal.
  • FIG. 4 is a flowchart illustrating actions performed by rule engine on receiving a control signal from Application Decode Module.
  • FIG. 5 is a table illustrating actions that the rule engine may perform for change in expression categories of two consecutive path nodes P 1 and P 2 .
  • FIG. 6 is a table illustrating skip value computed using a configured pattern match search algorithm.
  • FIG. 7 is a table illustrating the multi-level Trie for string compare.
  • Data packets This term refers to units of data that are sent on any packet switched network or the like, and encompasses Transmission Control Protocol/Internet Protocol (TCP/IP) packets, User Datagram Protocol (UDP) packets, which may also be referred to as datagrams, or any other such units of data.
  • TCP/IP Transmission Control Protocol/Internet Protocol
  • UDP User Datagram Protocol
  • Expression denotes a property of network traffic whose value determines the outcome of a condition. Examples of expressions include source IP address, destination IP address, and layer 3 protocols.
  • Rule mesh A data structure, which is a combination of two types of data structures namely, tree and graph.
  • the data structure starts as a tree, the leaf nodes of tree end into a graph.
  • a tree data structure is a data structure comprising nodes and edges.
  • a node can be root node, leaf node or an internal node.
  • the root node is the starting node of a tree. There is only one root node in a tree. On traversing the tree from top to bottom, the root node is the first node encountered. The tree starts from a root node and ends at leaf nodes. Nodes other than root node and leaf nodes are termed internal nodes.
  • An Internal node has one or more child nodes and is called the parent of its child nodes. All children of the same node are siblings. In a tree only one path exists between two nodes.
  • a graph data structure is a data structure comprising vertices and edges.
  • the vertices of the graph are equivalent to nodes of a tree and are connected via edges. In a graph, there can be multiple paths between two vertices.
  • Tree-graph This refers to a data structure, which is a combination of two types of data structures namely, tree and graph.
  • the tree-graph data structure starts as a tree.
  • the tree ends at tree leafs, from where the graphs start
  • Path node A path node refers to a node in the rule mesh.
  • the rule engine starts traversal from a root path node and takes a path edge based on the result of the search done on the path node.
  • the path edge leads the rule engine to the next path node, where “search and jump to next path node” operation is repeated.
  • Path edge is an edge that starts from a path node and leads to the next path node.
  • a path edge may lead to a tree node or to a graph node.
  • Matched rules in tree A rule may get matched in the tree part of the expression tree-graph, also referred to as the rule mesh. An edge of a tree gives the rules that have matched as a result of reaching that part of the tree. For the rule engine, a leaf of the tree, which is also the start of the graph, gives all the rules that have matched in the tree leading to the start of graph.
  • Pending rules in graph On the edge of a tree few rules have got matched within the tree, while few others would get matched in the graph below. The rules that would get matched or decided in the graph are grouped in a set of pending rules. In the graph, a few rules out of the pending list of rules may match and few others may get eliminated.
  • Start of graph The start of graph is the first node of the graph. A leaf tree edge always leads to the start of graph. The start of graph gives the ‘pending rules in graph’. The leaf edge gives the Tree-Id.
  • the present invention is a system and method for evaluating packets against configured rules and mapping the packets to the rules that have matched.
  • the present invention is envisaged to be operating within an integrated policy enforcement system hereinafter referred to as Policy Agent.
  • the policy agent may be embodied in a product such as the ipEnforcer 5000® as provided by iPolicy Networks Inc. of Fremont, Calif. This product is used to enforce management policies on networks, and is placed at a point where packets enter a network. Further, the policy agent may be encoded in a programming language such as C or Assembly.
  • the Policy Agent scans packets as they pass through it, and enforces network policies on these packets.
  • the Policy Agent may be variously provided, a description of one such Policy Agent can be found in U.S. patent application Ser. No. 10/052,745 filed on Jan. 17, 2002, and titled “Architecture for an Integrated Policy Enforcement System”; the entire contents of which are hereby incorporated by reference.
  • the present invention may be adapted to operate in other Policy Agents by one skilled in the art.
  • FIG. 1 is a schematic diagram that illustrates the functional modules of an exemplary Policy Agent.
  • the various functional modules of the Policy Agent are Generic Extension Builder 101 , Session Cache Module 103 , Application Decode Module 105 , Rule Engine Module 107 and Policy Entities 109 .
  • the Policy Agent is also supported by a Policy Manager 111 .
  • a packet entering the Policy Agent travels through these functional modules.
  • Each functional module appends its output to extensions in the packet, which are then used by subsequent modules of the Policy Agent.
  • Generic Extension Builder 101 processes the packet headers for information related to Open Systems Interconnection (OSI) Layer 2 and Layer 3.
  • OSI Open Systems Interconnection
  • Session Cache Module 103 processes the packet headers for information related to OSI Layer 4 and layers above it.
  • Application Decode Module 105 identifies the application generating the packet and tracks the packet as it transitions from one application state to another.
  • Rule Engine Module 107 makes policy decisions based on the information gathered from the previous modules. It identifies rules matched by a packet, and passes this information to Policy Entities 109 .
  • Policy Entities 109 comprises policy-processing modules, which are also referred to as Service Application Modules (SAMs). These modules analyze the packet further according to its requirements and enforce policies. SAMs include, but are not limited to, Firewall modules, Intrusion Detection System (IDS) modules and Virtual Private Network (VPN) modules.
  • SAMs include, but are not limited to, Firewall modules, Intrusion Detection System (IDS) modules and Virtual Private Network (VPN) modules.
  • Policy Manager 111 comprises policy rules, which are implemented by the Policy Agent.
  • FIG. 2 illustrates the method for processing of packets by Rule Engine Module 107 .
  • the rule engine traverses a rule mesh for evaluating a stream of packets flowing through a network against rules configured in the rule mesh.
  • the rule mesh is generated by a rule compiler.
  • the structure and creation of the rule mesh have been described in co pending U.S. patent application Ser. No. 10/264,889 titled ‘Rule compiler for computer network policy enforcement systems’, the disclosure of which is hereby incorporated by reference.
  • the rule mesh is a combination of tree and graph data structures. It would be evident to a person skilled in the art that this design enables striking of a balance between execution speed afforded by a tree data structure, and memory space saving provided by a graph data structure. Further, it would also be evident to a person skilled in the art that there can be numerous other data structures that may be employed.
  • the rule mesh is a combination of path nodes and path edges.
  • a path node denotes an expression against which a packet is checked. Based on such a check, a path edge is chosen for traversal.
  • Each leaf level path edge of the tree part of the rule mesh leads into a graph.
  • the graph consists of path nodes and path edges arranged as a mesh instead of a tree.
  • the rule engine traverses these path nodes and path edges to reach the end of the rule mesh traversal.
  • the traversal of the rule mesh for every packet generates a rule lookup-Id for the given packet.
  • the rule lookup-Id is used to indicate the rules matched by a packet during rule mesh traversal.
  • the rule lookup-Id is populated in a packet extension and travels along with the packet to other modules of the Policy Agent.
  • the rule engine starts traversal of the rule mesh from a path node referred to as a root path node.
  • the rule engine begins traversal of the tree data structure starting from the root path node. The tree traversal continues till the rule engine arrives at a ‘start of graph’ path node.
  • the rule engine performs a search at each path node. Every path node specifies the search to be performed to determine a path edge. This path edge leads the rule engine to the next path node against which the packet should be evaluated.
  • a rule may get matched in the tree part of the rule mesh. An edge of a tree gives the rules that have matched so far.
  • a leaf edge of the tree which leads to a ‘start of the graph’ path node, gives all the rules that have matched for a given packet within the tree part of rule mesh.
  • the rule engine arrives at a path node that signals ‘start of graph’, the tree traversal terminates. At this stage the rule engine collects a ‘Tree-Id’ from the path edge that leads it to the ‘start of graph’ path node.
  • the ‘start of graph’ path node is the first node of the graph.
  • a tree leaf edge always leads to a ‘start of graph’ path node.
  • the ‘start of graph’ gives the ‘pending rules in graph’.
  • the packet being evaluated may have matched few rules within the tree, while few other rules remain pending against which the packet needs to be checked. The packet is checked against these pending rules in the graph that are grouped in a set of pending rules.
  • the graph traversal starts at a ‘start of graph’ path node and continues till the end of rule mesh traversal.
  • the rule engine traverses the rule mesh till at least one of the conditions governing end of rule mesh traversal are satisfied. These conditions governing end of rule mesh traversal are described in detail later. All throughout the graph traversal, the rule engine maintains two bitmaps: namely, a Rule Confirmation Bitmap (RCB) and a Graph Traversal Bitmap (GTB).
  • RDB Rule Confirmation Bitmap
  • GTB Graph Traversal Bitmap
  • each graph edge comprises two bitmaps, namely: a Confirmation Bitmap (CB) and an Elimination Bitmap (EB).
  • CB Confirmation Bitmap
  • EB Elimination Bitmap
  • the rule engine arrives at a graph edge, it re-computes values of RCB and GTB based on occurring values of RCB and GTB and values of CB and EB for the particular path edge arrived at.
  • a path edge leads the rule engine along with the new values of RCB and GTB to the next path node against which a packet is to be evaluated.
  • the graph traversal ends when a condition governing the end of rule mesh traversal is satisfied.
  • the nodes in the rule mesh represent different expressions supported.
  • the different expressions supported fall into three different expression categories namely: session-based, control-based and data-based.
  • a session-based expression is one, whose value remains the same for all packets of a session such as a TCP based session or a UDP based session.
  • Each packet of an application based on TCP or UDP (referred to as the packets of the session) is characterized by a set comprising the source and destination IP addresses, source and destination port numbers and Layer-4 protocol value. All values related to these expressions remain constant and do not change for different packets of a session. Therefore, once these values have been evaluated for a given packet of a session, they need not be evaluated again for subsequent packets of the same session.
  • a control-based expression is one, whose value changes rarely for different packets of a session.
  • the expressions related to higher-level application transactions and the application parameters fall into the category of control-based expressions.
  • the FTP session enters a GET transaction state, when a FTP client sends a ‘GET’ message to the FTP server. Thereafter many packets are transacted between the FTP client and server as part of the FTP GET transaction processing. Therefore, the value of FTP_Tx for all these packets of the session remains ‘GET’. However, after ‘GET’, the client might send a ‘PUT’ transaction to the FTP server. At this point, the value of the expression FTP_Tx changes from ‘GET’ to ‘PUT’.
  • control-based expression category for a stream of packets
  • the Application Decode Module is described in co-pending U.S. patent application Ser. No. 10/264,971, titled ‘Application Decoding Engine for Computer Networks’, the disclosure of which is hereby incorporated by reference.
  • the action performed by the rule engine on receiving a signal from Application Decode Module is explained in detail in FIG. 4 .
  • the session-based expressions need to be evaluated only for a given packet of a session and all other packets of the same session are not required to be re-evaluated.
  • the control-based expressions need to be evaluated only for first packet of every session received after having received a control signal from the Application Decode Module.
  • the data-based expressions are those, whose value may change for each packet of a session. They need to be evaluated for each packet of a session.
  • expressions such as packet direction and time are treated as session based expressions.
  • packet direction and time are data based expressions and need to be evaluated for every packet of a session.
  • the Rule Engine Module maintains two separate positions for start of traversal of the rule mesh, one for the incoming packet direction and another for the outgoing packet direction.
  • ‘packet direction’ expression can be treated as a session-based expression. The value of the expression would not change for all packets of a session flowing in the same direction.
  • a session receives the same treatment determined by the time when the session started, irrespective of the time change while the session is in progress.
  • weights are assigned to different expressions based on certain criteria. Amongst these criteria, the one that carries the maximum weight-age is the category of a session. A session-based expression always has a higher weight-age than control-based expressions, which in turn have higher weight-age than data-based expressions.
  • the Rule Compiler Module ensures that nodes denoting session-based expressions (session-based nodes) appear on top of rule mesh; followed by the nodes denoting control-based expressions (control-based nodes); and lastly the nodes denoting data-based expressions (data-based nodes) are placed. Thus, when the rule engine traverses rule mesh, it first encounters session-based expressions.
  • the rule engine encounters control-based expressions and lastly it comes across data-based expressions. This structuring of the rule mesh eliminates the need to evaluate subsequent packets of a session that have the same expression value as an already evaluated packet, for same nodes, against which the latter has been evaluated.
  • the Session Cache Module 103 adds information in the packet extension identifying a packet as a packet of a session based application. Session Cache Module 103 also appends a session flag and other session related static information in the packet extension of each packet of a session based application.
  • the session flag may take different values, for e.g.
  • SC_CREATE (a packet carrying this flag creates the session and is the first packet of a session)
  • SC_SETUP (a packet carrying this flag is a normal packet in the middle of a session)
  • SC_CLOSE (a packet carrying this flag is the final packet of a session and closes a session).
  • a Session Cache Module is described in co-pending U.S. application Ser. No. 10/052,745 titled “Architecture for an Integrated Policy Enforcement System”. The Session Cache Module 103 thus maps a packet received to a session.
  • the Session Cache Module 103 appends session information to the packet extension that indicates if a packet is that of a session based application (like those based on TCP or UDP) or a packet of other applications i.e. non session based application.
  • the Policy Agent treats packets of a TCP or UDP based application as packets of a session based application and performs session based optimization for such packets, it would be evident to one skilled in the art that optimization for packets of applications that are based on other Level 4 protocols can also be achieved.
  • the Session Cache Module 103 maintains a session cache, which contains the data for all active sessions in the Policy Agent.
  • the mapping of packet to a session lends enhanced performance to rest of the modules, as in many cases all packets of a session are given the same treatment.
  • the Session Cache Module 103 updates the packet extension with the session flag and all the other data that is static for the session.
  • Session create is a flag that is carried in the packet extension of the first packet of a session based application such as a TCP or UDP based application.
  • a session entry is initialized.
  • the Session Cache Module 103 creates the session entry. Presence of session create flag denotes that the packet is first packet of a session based application.
  • a session entry stores key elements that are used to resume path traversal from any intermediate node of the rule mesh.
  • the session entry contains one set of these key elements for each direction of the session, i.e. incoming and outgoing directions. Further, the session entry contains a data set and a control set for each direction, i.e. incoming and outgoing directions.
  • Data set indicates the position from where the traversal needs to start for all packets of a session
  • control set indicates the position from where the traversal should start after the rule engine receives a control signal from the Application Decode Module 105 .
  • the action on receiving a control signal is described later in FIG. 4 in detail.
  • Initialization of session entry involves initializing control and data sets of the session entry, for both incoming and outgoing directions, to point to a root node.
  • the data and control sets for each direction comprise values for a start path node, a Tree-Id, RCB and GTB.
  • a start path node is the node from where a packet starts traversal of the rule mesh.
  • a Tree-Id is a value that represents a unique Id for a given tree leaf edge.
  • RCB is a bitmap that the rule engine updates while traversing the graph. Each bit represents a rule from the set of ‘pending rules in graph’. A bit in this bitmap gets set, if the rule is matched in the graph.
  • GTB is a bitmap that the rule engine updates while traversing the graph. Each bit represents a rule from the set of ‘pending rules in graph’. The rule engine stops traversal of rule mesh when this bitmap becomes zero.
  • the rule engine therefore stores four sets of the above mentioned variables in each session entry maintained by it.
  • the rule engine updates the control and data sets in the session entry, while doing rule mesh traversal. As the rule engine traverses through the rule mesh, passing from one path node to another, it encounters a change in the expression category of the path nodes. Two consecutive path nodes, say P 1 and P 2 , may have same or different expression categories. The actions that the rule engine may perform for all possible combination of expressions are shown in FIG. 5 .
  • the rule engine retrieves start node from data set in the session entry.
  • the session entry is initialized to point to the root node. This is done by initializing the data set in the session entry to point to the root node.
  • the session create packet starts traversal from root node.
  • the session entry is retrieved.
  • the session entry is saved in a memory, from where it is retrieved.
  • the absence of a session create flag indicates that the packet is a not the first packet of a session based application.
  • the rule engine retrieves the node for start of traversal from the data set of the session entry and continues traversal from the node retrieved. Thus, subsequent packets of a session based application start traversal from the start node retrieved from the data set of the session entry.
  • a root node is assigned as the node for start of traversal for this packet. For all packets, not having a session flag i.e. non-session based applications; the root node is assigned as the start node.
  • all packets of applications based on ICMP or IGMP start traversal from the root node.
  • the rule engine proceeds with rule mesh traversal at step 215 . Subsequently, at step 217 , a check is again made to determine whether the packet is that of a session based application. If the session flag is present denoting that the packet is a session based application packet, then, at step 219 , node for start of traversal for subsequent packets is saved in the session entry. Following which, at step 221 , the rule lookup-Id, which comprises the Tree-Id and RCB is appended to the packet extension. This rule lookup-Id is used by the SAMs to determine the actions they need to take corresponding to the rules that have matched for the individual SAMs.
  • a rule lookup table is used by rule lookup macros of individual SAMs.
  • Each SAM contains one rule lookup table. This table is indexed using the Tree-Id and then the rule lookup macro traverses through the rule lookup table using the RCB to find matching rules.
  • step 217 in case the packet is not that of a session based application then the rule lookup-Id is appended to the packet extension at step 221 .
  • FIG. 3 illustrates rule mesh traversal.
  • the start node (P 1 ) for traversal is determined.
  • Step 301 of determining start node may involve either step 213 of retrieving start node from session entry or step 207 of assigning start node as root node, as have been elaborated in FIG. 2 .
  • the search indicated in P 1 is carried out to determine a path edge for traversal.
  • the path edge is retrieved from a path edge table.
  • a path edge table stores the different tree and graph edges of the rule mesh.
  • Each path node of the rule mesh stores the location into the path edge table, where the edge entries for that path node start.
  • the rule engine retrieves the index of next path node from the path edge.
  • the index of the next path node is used to retrieve the path node from the path node table.
  • the rule engine retrieves the next path node from the path node table.
  • RCB and GTB are computed from a Confirmation Bitmap (CB) and an Elimination Bitmap (EB).
  • CB is a bitmap maintained within a graph edge. Each bit in it represents a rule from the set of ‘pending rules in graph’. A bit in this bitmap is set for a graph edge, if taking that edge confirms a rule from the pending set.
  • EB is a bitmap maintained within a graph edge. Each bit in the EB represents a rule from the set of ‘pending rules in graph’. A bit in this bitmap is set if the rule is eliminated as a result of taking that edge.
  • the rule compiler computes and populates CB and EB on each graph edge. This is explained in detail in co-pending U.S. patent application Ser. No. 10/264,889 titled ‘Rule compiler for computer network policy enforcement systems’, the disclosure of which is hereby incorporated by reference.
  • the rule engine As the rule engine arrives at a graph edge, it re-computes values of RCB and GTB based on occurring values of RCB and GTB and values of CB and EB for the particular path edge arrived at. In this way, a path edge leads the rule engine along with the new values of RCB and GTB to the next path node against which a packet is to be evaluated.
  • GTB ) GTB GTB & EB
  • step 317 After retrieving the next path node (P 2 ), at step 317 , a check is made whether end of rule traversal is reached. The end of rule traversal is reached if conditions governing end of traversal are satisfied.
  • the packet extension is appended with the rule lookup-Id, which is the Tree-Id and the RCB taken together.
  • the type of change in the expression category is determined. For example, while the rule engine traverses from a path node P 1 to another path node P 2 ; P 1 may be a session-based node and P 2 may also be session-based node; P 1 may be session-based node and P 2 may be a control based node; P 1 may be a session-based node and P 2 may be a data-based node; P 1 may be a control-based node and P 2 may also be a control-based node; P 1 may be a control-based node and P 2 may be a data-based node or P 1 may be a data-based node and P 2 also a data-based node.
  • control set of the session entry or the data set of the session entry is updated as per the following criteria.
  • the rule engine For the rule engine to update the start node for a session in a data set, the rule engine needs to determine the transition from session-based nodes to data-based nodes or from control-based nodes to data-based nodes. By updating the data set, traversal for subsequent packets is required only for the data-based nodes, thereby skipping the session-based nodes and control-based nodes that do not often change values within the session.
  • the rule engine stores the start node in a control set for a session. For this purpose, the rule engine needs to determine the transition from session-based nodes to control-based nodes or from session-based nodes to data-based nodes. When Application Decode Module sends a control signal, the rule engine starts traversal from start of control-based nodes, as the values of packets for these nodes might have changed.
  • rule engine starts traversal from the start node of data-based nodes.
  • the Rule engine starts traversal from the start node of control-based node stored in the session entry.
  • step 325 node P 1 is set as node P 2 and the whole process is repeated again till end of traversal.
  • a path node table stores the different tree and graph nodes of the rule mesh.
  • the rule engine starts processing at a root path node, which is the first row of this table.
  • Each path node specifies a search address, operation to be performed, location of path edges corresponding to that path node, location and size of operands and also contains two path edges within its structure.
  • the two path edges correspond to the most often-occurring path edges.
  • the values of RCB and GTB corresponding to these path edges are also stored in the path node.
  • the rule engine first does a comparison of current values of the expression against the values stored in the path nodes to check if it could take any of the two path edges stored in the path node.
  • the path edges are stored in a path edge table. For each path edge this table also stores the path node that is arrived at as a result of traversing that path edge.
  • the rule engine uses various search mechanisms to decide the path edge to be taken corresponding to a path node. These search mechanisms have been described in detail later.
  • Each path node is like a condition element that is evaluated and the result of the evaluation determines the path edge to be taken.
  • a condition might be stated as: If Protocol_ID is 2 then edge 1, if it is 5 then edge 2 and if it is 25 then edge 3.
  • the Protocol_ID is a value corresponding to a packet, which is taken from the packet extensions and matched against the values of interest namely: 2, 5 and 25.
  • Protocol_ID is the operand and 2, 5 and 25 are the values, while the edges are 1, 2 and 3.
  • FIG. 4 illustrates the action on receiving a control signal from Application Decode Module.
  • start node in data set of session entry is NULL. If start node is not NULL, then at step 405 , a “processing required” flag is set in the session entry. Subsequently, at step 407 , start node in data set is set as start node in control set in the session entry. The subsequent packets then start the traversal from the start node in the data set, which is the same as the start node in the control set at that time.
  • step 403 If, at step 403 , the start node in the data set of the session entry is NULL, then the rule engine ends processing of the application decode control signal.
  • step 401 if the control packet received does not have a control signal from Application Decode Module, then the rule engine ends processing for the application decode control signal.
  • FIG. 5 is a table illustrating the actions that the rule engine may perform when it encounters a change in expression categories of two consecutive path nodes P 1 and P 2 .
  • the rule engine updates the control and data sets in the session entry for pointing to the start nodes from which subsequent packets should start traversal.
  • the rule engine traverses through the rule mesh, passing from one path node to another, it encounters change in the expression categories of the path nodes. For example, two consecutive path nodes P 1 and P 2 may have different expression categories, where P 1 is a session-based node and P 2 is a control-based node.
  • This change in expression categories occurs as path nodes that exist in a given path depend on the created rule mesh and the conditions comprised in the rules.
  • the nodes denoting rules may use only 3 conditions, namely: SRC-IP, L4-PROTOCL and Application-Pattern.
  • the first two conditions are session-based conditions and the third is a data based condition.
  • the rule mesh created out of these nodes would have the src-ip, followed by I4-protocol, followed by application-pattern. As the rule engine traverses from I4-protocol to application-pattern, it is traversing from a session-based node to a data based node.
  • the rule engine uses various search mechanisms to look up the path node and path edge tables. It would be evident to one skilled in the art that there can be numerous ways of doing the same. Some of these search mechanisms are briefly described below.
  • Integer match search There are three different types of searches in this category. They are sequential integer match, hashed integer match and indexed integer match. In sequential integer match search, all the possible values are laid in an array and the search algorithm compares the value to the possible values one after another. The match also gives the edge to be taken. Hashed integer match compares the integers, one nibble at a time, for faster convergence. Whereas, the indexed integer match uses the value of the operand as an index into an array and the index provides the edge to be taken.
  • String compare search The string compare algorithm follows a simple hash and brute force string compare, very similar to the hashed search. The first eight characters of the string are taken to hash into a hash table and the resulting address either points to another hash entry for string search or to a string entry, wherein the string compare is then done a character at a time.
  • Pattern match search This search is used when a set of patterns (‘n’ patterns) are given, and the problem is to find out if one or more than one of these patterns exist in a text. This can be done by using Brute Force Pattern Match search. This involves creating a window of the size of the smallest pattern in the list of patterns and positioning it in the beginning of the text. Subsequently, strings are compared to check if any of the patterns in the list match, within that window. The window is stretched to accommodate the largest string in the window and then the window is continuously moved by one character at a time. At each position, matching is done against the patterns to check if any of the patterns match.
  • String comparison is optimized using a Trie implementation to converge on a string match faster, while the window-shift is improved from the current shift of one character to shift for more characters at using a modification of the Boyre-Moore algorithm.
  • An array of Skip values corresponding to each ASCII character is created. This array is indexed by the ASCII value of the character.
  • the skip values for all characters are initialized with the string length of the smallest pattern in the list of patterns; in the current example this would be 5 (the size of “hello”).
  • the skip-value is computed as the distance of the first occurrence of the character, when going from the last character to the first character, from the last character of the pattern. So the shift value for ‘I’ would be 1, while the shift character for ‘e’ would be 3. This skip-value is updated in the Array of Skip-Values for that character, if the skip-value in the array is bigger than that just computed.
  • the skip value computed from using the above algorithm is shown in FIG. 6 .
  • the window scrolls around “said h”, as ‘h’ is 5 characters from ‘s’. Note that the window also stretches to be as big as the largest pattern. The string match fails to match any pattern. Take the skip value corresponding to the last character in the window, which is ‘h’. The skip value corresponding to ‘s’ is 4. Skip 4 characters.
  • the window scrolls around “hello”, as ‘o’ is 4 characters from ‘h’.
  • the string match succeeds to find hello. Note that the string comparison is done from the end of the window towards the beginning. A match is found.
  • the next task is to do a string compare against all the patterns, to verify if any of the patterns exists.
  • a multi-level Trie structure is used. This structure facilitates faster convergence of the string match against the given patterns.
  • the string comparison logic starts traversing the trie structure from the top two characters at a time. It continues comparing the trie characters consecutively until it reaches the end of the trie given in the ‘Trie Entry Flag’. If at any trie match, the two characters actually match, the “level” field gives the next trie record to access to check the next match. This way trie comparison eliminates the strings that do not match. Finally when the strings left are narrowed down to one, a simple string match is done.
  • the string is stored at the offset pointed by the level from the start of the string table kept in the header of the Trie table. This is illustrated in FIG. 7 . While the preferred embodiments of the invention have been illustrated and described, it will be clear that the invention is not limited to these embodiments only. Numerous modifications, changes, variations, substitutions and equivalents will be apparent to those skilled in the art without departing from the spirit and scope of the invention as described in the claims.

Abstract

A rule engine for a computer network traverses a rule mesh having path nodes and path edges in form of a tree part and a graph part. The rule engine evaluates data packets flowing through a network to determine rules matched for every packet. Subsequent packets having same expression values as an already checked packet are not rechecked against the same nodes in the rule mesh through the use of a session entry. The rule engine performs a search on every path node of rule mesh to determine the next path edge to traverse. A Tree-Id and Rule Confirmation Bitmap that are indicative of path traversed and rules matched by a packet are generated at the end of rule mesh traversal. These are appended in the packet extension for subsequent modules of Policy Agent.

Description

    CROSS REFERENCE TO RELATED APPLICATION
  • This application is a continuation application of U.S. application Ser. No. 10/264,803, filed Oct. 4, 2002, entitled, ‘Rule Engine’ by Parekh, et al
  • BACKGROUND
  • The invention relates to integrated policy enforcement systems for computer networks. In particular the invention provides a method and system for evaluating data packets against configured rules and mapping the packets to the rules that have matched for an integrated policy enforcement system.
  • The emergence and advancement of networks and networking technologies has revolutionized information exchange between organizations. A network may be defined as a group of computers and associated devices that are connected via communication links. These communication links can be wireless communication links. All the devices connected over a network are capable of communicating (i.e. sending and receiving information) with other devices connected to the network.
  • A network can range from one that connects a few devices in a single office to one that spans continents and connects several thousand computers and associated devices. Networks are generally classified as Local Area Networks (LANs) and Wide Area Networks (WANs) based on the geographic area they cover. A LAN is a network connecting servers, computers and associated devices within a small geographic area. LANs are widely used to connect servers, computers and devices in organizations to exchange information. A WAN is a network that links at least two LANs, which are spread over a wide geographic area. A network of an organization connecting devices and resources of the organization is called an intranet. The devices and resources in an intranet may be connected over a LAN or WAN. The globally interlinked collection of LANs, WANs and intranets is called Internet. The Internet can thus be called a network of networks. The Internet allows exchange of information between LANs, WANs and intranets that are connected to it.
  • Most organizations link their intranets with the Internet to allow information exchange with different organizations. Information exchange involves transfer of data packets. Organizations allow legitimate users on the Internet to access their intranets for information exchange. Legitimate users are people outside the organization who have authorization from the organization to access its intranet. Such information exchange poses a security risk as the organization's intranet becomes accessible to outsiders. Illegitimate users can change data, gain unauthorized access to data, destroy data, or make unauthorized use of computer resources. These security issues require organizations to implement safeguards that ensure security of their networks.
  • Various solutions are available to deal with such security issues. Most of these solutions implement a security policy on network traffic to address security concerns and are known as ‘policy enforcement systems’. Network traffic comprises data packets flowing through the network. The policy comprises a set of rules that checks data packets flowing though the network for irregularities. The rules comprise conditions that are checked based on properties of data packets. Based on this check, the security solution regulates network traffic.
  • One of the commonly used security solutions that implement a policy is a firewall. Firewalls are installed between an organization's intranet and the Internet. Firewalls, being policy-based security devices, selectively allow or disallow data packets from entering or leaving the organization's intranet.
  • Firewalls inspect each data packet entering or leaving the intranet against a set of rules. Hence, the performance of a firewall suffers with an increase in the number of rules, because each data packet has to be checked against an increased number of rules. This decreases the number of packets that the firewall can process per unit time. Moreover, an increase in the volume of network traffic increases the number of packets that have to be checked against the rules per unit time. Due to these limitations, conventional firewall systems are capable of implementing only a limited number of rules and can handle only a limited volume of network traffic.
  • An effort to overcome these problems has been made by U.S. Patent Application No. US 2002/0032773 assigned to SERVGATE Technology, Inc. and titled “System, method and computer software product for network firewall fast policy lookup”. The patent application describes a system and method for faster rule lookup. The method described in the patent application improves the speed of rule lookup in firewalls. Firewalls store all the rules against which the data packets passing though the firewall have to be checked. For implementing security, firewalls perform a table lookup, which involves validating a data packet against rules defined in the policy table. The patent application describes a method that allows for faster rule lookup than conventional firewall systems. This is achieved by simplifying the table lookup process.
  • Though, most networks are protected by firewalls but firewalls do not provide a complete security solution. This is because firewalls can be circumvented through various techniques such as “tunneling” and “back doors”. Moreover, a firewall alone cannot provide information regarding any attack that is successfully repelled. Such information can be used to block future such attacks. Intrusion Detection Systems (IDS) are thus used as a protection against such attempts to exploit the devices connected over the network.
  • Intrusion Detection Systems adopt either a network or a host based approach to recognize and stop attacks. In both cases, the IDS looks for attack signatures. Attack signatures are patterns that indicate any harmful intent. If an IDS checks for such patterns in network traffic, then it is said to be following a network-based approach. Whereas, if an IDS searches for attack signatures in log files then it is said to be following a host based approach. Log files contain records of events and activities taking place at individual computers and associated devices. If an attack is detected, the IDS may take corrective measures like administrator notification and connection termination. Network-based IDS is essentially used for detecting attacks that emanate from outside the organization's intranet. Typically, network-based IDS use two approaches to analyze the network traffic, viz. pattern matching and anomaly detection. Pattern matching involves comparison of network traffic with signatures of known attacks. These signatures are generally stored in a database and serve as a basis of comparison with the network traffic. In anomaly detection, the IDS checks for any unusual activity in the network traffic. An unusual activity is defined as one that deviates to a large extent from the normal state of the network traffic. In case IDS finds any such activity, it generates an alert such as administrator notification.
  • The above-mentioned security systems may be deployed by Internet Service Providers (ISPs) to ensure safety of their customer's intranets. ISPs provide these security services to their customers in addition to various other services like ‘Quality of Service’. ‘Quality of Service’ refers to the ability of an ISP to provide a customer with the best available services based on the terms and conditions of their agreement. The ISPs need to implement policies in order to take a decision for the same.
  • The above-mentioned policy enforcement systems have some inherent advantages. For ISPs and big organizations it becomes necessary to integrate two or more of the above systems to provide enhanced security and services. For example, an organization may like to have network-based IDS behind a firewall. This configuration will provide enhanced security as it would raise an alert in case of incoming network packets that may have circumvented the firewall. Thus, integrated systems have the potential of offering enhanced security.
  • An effort in this direction has been made by U.S. Pat. No. 5,996,077 assigned to Cylink Corporation, of Sunnyvale, Calif., USA, and titled “Access control system and method using hierarchical arrangement of security devices”. The patent describes a system and method for coupling two or more security devices to create an integrated security system that offers enhanced security. The integrated security system is installed between the intranet of an organization and the Internet and receives network traffic consisting of data packets. These data packets are passed through a plurality of security devices that have rules of descending strictness. The first security device receives the data packet and tries to process it by using security rules defined for the first device. If the first security device is not able to process the packet then the packet is passed to the second security device for possible processing using security rules defined for the second device. The process of passing the data packet to the next security device is repeated until the data packet is processed or until the last security device passes the data packet as unprocessed. This system requires a plurality of security devices to have rules of descending strictness. Moreover, processing of data packets by every security device involves rechecking of some conditions defined in the rules. This is because some conditions that were already checked may be rechecked again when the data packet passes through subsequent security devices. This reprocessing will make the above system inefficient if there are a large number of policies to be implemented or if the volume of network traffic increases.
  • In light of the foregoing, what is required is a network security system that offers the capability of integrating two or more security devices to offer enhanced security. The system should also be capable of implementing a large number of rules over a large volume of network traffic without adversely affecting its performance.
  • SUMMARY
  • An object of the present invention is to perform traversal of a rule mesh for checking packets against nodes in the rule mesh; the nodes signifying rules or parts of configured rules.
  • Another object of the present invention is to provide information for every packet regarding rules matched by each packet.
  • Still another object of the present invention is to improve efficiency of rule mesh traversal for subsequent packets of a session by ensuring that subsequent packets having same expression values as an already checked packet are not rechecked against same nodes.
  • Yet another object of the present invention is to resume path traversal from any intermediate node of the rule mesh, for most of the packets on the Internet to gain in performance.
  • A rule engine traverses a rule mesh having path nodes and path edges arranged in form of a tree part and a graph part. The rule engine evaluates packets flowing through a network to determine rules matched for every packet. The rule engine flags a node in the rule mesh for subsequent packets of a session to start traversal from this flagged node. The information regarding flagged node is stored in a session entry. Subsequent packets having same expression values as an already checked packet are not rechecked against the same nodes in the rule mesh. This is achieved through the use of this information stored in session entry. The rule engine while traversing the rule mesh for a packet performs a search on every path node to determine the next path edge to traverse. The path edge leads to another path node where the process of search is repeated. The rule mesh consists of rule tree on the top followed by the rule graph at the leaf edge of each rule tree. At the end of tree traversal a Tree-Id is collected and Rule Confirmation Bitmap (RCB) and Graph Traversal Bitmap (GTB) are initialized for subsequent traversal of the graph. The values of RCB and GTB are computed at every path edge during graph traversal. During graph traversal, RCB gets formed into a bitmap that indicates the rules confirmed or matched amongst the pending rules in the graph, while GTB degenerates to NULL as all pending rules get either eliminated or confirmed into RCB. The Tree-Id and RCB generated at the end of rule mesh traversal are indicative of path traversed and rules matched by a packet. The tree-Id and RCB together are referred to as rule lookup-Id. These are appended in the packet extension for subsequent modules of integrated policy enforcement system.
  • BRIEF DESCRIPTION OF THE DRAWINGS
  • The preferred embodiments of the invention will hereinafter be described in conjunction with the appended drawings provided to illustrate and not to limit the invention, wherein like designations denote like elements, and in which:
  • FIG. 1 is a schematic diagram that illustrates the functional modules of an exemplary Policy Agent.
  • FIG. 2 is a flowchart illustrating a method for processing of packets by a Rule Engine Module.
  • FIG. 3 is a flowchart illustrating steps involved in rule mesh traversal.
  • FIG. 4 is a flowchart illustrating actions performed by rule engine on receiving a control signal from Application Decode Module.
  • FIG. 5 is a table illustrating actions that the rule engine may perform for change in expression categories of two consecutive path nodes P1 and P2.
  • FIG. 6 is a table illustrating skip value computed using a configured pattern match search algorithm.
  • FIG. 7 is a table illustrating the multi-level Trie for string compare.
  • DESCRIPTION OF PREFERRED EMBODIMENTS
  • Definitions
  • Data packets: This term refers to units of data that are sent on any packet switched network or the like, and encompasses Transmission Control Protocol/Internet Protocol (TCP/IP) packets, User Datagram Protocol (UDP) packets, which may also be referred to as datagrams, or any other such units of data.
  • Expression: An expression denotes a property of network traffic whose value determines the outcome of a condition. Examples of expressions include source IP address, destination IP address, and layer 3 protocols.
  • Rule mesh: A data structure, which is a combination of two types of data structures namely, tree and graph. The data structure starts as a tree, the leaf nodes of tree end into a graph.
  • Tree data structure: A tree data structure is a data structure comprising nodes and edges. A node can be root node, leaf node or an internal node. The root node is the starting node of a tree. There is only one root node in a tree. On traversing the tree from top to bottom, the root node is the first node encountered. The tree starts from a root node and ends at leaf nodes. Nodes other than root node and leaf nodes are termed internal nodes. An Internal node has one or more child nodes and is called the parent of its child nodes. All children of the same node are siblings. In a tree only one path exists between two nodes.
  • Graph data structure: A graph data structure is a data structure comprising vertices and edges. The vertices of the graph are equivalent to nodes of a tree and are connected via edges. In a graph, there can be multiple paths between two vertices.
  • Tree-graph: This refers to a data structure, which is a combination of two types of data structures namely, tree and graph. The tree-graph data structure starts as a tree. The tree ends at tree leafs, from where the graphs start Path node: A path node refers to a node in the rule mesh. The rule engine starts traversal from a root path node and takes a path edge based on the result of the search done on the path node. The path edge leads the rule engine to the next path node, where “search and jump to next path node” operation is repeated.
  • Path edge: A path edge is an edge that starts from a path node and leads to the next path node. A path edge may lead to a tree node or to a graph node.
  • Matched rules in tree: A rule may get matched in the tree part of the expression tree-graph, also referred to as the rule mesh. An edge of a tree gives the rules that have matched as a result of reaching that part of the tree. For the rule engine, a leaf of the tree, which is also the start of the graph, gives all the rules that have matched in the tree leading to the start of graph.
  • Pending rules in graph: On the edge of a tree few rules have got matched within the tree, while few others would get matched in the graph below. The rules that would get matched or decided in the graph are grouped in a set of pending rules. In the graph, a few rules out of the pending list of rules may match and few others may get eliminated.
  • Start of graph: The start of graph is the first node of the graph. A leaf tree edge always leads to the start of graph. The start of graph gives the ‘pending rules in graph’. The leaf edge gives the Tree-Id.
  • The present invention is a system and method for evaluating packets against configured rules and mapping the packets to the rules that have matched.
  • The present invention is envisaged to be operating within an integrated policy enforcement system hereinafter referred to as Policy Agent. The policy agent may be embodied in a product such as the ipEnforcer 5000® as provided by iPolicy Networks Inc. of Fremont, Calif. This product is used to enforce management policies on networks, and is placed at a point where packets enter a network. Further, the policy agent may be encoded in a programming language such as C or Assembly.
  • The Policy Agent scans packets as they pass through it, and enforces network policies on these packets. Although the Policy Agent may be variously provided, a description of one such Policy Agent can be found in U.S. patent application Ser. No. 10/052,745 filed on Jan. 17, 2002, and titled “Architecture for an Integrated Policy Enforcement System”; the entire contents of which are hereby incorporated by reference. However, it may be noted that the present invention may be adapted to operate in other Policy Agents by one skilled in the art.
  • FIG. 1 is a schematic diagram that illustrates the functional modules of an exemplary Policy Agent. Referring to FIG. 1, the various functional modules of the Policy Agent are Generic Extension Builder 101, Session Cache Module 103, Application Decode Module 105, Rule Engine Module 107 and Policy Entities 109. The Policy Agent is also supported by a Policy Manager 111. A packet entering the Policy Agent travels through these functional modules. Each functional module appends its output to extensions in the packet, which are then used by subsequent modules of the Policy Agent.
  • Generic Extension Builder 101 processes the packet headers for information related to Open Systems Interconnection (OSI) Layer 2 and Layer 3.
  • Session Cache Module 103 processes the packet headers for information related to OSI Layer 4 and layers above it.
  • Application Decode Module 105 identifies the application generating the packet and tracks the packet as it transitions from one application state to another.
  • Rule Engine Module 107 makes policy decisions based on the information gathered from the previous modules. It identifies rules matched by a packet, and passes this information to Policy Entities 109.
  • Policy Entities 109 comprises policy-processing modules, which are also referred to as Service Application Modules (SAMs). These modules analyze the packet further according to its requirements and enforce policies. SAMs include, but are not limited to, Firewall modules, Intrusion Detection System (IDS) modules and Virtual Private Network (VPN) modules.
  • Policy Manager 111 comprises policy rules, which are implemented by the Policy Agent.
  • FIG. 2 illustrates the method for processing of packets by Rule Engine Module 107.
  • The rule engine traverses a rule mesh for evaluating a stream of packets flowing through a network against rules configured in the rule mesh. The rule mesh is generated by a rule compiler. The structure and creation of the rule mesh have been described in co pending U.S. patent application Ser. No. 10/264,889 titled ‘Rule compiler for computer network policy enforcement systems’, the disclosure of which is hereby incorporated by reference. The rule mesh is a combination of tree and graph data structures. It would be evident to a person skilled in the art that this design enables striking of a balance between execution speed afforded by a tree data structure, and memory space saving provided by a graph data structure. Further, it would also be evident to a person skilled in the art that there can be numerous other data structures that may be employed.
  • The rule mesh is a combination of path nodes and path edges. A path node denotes an expression against which a packet is checked. Based on such a check, a path edge is chosen for traversal. Each leaf level path edge of the tree part of the rule mesh leads into a graph. The graph consists of path nodes and path edges arranged as a mesh instead of a tree. The rule engine traverses these path nodes and path edges to reach the end of the rule mesh traversal. The traversal of the rule mesh for every packet generates a rule lookup-Id for the given packet. The rule lookup-Id is used to indicate the rules matched by a packet during rule mesh traversal. The rule lookup-Id is populated in a packet extension and travels along with the packet to other modules of the Policy Agent.
  • The rule engine starts traversal of the rule mesh from a path node referred to as a root path node. The rule engine begins traversal of the tree data structure starting from the root path node. The tree traversal continues till the rule engine arrives at a ‘start of graph’ path node. During tree traversal, the rule engine performs a search at each path node. Every path node specifies the search to be performed to determine a path edge. This path edge leads the rule engine to the next path node against which the packet should be evaluated. A rule may get matched in the tree part of the rule mesh. An edge of a tree gives the rules that have matched so far. A leaf edge of the tree, which leads to a ‘start of the graph’ path node, gives all the rules that have matched for a given packet within the tree part of rule mesh. When the rule engine arrives at a path node that signals ‘start of graph’, the tree traversal terminates. At this stage the rule engine collects a ‘Tree-Id’ from the path edge that leads it to the ‘start of graph’ path node.
  • The ‘start of graph’ path node is the first node of the graph. A tree leaf edge always leads to a ‘start of graph’ path node. The ‘start of graph’ gives the ‘pending rules in graph’. At the leaf edge of a tree the packet being evaluated may have matched few rules within the tree, while few other rules remain pending against which the packet needs to be checked. The packet is checked against these pending rules in the graph that are grouped in a set of pending rules.
  • The graph traversal starts at a ‘start of graph’ path node and continues till the end of rule mesh traversal. The rule engine traverses the rule mesh till at least one of the conditions governing end of rule mesh traversal are satisfied. These conditions governing end of rule mesh traversal are described in detail later. All throughout the graph traversal, the rule engine maintains two bitmaps: namely, a Rule Confirmation Bitmap (RCB) and a Graph Traversal Bitmap (GTB). On every path node within the graph (hereinafter referred to as a graph node), the rule engine determines the next path edge by doing a search specified at each graph node. Further, each graph edge comprises two bitmaps, namely: a Confirmation Bitmap (CB) and an Elimination Bitmap (EB). As the rule engine arrives at a graph edge, it re-computes values of RCB and GTB based on occurring values of RCB and GTB and values of CB and EB for the particular path edge arrived at. In this way, a path edge leads the rule engine along with the new values of RCB and GTB to the next path node against which a packet is to be evaluated. The graph traversal ends when a condition governing the end of rule mesh traversal is satisfied.
  • The nodes in the rule mesh represent different expressions supported. The different expressions supported fall into three different expression categories namely: session-based, control-based and data-based.
  • A session-based expression is one, whose value remains the same for all packets of a session such as a TCP based session or a UDP based session. Each packet of an application based on TCP or UDP (referred to as the packets of the session) is characterized by a set comprising the source and destination IP addresses, source and destination port numbers and Layer-4 protocol value. All values related to these expressions remain constant and do not change for different packets of a session. Therefore, once these values have been evaluated for a given packet of a session, they need not be evaluated again for subsequent packets of the same session.
  • A control-based expression is one, whose value changes rarely for different packets of a session. The expressions related to higher-level application transactions and the application parameters fall into the category of control-based expressions. For example, the FTP session enters a GET transaction state, when a FTP client sends a ‘GET’ message to the FTP server. Thereafter many packets are transacted between the FTP client and server as part of the FTP GET transaction processing. Therefore, the value of FTP_Tx for all these packets of the session remains ‘GET’. However, after ‘GET’, the client might send a ‘PUT’ transaction to the FTP server. At this point, the value of the expression FTP_Tx changes from ‘GET’ to ‘PUT’.
  • Any change in value of control-based expression category for a stream of packets, is indicated to the rule engine, through a control signal from the Application Decode Module 105. The Application Decode Module is described in co-pending U.S. patent application Ser. No. 10/264,971, titled ‘Application Decoding Engine for Computer Networks’, the disclosure of which is hereby incorporated by reference. The action performed by the rule engine on receiving a signal from Application Decode Module is explained in detail in FIG. 4. As mentioned, the session-based expressions need to be evaluated only for a given packet of a session and all other packets of the same session are not required to be re-evaluated. Similarly, the control-based expressions need to be evaluated only for first packet of every session received after having received a control signal from the Application Decode Module.
  • The data-based expressions are those, whose value may change for each packet of a session. They need to be evaluated for each packet of a session.
  • In a preferred embodiment of the present invention, expressions such as packet direction and time are treated as session based expressions. Generally, packet direction and time are data based expressions and need to be evaluated for every packet of a session. However, in a preferred embodiment of the present invention the Rule Engine Module maintains two separate positions for start of traversal of the rule mesh, one for the incoming packet direction and another for the outgoing packet direction. Thus, ‘packet direction’ expression can be treated as a session-based expression. The value of the expression would not change for all packets of a session flowing in the same direction. Also, according to a preferred embodiment of the present invention, a session receives the same treatment determined by the time when the session started, irrespective of the time change while the session is in progress.
  • Referring again to the Rule Compiler Module, during compilation weights are assigned to different expressions based on certain criteria. Amongst these criteria, the one that carries the maximum weight-age is the category of a session. A session-based expression always has a higher weight-age than control-based expressions, which in turn have higher weight-age than data-based expressions. The Rule Compiler Module ensures that nodes denoting session-based expressions (session-based nodes) appear on top of rule mesh; followed by the nodes denoting control-based expressions (control-based nodes); and lastly the nodes denoting data-based expressions (data-based nodes) are placed. Thus, when the rule engine traverses rule mesh, it first encounters session-based expressions. As it traverses along the rule mesh, the rule engine encounters control-based expressions and lastly it comes across data-based expressions. This structuring of the rule mesh eliminates the need to evaluate subsequent packets of a session that have the same expression value as an already evaluated packet, for same nodes, against which the latter has been evaluated.
  • Referring to FIG. 2, at step 201, a check is made in the packet extension to determine if the packet belongs to a session based application such as one based on TCP or UDP. The Session Cache Module 103 adds information in the packet extension identifying a packet as a packet of a session based application. Session Cache Module 103 also appends a session flag and other session related static information in the packet extension of each packet of a session based application. The session flag may take different values, for e.g. SC_CREATE (a packet carrying this flag creates the session and is the first packet of a session), SC_SETUP (a packet carrying this flag is a normal packet in the middle of a session), and SC_CLOSE (a packet carrying this flag is the final packet of a session and closes a session). A Session Cache Module is described in co-pending U.S. application Ser. No. 10/052,745 titled “Architecture for an Integrated Policy Enforcement System”. The Session Cache Module 103 thus maps a packet received to a session. The Session Cache Module 103 appends session information to the packet extension that indicates if a packet is that of a session based application (like those based on TCP or UDP) or a packet of other applications i.e. non session based application. Although, according to the preferred embodiment, the Policy Agent treats packets of a TCP or UDP based application as packets of a session based application and performs session based optimization for such packets, it would be evident to one skilled in the art that optimization for packets of applications that are based on other Level 4 protocols can also be achieved. Further, the Session Cache Module 103 maintains a session cache, which contains the data for all active sessions in the Policy Agent. The mapping of packet to a session lends enhanced performance to rest of the modules, as in many cases all packets of a session are given the same treatment. The Session Cache Module 103 updates the packet extension with the session flag and all the other data that is static for the session.
  • At step 203, a check is made to determine the presence of session create in a packet. Session create is a flag that is carried in the packet extension of the first packet of a session based application such as a TCP or UDP based application.
  • If session create is present, then at step 205, a session entry is initialized. The Session Cache Module 103 creates the session entry. Presence of session create flag denotes that the packet is first packet of a session based application. A session entry stores key elements that are used to resume path traversal from any intermediate node of the rule mesh. The session entry contains one set of these key elements for each direction of the session, i.e. incoming and outgoing directions. Further, the session entry contains a data set and a control set for each direction, i.e. incoming and outgoing directions. Data set indicates the position from where the traversal needs to start for all packets of a session, while the control set indicates the position from where the traversal should start after the rule engine receives a control signal from the Application Decode Module 105. The action on receiving a control signal is described later in FIG. 4 in detail.
  • Initialization of session entry involves initializing control and data sets of the session entry, for both incoming and outgoing directions, to point to a root node.
  • In a preferred embodiment of the present invention, the data and control sets for each direction comprise values for a start path node, a Tree-Id, RCB and GTB.
  • A start path node is the node from where a packet starts traversal of the rule mesh.
  • A Tree-Id is a value that represents a unique Id for a given tree leaf edge.
  • RCB is a bitmap that the rule engine updates while traversing the graph. Each bit represents a rule from the set of ‘pending rules in graph’. A bit in this bitmap gets set, if the rule is matched in the graph.
  • GTB is a bitmap that the rule engine updates while traversing the graph. Each bit represents a rule from the set of ‘pending rules in graph’. The rule engine stops traversal of rule mesh when this bitmap becomes zero.
  • The rule engine, therefore stores four sets of the above mentioned variables in each session entry maintained by it.
  • The rule engine updates the control and data sets in the session entry, while doing rule mesh traversal. As the rule engine traverses through the rule mesh, passing from one path node to another, it encounters a change in the expression category of the path nodes. Two consecutive path nodes, say P1 and P2, may have same or different expression categories. The actions that the rule engine may perform for all possible combination of expressions are shown in FIG. 5.
  • Referring to step 205, after the session entry has been initialized, at step 213 the rule engine retrieves start node from data set in the session entry. In case of first packet of a session based application, which carries a session create flag, the session entry is initialized to point to the root node. This is done by initializing the data set in the session entry to point to the root node. Thus, the session create packet starts traversal from root node.
  • Referring to step 203, if it is found that the packet does not carry a session create flag, then at step 209 the session entry is retrieved. The session entry is saved in a memory, from where it is retrieved. The absence of a session create flag indicates that the packet is a not the first packet of a session based application. Thereafter, at step 213, the rule engine retrieves the node for start of traversal from the data set of the session entry and continues traversal from the node retrieved. Thus, subsequent packets of a session based application start traversal from the start node retrieved from the data set of the session entry.
  • Again referring to step 201, if the packet is not that of a session based application, which implies that the packet is not a TCP or UDP based packet, then at step 207, a root node is assigned as the node for start of traversal for this packet. For all packets, not having a session flag i.e. non-session based applications; the root node is assigned as the start node. By way of an example, all packets of applications based on ICMP or IGMP start traversal from the root node.
  • Once the rule engine knows the start path node for a packet of a session, it proceeds with rule mesh traversal at step 215. Subsequently, at step 217, a check is again made to determine whether the packet is that of a session based application. If the session flag is present denoting that the packet is a session based application packet, then, at step 219, node for start of traversal for subsequent packets is saved in the session entry. Following which, at step 221, the rule lookup-Id, which comprises the Tree-Id and RCB is appended to the packet extension. This rule lookup-Id is used by the SAMs to determine the actions they need to take corresponding to the rules that have matched for the individual SAMs. In a preferred embodiment of the present invention, a rule lookup table is used by rule lookup macros of individual SAMs. Each SAM contains one rule lookup table. This table is indexed using the Tree-Id and then the rule lookup macro traverses through the rule lookup table using the RCB to find matching rules.
  • Referring again to step 217, in case the packet is not that of a session based application then the rule lookup-Id is appended to the packet extension at step 221.
  • FIG. 3 illustrates rule mesh traversal. At step 301, the start node (P1) for traversal is determined. Step 301 of determining start node may involve either step 213 of retrieving start node from session entry or step 207 of assigning start node as root node, as have been elaborated in FIG. 2.
  • At step 303, the search indicated in P1 is carried out to determine a path edge for traversal.
  • At step 305, the path edge, determined in previous step, is retrieved from a path edge table. A path edge table stores the different tree and graph edges of the rule mesh. Each path node of the rule mesh stores the location into the path edge table, where the edge entries for that path node start.
  • At step 307, a check is made whether the path edge retrieved is a tree edge. If the path edge is a tree edge then at step 309 a check is made whether the path node retrieved from the path node table is a ‘start of graph’ path node. If it is a ‘start of graph’ path node, then at step 311, the rule engine retrieves a Tree-Id from the tree path edge that leads to ‘start of graph’ path node. The rule engine also initializes an RCB and GTB to predefined values.
  • Subsequently, at step 313, the rule engine retrieves the index of next path node from the path edge. The index of the next path node is used to retrieve the path node from the path node table.
  • If the path node retrieved at step 309 is not a ‘start of graph’ path node, then at step 313, the rule engine retrieves the next path node from the path node table.
  • Referring back to step 307, if the path edge retrieved from the path edge table is not a tree edge, then at step 315, RCB and GTB are computed from a Confirmation Bitmap (CB) and an Elimination Bitmap (EB).
  • CB is a bitmap maintained within a graph edge. Each bit in it represents a rule from the set of ‘pending rules in graph’. A bit in this bitmap is set for a graph edge, if taking that edge confirms a rule from the pending set.
  • EB is a bitmap maintained within a graph edge. Each bit in the EB represents a rule from the set of ‘pending rules in graph’. A bit in this bitmap is set if the rule is eliminated as a result of taking that edge.
  • The rule compiler computes and populates CB and EB on each graph edge. This is explained in detail in co-pending U.S. patent application Ser. No. 10/264,889 titled ‘Rule compiler for computer network policy enforcement systems’, the disclosure of which is hereby incorporated by reference.
  • As the rule engine arrives at a graph edge, it re-computes values of RCB and GTB based on occurring values of RCB and GTB and values of CB and EB for the particular path edge arrived at. In this way, a path edge leads the rule engine along with the new values of RCB and GTB to the next path node against which a packet is to be evaluated.
  • In a preferred embodiment of the present invention, RCB and GTB are calculated according to the following formula:
    RCB=(RCB|CB) & (RCB|GTB)
    GTB=GTB & EB
  • After retrieving the next path node (P2), at step 317, a check is made whether end of rule traversal is reached. The end of rule traversal is reached if conditions governing end of traversal are satisfied.
  • Conditions governing end of traversal are satisfied when either of the following occurs: either the value of GTB is zero or the next path node retrieved is NULL.
  • If the rule mesh traversal is over, then at step 319, the packet extension is appended with the rule lookup-Id, which is the Tree-Id and the RCB taken together.
  • If the rule mesh traversal is not over, then at step 321, the type of change in the expression category is determined. For example, while the rule engine traverses from a path node P1 to another path node P2; P1 may be a session-based node and P2 may also be session-based node; P1 may be session-based node and P2 may be a control based node; P1 may be a session-based node and P2 may be a data-based node; P1 may be a control-based node and P2 may also be a control-based node; P1 may be a control-based node and P2 may be a data-based node or P1 may be a data-based node and P2 also a data-based node.
  • Subsequently, at step 323, the control set of the session entry or the data set of the session entry is updated as per the following criteria.
  • For the rule engine to update the start node for a session in a data set, the rule engine needs to determine the transition from session-based nodes to data-based nodes or from control-based nodes to data-based nodes. By updating the data set, traversal for subsequent packets is required only for the data-based nodes, thereby skipping the session-based nodes and control-based nodes that do not often change values within the session.
  • Similarly, the rule engine stores the start node in a control set for a session. For this purpose, the rule engine needs to determine the transition from session-based nodes to control-based nodes or from session-based nodes to data-based nodes. When Application Decode Module sends a control signal, the rule engine starts traversal from start of control-based nodes, as the values of packets for these nodes might have changed.
  • Thus, for subsequent packet of a session, rule engine starts traversal from the start node of data-based nodes. Where the Application Decode Module sends a control packet, the rule engine starts traversal from the start node of control-based node stored in the session entry.
  • Finally at step 325, node P1 is set as node P2 and the whole process is repeated again till end of traversal.
  • In a preferred embodiment of the present invention, a path node table stores the different tree and graph nodes of the rule mesh. The rule engine starts processing at a root path node, which is the first row of this table. Each path node specifies a search address, operation to be performed, location of path edges corresponding to that path node, location and size of operands and also contains two path edges within its structure. The two path edges correspond to the most often-occurring path edges. The values of RCB and GTB corresponding to these path edges are also stored in the path node. The rule engine first does a comparison of current values of the expression against the values stored in the path nodes to check if it could take any of the two path edges stored in the path node. If it finds a match, it does not need to do a search to retrieve the next path edge. This enhances the efficiency of the rule engine. The path edges are stored in a path edge table. For each path edge this table also stores the path node that is arrived at as a result of traversing that path edge. The rule engine uses various search mechanisms to decide the path edge to be taken corresponding to a path node. These search mechanisms have been described in detail later.
  • Each path node is like a condition element that is evaluated and the result of the evaluation determines the path edge to be taken. For example, a condition might be stated as: If Protocol_ID is 2 then edge 1, if it is 5 then edge 2 and if it is 25 then edge 3. In this case, the Protocol_ID is a value corresponding to a packet, which is taken from the packet extensions and matched against the values of interest namely: 2, 5 and 25. Here Protocol_ID is the operand and 2, 5 and 25 are the values, while the edges are 1, 2 and 3.
  • FIG. 4 illustrates the action on receiving a control signal from Application Decode Module.
  • At step 401, a check is made whether a control packet received has a control signal from Application Decode Module. This signal is sent in a control packet by the Application Decode Module. No traversal is done for such a packet; traversal is done only for data packets received.
  • If a control signal is received, then at step 403, a check is made whether start node in data set of session entry is NULL. If start node is not NULL, then at step 405, a “processing required” flag is set in the session entry. Subsequently, at step 407, start node in data set is set as start node in control set in the session entry. The subsequent packets then start the traversal from the start node in the data set, which is the same as the start node in the control set at that time.
  • If, at step 403, the start node in the data set of the session entry is NULL, then the rule engine ends processing of the application decode control signal.
  • Referring back to step 401, if the control packet received does not have a control signal from Application Decode Module, then the rule engine ends processing for the application decode control signal.
  • FIG. 5 is a table illustrating the actions that the rule engine may perform when it encounters a change in expression categories of two consecutive path nodes P1 and P2.
  • The rule engine updates the control and data sets in the session entry for pointing to the start nodes from which subsequent packets should start traversal. As the rule engine traverses through the rule mesh, passing from one path node to another, it encounters change in the expression categories of the path nodes. For example, two consecutive path nodes P1 and P2 may have different expression categories, where P1 is a session-based node and P2 is a control-based node. This change in expression categories occurs as path nodes that exist in a given path depend on the created rule mesh and the conditions comprised in the rules. For example, in a rule mesh, the nodes denoting rules may use only 3 conditions, namely: SRC-IP, L4-PROTOCL and Application-Pattern. The first two conditions are session-based conditions and the third is a data based condition. The rule mesh created out of these nodes would have the src-ip, followed by I4-protocol, followed by application-pattern. As the rule engine traverses from I4-protocol to application-pattern, it is traversing from a session-based node to a data based node.
  • The rule engine uses various search mechanisms to look up the path node and path edge tables. It would be evident to one skilled in the art that there can be numerous ways of doing the same. Some of these search mechanisms are briefly described below.
  • Integer match search: There are three different types of searches in this category. They are sequential integer match, hashed integer match and indexed integer match. In sequential integer match search, all the possible values are laid in an array and the search algorithm compares the value to the possible values one after another. The match also gives the edge to be taken. Hashed integer match compares the integers, one nibble at a time, for faster convergence. Whereas, the indexed integer match uses the value of the operand as an index into an array and the index provides the edge to be taken.
  • String compare search: The string compare algorithm follows a simple hash and brute force string compare, very similar to the hashed search. The first eight characters of the string are taken to hash into a hash table and the resulting address either points to another hash entry for string search or to a string entry, wherein the string compare is then done a character at a time.
  • Pattern match search: This search is used when a set of patterns (‘n’ patterns) are given, and the problem is to find out if one or more than one of these patterns exist in a text. This can be done by using Brute Force Pattern Match search. This involves creating a window of the size of the smallest pattern in the list of patterns and positioning it in the beginning of the text. Subsequently, strings are compared to check if any of the patterns in the list match, within that window. The window is stretched to accommodate the largest string in the window and then the window is continuously moved by one character at a time. At each position, matching is done against the patterns to check if any of the patterns match.
  • In a preferred embodiment of the present invention following mechanism is used to search.
  • String comparison is optimized using a Trie implementation to converge on a string match faster, while the window-shift is improved from the current shift of one character to shift for more characters at using a modification of the Boyre-Moore algorithm.
  • In the Boyre-Moore algorithm for pattern matching, the basic idea is to be able to shift the window more than one character as is done in the Brute-Force algorithm. This algorithm pre-computes the shift information about the patterns, which is then used to skip some number of characters in the text. The following example can be considered as an illustration of the algorithm. To compute the skip table for the patterns: ‘hello’, ‘window’ and ‘salute’, the algorithm used to compute the skip values is described below.
  • An array of Skip values corresponding to each ASCII character is created. This array is indexed by the ASCII value of the character.
  • The skip values for all characters are initialized with the string length of the smallest pattern in the list of patterns; in the current example this would be 5 (the size of “hello”).
  • For each pattern in the list the following steps are repeated:
  • For each character in the pattern, the skip-value is computed as the distance of the first occurrence of the character, when going from the last character to the first character, from the last character of the pattern. So the shift value for ‘I’ would be 1, while the shift character for ‘e’ would be 3. This skip-value is updated in the Array of Skip-Values for that character, if the skip-value in the array is bigger than that just computed.
  • The skip value computed from using the above algorithm is shown in FIG. 6.
  • The skip values for all characters, not shown in FIG. 6, would remain 5.
  • If the text in which pattern match is to be done is “She said hello to him”. The pattern match algorithm would follow the sequence described below.
  • Place a window around “She s” and do a string compare against the patterns. The string match fails to match any pattern. Take the skip value corresponding to the last character in the window, which is ‘s’. The skip value corresponding to ‘s’ is 5. Skip 5 characters.
  • The window scrolls around “said h”, as ‘h’ is 5 characters from ‘s’. Note that the window also stretches to be as big as the largest pattern. The string match fails to match any pattern. Take the skip value corresponding to the last character in the window, which is ‘h’. The skip value corresponding to ‘s’ is 4. Skip 4 characters.
  • The window scrolls around “hello”, as ‘o’ is 4 characters from ‘h’. The string match succeeds to find hello. Note that the string comparison is done from the end of the window towards the beginning. A match is found.
  • Once a window is placed around given part of the text, as described above, the next task is to do a string compare against all the patterns, to verify if any of the patterns exists. For this a multi-level Trie structure is used. This structure facilitates faster convergence of the string match against the given patterns. The string comparison logic starts traversing the trie structure from the top two characters at a time. It continues comparing the trie characters consecutively until it reaches the end of the trie given in the ‘Trie Entry Flag’. If at any trie match, the two characters actually match, the “level” field gives the next trie record to access to check the next match. This way trie comparison eliminates the strings that do not match. Finally when the strings left are narrowed down to one, a simple string match is done. The string is stored at the offset pointed by the level from the start of the string table kept in the header of the Trie table. This is illustrated in FIG. 7. While the preferred embodiments of the invention have been illustrated and described, it will be clear that the invention is not limited to these embodiments only. Numerous modifications, changes, variations, substitutions and equivalents will be apparent to those skilled in the art without departing from the spirit and scope of the invention as described in the claims.

Claims (17)

1. A system for evaluating a data packet against rules, the system comprising:
a. a rule mesh configured with the rules, the rule mesh being a combination of a tree data structure and a graph data structure; and
b. a policy agent, wherein the policy agent evaluates the data packet against the rules in the rule mesh.
2. The system of claim 1 further comprising a rule compiler, wherein the rule compiler generates the rule mesh.
3. The system of claim 1, wherein the rule mesh comprises:
a. a path node table, wherein the path node table stores information regarding one or more tree nodes and one or more graph nodes of the rule mesh; and
b. a path edge table, wherein the path edge table stores information regarding one or more tree edges and one or more graph edges in the rule mesh.
4. The system of claim 3, wherein each graph edge comprises:
a. a confirmation bitmap, the confirmation bitmap comprising bits, the bits representing the rules that are pending in the graph data structure, wherein a bit is set if taking a graph edge confirms a rule from the pending rules; and
b. an elimination bitmap, the elimination bitmap comprising bits, the bits representing the rules that are pending in the graph data structure, wherein a bit is set if taking a graph edge eliminates a rule from the pending rules.
5. The system of claim 1, wherein the policy agent comprises:
a. a generic extension builder, wherein the generic extension builder processes the data packet header for obtaining information related to an Open System Interconnection (OSI) network model;
b. a session cache module, wherein the session cache module further processes the data packet header for obtaining information related to the OSI network model;
c. an application decode module, wherein the application decode module identifies information regarding an application, the application generating the data packet;
d. a rule engine module, wherein the rule engine module makes policy decisions based on the information related to the OSI network model and the information regarding the application; and
e. one or more policy entities, wherein each policy entity enforces one or more policies based on policy decisions.
6. The system of claim 5, wherein the policy agent further comprises a policy manager, the policy manager comprising rules related to the one or more policies.
7. The system of claim 5, wherein the rule engine module comprises:
a. a Rule Confirmation Bitmap (RCB), wherein the RCB indicates the rules matched in the graph data structure; and
b. a Graph Traversal Bitmap (GTB), wherein the GTB indicates conditions governing end of the traversal of the graph data structure.
8. The system of claim 5, wherein each policy entity comprises:
a. a policy processing module, wherein the policy processing module enforces the one or more policies on the data packet.
9. The system of claim 8, wherein the policy processing module comprises:
a. a rule lookup table, wherein the rule lookup table is indexed using an identity of the one or more tree data structures.
10. A system for traversing a rule mesh for evaluating a data packet against rules, the rule mesh being a combination of a tree data structure and a graph data structure, the rules being configured in the rule mesh as comprising path nodes and path edges, the system comprising:
a. means for receiving the data packet;
b. means for determining a root path node for the data packet;
c. means for performing rule mesh traversal for the data packet, wherein the rule mesh traversal starts from the root path node; and
d. means for updating information in the data packet during the rule mesh traversal, wherein the information is data regarding the rules satisfied by the data packet.
11. A computer program product for traversing a rule mesh for evaluating a data packet against rules, the rule mesh being a combination of a tree data structure and a graph data structure, the rules being configured in the rule mesh as nodes and path edges, the computer program product comprising a computer readable medium, the computer readable medium comprising:
a. computer executable instructions for receiving the data packet;
b. computer executable instructions for determining a root path node for the data packet;
c. computer executable instructions for performing rule mesh traversal for the data packet, wherein the rule mesh traversal starts from the root path node; and
d. computer executable instructions for updating information in the data packet during the rule mesh traversal, wherein the information is data regarding the rules satisfied by the data packet.
12. The computer program product according to claim 11, wherein the computer executable instructions for determining the root path node comprises computer executable instructions for checking the data packet for a session based application.
13. The computer program product according to claim 12, wherein the computer executable instructions for checking the data packet for the session based application comprises:
a. computer executable instructions for checking the presence of a session create flag if the data packet is for the session based application, wherein the session create flag indicates that the data packet is a first data packet of the session based application; and
b. computer executable instructions for assigning the root path node as the node for start of the rule mesh traversal if the data packet is not for the session based application.
14. The computer program product according to claim 13, wherein the computer executable instructions for checking the presence of the session create flag comprises:
a. computer executable instructions for initializing a session entry if the session create flag is present, wherein the session entry is used for determining the root path node; and
b. computer executable instructions for retrieving the session entry if the session create flag is not present.
15. The computer program product according to claim 11, wherein the computer executable instructions for performing the rule mesh traversal comprises:
a. computer executable instructions for traversing the tree data structure of the rule mesh till a start of graph path node is reached, wherein the start of graph path node indicates the start of the graph data structure in the rule mesh;
b. computer executable instructions for traversing the graph data structure of the rule mesh when the start of graph path node is reached; and
c. computer executable instructions for appending a rule lookup-id to the data packet after the rule mesh traversal, wherein the rule lookup-id contains data pertaining to the rules matched during the rule mesh traversal.
16. The computer program product according to claim 15, wherein the computer executable instructions for traversing the tree data structure of the rule mesh comprises:
a. computer executable instructions for determining a root node for the tree data structure, wherein the root node is a start node for traversing the tree data structure;
b. computer executable instructions for determining a tree edge for traversing the tree data structure, wherein the step of determining the tree edge comprises performing a search indicated on the root node;
c. computer executable instructions for arriving at a next path node of the tree data structure by traversing along the tree edge;
d. computer executable instructions for iteratively repeating steps b and c until the next path node is not the start of graph path node, wherein the start of graph path node is a first node of the graph data structure in the rule mesh; and
e. computer executable instructions for retrieving a tree ID from the tree edge if the next path node is the start of graph path node.
17. The computer program product according to claim 15, wherein the computer executable instructions for traversing the graph data structure comprises:
a. computer executable instructions for updating a Rule Confirmation Bitmap (RCB), wherein the RCB indicates the rules matched in the graph data structure;
b. computer executable instructions for initializing a Graph Traversal Bitmap (GTB), wherein the GTB indicates conditions governing end of the traversal of the graph data structure;
c. computer executable instructions for determining a graph edge for traversing the graph data structure based on the RCB and the GTB;
d. computer executable instructions for arriving at a next path node of the graph data structure by traversing along the graph edge; and
e. computer executable instructions for ending the rule mesh traversal if at least one of the conditions governing end of the traversal of the graph data structure is satisfied.
US11/584,051 2002-10-04 2006-10-20 Rule engine Abandoned US20070038775A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US11/584,051 US20070038775A1 (en) 2002-10-04 2006-10-20 Rule engine

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US10/264,803 US7139837B1 (en) 2002-10-04 2002-10-04 Rule engine
US11/584,051 US20070038775A1 (en) 2002-10-04 2006-10-20 Rule engine

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
US10/264,803 Continuation US7139837B1 (en) 2002-10-04 2002-10-04 Rule engine

Publications (1)

Publication Number Publication Date
US20070038775A1 true US20070038775A1 (en) 2007-02-15

Family

ID=37423341

Family Applications (2)

Application Number Title Priority Date Filing Date
US10/264,803 Active - Reinstated 2024-10-26 US7139837B1 (en) 2002-10-04 2002-10-04 Rule engine
US11/584,051 Abandoned US20070038775A1 (en) 2002-10-04 2006-10-20 Rule engine

Family Applications Before (1)

Application Number Title Priority Date Filing Date
US10/264,803 Active - Reinstated 2024-10-26 US7139837B1 (en) 2002-10-04 2002-10-04 Rule engine

Country Status (1)

Country Link
US (2) US7139837B1 (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060085533A1 (en) * 2004-09-10 2006-04-20 Hussain Muhammad R Content search mechanism
US20090119399A1 (en) * 2007-11-01 2009-05-07 Cavium Networks, Inc. Intelligent graph walking
US20090157586A1 (en) * 2007-12-17 2009-06-18 Honeywell International Inc. Object oriented rule-based system and method
US20100114973A1 (en) * 2008-10-31 2010-05-06 Cavium Networks, Inc. Deterministic Finite Automata Graph Traversal with Nodal Bit Mapping
WO2013095467A1 (en) * 2011-12-21 2013-06-27 Intel Corporation A balanced p-lru tree for a "multiple of 3" number of ways cache
WO2015126845A1 (en) * 2014-02-18 2015-08-27 F5 Networks, Inc. Concurrent evaluation of large rule sets with conditions
US20150281049A1 (en) * 2014-03-31 2015-10-01 Vmware, Inc. Fast lookup and update of current hop limit
US20150286932A1 (en) * 2014-04-04 2015-10-08 Ca, Inc. Leveraging unique object references to enhance performance of rete-based rule engines
CN105743871A (en) * 2014-12-12 2016-07-06 国家电网公司 Decision tree-based firewall policy conflict detection method
US10454768B2 (en) 2013-11-15 2019-10-22 F5 Networks, Inc. Extending policy rulesets with scripting

Families Citing this family (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7546629B2 (en) * 2002-03-06 2009-06-09 Check Point Software Technologies, Inc. System and methodology for security policy arbitration
US7634500B1 (en) 2003-11-03 2009-12-15 Netlogic Microsystems, Inc. Multiple string searching using content addressable memory
US7353332B2 (en) * 2005-10-11 2008-04-01 Integrated Device Technology, Inc. Switching circuit implementing variable string matching
US7783654B1 (en) 2006-09-19 2010-08-24 Netlogic Microsystems, Inc. Multiple string searching using content addressable memory
US7676444B1 (en) 2007-01-18 2010-03-09 Netlogic Microsystems, Inc. Iterative compare operations using next success size bitmap
US8619766B2 (en) * 2007-03-02 2013-12-31 At&T Intellectual Property Ii, L.P. Method and apparatus for classifying packets
US7707294B2 (en) * 2007-06-26 2010-04-27 Microsoft Corporation Edge traversal service dormancy
US8370919B2 (en) * 2007-06-26 2013-02-05 Microsoft Corporation Host firewall integration with edge traversal technology
US8553654B2 (en) * 2007-06-27 2013-10-08 Telefonaktiebolaget L M Ericsson (Publ) Method for expression evaluation and network node implementing such a method
US8051085B1 (en) 2008-07-18 2011-11-01 Netlogic Microsystems, Inc. Determining regular expression match lengths
MX2012003721A (en) 2009-09-30 2012-06-28 Evan V Chrapko Systems and methods for social graph data analytics to determine connectivity within a community.
US20110099164A1 (en) 2009-10-23 2011-04-28 Haim Zvi Melman Apparatus and method for search and retrieval of documents and advertising targeting
WO2011134086A1 (en) * 2010-04-30 2011-11-03 Evan V Chrapko Systems and methods for conducting reliable assessments with connectivity information
JP5645269B2 (en) * 2011-10-17 2014-12-24 株式会社日立製作所 Network system
US9491069B2 (en) 2012-07-29 2016-11-08 Verint Systems Ltd. System and method of high volume rule engine
US20150293994A1 (en) * 2012-11-06 2015-10-15 Hewlett-Packard Development Company, L.P. Enhanced graph traversal
US9578043B2 (en) 2015-03-20 2017-02-21 Ashif Mawji Calculating a trust score
US20170235792A1 (en) 2016-02-17 2017-08-17 Www.Trustscience.Com Inc. Searching for entities based on trust score and geography
US9679254B1 (en) 2016-02-29 2017-06-13 Www.Trustscience.Com Inc. Extrapolating trends in trust scores
US9721296B1 (en) 2016-03-24 2017-08-01 Www.Trustscience.Com Inc. Learning an entity's trust model and risk tolerance to calculate a risk score
US10802945B2 (en) * 2016-12-07 2020-10-13 Ab Initio Technology Llc Differencing of executable dataflow graphs
US10180969B2 (en) 2017-03-22 2019-01-15 Www.Trustscience.Com Inc. Entity resolution and identity management in big, noisy, and/or unstructured data
US11556636B2 (en) * 2020-06-30 2023-01-17 Microsoft Technology Licensing, Llc Malicious enterprise behavior detection tool
CN114124541B (en) * 2021-11-25 2024-02-09 北京锐安科技有限公司 Data processing method, device and equipment for rule ID and storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5170464A (en) * 1990-01-26 1992-12-08 International Business Machines Corporation Method for rolling back an expert system
US5970490A (en) * 1996-11-05 1999-10-19 Xerox Corporation Integration platform for heterogeneous databases
US5996077A (en) * 1997-06-16 1999-11-30 Cylink Corporation Access control system and method using hierarchical arrangement of security devices
US6122665A (en) * 1998-08-26 2000-09-19 Sts Software System Ltd. Communication management system for computer network-based telephones
US20020032773A1 (en) * 2000-07-31 2002-03-14 Servgate Technology, Inc. System, method and computer software products for network firewall fast policy look-up
US6484261B1 (en) * 1998-02-17 2002-11-19 Cisco Technology, Inc. Graphical network security policy management
US6587466B1 (en) * 1999-05-27 2003-07-01 International Business Machines Corporation Search tree for policy based packet classification in communication networks
US20030123456A1 (en) * 2001-12-28 2003-07-03 Denz Peter R. Methods and system for data packet filtering using tree-like hierarchy
US20030212900A1 (en) * 2002-05-13 2003-11-13 Hsin-Yuo Liu Packet classifying network services
US6987768B1 (en) * 1999-06-02 2006-01-17 Fujitsu Limited Packet transferring apparatus

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5485455A (en) * 1994-01-28 1996-01-16 Cabletron Systems, Inc. Network having secure fast packet switching and guaranteed quality of service
US20010045914A1 (en) * 2000-02-25 2001-11-29 Bunker Philip Alan Device and system for providing a wireless high-speed communications network
CA2463479A1 (en) * 2000-10-10 2002-04-18 Radiant Networks Plc Communications meshes
EP1543472A2 (en) * 2002-08-09 2005-06-22 Corticon Technologies, Inc. Rule engine

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5170464A (en) * 1990-01-26 1992-12-08 International Business Machines Corporation Method for rolling back an expert system
US5970490A (en) * 1996-11-05 1999-10-19 Xerox Corporation Integration platform for heterogeneous databases
US5996077A (en) * 1997-06-16 1999-11-30 Cylink Corporation Access control system and method using hierarchical arrangement of security devices
US6484261B1 (en) * 1998-02-17 2002-11-19 Cisco Technology, Inc. Graphical network security policy management
US6122665A (en) * 1998-08-26 2000-09-19 Sts Software System Ltd. Communication management system for computer network-based telephones
US6587466B1 (en) * 1999-05-27 2003-07-01 International Business Machines Corporation Search tree for policy based packet classification in communication networks
US6987768B1 (en) * 1999-06-02 2006-01-17 Fujitsu Limited Packet transferring apparatus
US20020032773A1 (en) * 2000-07-31 2002-03-14 Servgate Technology, Inc. System, method and computer software products for network firewall fast policy look-up
US20030123456A1 (en) * 2001-12-28 2003-07-03 Denz Peter R. Methods and system for data packet filtering using tree-like hierarchy
US20030212900A1 (en) * 2002-05-13 2003-11-13 Hsin-Yuo Liu Packet classifying network services

Cited By (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8818921B2 (en) 2004-09-10 2014-08-26 Cavium, Inc. Content search mechanism that uses a deterministic finite automata (DFA) graph, a DFA state machine, and a walker process
US20060085533A1 (en) * 2004-09-10 2006-04-20 Hussain Muhammad R Content search mechanism
US8560475B2 (en) 2004-09-10 2013-10-15 Cavium, Inc. Content search mechanism that uses a deterministic finite automata (DFA) graph, a DFA state machine, and a walker process
US9336328B2 (en) 2004-09-10 2016-05-10 Cavium, Inc. Content search mechanism that uses a deterministic finite automata (DFA) graph, a DFA state machine, and a walker process
US9652505B2 (en) 2004-09-10 2017-05-16 Cavium, Inc. Content search pattern matching using deterministic finite automata (DFA) graphs
US20090119399A1 (en) * 2007-11-01 2009-05-07 Cavium Networks, Inc. Intelligent graph walking
US8819217B2 (en) 2007-11-01 2014-08-26 Cavium, Inc. Intelligent graph walking
US20090157586A1 (en) * 2007-12-17 2009-06-18 Honeywell International Inc. Object oriented rule-based system and method
US8001070B2 (en) 2007-12-17 2011-08-16 Honeywell International Inc. Object oriented rule-based system and method
US20100114973A1 (en) * 2008-10-31 2010-05-06 Cavium Networks, Inc. Deterministic Finite Automata Graph Traversal with Nodal Bit Mapping
US8473523B2 (en) * 2008-10-31 2013-06-25 Cavium, Inc. Deterministic finite automata graph traversal with nodal bit mapping
US8886680B2 (en) 2008-10-31 2014-11-11 Cavium, Inc. Deterministic finite automata graph traversal with nodal bit mapping
US9495479B2 (en) 2008-10-31 2016-11-15 Cavium, Inc. Traversal with arc configuration information
WO2013095467A1 (en) * 2011-12-21 2013-06-27 Intel Corporation A balanced p-lru tree for a "multiple of 3" number of ways cache
US9348766B2 (en) 2011-12-21 2016-05-24 Intel Corporation Balanced P-LRU tree for a “multiple of 3” number of ways cache
US10454768B2 (en) 2013-11-15 2019-10-22 F5 Networks, Inc. Extending policy rulesets with scripting
WO2015126845A1 (en) * 2014-02-18 2015-08-27 F5 Networks, Inc. Concurrent evaluation of large rule sets with conditions
US20150281049A1 (en) * 2014-03-31 2015-10-01 Vmware, Inc. Fast lookup and update of current hop limit
US9667528B2 (en) * 2014-03-31 2017-05-30 Vmware, Inc. Fast lookup and update of current hop limit
US10187294B2 (en) 2014-03-31 2019-01-22 Vmware, Inc. Fast lookup and update of current hop limit
US20190230024A1 (en) * 2014-03-31 2019-07-25 Vmware, Inc. Fast lookup and update of current hop limit
US10841204B2 (en) * 2014-03-31 2020-11-17 Vmware, Inc. Fast lookup and update of current hop limit
US20150286932A1 (en) * 2014-04-04 2015-10-08 Ca, Inc. Leveraging unique object references to enhance performance of rete-based rule engines
US9965723B2 (en) * 2014-04-04 2018-05-08 Ca, Inc. Leveraging unique object references to enhance performance of RETE-based rule engines
CN105743871A (en) * 2014-12-12 2016-07-06 国家电网公司 Decision tree-based firewall policy conflict detection method

Also Published As

Publication number Publication date
US7139837B1 (en) 2006-11-21

Similar Documents

Publication Publication Date Title
US7139837B1 (en) Rule engine
US7203744B1 (en) Rule compiler for computer network policy enforcement systems
Golnabi et al. Analysis of firewall policy rules using data mining techniques
JP4490994B2 (en) Packet classification in network security devices
US9270704B2 (en) Modeling network devices for behavior analysis
US8726016B2 (en) Intelligent integrated network security device
US9800608B2 (en) Processing data flows with a data flow processor
US20050138413A1 (en) Network security planning architecture
US20110238855A1 (en) Processing data flows with a data flow processor
US20110231564A1 (en) Processing data flows with a data flow processor
JP2004533676A (en) Application layer security method and system
WO2007143226A2 (en) Generating a multiple-prerequisite attack graph
Soni et al. Use of Machine Learning algorithms for designing efficient cyber security solutions
Albanese et al. Deceiving attackers by creating a virtual attack surface
Stephan et al. Neural network approach to web application protection
Samak et al. Firecracker: A framework for inferring firewall policies using smart probing
Trabelsi et al. Hybrid mechanism towards network packet early acceptance and rejection for unified threat management
Vasu et al. Improving firewall performance by eliminating redundancies in access control lists
Holsopple et al. Virtual terrain: a security-based representation of a computer network
Wakabayashi et al. Traffic-aware access control list reconstruction
Turner et al. A statistical and cluster analysis exploratory study of snort rules
Dzeparoska et al. SDX-based security collaboration: Extending the security reach beyond network domains
Anand et al. Performance Analysis of ACO-based IP Traceback
KR100608210B1 (en) SVM Based Advanced Packet Marking Mechanism for Traceback AND Router
Qin et al. Computer Network Security Protection System Based on Genetic Algorithm

Legal Events

Date Code Title Description
AS Assignment

Owner name: IPOLICY NETWORKS INC., CALIFORNIA

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:PAREKH, PANKAJ;GUPTA, SANDEEP;MAMTANI, VIJAY;REEL/FRAME:018446/0072;SIGNING DATES FROM 20061018 TO 20061020

STCB Information on status: application discontinuation

Free format text: ABANDONED -- FAILURE TO RESPOND TO AN OFFICE ACTION