Moving Target Defense (MTD) is recently defined as one of the game changers in security. By applying MTD, defenders are able to modify particular configurations in order to confuse attackers. Consequently, the attacker cannot find vulnerabilities and leverage on them to launch attacks. In this project, we first propose a framework to analyze MTD advantages and drawbacks in any given system, considering the attack surface. Our framework helps designers to find the optimal strategy to be employed with MTD, given any new type of attacks. We then define a novel mechanism to implement MTD in IPv6 networks. Our approach employs Hash Chain Functions to change IP addresses periodically and in a way that the attacker cannot find the target easily. In comparison with similar approaches, our mechanism can be implemented in a traarent way, such that the changes in IP address would not tear down the ongoing connections. Moreover, the routers between sender and receiver cannot obtain enough information about the current IP address of the sender that uses our protocol. Finally, we compute the optimal time of moves when we use MTD mechanism. We elaborate on FlipIt protocol (i.e., a defined game of stealthy takeover), considering the probability of successful attack/defense and show how these parameters can change the time of defense with MTD. We believe that our results would be the first step towards designing an efficient MTD protocol in computer networking. Keywords: Moving Target Defense, Network Security, Game Theory, FlipIt, IPv6, Attack Surface