Wireless Information and Power Transfer in Communication Networks: Performance Analysis and Optimal Resource Allocation