1. The Client/Server Model

1.1. Distributed System

A distributed computer system contains software programs and data resources dispersed across independent computers connected through a communication network.

1.2. Advantages

  • It allows users of individual, networked computers to share data and processing power, often over long distances.

  • Distribution can also enhance availability, reliability and performance.

Figure 11.1. Heterogeneous network

Heterogeneous network

1.2.1. Coordination Models

A coordination model establishes logical roles and associated behaviours (for applications that assume such roles) for executing distributed interactions.

Audio in Portuguese

1.3. The client

Requests an operation or service that some other application, the server, provides.

1.4. The server

Receives a client request, performs the requested service and returns to the client any results.

1.5. Advantages

  • It offers simplicity in closely matching the flow of data with the control flow.

  • It promotes modular, flexible, and extensive system designs.

  • Data resources and computing services can be organized, integrated and used as a service.

  • Widely used in distributed systems.

1.6. Communication

  • Servers communicate over a network.

  • In Unix and Windows machines the network uses: TCP/IP & UDP.

TCP and UDP protocols:

Figure 11.2. Network Stack

Network Stack

Audio in Portuguese

1.8. TCP

1.8.1. Definition

TCP is a connection-based protocol that provides a reliable flow of data between two computers.

1.8.2. Example

HTTP

ftp

Telnet

1.9. UDP

1.9.1. Definition

UDP is a protocol that sends independent packets of data, called datagrams from one computer to another with no guarantees about arrival.

1.9.2. Example

ping

1.10. Ports

1.10.1. Definition

The TCP and UDP protocols use ports to map incoming data to a particular process running on a computer.

  • Computers are identified by a 32-bit IP address.

    IP uses to deliver data to the right computer on the network.

  • Ports are identified by a 16-bit number.

    TCP and UDP use to deliver the data to the right application.

Figure 11.3. Ports

Ports

Audio in Portuguese

1.10.2. Port Numbers

Range: from 0 to 65535

Reserved: 0 - 1023 are restricted--they are reserved for use by services such as HTTP and ftp and other system services.

Figure 11.4. Port Numbers

Port Numbers

1.11. Sockets

  • Are the basic components of interprocess communication.

  • Provide access to the network transport protocols

  • Are an endpoint of communication to which a name can be bound.

1.11.1. Stream Socket

A stream socket provides bidirectional, reliable, sequential, and unduplicated flow of data with no record boundaries. It uses TCP/IP protocol.

1.11.2. Datagram Socket

A datagram socket provides bidirectional flow of data, the data is divided in packages, the receiver can receive them in a different order from the sending sequence and may receive duplicated messages. It uses UDP protocol.

Audio in Portuguese