  In this paper, we investigate joint relay and jammer selection in two-way
cooperative networks, consisting of two sources, a number of intermediate
nodes, and one eavesdropper, with the constraints of physical layer security.
Specifically, the proposed algorithms select two or three intermediate nodes to
enhance security against the malicious eavesdropper. The first selected node
operates in the conventional relay mode and assists the sources to deliver
their data to the corresponding destinations using an amplify-and-forward
protocol. The second and third nodes are used in different communication phases
as jammers in order to create intentional interference upon the eavesdropper
node. Firstly, we find that in a topology where the intermediate nodes are
randomly and sparsely distributed, the proposed schemes with cooperative
jamming outperform the conventional non-jamming schemes within a certain
transmitted power regime. We also find that, in the scenario in which the
intermediate nodes gather as a close cluster, the jamming schemes may be less
effective than their non-jamming counterparts. Therefore, we introduce a hybrid
scheme to switch between jamming and non-jamming modes. Simulation results
validate our theoretical analysis and show that the hybrid switching scheme
further improves the secrecy rate.
