  In an Internet-of-Things system where status data are collected from sensors
and actuators for time-critical applications, the freshness of data is vital
and can be quantified by the recently proposed age-of-information (AoI) metric.
In this paper, we first consider a general scenario where multiple terminals
share a common channel to transmit or receive randomly generated status
packets. The optimal scheduling problem to minimize AoI is formulated as a
restless multi-armed bandit problem. To solve the problem efficiently, we
derive the Whittle's index in closed-form and establish the indexability
thereof. Compared with existing work, we extend the index policy for AoI
optimization to incorporate stochastic packet arrivals and optimal packet
management (buffering the latest packet). Inspired by the index policy which
has near-optimal performance but is centralized by nature, a decentralized
status update scheme, i.e., the index-prioritized random access policy (IPRA),
is further proposed, achieving universally near-optimal AoI performance and
outperforming state-of-the-arts in the literature.
