Can you describe the algorithm of _get_network_details in plain English? It's not clear to me why it's doing what it's doing.