Modeling of switching speed and retention time in volatile resistive switching memory by ionic drift and diffusion