CTG: A connectivity trace generator for testing the performance of opportunistic mobile systems