Optimal Resource Allocation for Network Protection: A Geometric Programming Approach