we all know that in SDN when a packet arrives at a switch if there isn't already a flow, matching this packet, the switch will generate a packet_in message and ask the controller for instructions.
my question is that if the openflow switch has absolutely no rules at boot-up, how can it communicate with the controller in the first place. for example in the following diagram if PC1 wants to communicate with PC2, it will send it's packet to switch 1. since switch1 has no flow matching this packet it will try to consult the controller. the admin has configured each of the switches with IP address of the controller. but there is no flow pre-installed on switches to tell them where to send packets destined for the controller.
in Mininet there is a logical link between each switch and the host system running mininet. so each switch sends out the openflow messages on this logical link and it arrives at controller.
but in real networks we cannot connect each switch directly to the controller.