In this paper, we present an analysis on optimization and risk management in Communication Networks (CNs). The model is proposed for offline traffic engineering optimization, which takes a centralized view of bandwidth allocation, performance control, and risk control of network profit shortfall. First, we introduce a linear penalty cost in the CN optimization model and derive the optimal bandwidth capacity with the penalty cost. Then, we use the mean-variance approach to analyze the profit shortfall risk in CNs. Finally, numerical results are shown to reveal the impact of the penalty cost on the CNs performance.