The ergodic capacity of device-to-device (D2D) communication underlaying cellular networks is analyzed. First,the D2D communication model is introduced and the interference during uplink period and downlink period is analyzed.In a D2D communication system,since it is very difficult to obtain the instantaneous channel state information (CSI),assume that only the transmitters know the statistical CSI and the channel coefficient follows an independent complex Gaussian distribution.Based on the assumptions,for the uplink period,the signal to interference plus noise ratio (SINR)of the D2D user equipments(DUEs)is expressed. Then the cumulative distribution function (CDF ) and probability distribution function (PDF)formulae of the SINR of the DUEs are presented.Based on the SINR formulae during the uplink period,the ergodic capacity formula of the uplink period is derived. Subsequently, using the same methods,the ergodic capacity formula of the downlink period is derived.The simulation results show that the DUEs can still obtain a high ergodic capacity even in the case of a large number of DUEs.This result can be applied to the design and optimization of D2D communications.