common network functions