The latest developments in mobile cloud computing (MCC) have changed user's priorities for computing. However, the change towards MCC brings new challenges to cloud service providers and administrators. Authentication is one among the challenges categorized in the classification of security issues for MCC. Port knocking authentication method eliminates user's collaboration during the authentication process. Thus, such technique has the potential to be applied on the MCC environment which can ensure reliable communication. However, current port knocking authentication techniques lack of addressing the issue of knock-sequence length. It is challenging to deploy appropriate length sequence for port knocking authentication for the reason that shorter length knock sequence degrades security, whereas, deploying longer length sequence involves performance issues in terms of time and buffer management. This paper proposes a dynamic length port knocking authentication framework which addresses the issue of security degradation and optimizes performance in terms of time up and buffer managment. We employ MikroTik RouterOS for the evaluation of the proposed technique. Analysis of the results shows that dynamic length port knocking authentication technique improves performance in terms of time up to 23% and buffer management up to 28% by reducing the imposed load. Furthermore, by deploying dynamic length (DL) and pool of length (PoL), the proposed method reveals high security, which decreases the probability of hacking knock-sequence near to zero for a number of parallel authentication requests. Hence, dynamic length port knocking authentication technique provides an optimal solution for reliable communication in MCC.