Modeling and design of control algorithms over wireless networks