One of the application of the second stage of next generation passive optical network (NG-PON2) based on time and wavelength division multiplexed PON (TWDM-PON) is expected to be fronthaul streams in fifth generation (5G) mobile networks. TWDM-PON has ability to transfer up to 40 Gbps and can be coexistence with previous time division multiplexed TDMPON generations without any change to optical distribution network (ODN). In this paper, we demonstrate a software defined (SD) dynamic bandwidth wavelength allocation (DBWA) mechanism in converged mobile and TWDM-EPON architecture. In the proposed mechanism, the multi-scheduling domain (MSD) is used to separate the bandwidth allocation between hybrid remote radio network unit/optical network unit (RRU/ONU) and conventional ONU into virtual groups (VGs). When the current wavelength in certain VG is overloaded, the optical line terminal (OLT) automatically distributes to the other wavelengths in the others VGs. Simulation results show that our proposed mechanism is able to maintain the overall quality of services (QoS) system performance in terms of mean packet delay and EF jitter.