save and restore network states