Skip to content

2.1 Principles of Network Appications

At the core of network application develop is writing programs that run on different end systems and communicate with each other over the network. Thus, when developing your new application, you need to write software that will run on multiple end systems. This can be written in C, Java, Python, etc.

Network Application Architectures

The application architecture is designed by the application developer and dictates how the applicatio nis structured over the various end systems. This is opposed to network architecture (the 5-layer Internet architecture discussed in 1. Computer Networks and the Internet. Network architecture is fixed.

Client-server architecture is the structuer where there is an always-on host, called the server, which services requests from many other hosts, called clients. Some notes:

  • always-on Web server services requests from browsers running on client hosts. When a Web server receives a request for an objectfrom a client host, it responds by sending he requested object to the client host.

  • Note that with client-server architecture, clients do not directly communicate with each other; two browsers do not communicate with each other, they instead communicate with a server.

  • In client-server architecture, servers have a fixed, well-known address, called an IP address. A client can always contact the server by sending a packet to the server's IP address

  • Data centers (housing a large number of hosts) is often used to create a powerful virtual server

Peer-to-Peer architecture (P2P architecture), there is minimal reliance on deciated servers in data centers. Instead the application exploits direct communication between pairs of intermittenly connected hosts, called peers. Some notes:

  • Peers are not owned by the service provider, but are instead desktops and laptops controlled by users, with most of the peers residing in homes, universities, offices, etc.

  • There is no dedicated server it passes through.

  • A compelling feature of P2P: self-scalability. In a P2P file sharing application, although each peer generates workload by requesting files, each peer also adds service capacity to the system by distributing files to other peers.

  • Cost effective, since they normally don't require significant server infrastructure and server bandwidth

  • Faces challenges of security, performance, and reliability due to their highly decentralized structure.

An image showing the difference:

2.1.1 clientp2p.png

Process Communicating

You also need a basic understanding of how programs, running in multiple end systems, communicate with each other. In jargon of OS, it is not actually programs but processes that communicate. Process: program that is running within an end system. When processes are running on the same end system, they can communicate with each other with interprocess communication. We are interested in how processes running on different hosts (with potentially different OS) communicate.

Processes communicate by exchanging messages across the computer network. A receiving process receives these messages and possibly responds by sending messages back.

Client and Server Processes

In the context of communication session between a pair of processes, the process that initiates the communication is labeled as the client. The process that waits to be contacted to begin the session is the server.

  • Web application - browser is the client process, and the Web server is the server process

  • P2P file-sharing system - peer that is downloading is the client, and the peer that is uploading is the server

You see in P2P that a process can be both a client and a server. It just depends on the context.

The Interface Between the Process and the Computer Network

A process sends messages into, and receives messages from, the network through a sofware interface called a socket. If a process is a house, the socket is the door. When a process wants to send a message to another process on another host, it shoves the message out its door. Once the message arrives at the destination host, the message passes through the receiving process's door, and the receiving process then acts on the message.

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

The only control that the application develop has on the transport-layer side is 1. The choice of transport protocol 2. Perhaps the ability to fix a few transport-layer parameters such as maximum buffer and maximum segment sizes

Addressing Processes

To identify the receiving process, two pieces of information need to be specified 1. The address ofthe host 2. An identifier that specifies the receiving process in the destination host

The host is identified by its IP address. We also need to identify the receiving process, called the prot number. A Web server is identified by port number 80. Mail server process is identified by port number 25.

Transport Services Available to Applications

Many networks provide more than one transport-layer protocol. You must choose one of the available TL protocols. How do you know what to pick? We looko at 4 factors

Reliable Data Transfer

Packets can get lost within a computer network (overflow a buffer in a router, discarded by host or router after bit corruption).

If a protocol provides such a guaranteed data delivery service, it is said to provide reliable data transfer. When a TL protcol doesn't provide reliable data transfer, some of the data sent by the sending process may never arrive at the receiving process. This may be acceptable for loss-tolerant applications, like multimedia applications that can tolerate some amount of data loss.

Throughput

Throughput is the rate at which the sending process can deliver bits to the receiving process. The available throughput fill fluctuate over time since there will be other sessions sharing the bandwidth, those coming and going.

The application could provide guaranteed available throghput at some specified rate of \(r \;bits/sec\). Applications that have throughput requirements are said to be bandwidth-sensitive applications. Multimedia applications are bandwidth sensitive. Conversely elastic applications can make use of as much or as little throughput as happens to be available. Email, file transfer, and Web transfers are elastic applications.

Timing

TL protocol can also provide timing guarantees. An example guarantee might be that every bit that the sender pumps into the socket arrives at the receiver's socket no more than 100 msec later, which might be important in Internet telephony, virtual environments, teleconferencing, and multiplayer games. Lower delay is always preferable to higher delay.

Security

TL protocol can provide an application with one or more security services. The TL protocol can encrypt sending host data transmitted to the receiving host, which will be decrypted.

Transport Services Provided by the Internet

The Internet makes two transport protocols availabel to applications, TCP and UDP. One of the first decisions you have to make is whether to use TCP or UDP.

TCP Services

TCP service model includes a connection-oriented service and a reliable data transfer service. We get the following:

  • Connection-oriented service: TCP has the client and server exchange TL control information with each other before the application-level messages begin to flow (a handshake procedure). Then a TCP connection is said to exist between the sockets of the two processes

  • Reliable data transfer service: it will deliver all data sent without error and in proper order.

  • Congestion control mechanism: throttles a sending process when the network is congested between sender and receiver

UDP Services

UDP is a no-frills, lightweight transport protocol, providing minimal services, UDP is connectionless, so there is no handshaking before the two processes start to communicate. We also have an unreliable data transfer service. UDP provides no guarantee that the message will ever reeach the receiving process. Furthermore, messages do not arrive at the same time, and might be out of order.

There is also no congestin-control mechanism.

Neither TCP nor UDP provide any encryption, the Internet communicty has developed an enhancement for TCP, called TLS (Transport Layer Security), that includes security.

Services Not Provided by Internet Transport Protocols

The dimension of timing is missing in TCP and UDP. Today's Internet, however, 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. If a TL protocol sends messages into sockets, the AL protocol will determine how the messages are structured.

In particular, an application-layer protocol defines:

  • The types of messages exchangs, for example, request messags and response messages

  • the syntax of the various message types, such as the fields in the message and how the fields are delineated

  • The semantics of the fields, that is, the meaning of the information in the fields

  • Rules for determining when and how a process sends messages and responds to messages.