IP is considered layer 3. It is independent of the medium below it, and it is used in routing. ATM and MPLS sit somewhat above the electrical specification (e.g., Manchester Encoding of Ethernet), which is layer 2. They also perform routing (a layer 3 function), and allow IP and its associated routing on top of it -- which is already layer 3. Thus, they do the work of layers 2 and 3, but expect to normally have a layer 3 protocol running on top of them, and interface with varying layer 2 signaling protocols below them.
Layer 2: Packet interface to the medium: Token ring / bus protocols, Ethernet, and little tubes full of paper
This layer 2.5 stuff: defines packet structure / encapsulation that carries layer 3 on top of it, and is carried by layer 2. It performs the routing function of layer 3. Thus it is neither layer 2, nor 3, and performs aspects of both. Just to really mess with you, sometimes MPLS is run on top of IP.
Layer 3: IP, IP, and the pigeon knowing where home is.
And beyond that, I don't know how to be more detailed without specific questions.
ATM and MPLS are not well classified by the OSI stack model because they are not OSI protocols. (Neither are HTTP, TCP or IP)
The OSI model looks OK in theory, but is pretty flawed in implementation.
Today, the OSI model is really best used as a teaching point to describe seperation of layers and encapsulations. There's not a lot of practical value in trying to map an old rigid model on protocols that don't adhere to it.
IP is considered layer 3. It is independent of the medium below it, and it is used in routing. ATM and MPLS sit somewhat above the electrical specification (e.g., Manchester Encoding of Ethernet), which is layer 2. They also perform routing (a layer 3 function), and allow IP and its associated routing on top of it -- which is already layer 3. Thus, they do the work of layers 2 and 3, but expect to normally have a layer 3 protocol running on top of them, and interface with varying layer 2 signaling protocols below them.
EDIT: Clarifying attempt
And beyond that, I don't know how to be more detailed without specific questions.
Why aren't they?
ATM and MPLS are not well classified by the OSI stack model because they are not OSI protocols. (Neither are HTTP, TCP or IP)
The OSI model looks OK in theory, but is pretty flawed in implementation.
Today, the OSI model is really best used as a teaching point to describe seperation of layers and encapsulations. There's not a lot of practical value in trying to map an old rigid model on protocols that don't adhere to it.