I think bit fields are not possible in c# structure. It is possible in c++.
typedef struct
    UINT16 SrcPort:16;
    UINT16 DstPort:16;
    UINT32 SeqNum:32;
    UINT32 AckNum:16;
    UINT16 Reserved1:4;
    UINT16 HdrLength:4;
How can we create a structure like this in c# with bit fields?

My question is how we can set bit fields in C# structure.Is there any ways to do it in C#?