Embodiments of the apparatus for modifying packet headers relate to a use of bit vectors to allow expansion and collapse of protocol headers within packets for enabling flexible modification. A rewrite engine expands each protocol header into a generic format and applies various commands to modify the generalized protocol header. The rewrite engine maintains a bit vector for the generalized protocol header with each bit in the bit vector representing a byte of the generalized protocol header. A bit marked as 0 in the bit vector corresponds to an invalid byte, while a bit marked as 1 in the bit vector corresponds to a valid byte. The rewrite engine uses the bit vector to remove all the invalid bytes after all commands have been operated on the generalized protocol header to thereby form a new protocol header.
Legal claims defining the scope of protection. Each claim is shown in both the original legal language and a plain English translation.
1. A method of a rewrite engine of a network switch, the method comprising: maintaining a bit vector for a generalized protocol header layer of a packet, wherein the bit vector comprises a plurality of values that each represent a different portion of the generalized protocol header layer; updating the bit vector based on modification of the generalized protocol header layer; and using the updated bit vector to compress the generalized protocol header layer by removing fields from the generalized protocol header layer based on the updated bit vector.
A network switch's rewrite engine modifies packet headers. It maintains a bit vector representing a generalized protocol header layer, where each value in the vector corresponds to a portion of the header. When the header layer is modified, the bit vector is updated. The updated bit vector is then used to compress the header layer by removing fields marked as invalid according to the bit vector.
2. A method of a rewrite engine of a network device, the method comprising: maintaining a bit vector for a generalized protocol header layer of a packet; updating the bit vector based on modification of the generalized protocol header layer; and using the updated bit vector to compress the generalized protocol header layer, wherein the generalized protocol header layer is a protocol header layer of the packet expanded to a generic format, and further wherein the generic format includes all possible fields supported by a protocol of the protocol header layer, wherein each of the fields has the same offset irrespective of which variation of the protocol the protocol header layer corresponds to.
A network device's rewrite engine modifies packet headers. It keeps a bit vector for a generalized protocol header layer. This layer is a protocol header expanded to a generic format containing all possible fields for that protocol, each at a consistent offset, regardless of the specific protocol version. The bit vector is updated based on header modifications. Finally, the updated bit vector is used to compress the generalized header layer, removing unused fields.
3. The method of claim 1 , wherein the bit vector includes a bit per byte for each byte of the generalized protocol header layer.
In the network switch's rewrite engine, from the previous description, the bit vector used to track header layer modifications has one bit for each byte of the generalized protocol header layer, providing fine-grained control over header compression.
4. The method of claim 1 , wherein the modification uses at least one command from a set of generic commands that is stored in a memory of the network switch to modify the generalized protocol header layer.
In the network switch's rewrite engine, from the initial description, the header modifications are performed using generic commands stored in the switch's memory. These commands are applied to the generalized protocol header layer, enabling consistent modification regardless of the specific protocol being handled.
5. A method of a rewrite engine of a network device, the method comprising: maintaining a bit vector for a generalized protocol header; updating the bit vector based on modification of at least one generalized protocol header; using the updated bit vector to compress the at least one generalized protocol header; and prior to using the updated bit vector, performing an XOR operation on the bit vector and the updated bit vector to determine how many bits changed.
A network device's rewrite engine uses a bit vector to manage generalized protocol header modifications. After modifying one or more generalized headers and updating the bit vector accordingly, the engine performs an XOR operation between the original and updated bit vectors. This XOR operation determines the number of bits that have changed, indicating the extent of header modifications. The updated bit vector is then used to compress the generalized headers.
6. A method of a network switch, the method comprising: receiving a packet having a header including a plurality of protocol header layers at an incoming port of the network switch; generalizing each of the protocol header layers of the packet according to a generic format for the protocol header layer thereby forming generalized protocol header layers; maintaining a bit vector for each of the generalized protocol header layers, wherein the bit vector comprises a plurality of values that each represent a different portion of the generalized protocol header layer and further wherein the bit vector includes bits marked as a first value for invalid fields and bits marked as a second value for valid fields; modifying at least one of the generalized protocol header layers and updating the bit vector associated with the at least one of the generalized protocol header layers thereby forming an updated bit vector; collapsing the updated bit vector forming a compress bit vector; and forming a new protocol header based on the compressed bit vector.
A network switch processes packets with multiple protocol header layers. First, it generalizes each layer into a generic format. It maintains a bit vector for each generalized header layer, with bits indicating valid or invalid fields. Upon modifying one or more generalized header layers, the switch updates the corresponding bit vectors. These updated bit vectors are then compressed. Finally, the switch forms a new protocol header based on the compressed bit vectors.
7. The method of claim 6 , wherein generalizing each of the protocol header layers includes: detecting missing fields from the protocol header layer of the packet; and based on the detection, expanding the protocol header layer to the generic format by including the missing fields.
When generalizing protocol header layers, as in the network switch description above, the switch detects any missing fields in the original header. If fields are missing, the switch expands the header to the generic format by including these missing fields at their predefined locations. This ensures consistency for subsequent processing.
8. The method of claim 6 , wherein the modification uses at least one command from a set of generic commands that is stored in a memory of the network switch to modify the at least one of the generalized protocol header layers.
As in the network switch description, the modifications to the generalized header layers are performed using generic commands stored in the switch's memory. These commands provide a standardized way to manipulate the header fields, irrespective of the specific protocol variation.
9. The method of claim 6 , wherein the modification of the at least one of the generalized protocol header layers is based on egress portType of the outgoing port of the network switch.
Header modifications, as described in the network switch, can be based on the egress port type of the outgoing port. This allows for different header transformations depending on where the packet is being sent, optimizing the header for the next hop in the network.
10. A method of a network switch, the method comprising: receiving a packet having a header including a plurality of protocol header layers at an incoming port of the network switch; generalizing each of the protocol header layers of the packet according to a generic format for the protocol header layer thereby forming generalized protocol header layers; maintaining a bit vector for each of the generalized protocol header layers, wherein the bit vector includes bits marked as a first value for invalid fields and bits marked as a second value for valid fields; modifying at least one of the generalized protocol header layers and updating the bit vector forming an updated bit vector; collapsing the updated bit vector forming a compress bit vector; and forming a new protocol header based on the compressed bit vector wherein collapsing the updated bit vector includes shifting the updated bit vector by removing each bit marked as the first value in the updated bit vector.
In the network switch's packet header modification process, the updated bit vector is compressed by shifting its bits and removing each bit marked as invalid. This collapsing of the bit vector effectively removes the corresponding invalid fields from the generalized header, creating a smaller, more efficient header.
11. The method of claim 6 , further comprising transmitting the packet with at least the new protocol header via an outgoing port of the network switch.
After forming the new protocol header using the bit vector compression method in the network switch, the packet, now containing the new header, is transmitted via an outgoing port of the network switch.
12. A method of a network switch, the method comprising: receiving a packet having a header including a plurality of protocol header layers at an incoming port of the network switch; generalizing each of the protocol header layers of the packet according to a generic format for the protocol header layer thereby forming generalized protocol header layers; maintaining a bit vector for each of the generalized protocol header layers, wherein the bit vector includes bits marked as a first value for invalid fields and bits marked as a second value for valid fields; modifying at least one of the generalized protocol header layers and updating the bit vector forming an updated bit vector; collapsing the updated bit vector forming a compress bit vector; and forming a new protocol header based on the compressed bit vector, before transmitting the packet with at least the new protocol header, counting a number of bytes added or deleted for all operations performed.
In the network switch's packet header modification process, before transmitting the packet with the new header, the switch counts the number of bytes added or deleted during all header operations. This allows for tracking the overall size changes resulting from the header modifications.
13. A network switch comprising: an input port for receiving a packet; a memory storing a set of generic commands, wherein the set of generic commands is used for protocol header layer modifications irrespective of which variations of supported protocol variations incoming protocol header layers are; and a rewrite engine using bit vectors to allow expansion and collapse of protocol header layers of the packet, thereby enabling flexible modification of the packet by using the set of generic commands, wherein each of the bit vectors comprises a plurality of values that each represent a different portion of one the protocol header layers to which the bit vector corresponds.
A network switch has an input port, memory storing generic commands for header modifications, and a rewrite engine. The rewrite engine uses bit vectors to expand and collapse packet header layers, enabling flexible modification with the generic commands. Each bit vector corresponds to a header layer, with each value representing a different portion of that layer. The commands work independently of the specific protocol variations.
14. The network switch of claim 13 , wherein the set of generic commands include a Delete command, a Copy command and a Move command.
In the described network switch, the set of generic commands stored in memory includes commands like "Delete" (to remove fields), "Copy" (to duplicate fields), and "Move" (to reposition fields). These commands provide the building blocks for modifying header layers in a standardized manner.
15. The network switch of claim 13 , wherein each of the protocol header layers is generalized according to one of a plurality of software-defined mappings that is specific to a protocol of the protocol header layer.
In the network switch, each protocol header layer is generalized according to software-defined mappings. Each mapping is specific to the protocol of that header layer, ensuring proper conversion to the generic format.
16. The network switch of claim 13 , wherein the software-defined mappings are stored in the memory.
The software-defined mappings used for generalizing the protocol header layers in the network switch are stored in the memory of the switch, allowing for easy updates and customization.
17. The network switch of claim 15 , wherein each generalized protocol header layer includes a bit vector with bits marked as a first value for invalid fields and bits marked as a second value for valid fields.
Each generalized protocol header layer, as implemented in the network switch, includes a bit vector. This bit vector has bits marked to indicate invalid (first value) and valid (second value) fields within the generalized header, providing a map for compression.
18. The network switch of claim 17 , wherein the rewrite engine updates the bit vector after the generalized protocol header layer is modified.
After a generalized protocol header layer is modified in the network switch, the corresponding bit vector is updated to reflect the changes made to the validity of the header's fields.
19. The network switch of claim 18 , wherein the rewrite engine collapses the updated bit vector by removing each bit marked as the first value in the updated bit.
In the network switch, the rewrite engine collapses the updated bit vector by removing each bit marked as invalid. This compression effectively removes the corresponding invalid fields from the generalized header.
20. The network switch of claim 19 , wherein a new protocol header layer is formed based on the collapsed bit vector.
After collapsing the updated bit vector, a new protocol header layer is formed based on the resulting compressed bit vector, representing the modified header in its optimized form, inside the network switch.
21. The network switch of claim 19 , further comprising an outgoing port for transmitting the packet with the new protocol header layer.
The network switch also includes an outgoing port to transmit the packet containing the newly formed protocol header layer, after the header has been modified and compressed.
22. The network switch of claim 13 , wherein the rewrite engine is configured to expand each of the protocol header layers to a generic format that corresponds to a protocol of the protocol header layer and includes all fields supported by the protocol of the protocol header layer, wherein each of the fields has the same offset irrespective of which variation of the protocol the protocol header layer corresponds to.
This invention describes a network switch designed to flexibly modify packet headers. The switch features an input port to receive packets, memory storing a set of generic commands for header modifications, and a rewrite engine. This rewrite engine uses bit vectors, where each bit vector represents different portions of a protocol header layer, to allow for the expansion and collapse of these layers, enabling flexible packet modifications using the stored generic commands. Specifically, the rewrite engine is configured to expand each incoming protocol header layer into a standardized, "generic format." This generic format is specific to the original protocol and encompasses all possible fields that the protocol could support. A key feature is that, within this generic format, every field maintains a consistent, fixed memory offset, regardless of the specific variant or version of the original protocol header layer. ERROR (embedding): Error: Failed to save embedding: Could not find the 'embedding' column of 'patent_claims' in the schema cache
23. A network switch comprising: an input port for receiving a packet, wherein the packet includes a body and a header having a plurality of protocol layers forming a protocol stack; an output port for transmitting modified packets; a memory to store a set of software-defined mappings of generic formats of protocols and a set of generic modification commands, wherein the set of generic modification commands is used for protocol header layer modifications irrespective of which variations of supported protocol variations incoming protocol header layers are; and a rewrite engine to: convert each of the protocol header layers of the protocol stack into a generic format based on one from the set of software-defined mappings thereby forming converted protocol header layers; maintain a bit vector for each of the converted protocol header layers, wherein each of the bit vectors comprises a plurality of values that each represent a different portion of one the converted protocol header layers to which the bit vector corresponds; use the set of generic modifications commands to modify each of the converted protocol header layers; update each of the bit vectors after the bit vector thereby forming updated bit vectors; collapse each of the updated bit vectors to thereby form a new protocol stack; and attach the new protocol stack with the body to be transmitted via the output port.
A network switch receives packets with protocol stacks. It has an output port, memory for software-defined mappings of generic protocol formats and generic modification commands. A rewrite engine converts header layers to generic formats using the mappings. It maintains a bit vector for each converted layer, uses generic commands to modify them, updates the bit vectors, collapses the vectors to create a new protocol stack, and attaches this stack to the packet body for transmission.
24. The network switch of claim 23 , wherein the bit vector includes a bit per byte for each byte of the converted protocol header.
In the described network switch, the bit vector for each converted protocol header includes a bit per byte of the header. This allows fine-grained tracking of validity for each byte within the header.
25. The network switch of claim 24 , wherein the bit vector includes bits marked as a first value for invalid fields of the converted protocol header and bits marked as a second value for valid fields of the converted protocol header.
The bit vector in the network switch uses a first value to mark bits corresponding to invalid fields in the converted protocol header and a second value for bits representing valid fields. This distinction is crucial for the compression process.
Cooperative Patent Classification codes for this invention. Click any code to explore related patents in that topic.
June 19, 2014
April 25, 2017
Browse 5M+ US patents with plain-English claim translations and AI-generated analysis.