We present in this thesis a new structure that incorporates SDN with Vanets, and we make a meticulous study of routing mechanisms and their effects on security aspects. We also present a new security system that depends on public key infrastructure, and finally we demonstrate how to benefit from SDN in facing several security attacks and preaches, which are common in traditional Vanets, through number of security algorithms which allow deploying intrusion detection systems as a step towards self-healing and self-configuration system.