The main subject of the thesis is the study of stationary nonequilibrium states trough the use of microscopic stochastic models that encode the physical interaction in the rules of Markovian dynamics for particles configurations. These models are known as interacting particles systems and are simple enough to be treated analytically but also complex enough to capture essential physical behaviours. The thesis is organized in two parts. The part 1 is devoted to the microscopic theory of the stationary states. We characterize these states developing some general structures that have an interest in themselves. In this part there is an interlude dedicated to discrete calculus on discrete manifolds with an exposition a little bit different to the one available in literature and some original definitions. The part 2 studies the problem macroscopically. In particular we consider the large deviations asymptotic behavior for a class of solvable one dimensional models of heat conduction. Both part 1 and 2 begin with an introduction of motivational character followed by an overview of the relevant results and a summary explaining the organization. Even tough the two parts are strictly connected they can be read independently after chapter 1. The material is presented in such a way to be self-consistent as much as possible.