With accurate network traffic prediction, communication systems can make self-management and embrace efficient automation. However, due to the lack of consideration of dynamic spatial interactions between regions in existing methods, the performance of network traffic prediction still needs to be improved. To solve the above problem, this paper proposes a spatiotemporal dynamic relative-flow network (STDRN) to capture the dynamic spatial dependency, thereby improving the accuracy of urban network prediction. In the proposed STDRN, we take both spatial and temporal dependence of network traffic into consideration. First, we propose relative-flow gating mechanism (RGM) combined with convolutional neural network (CNN) to learn the dynamic spatial dependency. Then, we adopt the periodic shifting attention mechanism to capture the long-term periodic temporal dependency while long short-term memory (LSTM) for the short-term temporal dependency. The STDRN is tested on real-world network traffic dataset. Experimental results demonstrate that compared with other benchmark methods, STDRN can reduce RMSE by up to 48.99% and MAPE by 13.61%, which proves the effectiveness of our proposal.