Uncertain dynamics in communication network, including random delays and packet losses make it difficult to guarantee stability of cyber-physical systems (CPSs). Many existing works consider the uncertainties of network channel with strong assumptions that network delay bounds and its distribution are known a priori and time-invariant. However, these assumptions could be invalidated in realistic CPSs by malicious attacks, system hardware faults, topology changes etc. A probability density function (PDF)-based tuning of stochastic optimal control (PTSOC) is proposed to manage the unknown dynamics in the embedded network. The update law of the proposed controller is derived and updated based on the PDF estimation of network delays that explicitly consider delays and its time-varying distribution. The results illustrate that the proposed PTSOC has a better performance in terms of the overshoot, convergence time, and cost when compared with the conventional stochastic optimal control.