In SDN, controllers are used to provide functionality to the openflow switches(dumb).
Consider these two parts,
1) Controllers: These are the programs that run on any device with the logic may be l2/l3 and make the switches connected to it according to the algorithms defined in the controller.
There are some controller APIs like POX,NOX,PYRETIC, FLOODLIGHT on different languages, in market that you can implement to write your own controller.
2) Switches: The controllers control the switches. Fine! But how? There must be some protocol that is used to provide communication between them, this is what we call OpenFlow Protocol.
The controller implements the functionality say OSPF/BGP using the controller's API and the openFlow API together.
Finally this is the structure that comes in imagination.
Controller(at some IP say 192.168.56.101) providing OSPF/firewall/URL filtering or any functionality to the openflow switches >>
OpenFlow Switch or switches(dumb) used for connectivity of hosts >>
then there is/are Host(s): that are normally linux based if you use mininet emulator.