Jerry's Blog

Recording what I learned everyday

View on GitHub


27 September 2019

Network(9) -- Principles of Network Applications

by Jerry Zhang

Network Application Architectures

In a client-server architecture, there is an always-on host, called the server, which services requests from many other hosts, called clients.

A data center, housing a large number of hosts, is often used to create a powerful virtual server.

In a P2P architecture, there is minimal (or no) reliance on dedicated servers in data centers.

We mention that some applications have hybrid architectures, combining both client-server and P2P elements. For example, for many instant messaging applications, servers are used to track the IP addresses of users, but user-touser messages are sent directly between user hosts (without passing through intermediate servers).

P2P architectures is self-scalability.

Processes Communicating

Processes on two different end systems communicate with each other by exchanging messages across the computer network.

With P2P file sharing, the peer that is downloading the file is labeled as the client, and the peer that is uploading the file is labeled as the server.

In the context of a communication session between a pair of processes, the process that initiates the communication (that is, initially contacts the other process at the beginning of the session) is labeled as the client. The process that waits to be contacted to begin the session is the server.

The Interface Between the Process and the Computer Network

A process sends messages into, and receives messages from, the network through a software interface called a socket.

A socket is the interface between the application layer and the transport layer within a host. It is also referred to as the Application Programming Interface (API) between the application and the network.

On the transport-layer side, the application developer can only control: (1) the choice of transport protocol and (2) a few transport-layer parameters such as maximum buffer and maximum segment sizes.

Addressing Processes

In the Internet, the host is identified by its IP address. A destination port number identify the receiving process (more specifically, the receiving socket) running in the host.

Transport Services Available to Applications

We can broadly classify the possible services along four dimensions: reliable data transfer, throughput, timing, and security.

Reliable Data Transfer

If a protocol provides such a guaranteed data delivery service, it is said to provide reliable data transfer.

This may be acceptable for loss-tolerant applications, most notably multimedia applications such as conversational audio/video that can tolerate some amount of data loss.

Throughput

The available throughput can fluctuate with time.

A transport-layer protocol could also provide the service, guaranteed available throughput at some specified rate.

The application could request a guaranteed throughput of r bits/sec. Applications that have throughput requirements are said to be bandwidth-sensitive applications.

Elastic applications can make use of as much, or as little, throughput as happens to be available. For example, e-mail, file transfer, and Web transfers.

Timing

A transport-layer protocol can also provide timing guarantees. Every bit that the sender pumps into the socket arrives at the receiver’s socket no more than 100 msec later.

Real-time applications, such as Internet telephony, virtual environments, teleconferencing, and multiplayer games.

Security

A transport protocol can encrypt all data transmitted by the sending process

Transport Services Provided by the Internet

The Internet (and, more generally, TCP/IP networks) makes two transport protocols available to applications, UDP and TCP.

TCP Services

The TCP service model includes a connection-oriented service and a reliable data transfer service.

After the handshaking phase, a TCP connection is said to exist between the sockets of the two processes. The connection is a full-duplex connection in that the two processes can send messages to each other over the connection at the same time. When the application finishes sending messages, it must tear down the connection.

Without error and in the proper order.

SSL

Enhancement for TCP, called Secure Sockets Layer (SSL). TCP-enhanced-with-SSL not only does everything that traditional TCP does but also provides critical process-to-process security services, including encryption, data integrity, and end-point authentication.

If an application wants to use the services of SSL, it needs to include SSL code in both the client and server sides of the application.

When an application uses SSL, the sending process passes cleartext data to the SSL socket; SSL in the sending host then encrypts the data and passes the encrypted data to the TCP socket.

UDP Services

UDP is connectionless, so there is no handshaking before the two processes start to communicate.

UDP provides an unreliable data transfer service—that is, when a process sends a message into a UDP socket, UDP provides no guarantee that the message will ever reach the receiving process. Furthermore, messages that do arrive at the receiving process may arrive out of order.

UDP does not include a congestion-control mechanism.

Services Not Provided by Internet Transport Protocols

Throughput or timing guarantees are services that are not provided by today’s Internet transport protocols.

In summary, today’s Internet can often provide satisfactory service to time-sensitive applications, but it cannot provide any timing or throughput guarantees.

Application-Layer Protocols

An application-layer protocol defines how an application’s processes, running on different end systems, pass messages to each other. It defines:

The Web’s application-layer protocol, HTTP (the HyperText Transfer Protocol [RFC 2616]), is available as an RFC.

An application-layer protocol is only one piece of a network application.

Network Applications

The Web, electronic mail, directory service video streaming, and P2P applications.

For example, DNS provides a directory service for the Internet.

tags: Network