
5.2.2. Parser runtime block
e parser runtime block works in concert with the parser. It provides an error code to the match-
action pipeline, based on the parser actions, and it provides information about the packet payload
(e.g., the size of the remaining payload data) to the demux block. As soon as a packet's processing is
completed by the parser, the match-action pipeline is invoked with the associated metadata as inputs
(packet headers and user-dened metadata).
5.2.3. Demux block
e core functionality of the demux block is to receive the headers for the outgoing packet from the
deparser and the packet payload from the parser, to assemble them into a new packet and to send the
result to the correct output port. e output port is specied by the value of outCtrl.ouputPort, which
is set by the match-action pipeline.
• Sending the packet to the drop port causes the packet to disappear.
• Sending the packet to an output Ethernet port numbered between 0 and 7 causes it to be emitted
on the corresponding physical interface. e packet may be placed in a queue if the output inter-
face is already busy emitting another packet. When the packet is emitted, the physical interface
computes a correct Ethernet checksum trailer and appends it to the packet.
• Sending a packet to the output CPU port causes the packet to be transferred to the control plane.
In this case, the packet that is sent to the CPU is the original input packet, and not the packet
received from the deparser—the latter packet is discarded.
• Sending the packet to the output recirculation port causes it to appear at the input recirculation
port. Recirculation is useful when packet processing cannot be completed in a single pass.
• If the outputPort has an illegal value (e.g., 9), the packet is dropped.
• Finally, if the demux unit is busy processing a previous packet and there is no capacity to queue
the packet coming from the deparser, the demux unit may drop the packet, irrespective of the
output port indicated.
Please note that some of the behaviors of the demux block may be unexpected—we have highlighted
them in bold. We are not specifying here several important behaviors related to queue size, arbitration,
and timing, which also inuence the packet processing.
e arrow shown from the parser runtime to the demux block represents an additional information
ow from the parser to the demux: the packet being processed as well as the oset within the packet
where parsing ended (i.e., the start of the packet payload).
5.2.4. Available extern blocks
e VSS architecture provides an incremental checksum extern block, called Checksum16. e check-
sum unit has a constructor and four methods:
• clear(): prepares the unit for a new computation
• update<T>(in T data): add some data to be checksummed. e data must be either a bit-string, a
header-typed value, or a struct containing such values. e elds in the header/struct are con-
catenated in the order they appear in the type declaration.
• get(): returns the 16-bit one's complement checksum. When this function is invoked the check-
sum must have received an integral number of bytes of data.
17