Jitendra, thanks for the review.
> 1. What is the reason for defining header classes inside the Op enum?
It is because the headers are operation related. There are other classes like PacketHeader which is nothing to do with operations.
> 2. I will recommend adding a factory to create right header object depending on the opcode. The factory could be useful at the receiving end.
We already have DataTransferProtocol.Receiver. I think it is the factory you mean.
> 3. Please add a few unit tests for serialization/de-serialization of the headers.
We have many tests for read, write, fault-inject tests, balancer, etc. These tests cover DataTransferProtocol. So adding new tests for the header seems redundant. Do you agree?