Hardware Reference
In-Depth Information
Packet Processing
When a packet arrives, it goes through a number of processing stages, indepen-
dent of whether the network processor has a parallel or pipeline organization.
Some network processors divide these steps into operations performed on incom-
ing packets (either from a network line or from the system bus), called ingress
processing , and operations performed on outgoing packets, called egress process-
ing . When this distinction is made, every packet goes first through ingress proc-
essing, then through egress processing. The boundary between ingress and egress
processing is flexible because some steps can be done in either part (e.g., collecting
traffic statistics).
Below we will discuss a potential ordering of the various steps, but note that
not all packets need all steps and that many other orderings are equally valid
1. Checksum verification. If the incoming packet is arriving from the
Ethernet, the CRC is recomputed so it can be compared with the one
in the packet to make sure there was no transmission error. If the
Ethernet CRC is correct or not present, the IP checksum is recom-
puted and compared to the one in the packet to make sure the IP pack-
et was not damaged by a faulty bit in the sender's memory after the IP
checksum was computed there. If all checksums are correct, the
packet is accepted for further processing; otherwise, it is simply dis-
carded.
2. Field extraction. The relevant header is parsed and key fields are
extracted. In an Ethernet switch, only the Ethernet header is exam-
ined, whereas in an IP router, it is the IP header that is inspected. The
key fields are stored in registers (parallel PPE organization) or SRAM
(pipeline organization).
3. Packet classification. The packet is classified according to a series
of programmable rules. The simplest classification is to distinguish
data packets from control packets, but usually much finer distinctions
are made.
4. Path selection. Most network processors have a special fast path op-
timized for handling plain old garden-variety data packets, with all
other packets being treated differently, often by the control processor.
Consequently, either the fast or the slow path has to be selected.
5. Destination network determination. IP packets contain a 32-bit
destination address. It is not possible (or even desirable) to have a 2 32
entry table to look up the destination of each IP packet, so the left-
most part of each IP address is the network number and the rest speci-
fies a machine on that network. Network numbers can be of any
 
Search WWH ::




Custom Search