Calculates the network direction given a source IP address, destination IP address, and a list of internal networks.