Flux between regions of different concentration occurs in nearly
every device involving diffusion, whether an electrochemical cell,
a bipolar transistor, or a protein channel in a biological membrane. Diffusion theory has calculated that flux since the time of Fick (1855), and the flux has been known to arise from the stochastic behavior of Brownian trajectories since the time of Einstein (1905), yet the mathematical description of the behavior of trajectories corresponding to different types of boundaries is not complete. We consider the trajectories of non-interacting particles diffusing in a finite region connecting two baths of fixed concentrations. Inside the region, the trajectories of diffusing particles are governed by the Langevin equation. At the interface between the region and the baths, trajectories are set by a control mechanism that modifies dynamics so the concentration of particles remains (nearly) constant. We analyze different models of controllers and derive equations for the time evolution and spatial distribution of particles inside the domain. Our analysis shows a distinct difference between the time evolution and the steady state concentrations. While the time evolution of the density is governed by an integral operator, the spatial distribution is governed by the familiar Fokker-Planck operator. The boundary conditions for the time dependent density depend on the model of the controller; however, this dependence disappears in the steady state, if the controller is of a renewal type. Renewal-type controllers, however, produce spurious boundary layers that can be catastrophic in simulations of charged particles, because even a tiny net charge can have global effects. The design of a non-renewal controller that maintains concentrations of non-interacting particles without creating spurious boundary layers at the interface requires the solution of the time-dependent Fokker-Planck equation with absorption of outgoing trajectories and a source of ingoing trajectories on the boundary (the so called albedo problem).