First of all: Thanks for making the internet better with NKN, great project, well done, just needs some more features probably! I worked in IT for 5years, been in the blockchain space for 2 years so I hope i can contribute a bit also.
Maybe it collides with " [NKP-0009] NKN Transport layer", feel free to close it.
Background story of this proposal:
I tried to transfer binary files (1MB+) using NKN in 8kb chunks, they arrived sometimes out of order or some packets were dropped.
I guess this happens because of the data passing through multiple nodes in international locations of variying stability.
Also it was kind of a hassle to setup code to just have 2 clients communicate over the network, why can’t we simply provide a virtual network with regular IPs and ports?
There are tons of open source codes for raw TCP sockets, protocol documentations etc. I am not a high level network engineer, but I am sure someone could use existing systems or even codes as a template to implement it!
I call it “NVPN”:
User should be able to install a virtual network adapter (Like OPENVPN or PPTP), pay (or hold/freeze?) a small fee to create a network, allow others to join + allow them to authorize others to join. Maybe also a small fee per gigabyte transferred, in case the will put too much load on the network.
Or generate access codes other can use to join.
The network adapter software should handle thing like requesting ACKnowledgement messages from the recipients, reorder packets if they arrive out of order and retransmit if they
got dropped etc.
Just like what TCP does already:
TCP flow control “Flow Control basically means that TCP will ensure that a sender is not overwhelming a receiver by sending packets faster than it can consume.” - https://www.brianstorti.com/tcp-flow-control/
TCP automatic retransmission: “When the TCP transmits a segment containing data, it puts a copy on a retransmission queue and starts a timer; when the acknowledgment for that data is received, the segment is deleted from the queue. If the acknowledgment is not received before the timer runs out, the segment is retransmitted.” https://www.saminiir.com/lets-code-tcp-ip-stack-5-tcp-retransmission/
Advantages this systems brings:
Developers and users do not need to reinvent the wheel - they can use existing, known, tested and performant workflow like having IP adresses with ports or joining networks (like WIFI).
Users and developers can leverage existing software on NKN e.g. using the Windows file browser or Firefox to browse a website or network shared folder. Or they could torrent or other swarm software in a virtual network, so many possibilities.
NKN gets a builtin new use case - providing VPN networks. Maybe even some existing paid VPN providers could join NVPN and let the internet traffic terminate at their existing servers as a kind of load balancing.