This article describes what Packet Copy On Write (PCOW) drops, which are seen in the output of the dropstats command on the vRouter, refer to and also the trigger for these drops.
dropstats
Example
Consider a typical mirror configuration scenario in Contrail where the mirror configuration is applied at a network-policy level as shown below. The mirror in this case points to an analyzer service instance that is created in Contrail, but can also point to a physical analyzer.
The policy is then applied to a virtual network (VN) whose traffic needs to be mirrored.
When the mirror configuration is applied at a network-policy level, the Juniper header is inserted by the vRouter in the mirrored packet. The header consists of an analyzer IP address, a UDP header, and some mirror metadata, which has information about any overlay virtual networks (VN).
Data for the Juniper header is taken from the flow entry. In the case of policy-based mirroring, the Juniper header will have a new TLV in the metadata, which specifies the fully qualified source and destination virtual-network (VN) names along with a host IP address and some additional mirror flags. The following image shows a dissected mirror packet with the Juniper header when mirroring is configured at a policy level.
For a vRouter (kernel or DPDK), there is a maximum limit on the size of the Juniper header that the vRouter can insert in a mirrored packet; this size is governed by an internal packet memory buffer with a maximum size of 256 bytes.
Before sending the Juniper header to the vRouter module, the vrouter-agent forms the metadata portion of the Juniper header. The vRouter then adds the necessary IP and UDP headers to form the mirror packet. As the size of the IP and UDP headers is fixed, the size of the metadata that the Juniper header can carry is limited to less than 256 bytes.
Note: This buffer limitation affects only Contrail releases 3.x and 4.x. Contrail releases 5.x already have the buffer chaining feature implemented, and therefore are not exposed to this limitation.
If the metadata information, which in the case of policy-based mirroring is source and destination VN names, is long enough to exceed 256 bytes, then the vRouter is unable to assemble the Juniper header and reports this in the output of the dropstats command as PCOW drops as shown below:
As a solution to this problem, an enhancement has been provided with Contrail release 3.2.15 and later for customers or users who choose to have longer VN names or Tenant names in their environment whose size exceeds the limit specified in the mirror metadata. This enhancement introduces memory buffer chaining wherein more buffer will be allocated dynamically based on the size of the metadata information.