Про netmap наверняка слышал каждый, кто отслеживает новости, связанные с FreeBSD. В докладе рассмотрим, чем хорош netmap, что уже сделано на его основе, а что только планируется сделать.
7. Programming simplicity
• Get NIC info
– ioctl(fd, NIOCGINFO, &nmr)
• Open HW queue (or entire NIC)
– ioctl(fd, NIOCREGIF, &tifreq)
• Mmap ring memory
– mmap(0, mmap_size, .., fd, 0);
• Go!
– select() / poll() on fd
7
8. Using NIC rings for balancing
• Thread-per-ring model
• Process-per-ring model
8
9. Framework simplicity
• Targets to different NICs
• ~400 lines per driver
– Not many places for bugs to hide
– Complicated drivers code (not related to nemap)
• Currently supported
–
–
–
–
9
if_em(4)
igb(4)
ixgbe(4)
re(4)
13. Users: ipfw
• 20120813 version
• On-going work to ease kernel/userland sync
• Pros
– Batching
• Cons
– Not all features work (iface matching, fwd, etc..)
13
14. Users: Sandstorm
• All-in-one app
– ethernet library
– libtcpip as light-weight TCP stack
– libmnio as netmap i/o abstraction
• Arch
–
–
–
–
optimizied for specific task
small number of components
ability to do easy cross-layering
(mostly) lockless scheme
• Features
– Very high throughput for small files
14
15. Future: routing
• /usr/ports/net/netmap_router
• Near to zero configuration
• Existing utilities to control interfaces/routing
• Kernel for control plane
• Netmap appliance for data plane
• Modified routing daemon for route export
15