add retrieving ip address func to network.py
.