In the current protocol stack for Internet of Things in general and wireless sensor network in particular, many devices rely on the Contiki MAC protocol at their MAC layer. This protocol is widely used and enabled by default for several industrial environments and time sensitive monitoring and control applications. However, few work exists regarding the performance of this protocol because it lacks of an underlying theoretical model for analysing its performance. In this paper, we propose a novel approach relying on process mining technique that aims to obtain a Markov chain model for networks running the Contiki MAC protocol. In particular, we present a comprehensive specification of the protocol and a Markov chain model obtained through the analysis and instrumentation of its reference implementation. We used the obtained Markov chain to analyze and estimate the end to end delay distribution for a multi-hops transmission with static routing. The approach can also be extended to a wide range of protocols.