A flexible event-based cycle-accurate network simulator