Of course, of course.....the protocol stack.
So, the NIC understands the low level protocols: the physical layer, the link layer, even maybe the network layer.
But, beyond that, the protocols are understood by software.
Can you explain more about how the OS puts all packets in order and passes them to the right process?
Not much too it really. What happens sort of depends.
Likely the OS will say to the NIC "Hey, this memory location is yours to scribble over." As the NIC gets packets, it will write directly to that memory location the full packet (full frame?). This is called
DMA. Once it is done writing, it notifies the OS via a CPU interrupt "Hey, I just wrote out some data". From there the OS will do what it does, whether it hands control over to the driver to do some extra processing on the data or something else depends somewhat on the particular OS. Generally, though, when it comes time to do the TCP stuff, the OS will do it all, it will inspect each packet, figure out the ordering, port, and application (the port is basically way of controlling what app gets what data). As part of the TCP protocol, the OS will check and see if it has all the information needed to start forwarding packets, if a packet comes in out of order the OS will hold off on forwarding one or more packets until the missing packet comes in. After a timeout, there will be a re-request for a numbered packet assuming that it simply died in the ether.
The driver is for a NIC is mostly for establishing a memory location that the NIC can write to as it comes in. Though, it may do more if the NIC has memory on it (like the Killer or whatever NICs that have 256mb of ram).
Once it gets into the application, that is where the Http protocol is handled. The application will read the http headers and then interpret the data as needed.