Skip to content
This repository was archived by the owner on Mar 16, 2021. It is now read-only.

Communication between Client and Storage server

bogotolec edited this page Oct 7, 2020 · 3 revisions

Overview

Client needs for a connection to the storage server in 2 cases:

  1. Client wants to download a file
  2. Client wants to upload a file

In both cases the scenario of getting access to the server is the same.

  1. Client asks an address of the Storage Server from Name Server.

  1. Client sends a request to the storage server.

But protocols differ because of the case of connection.

Request

The request to the Storage Server is following:

Response

Server already knows everything we need about us: who we are, what we want to do, the size of the file. Name Server tells it.

Uploading a file

In the case if we want to upload the file, we need just to send the content of the file. Server already knows the size of the file and where to save it. And it automatically closes the connection after receiving the file.

Downloading a file

In the case if we want to download the file, server will send us a response of following format:

After sending us the file, the server will automatically close the connection.

Clone this wiki locally