Method for building a network coding scheme to be used for the exchange of encoded data between a plurality of source nodes and a plurality of destination nodes in a communications network comprising a plurality of nodes, said method being performed automatically by a device and comprising the following steps: - determining the topology of said communications network; - extracting a graph associated with said communications network; - extending said graph by a virtual sources; and being characterized in that - for each destination node, determining (E4 to E6) a first set of source nodes from which there exist disjointed paths, in said communications network, to reach said destination node, disjointed paths being paths which do not have arc in common in the graph; - determining a second set of source nodes which is the intersection of the determined first sets of source nodes; - determining a sub-network for implementing the network coding comprising: o source nodes which belong only to the second set of source nodes, o the plurality of destination nodes, and o nodes included in the disjointed paths connecting the source nodes of said second set of source nodes and said destination nodes; and - building (E20, E25, E29) a network coding scheme based on said determined sub-network; and - the nodes comprised in said determined sub-network exchange data encoded with said network coding scheme. in that said step for building a network coding comprises the following steps: a) determining a matrix of adjacency of said sub-networks; b) determining (E14, T15, E16, T17, T18, E19, E20) a coding matrix from said adjacency matrix; c) determining a system matrix for each destination node from said coding matrix; d) verifying the invertible character of the system matrices of the destination nodes; e) in the event of negative verification, reiterating the steps b) to e), or else inversion of the system matrices of the destination nodes; and in that said method is interrupted after a predetermined number of negative verifications. - determining the topology of said communications network; - extracting a graph associated with said communications network; - extending said graph by a virtual sources; and being characterized in that - for each destination node, determining (E4 to E6) a first set of source nodes from which there exist disjointed paths, in said communications network, to reach said destination node, disjointed paths being paths which do not have arc in common in the graph; - determining a second set of source nodes which is the intersection of the determined first sets of source nodes; - determining a sub-network for implementing the network coding comprising: o source nodes which belong only to the second set of source nodes, o the plurality of destination nodes, and o nodes included in the disjointed paths connecting the source nodes of said second set of source nodes and said destination nodes; and o source nodes which belong only to the second set of source nodes, o the plurality of destination nodes, and o nodes included in the disjointed paths connecting the source nodes of said second set of source nodes and said destination nodes; and - building (E20, E25, E29) a network coding scheme based on said determined sub-network; and - the nodes comprised in said determined sub-network exchange data encoded with said network coding scheme. a) determining a matrix of adjacency of said sub-networks; b) determining (E14, T15, E16, T17, T18, E19, E20) a coding matrix from said adjacency matrix; c) determining a system matrix for each destination node from said coding matrix; d) verifying the invertible character of the system matrices of the destination nodes; e) in the event of negative verification, reiterating the steps b) to e), or else inversion of the system matrices of the destination nodes;