Hamana: An Application-oriented Network Architecture with Service-driven Programmable Gateways