Using netmap

Alexander Chernikov
Network Engineer
What is netmap?
What is Netmap?

• All-in-one solution? No.
– Part of framework to build solutions? Yes.

• Efficient Instrument for I/O
•...
Similar tools

• Intel DPDK
– WindRiver INP

• PacketShader I/O engine
• PF_RING

5
Key Features

• User-space
• Zero-copy
• Batching
• Simplicity
• Hardware independent

6
Programming simplicity

• Get NIC info
– ioctl(fd, NIOCGINFO, &nmr)

• Open HW queue (or entire NIC)
– ioctl(fd, NIOCREGIF...
Using NIC rings for balancing
• Thread-per-ring model
• Process-per-ring model

8
Framework simplicity

• Targets to different NICs
• ~400 lines per driver
– Not many places for bugs to hide
– Complicated...
Existing open-source users

• Pkt-gen
• libpcap consumers
• Ipfw
• Click router
• Sandstorm web server

10
Users: pkt-gen
• /usr/src/tools/tools/netmap/
• Linerate sending/receiving data
• Src/Dst address wildcards
• Features
– M...
Users: libpcap consumers

• /usr/src/tools/tools/netmap/
• Transparent
• s/lpcap/lnetmap/
• Improvements in 'easy' packet ...
Users: ipfw

• 20120813 version
• On-going work to ease kernel/userland sync
• Pros
– Batching

• Cons
– Not all features ...
Users: Sandstorm
• All-in-one app
– ethernet library
– libtcpip as light-weight TCP stack
– libmnio as netmap i/o abstract...
Future: routing

• /usr/ports/net/netmap_router
• Near to zero configuration
• Existing utilities to control interfaces/ro...
Alexander Chernikov
Network Engineer
melifaro@yandex-team.ru

Thank you
Александр Черников: Использование netmap
Upcoming SlideShare
Loading in …5
×

Александр Черников: Использование netmap

2,690 views

Published on

Про netmap наверняка слышал каждый, кто отслеживает новости, связанные с FreeBSD. В докладе рассмотрим, чем хорош netmap, что уже сделано на его основе, а что только планируется сделать.

Published in: Technology, Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,690
On SlideShare
0
From Embeds
0
Number of Embeds
1,481
Actions
Shares
0
Downloads
15
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Александр Черников: Использование netmap

  1. 1. Using netmap Alexander Chernikov Network Engineer
  2. 2. What is netmap?
  3. 3. What is Netmap? • All-in-one solution? No. – Part of framework to build solutions? Yes. • Efficient Instrument for I/O • Other instruments needed – – – – 4 Memory allocator (like UMA in userspace) Packet chaining libraries (handling fragments) Lockless queues Flow inspection primitives
  4. 4. Similar tools • Intel DPDK – WindRiver INP • PacketShader I/O engine • PF_RING 5
  5. 5. Key Features • User-space • Zero-copy • Batching • Simplicity • Hardware independent 6
  6. 6. 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
  7. 7. Using NIC rings for balancing • Thread-per-ring model • Process-per-ring model 8
  8. 8. 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)
  9. 9. Existing open-source users • Pkt-gen • libpcap consumers • Ipfw • Click router • Sandstorm web server 10
  10. 10. Users: pkt-gen • /usr/src/tools/tools/netmap/ • Linerate sending/receiving data • Src/Dst address wildcards • Features – MAC rewriting – IP src/dst wildcards – PCAP replay • Note – Check flow control ( dev.ix.*.fc ) – Check older NICs ( Intel 82598 ) 11
  11. 11. Users: libpcap consumers • /usr/src/tools/tools/netmap/ • Transparent • s/lpcap/lnetmap/ • Improvements in 'easy' packet processing 12
  12. 12. Users: ipfw • 20120813 version • On-going work to ease kernel/userland sync • Pros – Batching • Cons – Not all features work (iface matching, fwd, etc..) 13
  13. 13. 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
  14. 14. 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
  15. 15. Alexander Chernikov Network Engineer melifaro@yandex-team.ru Thank you

×