Controlling the transport in the plasma edge of high temperature plasmas has recently been extended by a sophisticated option - the stochastization of the magnetic cage confining the plasma. The idea is to induce a chaotic magnetic field structure in the edge which can act as a magnetic valve to control heat and particle fluxes between the confined plasma and the plasma facing components. This tool is applied in both, stellarators as well as tokamaks. In this lecture an introduction into the topic will be given. The topics are (a) generation and structure of chaotic magnetic edge layers, (b) plasma transport with stochastic magnetic fields including the resulting three-dimensional plasma wall interaction and (c) impact of a plasma response. However, this field is matter of intense ongoing research and hence this lecture gives a systematic introduction into the challenges based on examples from the TEXTOR tokamak.