Optimal networked controllers for networked plants