The host-to-host/content/service communication instead of the host-to-host communication offered by traditional Internet Protocol (IP) routing solutions has been demanded in the last few years. Nowadays, getting this type of communication directly at network level is an increasing demand in the framework of new networking scenarios, such as Internet of Things and data center scenarios. Inspired by Key-Based Routing (KBR) solutions which, in conjunction with Distributed Hash Tables, have offered a way of providing content-sharing solutions in overlay networks on the top of the Internet for years now, we propose OFC-KBR (OpenFlow Compatible Key-Based Routing) solution. OFC-KBR is a key-based routing solution directly implemented at network layer that makes use of the potential of Software Defined Networking. In this solution, end-points are identified by virtual identifiers. These virtual identifiers are obtained from a descriptive textual name, whose format is not fixed and can be defined depending on the requirements of the service that is going to use the proposed OFC-KBR solution. OFC-KBR is totally compatible with the current OpenFlow standard and can co-exist with other L2/L3 protocols. The proposal has been implemented and evaluated by simulation considering real topologies.