How the IP Protocols Fit Together
While interfacing with the network, you may wonder how all these protocols fit together. In some cases, it may seem that they don't fit together at all. They do use some of each other's features, but they really don't work so closely together that they are inseparable.
The raw IP, ICMP, UDP, and TCP protocols fulfill specific roles. You can use these roles to fit your needs when you design your network application. Of course, while TCP has more reliability and features than the other protocols, you cannot replace ICMP with TCP. Because the Linux subsystems require different features from TCP/IP, each packet type is important for your system to work correctly.
The ICMP, UDP, and TCP packets physically rely on the raw IP packet. Their headers and data reside in the IP's data section, following the IP header.