Ddos Is One of the Most Common Attack That Is Prevalent In Traditional Networks, It Also Has Its Implications on Software Defined Networks (Sdn). Sdn Is a New Network Architecture Which Separates the Data Plane from the Control Plane. In Traditional Networks an Attack Is Performed By First Identifying the Ip Addresses of the Victim Machine and Then Sending Huge Amounts of Unnecessary Data to It. a Similar Attack Can Also Be Performed on Servers That Are Present In Sdn. In Our Paper We Propose a Method Wherein the Real Ipaddress of Important Servers Can Be Hidden Thereby Preventing the Ddos Attack. a Ddos Detection and Prevention Modules Are Deployed on the Sdn Controller. the Ddos Detection Module Identifies That There Is a Ddos Attack and Differentiates Legitimate Clients from Botnets. the Ddos Prevention Module Generates Virtual Ipaddresses For Every Real Ipaddress Dynamically That Changes Regularly After some Interval. the Sdn Controller Makes Use of the Results of These Two Modules and Installs Rules into Flow Table Such That Only the Legitimate Clients Will Be Provided With the Real Ipaddress Whereas the Botnets Are Blocked By Dropping Their Requests.