Towards 6G Through SDN and NFV-Based Solutions for Terrestrial and Non-Terrestrial Networks