rewrite virtual network layer code but no test.