libs/core: add "tunnel" interface type to network model, various optimizations