Tags:
create new tag
view all tags

Libpcap Tutorial

For basic networking, libpcap is one of the more accessible protocols to get at the guts of the packets going by without too much of an overarching system. Unfortunately, the documentation varies in quality and in my experience is often lacking in terms of examples at the higher end. The goal of this tutorial is to both gather the existing tutorials that are out on the web (in one form or another) along with providing ample sets of example code and discussions on using libpcap.

With that being said, you should also ask yourself what your end goal is with writing software? Would a raw socket suffice? Do you need a bit more robust learning curve albeit with a relatively more stable system? You might want to also check out the following options for developing network software:

  • Network simulators
  • Mixed network simulator / emulators
  • Wireless drivers
  • Emulators
  • Software routers

Ongoing Editing

In the interim before I have a chance to type up more details, you are welcome to download via the main NetScale webpage the source code for RIPPS (busy, lots of interlinked parts) and ScaleBox (much cleaner implementation). The most notable file for each is the Adapter.cc and Adapter_PCap.cc files that cover startup / interactions with libpcap.

Reference Links

  • ns3 aka nsnam - While it is in alpha form as of this writing, ns3 should have much better emulation capabilities than ns2.

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | More topic actions
Topic revision: r5 - 2008-07-22 - AaronStriegel
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback