  The huge amount of data generated by the Internet of things (IoT) devices
needs the computational power and storage capacity provided by cloud, edge, and
fog computing paradigms. Each of these computing paradigms has its own pros and
cons. Cloud computing provides enhanced data storage and computing power but
causes high communication latency. Edge and fog computing provide similar
services with lower latency but with limited capacity, capability, and
coverage. A single computing paradigm cannot fulfil all the requirements of IoT
devices and a federation between them is needed to extend their capacity,
capability, and services. This federation is beneficial to both subscribers and
providers and also reveals research issues in traffic offloading between
clouds, edges, and fogs. Optimization has traditionally been used to solve the
problem of traffic offloading. However, in such a complex federated system,
traditional optimization cannot keep up with the strict latency requirements of
decision making, ranging from milliseconds to sub-seconds. Machine learning
approaches, especially reinforcement learning, are consequently becoming
popular because they can quickly solve offloading problems in dynamic
environments with large amounts of unknown information. This study provides a
novel federal classification between cloud, edge, and fog and presents a
comprehensive research roadmap on offloading for different federated scenarios.
We survey the relevant literature on the various optimization approaches used
to solve this offloading problem, and compare their salient features. We then
provide a comprehensive survey on offloading in federated systems with machine
learning approaches and the lessons learned as a result of these surveys.
Finally, we outline several directions for future research and challenges that
have to be faced in order to achieve such a federation.
