Implementing NirVpnService
Find out that DatagramChannel.write() causes a NotYetConnectedException
Read from the tun device
Analyzing TCP and IP structure given as a byte array
Find out which IP version is used and what packet length we have
Extract data (not tested)
Convert bytes to an IP address and bytes to a port
Write portFromBytes()
Correct the calculation of an IP packet total length
Protect a socket and send data to the destination rather than the TUN device
Prove that we don't need to protect the socket before creating a TUN device
Remove getConnectionType() from NirVpnService because it will not be used
Implementing protected sockets
Trying using protected sockets taking into account ID bytes of IP packets
Stop the service correctly
Find a bug: response of a protected socket is always empty
Fix IP packet Identification. It consists of bytes from 4 (inclusive) to 6 (exclusive)
Shuffle bytes before sending to the server
Use DatagramChannel. Responses are not empty, but an IOException is thrown
Find out that an HTTP request is probably wrong. The response is "HTTP Error 400 Bad request"