Next: Conclusions
Up: Tagging Data In The
Previous: Miscellaneous Tags
There are several improvements we intend to make to the current
API. More specifically:
- Use of memory pools (see the pool(9) manual page) and
tag-specific deallocation routines, to improve performance. The
limitation of using memory pools is that it supports fixed-size
allocations which can lead to either inefficient use of memory or to a
large numbers of pools. Fortunately, it appears that all the tags that
have been defined to date fall in one of three categories with respect
to memory allocation: they require no additional memory (beyond the
tag header itself) -- as was the case with most of the PF tags, see
Section 3.3, one extra word (the loop-detection tags,
Section 3.2), or an IPsec SA identification payload
(Section 3.1). Thus, we could simply have three
different memory pools, one for each size. This change is fairly
simple and does not require any changes in the API itself, so we
intend to integrate it fairly soon.
- Tag-triggers, which will invoke specific packet-processing at
various points in the network stack, depending on existing tags. One
example is calculating the TCP or IP checksum of a packet that is
about to be encapsulated inside another protocol. In the extreme case,
these tags will carry a pointer to a protocol-specific function and
enough data to indicate the location where the desired operation
should take place. This is particularly useful when used in
conjunction with network cards that support some type of functionality
offloading and IPsec: if only some packets are IPsec-processed, we
need a way to defer expensive processing (such as checksum
computations) as late as possible, under the assumption that the
packet will not be encrypted and thus the expensive operation can be
offloaded to the NIC. When that assumption is violated (i.e.,
the packet does need to be encrypted), we need to detect and apply the
deferred operation. Such deferred processing is already done for TCP
and UDP checksum computation, but the approach is tailored for that
application. We intend to create a more general framework for deferred
processing using mbuf_tags.
- An API for application-defined tags. This will be used either
directly by applications or through setsockopt() calls to attach
information to packets that will cause deferred processing. We have an
application of this, for accelerating TLS [2] and SSH in
the presence of network cards with integrated cryptographic
functionality. In that scenario, the tags are used by crypto-aware
network interfaces to provide application-layer protocol
encryption. We intend to investigate this approach further in future
work. Naturally, the type of tags that can be attached by applications
must be carefully controlled, since these tags can affect network
processing in ways that may not have been intended or allowed by the
system administrator (e.g., bypassing PF rules). Fortunately,
doing so should be fairly straightforward, since the relevant
interface to the kernel (setsockopt()) is ``narrow'' enough that
we can perform the necessary checks.
Next: Conclusions
Up: Tagging Data In The
Previous: Miscellaneous Tags
Angelos D. Keromytis
7/7/2003