Sample Application: The Learning Switch Functionality
Create a HashMap called mac_to_port On packet_in, parse packet to get source and destination MAC addresses Store in a hashmap mapping between src_mac and in_port Lookup dst_mac in mac_to_port map to find next hop If next hop is found, create flow_mod and send Else, flood like hub. Processing a Packet: System View The application's workflow when processing a packet is shown in the following figure. Steps 1-3 in the figure show pkt_in processing. Steps 4-7 show pkt_out processing (flooding if not match is found). finally, Steps 8-12 show flow programming to the switch. The sequence details are as follows: A packet_in is sent from the switch to controller The OpenFlow java library parses the packet and translates it into an MD-SAL format governed by the OpenFlow protocol model; the OpenFlow 1.0/1.3 Plugin creates an MD-SAL Notification and publishes it into the MD-SAL. MD-SAL routes the notification to all registered consumers , in this case ...