  Fog computing has been advocated as an enabling technology for
computationally intensive services in smart connected vehicles. Most existing
works focus on analyzing the queueing and workload processing latencies
associated with fog computing, ignoring the fact that wireless access latency
can sometimes dominate the overall latency. This motivates the work in this
paper, where we report on a five-month measurement study of the wireless access
latency between connected vehicles and a fog/cloud computing system supported
by commercially available LTE networks. We propose AdaptiveFog, a novel
framework for autonomous and dynamic switching between different LTE networks
that implement a fog/cloud infrastructure. AdaptiveFog's main objective is to
maximize the service confidence level, defined as the probability that the
latency of a given service type is below some threshold. To quantify the
performance gap between different LTE networks, we introduce a novel
statistical distance metric, called weighted Kantorovich-Rubinstein (K-R)
distance. Two scenarios based on finite- and infinite-horizon optimization of
short-term and long-term confidence are investigated. For each scenario, a
simple threshold policy based on weighted K-R distance is proposed and proved
to maximize the latency confidence for smart vehicles. Extensive analysis and
simulations are performed based on our latency measurements. Our results show
that AdaptiveFog achieves around 30% to 50% improvement in the confidence
levels of fog and cloud latencies, respectively.
