You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to connect kernel interfaces into VPP's dataplane, VPP uses host-interfaces , and VPP applications use AF_PACKET type sockets to implement host interfaces.
As packets which are received by the AF_PACKET type socket are exact copies of the packets that are received on the interface, the TCP checksum field will not be recalculated to contain a full checksum when the packet is copied to the socket.
Instead, if a GRO offloaded packet with a partial checksum is received, the copy that is sent into the userspace application will contain the same partial checksum. VPP plugins that wish to verify checksums must thus be prepared to verify full or partial checksums.
However, on Linux, userspace applications setting the PACKET_AUXDATA socket option with setsockopt(SOL_PACKET, PACKET_AUXDATA, 1) can receive auxiliary data from the kernel containing the tp_status field which itself holds flags TP_STATUS_CSUM_VALID and TP_STATUS_CSUMNOTREADY. These flags are used to communicate to userspace that the kernel already (partially) verified the transport layer checksum:
TP_STATUS_CSUM_VALID : This flag indicates that at least the transport
header checksum of the packet has been already
validated on the kernel side. If the flag is not set
then we are free to check the checksum by ourselves
provided that TP_STATUS_CSUMNOTREADY is also not set.
It would be nice to be able to access this packet auxdata for VPP host interfaces, so that plugins which verify checksums can rely on the kernel provided data. The advantabe being that the VPP plugin doesn't have to recalculate the checksum in all cases, and it also avoids issues with partial vs full checksum calculation.
Description
In order to connect kernel interfaces into VPP's dataplane, VPP uses host-interfaces , and VPP applications use AF_PACKET type sockets to implement host interfaces.
As packets which are received by the AF_PACKET type socket are exact copies of the packets that are received on the interface, the TCP checksum field will not be recalculated to contain a full checksum when the packet is copied to the socket.
Instead, if a GRO offloaded packet with a partial checksum is received, the copy that is sent into the userspace application will contain the same partial checksum. VPP plugins that wish to verify checksums must thus be prepared to verify full or partial checksums.
However, on Linux, userspace applications setting the PACKET_AUXDATA socket option with setsockopt(SOL_PACKET, PACKET_AUXDATA, 1) can receive auxiliary data from the kernel containing the tp_status field which itself holds flags TP_STATUS_CSUM_VALID and TP_STATUS_CSUMNOTREADY. These flags are used to communicate to userspace that the kernel already (partially) verified the transport layer checksum:
TP_STATUS_CSUM_VALID : This flag indicates that at least the transport
header checksum of the packet has been already
validated on the kernel side. If the flag is not set
then we are free to check the checksum by ourselves
provided that TP_STATUS_CSUMNOTREADY is also not set.
It would be nice to be able to access this packet auxdata for VPP host interfaces, so that plugins which verify checksums can rely on the kernel provided data. The advantabe being that the VPP plugin doesn't have to recalculate the checksum in all cases, and it also avoids issues with partial vs full checksum calculation.
Assignee
Unassigned
Reporter
Andreas Karis
Comments
No comments.
Original issue: https://jira.fd.io/browse/VPP-2119
The text was updated successfully, but these errors were encountered: