In systems on chip, the energy consumed by the Network on Chip (NoC) depends heavily on the network traffic pattern. The higher the communication locality, the lower the energy consumption will be. In this paper, we use the Communication Probability Distribution (CPD) to model communication locality and energy consumption in NoC. Firstly, based on recent results showing that communication patterns of many parallel applications follow Rent's rule , we propose a Rent's rule traffic generator. In this method, the probability of communication between cores is derived directly from Rent's rule, which results in CPDs displaying high locality. Next, we provide a model for predicting NoC energy consumption based on the CPD. The model was tested on two NoC systems and several workloads, including Rent's rule traffic, and obtained accurate results when compared to simulations. The results also show that Rent's rule traffic has lower energy consumption than commonly used synthetic workloads, due to its higher communication locality. Finally, we exploit the tunability of our traffic generator to study applications with different locality, analyzing the impact of the Rent's exponent on energy consumption.