As a kind of new technologies in smart grid, vehicle-to-grid (V2G) constructs a flexible and extensible inter-operation platform between electric vehicles and grids, in which the bidirectional charging can be performed between vehicles and grid based on the demands. In V2G, there are numerous challenges among which cyber security is a major one that needs to be addressed with priority. The software-defined networking is an advanced architecture for next generation networks, which provide flexible control by separating control plane from data plane. The flexible configuration for the communications and security can enable more scalable, secure, and collaborative system, these make the SDN as a potential communication architecture for V2G. This paper aims to apply the SDN technology on V2G system, which we termed as software-definedV2G (SD-V2G). To the best of our knowledge, this is the first work to deal with the high dynamics of communications and security for V2G by using SDN. Moreover, we propose a novel security communication mechanism (SCM) for dynamic V2G system to ensure confidentiality, integrality, non-repudiation, authentication, etc. To evaluate the scheme, the security analysis, performances, and comparisons are done to demonstrate that the proposed software-defined SCM (SD-SCM) is possible and a promising solution for SD-V2G system. The proposed SD-SCM is significant to enhance the security for V2G.