Sometimes we think of TCP/IP as a protocol, but it is really a suite of protocols. Combinations of these protocols work together to transfer data from one computer to another. The name, TCP/IP, comes from two of the most frequently used protocols in the suite, the Transmission Control Protocol(TCP) and the Internet Protocol(IP).
To understand how TCP/IP works, you can think of the different protocols as separate APIs, or more commonly, layers. The layered diagrams sometimes confuse programmers. If you think of them as different level APIs, you will come closer to understanding them. Each layer, except the Network Access Layer, makes calls to the services provided by the layer below it. (The Network Access Layer makes calls to the hardware.) Each layer, except the application layer, returns data to the layer above it.
Another point of confusion comes by thinking that the Network Access Layer is made up of a single product or protocol. In reality, many different technologies are combined to perform the duties of this layer. Network cards have drivers that are called by routing software, and so forth.
The Application Layer can also be very complicated. Some application layers contain hundreds of servlets, JSPs, EJBs, and just about every other technology on the market. Figure 20.1 shows the layers of a typical TCP/IP model.
Figure 20.1. The Internet protocol model.
The layers in this model are
Application layer This layer can be as simple as a file transfer program, or it can as complex as an B2B application.
Transport layer This layer sends a set of data from one machine to another with data integrity and high reliability.
Internetwork layer This layer makes calls to pass "buckets" of data called datagrams from one computer to another and another and another until the final destination computer is reached.
Network Access layer This layer exchanges frames of data with other computers or routing devices on the same network.
The layers work together to create the effect of sending data reliably from one computer to one or more other computers.