Person re-identification(re-id) is the task of recognizing and identifying a person across multiple views in multi-camera networks. Although there has been much progress in person re-id, the person re-id in large-scale multi-camera networks still remains a challenging task because of the spatio-temporal uncertainty and high complexity due to large numbers of cameras and people. To handle these difficulties, additional information such as camera network topology should be provided, which is also difficult to automatically estimate. In this paper, we propose a unified framework which jointly solves both person re-id and camera network topology inference problems with minimal prior knowledge about the environments. The proposed framework takes general multi-camera network environments into account and can be applied to online person re-id in large-scale multi-camera networks. To effectively show the superiority of the proposed framework, we also provide a new person re-id dataset with full annotations, named SLP, captured in the synchronized multi-camera network. Experimental results using public and our datasets show that the proposed methods are promising for both person re-id and camera topology inference tasks.