PPTP, L2TP, PPPOE - these are tunneling protocols. And they are Data link Layer protocols. Why? As I understood, Layer2 protocols work only in same subnet. They don't use IP addresses and cannot be routed. They operate only with MAC addresses. These Layer2 members: LACP, WOL, CDP, Trunk/VLAN don't use IP addresses! Ofcource some of them could be routed using some broadcasting technologies. However, PPTP, PPPOE and L2TP protocols use IP addresses. Moreover, they use TCP ports, higher OSI layer. Why?
PPTP, PPPoE, and L2TP all provide OSI Layer 2 services. That is, the user of these protocols (usually, a network layer protocol suite) thinks it's running over a "normal" link layer. However, each of these protocols provides the link layer service by transporting packets over another service, rather than over the physical layer.
- PPTP provides PPP (link layer) service by running over TCP (transport layer).
- PPPoE provides PPP (link layer) service by running over Ethernet (a different link layer)
- L2TP provides PPP (link layer) service by running over UDP (transport layer).
So, each of these protocols plays two different roles. Each provides a service that's a link-layer service, so looking at it from above, it's a "link layer service provider". But each runs atop a different service, so, looking from below, it's a transport service user, network service user, or link service user.
Phrases like "X service user" and "X service provider" are generally more useful than the less distinct phrase "in the X layer". This user/provider distinction is an important part of the OSI layer model, though it may not be obvious from some tutorials.
Note that layer three and above protocols can be encapsulated inside the protocols you mention but not layer two (or below). One way to look at it is that you build a protocol stack from the bottom up. So first we put down layers 1, 2, and 3. Then for layer 4 we put PPTP (for example) and that starts a NEW layer 2 on top of (inside of) the "real" layers 1, 2, and 3. Then you can put yet another layer 3 on top of the new PPTP layer two and go on up from there.
That's not exactly what's going on but remember that the OSI model is only a MODEL. And technically the OSI model was meant to be used with OSI protocols, which most commonly used protocols are not. As a way to understand networking in general, the OSI model helps a lot, even with non-OSI protocols, which is why it is used by so many networking professionals in many areas. But again, it's only a model, so it helps us get a grip on what's happening but it does not rigidly define what is happening, nor does it 100% reflect what is happening.