Swapping original networking system

Hi!

When it comes to changing existing source code I don’t operate with an accuracy of a neurosurgeon, so the problem is how to alter networking code without wreaking havoc?

Is there any preferred way to swap the original networking system?

The final aim is to have precise control over every byte send, but without hurting the underlying system.

Is it possible to use my own packet structure and protocol and still take advantage of congestion control if it exists and maybe utilize parts of reliability layer?