(1) The controlle will get the datapathId through the get features message in openflow plugin when a new switch connects to it. I think the controller will create a switch or a node on controller side with this id. However, I am wondering how can the controller learn the switch and put it into topology? How can it recognize whether this is a switch or a host?
(2) If I want to add a new device (other than switch) to the controller, what kind of modules would be involved? Should I do some modifications on openflow protocol?