In a network of clocks, we consider a given reference node to determine the time evolution t. We introduce and analyze a stochastic model for clocks, in which the relative speedup of a clock, called the skew, is characterized by some given stochastic process. We study the problem of synchronizing clocks in a network, which amounts to estimating the instantaneous relative skews and relative offsets by exchange of time-stamped packets across the links of the network. We present a scheme for obtaining measurements in a communication link. We develop an algorithm for optimal filtering of measurements across a link (i, j) in order to estimate the logarithm of the relative speedup of node j with respect to node i, and we further study some implementation issues. We also present a scheme for pairwise offset estimation based on skew estimates. We study the properties of our algorithms and provide theoretical guarantees on their performance. We also develop an online centralized model-based asynchronous algorithm for optimal filtering of the time-stamps in the entire network, and an efficient distributed suboptimal scheme.