Sometimes, more than one tunnel will be used in the network, because both of them can carry different payload.
The IPSec tunnel cannot carry multicast traffic, but it can encrypt the carried traffic. On the contrary, the GRE tunnel can carry multicast traffic, but, it can’t protect the carried data not being modified.
So we usually use both of them and this will generate two combinations: IPsec over GRE and GRE over IPsec.
Firstly, let’s take a look at IPsec over GRE.
In IPsec over GRE, data will be encrypted by the IPsec first, then carried by the GR and transferred to the remote terminal. In this situation, since the data will be handled by the IPsec first, then by the GRE tunnel, so the multicast traffic can’t be transferred in the IPsec over GRE.
It works as the figure below shows:
Unlike the IPsec over GRE, GRE over IPsec has inverse processing of the data. Data will be encapsulated by the GRE tunnel first, then encrypted by the IPSec and transferred to the remote terminal. In this situation, since the GRE can carry the multicast data, the GRE over IPsec also could process the multicast traffic, but it is done indirectly rather than directly.
The GRE over IPsec process the data as below: