views:

113

answers:

3

when programming Tcp/IP program, we often will do data packet assembling and parsing, so is there a framework to make our life easier?

I know this is hard to implement.

Edit: to clarify:

  1. application level packet
  2. it may need to talk to c++ application, so .net serialization is not applicable.
+3  A: 

Pcap.NET may be what you're after:

Pcap.Net is a .NET wrapper for WinPcap written in C++/CLI and C#.
It features almost all WinPcap features and includes a packet interpretation framework.

Jon Skeet
Thanks Jon, you always answer so quickly.
Benny
+1  A: 

If you can use your own application protocol, Protocol Buffers might be the right tool to use.

Otherwise it depends on the protocol you are dealing with. For MIME based protocols you can leverage Sharp MIME tools.

Miroslav Bajtoš
A: 

Sharppcap, http://sharppcap.sf.net also provides this functionality and supports a wide range of packet types. Also works on windows, mac and Linux.

Chris Morgan