Sunteți pe pagina 1din 2

Client Server communication homework

You have the following URL: http://wikipedia.org . Perform the following:

- open the main page

- try to register a new username by providing invalid data in the fields

- create a new user by providing valid data in the registration fields

With developer tools open, for each of the above actions, follow what is happening on the network
level. Observe the details regarding:

-Headers, cookies, session, request type(GET,POST), response code, response message, parameters.
Describe why is happening what is happening and how. Describe the entire communication between
client and server in means of browser, client, DNS, request types, responses, message transition.

Describe all of the above and send them in a file attached in the homework.

 Open the main page

We put in browser URL: http://wikipedia.org and press ENTER

Open the main page : on the right in Developer Tools - HEADER should see some requests The
browser checks the cache or file host in PC for a DNS record to find the corresponding IP address
of www.wikipedia.org

The browser takes the DNS from a file host file from PC (Operating System –e.g. WINDOWS),
identifies the IP which is associated with DNS ;

Once the browser receives the correct IP address it will build a connection with the server that
matches IP address to transfer information. Browsers use internet protocols to build such
connections. The browser sends a request, although in DEV OPS we can see many requests, because
www.wikipedia.org is a dynamic site.

First, we have : Request URL for https://en.wikipedia.org/. Request method is GET and status 301
(Redirection).

In Headers we have information: Remote Address, cache –control, server : mw1327.eqiad.wmnet,


The path (/), the scheme (https),cookie, user –agent.

The first pagehttps://en.wikipedia.org/ is then redirected to the main page , there is a new request
URL : https://en.wikipedia.org/wiki/Main_Page.Now We have methot GET with status 304
(Redirection), Remote Address: [2620:0:862:ed1a::1]:443 , cache, server, the path: /wiki/Main_Page
, user agent, cookies..Response message is in HTML .

 we try to create an account by adding invalid data

In this case initial we have a request with METHOD GET , Status Code 200.
URL - we have string parameters : (we fill in textboxes with Username, Password.(For Password we
use an invalid format).

https://en.wikipedia.org/w/api.php?action=query&format=json&list=users&ususers=fsdafsdf&uspro
p=cancreate&formatversion=2&errorformat=html&errorsuselocal=true&uselang=en.

We could see that the request is for API, not for the main page. In this case the account will not be
created.

The next request uses method POST with Status Code 200.With this request we have body with
information.

We have information about: server, cache, cookie, user-agent, path, scheme, form data (username,
password ,email).

 create a new user by providing valid data in the registration fields

In this case we have Request URL:

https://en.wikipedia.org/w/index.php?title=Special:CreateAccount&returnto=Main+Page

We don t have request to API, we have instead request to the Main Page.
Request method is POST, Status Code 302.
The information is transmitted in body .After arrived to server, here are generated the user and pass
word. A session is associated that creates a token .With token it can be accessed that information.
For each login the token is used but with different values.