The present invention relates to the operation of network-based electronic devices, and more particularly, to systems and methods for filtering communications packets on such electronic devices.
One of the most vexing issues faced by the electronics industry, especially the electronic communications industry, is that the computer networks have become a favorite venue of various types of malfeasance.
One network security threat is the transmission of communications packets to a node on a network where the communications packets are undesirable to the node for some reason. That reason may, for example, be the repeated transmission of packets in an effort to disable the node.
Firewalls are examples of methods by which network nodes may be protected against attacks based on the transmission of communications packets. Firewalls can be implemented in hardware, software, or the combination of both. This work focuses on the software method. Firewall techniques include packet filter, application gateway, circuit-level gateway, and proxy server.
As the Internet grows, many small resource constrained devices join the Internet to provide services or to access resources over the Internet. One such example is the Network Smart Card which is a smart card with networking capabilities (Lu, H. K., Montgomery, M., and Ali, A., “Secure Networking Using a Resource Constraint Device,” U.S. patent application Ser. No. 10/848,738, the entire disclosure of which is incorporated herein by reference). Once joining the network, these embedded devices are exposed to the network security threats just like the other computers on the network. Therefore, they require security protections as well.
However, most existing firewalls are not suitable for small, embedded devices because of computing resource limitations due to the heavy resource burden imposed by such packet filters. Most prior art detection methods are based on statistics of the packets that indicate a probability of network-based attack based on certain characteristics, for example, probabilities or distributions of certain types of packets, open port numbers, service requests, errors, or signatures (or patterns) of the packets flow (i.e., particular patterns of packets or sequences of packets). These methods require the understanding of normal or abnormal packets probabilities or signatures and being able to separate normal and abnormal packet flows. These systems need to be trained and be adaptable to changes of the statistics or signatures. Implementation-wise, most existing methods for host computers run in a separate processor or a separate task. This would consume too many resources for resource-constrained network devices.
One way for a device to join a network is to use the Point-to-Point Protocol (PPP) to connect to another computer or a network, which has the Internet connection. For example, in order to get an Internet connection, a PDA connects to a host computer via Bluetooth or a mobile phone connects to a GPRS network. The PDA or the mobile phone use PPP as the link layer to dial into the host computer or the GPRS network. PPP frames encapsulate higher level protocol packets, e.g., the PPP packets may encapsulate Internet protocols, such as TCP/IP, UDP, or other protocols. The PPP protocol specifies three framing techniques for use with various media (described in RFC 1662, “PPP in HDLC-like Framing” Network Working Group, 1994). One of the framing techniques is the Asynchronous High-Level Data Link Control (AHDLC). The AHDLC is used for all asynchronous lines, such as modems used on computers.
From the foregoing it will be apparent that there is still a need for an improved system and method to detect network-based attacks against network-connected electronic devices. Such a system and method should be simple, use existing infrastructure, use only the resources and hardware intrinsically available to the electronic device, and without requiring building of data bases that catalog signatures of particular attacks or particular devices prone to attack. It would be desirable if such a system and method filtered out attacks as early as possible in the processing of incoming communications data, e.g., at the link layer in conjunction with the processing of data frames that carry link layer packets.
In a preferred embodiment, the invention provides a system and method for filtering packets that are undesirable at a very early stage processing of incoming communications data. The system and method according to the invention filters incoming communications packets in conjunction with the processing of data frames that carry link layer packets. An electronic device operating according to the invention filters incoming packets by receiving a communications packet in a link layer protocol embedded in a data frame protocol on the electronic device; determining a position of a first protocol header in the data frame wherein the first protocol header corresponds to a first protocol packet embedded in the data frame; and successively processing octets in the data frame. In successively processing octets of the data frame, the electronic device processes each octet according to the rules of the data frame protocol; upon processing octets comprising the first protocol header, passing the protocol header to a first protocol packet filter; receiving a first protocol filter result from the first protocol packet filter wherein the first protocol filter result indicates whether the received packet should be dropped according to at least one first protocol filtering rule; and in response to receiving a first protocol filter result indicative that the received packet should be dropped, skipping processing through the end of the data frame.
In a further embodiment of the invention, the electronic device, if the first protocol header contains first protocol options, passes the n octets, the number of octets of options, to a second packet filter for the first protocol. In a further alternative embodiment after filtering according to a first protocol, processing n additional octets of the incoming data, where n is the number of octets required for a next protocol filter, passing the n octets to a packet filter for the next protocol. In response to receiving a filter result from a packet filter indicative that the packet should be dropped, skipping processing of the data frame through the end of the data frame.
Other aspects and advantages of the present invention will become apparent from the following detailed description, taken in conjunction with the accompanying drawings, illustrating by way of example the principles of the invention.
In the following detailed description, reference is made to the accompanying drawings that show, by way of illustration, specific embodiments in which the invention may be practiced. These embodiments are described in sufficient detail to enable those skilled in the art to practice the invention. It is to be understood that the various embodiments of the invention, although different, are not necessarily mutually exclusive. For example, a particular feature, structure, or characteristic described herein in connection with one embodiment may be implemented within other embodiments without departing from the spirit and scope of the invention. In addition, it is to be understood that the location or arrangement of individual elements within each disclosed embodiment may be modified without departing from the spirit and scope of the invention. The following detailed description is, therefore, not to be taken in a limiting sense, and the scope of the present invention is defined only by the appended claims, appropriately interpreted, along with the full range of equivalents to which the claims are entitled. In the drawings, like numerals refer to the same or similar functionality throughout the several views.
As shown in the drawings for purposes of illustration, the invention is embodied in a network enabled electronic device, e.g., a network smart card, equipped with the capability of filtering data packets in conjunction with the processing of data frames that carry incoming link layer data packets. The system and method for filtering data packets according to the invention requires no additional hardware resources and very limited additional processing and memory resources and is therefore suitable for use in network-enabled resource-constrained devices, i.e., devices with limited memory, bandwidth, or processing power.
In one example, a network-enabled electronic device 101 is a network smart card installed into a handset 103. The handset 103 may be a mobile telephone having the usual accoutrements of a mobile telephone such as a keypad 105, a display 107, a microphone 109 and a speaker 111. In alternative embodiments, the handset 103 may be a personal digital assistant or any other mobile device using a SIM card. The handset 103 also contains an electronic circuitry (not shown) including a central processing unit and memory. Furthermore, there are a variety of smart mobile devices available, such as web-enabled phones, smart phones, PDAs, handheld PCs and tablet PCs. Many of the smart phones and PDAs combine the cell phone and PDA functionalities. Popular operating systems for smart mobile devices include Symbian, Palm OS, and Microsoft Smartphone. The invention described herein is applicable to such devices if they have SIM device that is a network smart card 101.
The electronic circuitry provides communications functionality for the handset 103 with a wireless network 117 via a wireless link to a wireless telephony antenna 119. And the microprocessor provides some of the control functionality of the handset 103, such as managing operations of the handset 103 and managing communications protocols used to communicate with the wireless network 117. The network smart card 101 is connected to the electronic circuitry so as to allow communication between the network smart card 101 and the handset 103.
The wireless network 117 is composed of a complex communications infrastructure for providing connections to other stations, for example, other mobile stations or land-based telephone systems. One such station may be an Internet gateway 121, which gives the wireless network 117 access to the Internet 125. As commonly known, many computers are connected via the Internet. In the scenario presented herein, a user of a handset, e.g., a mobile telephone or a PDA, uses the infrastructure illustrated in
Another example, of a network-connected electronic-device 101′ is a network smart card having a credit card form factor and which is connected to the Internet 125 via a host computer 103′.
A network smart card 101 or 101′ is a smart card that is capable to act as an autonomous Internet node. Network smart cards are described in co-pending patent application Ser. No. 10/848,738 “SECURE NETWORKING USING A RESOURCE-CONSTRAINED DEVICE”, filed on May 19, 2004, the entire disclosure of which is incorporated herein by reference. A network smart card 101 implements Internet protocols (TCP/IP) and security protocols (SSL/TLS) built into the card and may implement other communications protocols as described herein below. The network smart card 101 can establish and maintain secure Internet connections with other Internet nodes. The network smart card 101 does not depend on a proxy on the host to enable Internet communications. More over, the network smart card 101 does not require local or remote Internet clients or servers to be modified in order to communicate with the smart card.
The invention is also applicable for use in other devices, including other network-enabled resource-constrained devices, and is not necessarily limited in use to resource-constrained devices. For example, a network-enabled electronic-device according to the invention may be a computer 101″. Herein, the term network-enabled electronic-device refers to any electronic device that is connected via a network to other electronic-devices and is capable of communicating electronically with such other devices. Similarly, the reference numeral 101 is used to refer to any such device and not specifically to any one such device.
In the scenario depicted in
The network-connected electronic device may be a network smart card, e.g., smart card 101′. Network smart cards, which are described in co-pending patent application Ser. No. 10/848,738 “SECURE NETWORKING USING A RESOURCE-CONSTRAINED DEVICE”, filed on May 19, 2004, the entire disclosure of which is incorporated herein by reference, combine the functionality of traditional smart cards with the capability of acting as autonomous network nodes by implementing a communications protocol stack used for network communication. In the event that the network-connected electronic device 101 connects to the network via a host computer 103′, the host computer 103′ may be the attacking computer, for example, as a reflector or by having some malware installed thereon.
The ROM 205 would also contain some type of operating system, e.g., a Java Virtual Machine. Alternatively, the communications module 321 would be part of the operating system. During operation, the CPU 203 operates according to instructions in the various software modules stored in the ROM 205 or NVM 209.
Thus, according to the invention, the CPU 203 operates according to the instructions in the communications module 321 to perform the various operations of the communications module 321 described herein below.
The host computer 303 has loaded thereon several network applications 305a, 305b, and 305c. (Note: In the case of a handset 103, the handset physical architecture is much like that of a computer. Thus, the handset 103 has a memory and a processor. The memory may be composed of RAM, ROM, EEPROM, etc. The memory contains the software modules that control the behavior of the processor. Thus, the various software modules illustrated in
The host computer 303 and the resource constrained device 301 communicate over several layers of communication protocols. In one embodiment, these layers may be represented by several communicating software modules, e.g., a TCP/IP Module 317 for handling communications at the TCP/IP level, a PPP module 318 for handling communications at the PPP level, and an AHDLC module 325 for providing communication of data frames that encapsulate PPP packets and, through PPP packets, encapsulate higher level protocol packets. PPP implementations may be built on a restricted subset of the High-Level Data Link Control (HDLC) protocol. HDLC carries out frame formation and frame transmission for PPP. PPP uses one of three framing techniques. For exemplary purposes, an embodiment of the invention using the AHDLC (Asynchronous HDLC), which is asynchronous communication, is described herein.
The host computer 303 may establish connection with the outside data network and may support several applications 305a-c. The application programs on the host computer use a communications module 311 to establish connections to outside network and to communicate with applications 307a-c on the resource constrained device 301.
The communications module 311 contains modules for implementing several communications layers. For example, a TCP/IP module 317 is an implementation of the TCP and IP communications protocols, a PPP module 318 is an implementation of the PPP communications protocol, and the ADHLC Module 315 is an implementation of the AHDLC protocol for receiving and transmitting dataframes that may encapsulate PPP, IP, and TCP packets.
Communication between the resource constrained device 301 and the network via the host computer 303 is described in greater detail in hereinabove referenced co-pending patent application Ser. No. 10/848,738 entitled “SECURE NETWORKING USING A RESOURCE-CONSTRAINED DEVICE”, filed May 19, 2004, which is incorporated herein by reference. The virtual serial port 313 implements the serial port interface that is defined by the operating system of the handset 303. Communication between a network SIM card (also known as a network UICC card) is described in greater detail in co-pending patent application Ser. No. 11/234,577 “COMMUNICATIONS OF UICC IN MOBILE DEVICES USING INTERNET PROTOCOLS,” filed on Sep. 23, 2005, which is incorporated herein by reference.
The AHDLC module 315 is further connected to a Hardware Layer module 319. The Hardware Layer module 319 transmits and receives AHDLC frames over the physical connection to the resource constrained device 301.
In the example of
The Card AHDLC module 325, according to the invention, also contains a AHDLC layer filter module 327. The AHDLC filter module contains an implementation of an AHDLC layer packet filter implemented according to the methodologies described herein, for example, in conjunction with
The AHDLC data framing for PPP uses two special octet values that have the hexadecimal values 7E and 7D. The value 7E is a frame delimiter that marks the end of one frame and the beginning of the next frame. The initial 7E is optional. Most implementations, however, start a PPP frame with 7E and end the frame with 7E. The value 7D is an escape character to inform the receiver to form the next actual decoded octet in the HDLC frame as an exclusive-OR of the next transmitted octet with the fixed hexadecimal value 20. The transmitter escapes the values 7D and 7E when sending the PPP frame. By default, all values between 00 and 1F are also escaped by preceding octets with these values with an octet having the value 7D. A special PPP option enables the peers, i.e., in the example of
A communication between two nodes using PPP commences with a negotiation process, e.g., including agreeing on escape character. Once the PPP negotiation successfully completes, the PPP packets are used to carry packets of the higher level network protocols. For the Internet protocol case, a PPP frame encapsulates an IP datagram.
The communications packets are typically processed one layer at a time. (The discussion that follows, describes the communication from the vantage point of the resource constrained device 301). After receiving a packet from the I/O hardware 318, the input process starts at the AHDLC layer, i.e., the Card AHDLC Module 325, and then moves relevant data up the communications stack to the higher-level protocol modules, e.g., the PPP module 329, the IP layer module 327 and the TCP module 323. The AHDLC layer module 325 processes one byte at a time from the input buffer and typically puts the result into another buffer. The resulting buffer (or the data in the buffer) is sent to the PPP layer module 329, the IP layer module 327, and the TCP layer module 323 for processing. Data may then be transmitted to the applications 307a-c.
In the prior art, packet filtering is usually performed at IP and TCP layers. Some PPP implementations include packet filtering at the PPP layer as well. This works well for most computers and servers because they have large memories and abundant computing resources. For resource-constrained devices, memory and computing power are very limited. Every effort is made to conserve and to best use the computing resource. Having packets fully processed at AHDLC layer and then dropping them later at upper layer by packet filters waste time and memory. According to the invention, packet filtering is performed at the AHDLC layer to save time and memory usage and, at the same time, provide better network security to the device.
The present invention presents a method and system for packet filtering at the AHDLC layer that may be realized, for example, in implementations of one of two alternative embodiments referred to herein as the Simple Method and the Filter Chain Method, respectively.
For an incoming AHDLC frame, instead of finishing AHDLC processing and sending the PPP frame to the PPP layer, the AHDLC layer only processes the AHDLC headers, PPP headers and 20 octets into the IP datagram. The number of octets in the AHDLC and PPP headers depends on the compression option. Without compression, the AHDLC and PPP headers contain a total of 4 octets. In that case, after processing 24 octets, the software can check a packet against the IP filtering rules, for example, using the IP addresses, to determine if the packet should be dropped. If so, the AHDLC layer does not need to continue processing the rest of the octets. Rather the AHDLC searches the end of the frame, i.e., by searching for an unescaped octet having the hexadecimal value 7E, and starts to process the next frame. If the packet has passed the IP filter (that is, not dropped), the AHDLC layer processes and obtains another 4 octets to obtain the transport layer port numbers. The AHDLC layer then checks the transport layer-filtering rules, for example, using the port numbers, to determine if the packet should be dropped. If so, it stops processing octets, searches the end of the frame, and starts to process the next frame.
First the AHDLC layer module 325 searches for a first frame by successively getting a next octet, step 701, and comparing that octet against a frame marker, e.g., the value 7E.
Upon detecting a new octet, the AHDLC layer module 325 establishes a value L and a value Filter, step 705. L is set to the location for the next protocol header. In the case of PPP carrying TCP/IP, the next header is the IP header, which is located 20 octets beyond the AHDLC and PPP headers. The first protocol filter to check the packet against is the IP Protocol filter. Thus, the value for Filter is set to ‘IP Filter’.
Next a sequence of octets are obtained, step 707, processed, step 709, checked to determine whether to save an octet in the result buffer for passing to the PPP module, step 711, until the number of octets processed equals the value L, step 713.
If the indicated protocol is ‘IP data’, step 715, the filter indicated by the value Filter is deployed, step 717, otherwise, the rest of the AHDLC frame is processed, step 719, and control (and a result buffer) is passed to the PPP layer module 329, step 721.
If the protocol is ‘IP data’, the frame is passed to the filter, step 717. There are many different filtering rules known in the art. The filter may deploy any such rule that relies on data up through the protocol header. If the filter returns a result that the packet does not pass the deployed filter rule, step 723, the AHDLC module 325 skips past all octets until the end of the data frame (indicated by an unescaped hexadecimal value 7E).
Otherwise, if the Filter value is ‘Port Filter’, step 727 (note: in the Simple Method, in the example of the embodiment illustrated in
If the Filter value is not ‘Port Filter’, step 723, that indicates that the port filter has not yet been executed. Then, the L value is incremented by 4, so that the port value can be read from the AHDLC frame and the Filter value is set to ‘Port Filter’. The process then continues with getting the next octet, step 707, until the port has been read as would be indicated in step 713.
This simple method of AHDLC layer filtering method provides several advantages:
This simple AHDLC packet filtering method assumes that the IP header is 20 octets long. This is true most of the time. However, IP header may contain options. In this case, the header is more than 20 octets long. The filter chain method to be described below in conjunction with
A second alternative embodiment, the Filter Chain Method, is illustrated in the flow charts of
The filter chain method is similar to the simple method but is not limited to the 20 octets default IP header. The UDP or TCP layer module 323 register to IP layer module 327 its packet filter. The IP layer module 327 registers a packet filter (IP Filter_1) to the AHDLC layer module 325. The IP Filter_1 takes the 20 octets IP header, does the filtering, and determines whether to pass or drop the packet. If the packet should be dropped, the process moves on to the next packet. If the packet passes (not dropped), the IP Filter_1 returns a number O and the next packet filter, where the number O indicates the number of additional octets to read.
If the IP header of the packet does not contain options, the number of additional octets to obtain is 4 and the next packet filter is TCP filter or UDP filter. If the IP header contains options, the additional octets to obtain are IP options and the next packet filter is the second IP filter, IP Filter_2. This filter may do filtering using the IP options in a filtering criteria to determine whether to pass or drop the packet. If filtering on IP options is not required or if the IP Filter_2 has not been configured to perform filtering according to IP options, the IP Filter_2 may simply let the packet pass. If the packet does not pass the IP Filter_2, the AHDLC module 325 moves on to process the next packet. If the packet does pass, the IP Filter_2 returns a value 4, which is the number of additional octets to read, and the next packet filter, which might be a TCP filter or UDP filter. The four octets are source and destination port numbers.
The TCP or UDP filter uses the port numbers to check against the filtering rules to decide whether to pass or drop packets. If the packet should be dropped, we go to the next packet. If the packet can pass, a UDP packet will go up the protocol stack from the AHDLC layer; a TCP packet might require more filtering. After a TCP packet passes the first TCP filter, the filter returns the number of additional octets to obtain and the next TCP filter. The next TCP filter may do, for example, state based filtering (or called stateful filtering).
The method of
Turning first to
If the packet does not pass the first filter, step 803, the packet is dropped, step 805.
If the packet passes the first IP layer filter, step 803, then, if the packet contains IP options, step 807, a second IP filter based on those IP options is to be applied, therefore, the La value, the number of octets to advance before invoking the next filter, is set to the length of the options, the Filter value is set to ‘IP Filter_2’ in order to invoke the second IP layer filter, step 809, and an indicator that the packet passed the filter is returned together with the values La, Filter, and the location to which to enter the next time a filter is applied, here ‘A’, step 811.
The next time the filter execute and select logic of
If there are no IP options, step 807, or if the second IP filter passes the packet, step 811, the La value is set to 4, i.e., the number of octets that make up TCP or UDP source and destination port numbers, step 821. A determination is made to determine whether the packet is a TCP, UDP or other kind of packet. As shown in
If the packet is a TCP packet, step 823, the packet is filtered using a TCP packet filter based on the TCP source and destination ports. Accordingly, with a return indicator of PASS, the routine returns next filter, Filter, as ‘TCP Filter’, and a next entry point as ‘D’, step 829.
For the UDP Filter, entry point C, location 831, the UDP filter is applied, step 833. f the packet does not pass the filter, step 835, the packet is dropped step 837. Otherwise, an indication that the packet has passed is returned with an indicator (NIL) that no further filtering will be done, step 839.
For the TCP Filter, entry point D, location 841, the TCP filter is applied, step 843. If the packet does not pass the filter, step 845, the packet is dropped, step 847. Otherwise, a second TCP filter, TCP Filter_2, will be employed using the remainder of the TCP header, step 849. Accordingly, an additional 16 octets should be read and processed, i.e., set La to 16, and the next filter entry point to ‘E’.
When the filter selection and invocation routine is next executed, i.e., at entry point ‘E’, location 851, the TCP Filter_2 is executed, step 853. f the packet does not pass the filter, step 855, the packet is dropped, step 857. If the packet passes the TCP Filter_2, further optional TCP filtering may be performed, step 859. In which case, parameters for such filtering is set, step 861. If no further TCP based filtering is to be performed, step 859, the next filter value is set to NIL to indicate that such is the case. Whether more filtering is to be done or not, a value of PASS is returned together with the value for the Filter variable, step 865. If further filtering is to be done using TCP optional filtering, there would be a further entry point and filtering, determination if the filter was passed, and so forth in a similar manner as to that discussed herein above. [0085] It should be noted that many filtering rules exist for TCP and UDP packet filtering. Any such rule may be applied for the UDP Filtering, and TCP Filtering used in steps 801, 815, 833, 843, and 853, respectively.
The filter chain method is dynamic in the sense that the next filter to use is determined according to the information in the received packet. The filter chain method has the same advantages as the simple method including better security, enhanced communication performance, and reduced memory usage. In addition, it removes the 20-octet default IP header assumption and provides more filtering options, for example, TCP stateful filtering. The filter chain method is more general and is more flexible than the simple method.
In this example, the AHDLC layer module 325 commences by finding the beginning of an AHDLC frame by successively obtaining new octets from the data stream, step 901, until a frame delimiter has been encountered, step 903.
As an initialization step, the AHDLC layer module sets up to filter using a first IP filter, IP_Filter 1, which is a filtering based on the IP header except for options. Because the IP header length without options is 20 bytes long a value La which is used to indicate how many octets to advance for the filter information used by the IP Filter_1 is set to 20. For the initial case, because of the AHDLC and PPP headers, the actual number of octets to be obtained, L, for the IP Filter_1 is incremented by the AHDLC and PPP header length. The next filter variable to be applied, Filter, is initialized to ‘IP Filter_1’, step 905.
Next, for each filter to be applied, L octets are obtained, step 907, are processed as required by AHDLC processing, step 909, if the octet is one that is kept for further processing, step 911, the number of obtained octets is compared to the value L, step 913, to determine if all the octets required for the next filter, Filter, have been obtained.
Once all necessary octets for applying the next filter, Filter, have been obtained, if the protocol, which would have been determined from the protocol field in the PPP header of the data frame, is one for which further filtering may be performed, e.g., it is an Internet protocol such as IP, step 915, filtering is performed by the next filter, Filter, step 917. The filter returns two values, the filter result, i.e., whether the packet passes the filter, and La, the number of octets to advance for the next filter to be applied.
If the packet did not pass the filter, processing is skipped to the end of the AHDLC data frame, step 921.
If there is another filter to apply, step 923, the value L is incremented by the number of additional octets, La, to obtain in order to apply that filter, step 925.
If there are no more filters to apply, e.g., as determined in steps 915 and 923, respectively, the AHDLC module continues processing octets through the end of the data frame, step 927, and the processed data is released to the PPP layer, step 929.
The method and system for filtering data packets according to the invention uses the operations of a communications module to filter incoming data packets during the processing of the link layer. An electronic device incorporating logic implementing or operating according to the method of the invention is highly efficient in that undesirable data packets are eliminated without undue processing at a very early processing stage. The system and method for filtering data packets according to the invention is a general framework for efficient packet filtering and is therefore suitable for use on small resource constrained network devices and may also be deployed on larger systems. The system and method of filtering undesirable packets according to the present invention has several advantages over existing packet filtering systems, including reduced memory usage, and enhanced performance.
Although specific embodiments of the invention have been described and illustrated, the invention is not to be limited to the specific forms or arrangements of parts so described and illustrated. The invention is limited only by the claims.
This invention claims priority pursuant to 35 U.S.C. 119 of U.S. Provisional Patent Application Ser. No. 60/652,342, filed on Feb. 11, 2006. This Provisional Application is hereby incorporated by reference in its entirety.
Number | Date | Country | |
---|---|---|---|
60652342 | Feb 2005 | US |