n source and destination pairs randomly located in an area want to communicate with each other. Signals transmitted from one user to another at distance r apart are subject to a power attenuation of 1/r^alpha as well as a random phase. We identify exactly the scaling laws of the information theoretic capacity of the network. In the case of dense networks, where the area is fixed and the density of nodes increasing, we show that the total capacity of the network scales linearly with n. In the case of extended networks, where the density of nodes is fixed and the area increasing linearly with n, we show that the sum capacity scales as n^(2-alpha/2) for alpha<3 and sqrt(n) for alpha>3. Thus, much better scaling than multihop can be achieved in dense networks, as well as in extended networks with low attenuation. The performance gain is achieved by intelligent node cooperation and distributed MIMO communication. The key ingredient is a hierarchical and digital architecture for nodal exchange of information for realizing the cooperation.