c - tcp - netmap : could tun/tap interface neglict the use of netmap? -
i asked question here : previous question
would tun/tap device avoid netmap/pf_ring/dpdk installation ? if tun/tap allow bypass kernel, isn't same thing ?
or codes bring many optimizations overclass tun os bypass strategy ?
i don't quite understand here.
thanks
tun/tap interfaces virtual network interfaces in instead of sending , receiving packets physical media, sends , receives them user space program. don't pass kernel it's mutual set tap interface default interface in order have user space programme intercept applications traffic.
consider below diagram typical interaction of userspace programme network interface , network stack.
+--------------------------+ | network interface driver | +------------+-------------+ | +------------+-------------+ | network stack | +--------+---+---+---------+ | | | kernel space +----------------------------------------+ | | | user space |sockets| | | | +--------+---+---+---------+ | user space applications | +--------------------------+
there’s no way exclusively bypass network stack in case of tap interface. userspace applications can still connect physical interface. if frame directed tap interface interceptor application can intercept frames.
+--------------------------+ +--------------------------+ | network interface driver | | tap interface | +------------+-------------+ +--------+----+------------+ | | | +------------+-------------+ | | | network stack +--------------+ | +---+------------------+---+ | | | | kernel space +-------------------------------------------------------------------------+ | | | user space sockets nic sockets tap tap file descriptor | | | +---+------------------+---+ +-------------+------------+ | normal applications | | interceptor application | +--------------------------+ +--------------------------+
in case of netmap 1 time userspace application exclusively acquired nic userspace application decide frames (if any) can injected network stack. hence can have performance of direct packet capturing , take advantage of network stack services when need them. exclusive access nic not feature always, consider simple scenario when nic has reply arp request.
+-----------------------------------------------------------+ | netmap enabled network interface driver | +-----+-----------------------------------------------------+ | +-----+-----+ +-----------+ +--------------------------+ | nic rings | | host ring +------+ network stack | +-----+-----+ +-----+-----+ +--------+---+---+---------+ | | | | | kernel space +-------------------------------------------------------------------------+ | | | | | user space mmap access mmap access |sockets| | | | | | +-----+-------------+------+ +--------+---+---+---------+ | interceptor application | | normal applications | +--------------------------+ +--------------------------+
unfortunatly dpdk doesn’t back upwards “host rings” according http://dpdk.org/doc/guides/sample_app_ug/netmap_compatibility.html
i’m not pf_ring
also note in order utilize netmap/pf_ring/dpdk must modify, recompile or redesign application match frameworks.
c tcp packet
No comments:
Post a Comment