Due to the multi-hop, long-distance, and wireless backbone connectivity, provisioning critical and diverse services face challenges such as low latency and reliability. This paper proposes ioFog, an offline fog architecture for achieving reliability and low latency in a large backbone network. Our solution uses a Markov chain-based task prediction model to offer dynamic service requirements with minimal dependency on the Internet. The proposed architecture considers a central Fog Controller (FC) to (i) provide a global status view and (ii) predict the type of tasks at the Fog Nodes for intelligent offloading decisions. The FC also has the current status of the existing fog nodes in terms of their processing and storage capabilities. Accordingly, it can schedule the possible future offline computations and task allocations. ioFog considers the requirements of individual IoT applications and enables improved fog computing decisions. As compared to the existing offline IoT solutions, ioFog reduces service time significantly and service delivery ratio up to 23%, compared to the existing relevant architectures.