This paper proposes an algorithm to assess the performance of a cloud-fog computing system by constructing a stochastic-flow cloud-fog computing network (SCCN) model. There are three phases of transmitting data: The first is to transmit data from the IoT devices to the fog servers. The next phase and last phases are transmitting a part of the data from the fog servers to the cloud servers for the further operations and back to the IoT devices for the immediate operations, respectively. Based on the transmission mechanisms, two demands, including initial demands and processed demands, should be satisfied simultaneously, where an initial demand is outing from an IoT device. The algorithm proposed in this paper could calculate reliability, the probability of successfully transmitting the data through the SCCN, by elucidating the flow relation among all equipment with IoT devices, edge servers, and cloud servers. Furthermore, another approach to adjust the flow assignment is also proposed for the case that demand may not be an integer.