This project is read-only.

PROFINET DCP with Pcap.Net

Jun 23, 2011 at 4:57 PM

I want to use Pcap.Net to implement a DCP client.
DCP (Discovery and Configuration Protocol) is a protocol within PROFINET standard (IEC 61158-6). It is a Network Layer (Layer 3) protocol using the VLAN Ethertype 0x8100 and the VLAN-ID 0x00009288 of Ethernet protocol.

What do I have to do to implement a new (Layer 3) protocol like DCP with Pcap.Net?
Unfortunately I can only use version 0.6.0 because I don't have Visual Studio 2010.

Thank you very much for your help!
Best regards

Jun 24, 2011 at 12:03 PM

Hi JK-MS-Flip-Flop,


I suggest you look at some examples of Datagrams and Layers classes.

Basically you need to add support for these layers - adding both a Datagram class and a Layer class.


I would be happy to support you in this, but it would be much easier if you can upgrade to VS2010.



Jun 30, 2011 at 3:37 PM


thank you very much for your answer. I'm sorry, but I have to use VS2008.

I've studied the source code and tried to implement the DCP layer and diagram classes. Now I have some further questions:

  • As I already mentioned DCP is a Layer-3 protocol. It is related to SNMP, so it also has Application Layer functionality. How do I have to send the "payload" of DCP? I've analyzed your implementation of ICMP because there is no higher layer too, but it is so complex that I failed to understand it.
  • In DCP there are also options like in TCP and I've seen that in there are special Option/Options classes. How do they work?
  • Last but not least: Can you give me a hint how to structure my DCP client programme? (i.e. How to encapsulate the DCP implementation from the client program?)

Sorry for my bloody beginner questions but this is my first time in implementing a protocol layer.

Thank you very much for your help!


Jul 2, 2011 at 10:19 AM

Hi JK-MS-Flip-Flop,


ICMP has indeed complex implementation since it is a protocol with many features, you might want to look at IGMP and GRE which both have simpler implementations.

By "sending the payload of DCP", what do you mean? Does DCP has a header and a payload or do you mean just the entire DCP data?


The Option/Options classes are generic and used both for IPv4 and for TCP.

Both IPv4 and TCP have their own Options classes which contain all the different option objects.

Each option is registered using OptionTypeRegistration attribute, which registers it to a specific Option type and option type value.

For each Options class, a dictionary between the option types and the Option classes is created. The Option classes are used as templates to create new Option objects according to the specific data.

I don't know DCP Options but unless they have very similar format, using the generic Options classes won't work since there a lot of assumptions on the Option format.


Good luck!



Nov 26, 2012 at 6:43 PM

Hi JK-MS-Flip-Flop,

I realize its been quite some time since you were looking into this originally for PROFINET (PN) DCP comms.  If you need further help please contact me directly and if time permits I can try to assist and give some pointers.  PROFINET DCP is not a layer 3 protocol.. It's layer 2 Ethernet and application layer only.  So you have to use a special PN Ethertype and application layer per the PN specification to get it to work.  If you would like I can try and send some sample files and also would recommend that  you look at some DCP packets in trace files. 

 Best Regards,