In Recent years, Network security becomes essential due to increase in usage of Smart phones and Internet of Things (IoT) devices. An IoT device plays a vital role in day to day life of human being. Such IoT devices are less secured and mostly used under abandoned environment. Recently these devices are widely affected by Distributed Denial of Service (DDoS) attack. DDos is one of the risky threats that destroy the critical network services. The extreme flow of packets in a network results in attack. Single source attack raises the Denial of Service (DoS); on the other hand attack rises from multiple servers referred to as DDoS. Researchers have developed software-defined networks (SDN) to effectively handle IoT equipment. To overcome above issue, we use an updated firefly algorithm to optimize the convolutional neural network (CNN) for detection of DDoS attacks in software-defined Internet of Things (SD-IoT) environment. Experimental result shows that our proposed model achieves 98% accuracy over detection of DDoS attack.