The idea of network protocol design based on optimization theory has been proposed and used practically in Internet for about 15 years. However, for large-scale wireless ad hoc network, although protocol could be viewed as a recursive solving of a global optimization problem, protocol design is still facing huge challenge because an effective distributed algorithm for solving global optimization problem is still lacking. We solve the problem by putting forward a systematic design method based on optimization decomposition. The systematic method includes primal decomposition method and dual decomposition method, with which a complex optimization problem can be decomposed into several smaller and independent optimization subproblems. By using subgradient method, each of these subproblems can be solved distributively. Further, the above two methods can be combined in different sequences or used recursively to solve more complex optimization problems. Two examples of wireless protocol design, the transmission control protocol and the joint congestion control and power control protocol, are given to demonstrate its validity.