  The widespread adoption of the fifth generation (5G) of cellular networks has
brought new opportunities for the development of localization-based services.
High-accuracy positioning use cases and functionalities defined by the
standards are drawing the interest of vertical industries. In the transition
towards the deployment, this paper aims to provide an in-depth tutorial on 5G
positioning, summarizing the evolutionary path that led to the standardization
of cellular-based positioning, describing the localization elements in current
and forthcoming releases of the Third Generation Partnership Project (3GPP)
standard, and the major research trends. By providing fundamental notions on
wireless localization, comprehensive definitions of measurements and
architectures, examples of algorithms, and details on simulation approaches,
this paper is intended to represent an exhaustive guide for researchers and
practitioners. Our approach aims to merge practical aspects of enabled use
cases and related requirements with theoretical methodologies and fundamental
bounds, allowing to understand the trade-off between system complexity and
achievable, i.e., tangible, benefits of 5G positioning services. We analyze the
performance of 3GPP Rel-16 positioning by standard-compliant simulations in
realistic outdoor and indoor propagation environments, investigating the impact
of the system configuration and the limitations to be resolved for delivering
accurate positioning solutions.
