Design and implementation of a framework for creating portable and efficient packet-processing applications