System for parsing a packet for conformity with a predetermined protocol using mask and comparison values included in a parsing instruction
First Claim
1. A method of parsing a packet received at a network interface from a network to determine if said packet conforms to a communication protocol for communicating between network entities, comprising:
- receiving a packet at a network interface from a network;
retrieving a first parsing instruction in a set of instructions stored on said network interface for parsing said packet;
executing said first instruction to access a first value within a header portion of said packet;
using a mask within said first instruction, masking said first value to produce a first masked value;
determining whether said first masked value has a specified relationship to a first comparison value within said first instruction; and
terminating execution of said parsing instructions if said determination indicates whether said header conforms to one of a set of pre-selected protocols.
2 Assignments
0 Petitions
Accused Products
Abstract
A high performance network interface receives network traffic in the form of packets. The network interface parses one or more headers of a received packet in order to determine whether the packet has been formatted with a pre-selected protocol. If so, one or more efficient enhancements in the processing of a packet may be enabled for the packet. During parsing, header data that may be useful in the processing enhancements may be saved. A packet conforming to one or more of a set of pre-selected protocols may be more completely parsed than a packet not conforming to any of the pre-selected protocols. Instructions for parsing a packet to determine a protocol and to extract useful data are stored in a writeable random-access memory. The instructions may be replaced, modified or supplemented depending upon the composition of network traffic and the protocols selected for enhanced processing. In a parsing instruction executed by a micro-sequencer, a value is extracted from a header and compared to a test value that may be derived from a protocol specification. If the comparison succeeds parsing continues along a first branch; if the comparison succeeds it continues along a second branch. The value extracted from the header may be saved. An offset to a parsing position within the packet is maintained and updated as the packet is parsed. Values other than those extracted for comparison may also be identified and saved.
-
Citations
33 Claims
-
1. A method of parsing a packet received at a network interface from a network to determine if said packet conforms to a communication protocol for communicating between network entities, comprising:
-
receiving a packet at a network interface from a network;
retrieving a first parsing instruction in a set of instructions stored on said network interface for parsing said packet;
executing said first instruction to access a first value within a header portion of said packet;
using a mask within said first instruction, masking said first value to produce a first masked value;
determining whether said first masked value has a specified relationship to a first comparison value within said first instruction; and
terminating execution of said parsing instructions if said determination indicates whether said header conforms to one of a set of pre-selected protocols. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)
copying a value from said predetermined field; and
applying a mask included in said first instruction to said copied value.
-
-
7. The method of claim 4, wherein said calculating comprises offsetting said position by an offset value included in said first instruction.
-
8. The method of claim 1, further comprising executing a second instruction in said set of parsing instructions to:
-
locate a second value within said header portion; and
perform an operation specified in said second instruction using said second value.
-
-
9. The method of claim 1, further comprising executing a selected second instruction, wherein said second instruction is selected depending upon whether said specified relationship exists between said first value and said first comparison value.
-
10. The method of claim 1, further comprising storing a second value of said header portion.
-
11. The method of claim 1, wherein said determining comprises comparing said first value to a first comparison value to determine if they are equivalent.
-
12. The method of claim 11, wherein said first comparison value is specified in one of said set of pre-selected protocols.
-
13. The method of claim 1, further comprising prior to said receiving, storing a set of instructions for parsing a packet.
-
14. The method of claim 13, further comprising updating said set of parsing instructions.
-
15. The method of claim 13, further comprising replacing said set of parsing instructions with a replacement set of parsing instructions.
-
16. The method of claim 1, further comprising transferring said packet to a host computer for processing in accordance with one or more protocols associated with said packet.
-
17. A method of parsing a packet received at a network interface from a network to determine if the packet conforms to a predetermined protocol for communicating between network entities, comprising:
-
maintaining a replaceable set of instructions on a network interface, wherein said set of instructions is configured to examine a packet received at said network interface;
receiving a packet at said network interface from a network;
executing one or more of said instructions to determine whether a header portion of said packet conforms to a predetermined protocol, wherein executing a first instruction comprises;
extracting a first header portion of said packet;
masking said first header portion to produce a first masked value;
using a mask included in said first instruction;
comparing said first masked value to a first comparison value included in said first instruction;
if said first masked value has a specified relationship to said first comparison value, identifying a second header portion of said packet; and
selectively performing an operation with said second header portion of said packet, depending on whether said first masked value has said specified relationship to said first comparison value. - View Dependent Claims (18, 19, 20, 21, 22, 23)
if said first masked value portion has a relationship other than said specified relationship to said first comparison value, halting said execution of said set of instructions and determining that said packet fails to conform to said predetermined protocol.
-
-
20. The method of claim 18, wherein said second instruction comprises halting said execution of said set of instructions and determining that said packet conforms to said predetermined protocol.
-
21. The method of claim 18, wherein said executing a second instruction comprises:
-
masking said second header portion to produce a second masked value; and
comparing said second masked value to a second comparison value.
-
-
22. The method of claim 18, wherein said executing a second instruction comprises storing said second header portion of said packet.
-
23. The method of claim 22, wherein said first portion of said packet comprises said second portion.
-
24. A network interface for parsing a packet received from a network for a host computer coupled to the network interface, comprising:
-
a re-writeable memory configured to store a series of instructions for parsing a packet received from a network, wherein each instruction in said series of instructions comprises;
an extraction mask configured to format a first value extracted from said packet to produce a formatted extracted value;
a comparison value to compare to said formatted extracted value;
a success instruction identifier configured to identify a first instruction to execute if said comparison is satisfied; and
a failure instruction identifier configured to identify a second instruction to execute if said comparison is not satisfied;
a position identifier configured to facilitate identification of a position within said packet at which to extract said first value;
a processor configured to execute said series of instructions; and
a memory configured to store a second value extracted from said packet;
wherein said processor executes one or more of said series of instructions to examine a header of said packet before said packet is transferred to a host computer. - View Dependent Claims (25, 26, 27, 28, 29)
a position updater configured to update said position identifier.
-
-
30. A computer readable storage medium storing instructions that, when executed by a computer, cause the computer to perform a method of parsing a packet received from a network to determine whether said packet conforms to a communication protocol for communicating between network entities, the method comprising:
-
receiving a packet at a network interface from a network;
retrieving a first instruction in a set of parsing instructions stored on said network interface for parsing said packet;
executing said first instruction to access a first value within a header portion of said packet;
using a mask within said first instruction, masking said first value to produce a first masked value;
determining whether said first masked value has a specified relationship to a first comparison value within said first instruction; and
terminating execution of said parsing instructions if said determination indicates whether said header conforms to one of a set of pre-selected protocols.
-
-
31. A network interface containing a first data structure configured to store a series of instructions for parsing a packet received at the network interface from a network, the first data structure comprising:
-
an instruction identifier for identifying an instruction for examining a packet received at a network interface from a network;
a portion identifier for identifying a first portion of said packet;
an extraction mask included in each instruction in said series of instructions, wherein said extraction mask of a first instruction in said series of instructions is configured for masking said first portion;
to produce a masked first portion of said packet a first comparison value included in each instruction in said series of instructions, wherein said first comparison value of said first instruction is configured for comparison with said masked first portion of said packet;
an offset for updating said portion identifier to identify a second portion of said packet; and
an operation identifier for identifying an operation to be performed on said second portion. - View Dependent Claims (32)
-
-
33. A computer readable storage medium storing instructions that, when executed by a computer, cause the computer to perform a method of parsing a packet received at a network interface from a network to determine if the packet conforms to a predetermined protocol for communicating between network entities, the method comprising:
-
maintaining a replaceable set of instructions on a network interface, wherein said set of instructions is configured to examine a packet received at said network interface;
receiving a packet at said network interface from a network;
executing one or more of said instructions to determine whether a header portion of said packet conforms to a predefined protocol, wherein executing a first instruction comprises;
extracting a first header portion of said packet;
masking said first header portion to produce a first masked value using a mask included in said first instruction;
comparing said first masked value to a first comparison value included in said first instruction;
if said first masked value has a specified relationship to said first comparison value, identifying a second header portion of said packet; and
selectively performing an operation with said second header portion of said packet, depending on whether said first masked value has said specified relationship to said first comparison value.
-
Specification