In this paper, we propose a novel framework, namely Q-TRANSFER, to address the insufficiency problem of the actual training data sets in modern networking platforms in order to push the application of deep learning in the context of communication networking. In particular, we adopt deep transfer learning, i.e., network-transfer, as a key technique to mitigate the data set insufficiency problem. Being aware of the negative transfer we - instead of trying to alleviate the negative transfer - aim to maximise the positive transfer. We examine a basic networking deep transfer learning system and formulate the optimisation problem of achieving the most beneficial knowledge from a source deep learning model. In order to circumvent the optimisation problem, we further propose to employ a reinforcement learning approach, i.e., Q-learning algorithm. As a case study, a DDoS attack detection method using a Multilayer Perceptrons algorithm (MLP) is taken to demonstrate the effectiveness and capabilities of the Q- TRANSFER framework. Results obtained from extensive experiments confirm that the most beneficial attack detection knowledge is derived from the source deep learning model by applying the Q-learning algorithm. The efficiency is increased up to 43.58 % compared to traditional deep transfer learning methods. To the best of our knowledge, this is the first study on optimising knowledge transfer for deep learning applications in the field of networking.