Design and performance of cognitive packet networks