The answer is: NEITHER.
Openflow works by updating entries to the FORWARDING table in your router or switch. Therefore it is not a routing or switching protocol at all.
The architecture of networking equipment is often described as having three planes of operation – management, control and data planes and often represented by the following diagram:
The Management Plane handles functions such device management, firmware updates, SNMP and external configuration via the CLI. The Data Plane refers to packet and frame forwarding through the device. The Control Plane is routing protocols such as BGP & OSPF and switching protocols such as STP & TRILL..
The control plane will use the routing table to build the forwarding table used by data plane. The forwarding table is delivered to the data plane by the management plane as part of the device operating system. Thus when an Ethernet frame arrives on the switch interface, the data plane then forwards it to output port.
OpenFlow is a new method of control for flows in the network. To date, networking has always focussed on managing frames and packets with routing protocols, but applications don’t use single packets to deliver services. Rather, they exchange data between server and client, they create a stream of packets from a source to destination that is commonly known as flow. As a metaphor, this flow is to packets as apples are to apple pie. A pie is what you are eating, not apples.
OpenFlow defines a standard for sending flow rules to network devices so that the Control Plane can add them to the forwarding table for the Data Plane. These flow rules contains fields for elements such as source & destination MAC, Source & destination IP, source and destination TCP, VLAN, QoS and MPLS tags and more. The flow rules are then added to the existing forwarding table in the network device.
The forwarding table is what all routers and switches use to dispatch frame and packets to their egress ports.
OpenFlow value is realised in the Controller, and the most interesting changes are because the Controller will get new capabilities and truly granular control of the traffic flows.
Therefore, OpenFlow is neither routing or switching, it’s about forwarding.
Of course, the next question is “How should I forward frames and packets ?” but that’s another day.