The top layer in the model is called the Application layer. This layer normally provides services such as encryption, compression, decryption, and decompression. You might hear this layer discussed in generic terms as the TCP/IP client or the TCP/IP server.
When TCP/IP was first created, the applications tended to be very simple. Over the years, clients have grown in sophistication so that now an Enterprise JavaBean (EJB) server resides completely in this layer. Figure 20.2 shows the layered architecture of an EJB server and an EJB client.
Figure 20.2. The EJB architecture.
The EJB clients and servers normally talk to each other using sockets. The client makes a request by opening a socket and placing a stream of data onto it. The server receives the request, processes it, and sends a stream containing the response back to the client.
In reality, most EJB servers and clients communicate using the Remote Method Invocation (RMI) facilities that are built into Java.