Next-generation wireless networks are envisaged to provide end-users ubiquitous low-latency computing services using devices at the network edge and machines before reaching the core cloud network. The crucial concepts of driving this technology are to offload computationally intensive tasks from users to edge or fog devices. The mobile edge network consists of an access point (AP), Radio Access Network (RAN), devices, edge servers, fog servers and finally the core cloud network. Given that fog computing is an emerging technology, it is imperative to study the performance of such systems analytically. Though there are many papers on performance analysis, many of them provide heuristic, ad-hoc solutions or pose it as optimization problems. In this work, we model a hierarchical fog architecture using Markov chain analysis and compare it with a flat fog architecture by investigating the different performance measures analytically and by simulation. © Springer Nature Singapore Pte Ltd 2020.