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 loss of r0 as well as a random phase. We identify the scaling laws of the information-theoretic capacity of the network when nodes can relay information for each other. 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. This improves on the best known achievability result of n2=3 of Aeron and Saligrama. In the case of extended networks, where the density of nodes is fixed and the area increasing linearly with n, we show that this capacity scales as n20=2 for 2 < 3 and pn for 3. The best known earlier result of Xie and Kumar identified the scaling law for > 4. Thus, much better scaling than multihop can be achieved in dense networks, as well as in extended networks with low attenuation. ...