Slide 2 - Application Flashcards

1
Q

Internet Protocol Stack

A
  • Application
  • Transport
  • Network
  • Link
  • Physical
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How many addresses has an IPV4 address ?

A

It has 32 bits and so 2^32 = 4294967296

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is needed to send or receive a message ?

A

An IP address (IPV4 or IPV6) and a port number

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the Application Layer demands from the Transport Layer Services ?

A
  • Data integrity;
  • Throughput (some apps, e.g. multimedia, require a minimum amount of Throughput to be “effective”);
  • Security;
  • Timing;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Characteristics of the TCP service:

A
  • Connection-oriented: setup required;
  • Reliable transport between the sending and receiving process;
  • Flow control: the sender won’t overwhelm the receiver;
  • Congestion control: control transmission speed when network overloaded;

DOES NOT PROVIDE:
- Timing, minimum throughput or security.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Security in TCP

A

Vanilla TCP (& UDP) just send the cleartext passwords through the internet. The TLS (Transport Layer Security) is needed providing encryption, data integrity and end-point authentication.

If implemented in application layer, the apps use TLS libraries.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Client-Server Architecture

A

Server:
- Always-on host;
Client:
- Uses the IP address and port number to communicate.
- May be intermittently connected;
- Do not communicate directly with each other.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does TCP provide ?

A

TCP provides a reliable, in-order transfer of bytes (“pipe”) between client and server.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does UDP provide ?

A

UDP provides unreliable transfer of groups of bytes (“datagrams”) between client and server.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Characteristics of TCP:

A
  • read() and write();
  • Byte stream (and no byte is lost);
  • Bytes read with read() may correspond to several write();
  • Bytes written with write() may need to be read with several read();
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Characteristics of UDP:

A
  • sendto() and recvfrom();
  • Preserves boundary between messages.
  • Each message read with recvfrom() corresponds to a single one sendto();
  • A message may be lost.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

HTTP Overview

A
  • HTTP is “stateless”, so the server maintains no information about past client requests.
  • Uses TCP, by default using port 80.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a Web Page?

A

A Web page consists of objects:
- HTML file;
- JPEG images;
- Audio files, …
It has a base object ( HTML file), in which it may reference the other objects.
Each object is addressable by a URL (Uniform Resource Locator).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Types of HTTP connections

A
  • Non-persistent HTTP or HTTP/1.0.
  • Persistent HTTP or HTTP/1.1.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the Non-persistent HTTP ?

A

Non-Persistent HTTP or HTTP/1.0 can :
- At most one object is sent over a TCP connection;
- Browsers can open parallel connections (typically 5-10).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is Persistent HTTP ?

A

Persistent HTTP or HTTP/1.1. can :
- Multiple objects can be sent over a single TCP connection;
- When using pipelining a browser can send requests as soon as it identifies them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is the response time in Non-persistent HTTP ?

A

RTT (round trip time):
- time for a small packet to travel from client to server and back.
Response time:
- One RTT to initiate TCP connection;
- One RTT for HTTP request and first few bytes of HTTP response to return;
- File transmission time.
Total = 2 X RTT + transmission time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What are the issues of Non-persistent HTTP ?

A
  • Requires 2 RTTs per object;
  • OS overhead for each TCP connection (e.g. allocate buffers and variables);
  • Browsers often open parallel TCP connections to fetch referenced objects.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is the response time in Persistent HTTP ?

A
  • Server leaves the connection open after sending response;
  • Subsequent HTTP messages between same client/server are sent over the open connection (requiring 1 RTT per each object after the first);
  • With PIPELINING: client sends requests as soon as it encounters a referenced object - as little as ONE RTT for all referenced objects.
20
Q

HTTP request message:

A
  • Uses ASCII (human-readable format)
    [request line] (GET, POST, HEAD)
    GET /somedir/page.html HTTP/1.1
    ——————————————-
    [header]
    Host: www.someschool.edu
    User-agent: Mozilla/4.0
    Connection: close
    Accept-language: fr
    ——————————————-
    [message body]
21
Q

HTTP Response Message

A

[status line]
НТTP/1.1 200 OK
——————————————-
[header]
Connection close
Date: Thu, 08 Aug 2019 12:00:15 GMT
Server: Apache/1.3.0 (Unix)
Last-Modified: Mon, 24 Jun 2019 ……
Content-Length: 6821
Content-Type: text/html
——————————————-
data data data data data …

22
Q

HTTP Response: Status Line Codes

A

200 - OK
301 - Moved Permanently
304 - Not Modified
400 - Bad Request [Req. not understood by the server]
404 - Not Found
505 - HTTP Version Not Supported

23
Q

What’s the goal of the Conditional GET

A

Its goal its not to send objects if the cache already has a up-to-date version.
Client: specify date of cached copy in HTTP request header:
If-modified-since: <date>
Server: response contains no object if cached copy is up-to-date:
HTTP/1.0 304 Not Modified</date>

24
Q

What is the purpose of cookies ?

A

Cookies are useful to maintain some state between transactions. When visiting a site for the first time the server will give the client a cookie number identifying him for future requests.
Cookies permit sites to learn a lot about you, it may supply your name and email to sites.

25
Q

What is the purpose of a Proxy Server ?

A

The goal is to satisfy the client request without involving the origin server.
- User sets browser to access the Web via a cache;
- Browser sends all the HTTP requests to the cache:
- If the object is in cache, return it;
- If not the then the proxy requests it to the origin and then returns it to the client.

26
Q

What’s the goal of Web Caching ?

A
  • Reduce response time for client request;
  • Reduce traffic on institutions’s access link;
  • Internet dense with caches: enables “poor” content providers to effectively deliver content.
27
Q

Characteristics of HTTP/2

A
  • Reduce latency by enabling full request and response multiplexing;
  • Minimize protocol overhead with compression;
  • Add support for request priorization;
  • Add server push;

IT IS NOT BACKWARD COMPATIBLE WITH PREVIOUS HTTP/1.X

28
Q

HTTP/2: Mitigating HOL blocking

A

HTTP/2 divides the objects into smaller frames, and transmit them interleaved.
Bigger objects will be slightly delayed however it is worth it because the smaller objects will be delivered quickly.

29
Q

Characteristics of HTTP/3

A

Adds security, per-object error and congestion control.
Unlike the previous versions it doesn’t work on top of TCP, it now uses UDP with QUIC by Google because it adds mechanisms to provide reliability to UDP.

30
Q

Electronic Mail

A
  • Uses TCP to transfer messages between SMTP servers;
  • Well-known port 25;
  • Three phases of transfer:
    [Handshaking (“greeting”), Transfer of messages and Closure]
  • Messages MUST be in 7-bit ASCII.
31
Q

SMTP Message Format

A
  • Envelope [ with sender and destiny email];
  • Message:
    - Header with the names, date and subject;
    - Body with the data.
32
Q

SMTP MIME

A

Multimedia mail extension, to convert non ascii into 7-bit ascii that can be used by the TCP servers.

33
Q

What is the objective of DNS ?

A

DNS stands for Domain Name System, and it is used to map hostnames to IP addresses.

34
Q

Characteristics of DNS

A
  • Distributed database implemented in hierarchy of name servers;
  • It is an application-layer protocol, hosts, routers, name servers communicate to resolve names.
35
Q

Why not centralize DNS ?

A
  • Single point of failure;
  • Traffic volume;
  • Distant centralised database;
  • Maintenance issues.
36
Q

The hierarchy of DNS

A

Root Level: Root DNS Servers
Top Level [TLD]: “.com”, “.pt” , … servers;
Authoritative Level: ulisboa.pt or google.com

37
Q

Steps to get IP address from www.amazon.com ?

A
  1. client queries root DNS server to find .com DNS server
  2. client queries .com TLD DNS server to get amazon.com authoritative DNS server
  3. client queries amazon.com authoritative DNS server to get IP address for www.amazon.com
38
Q

What is the Local Name Server in DNS ?

A
  • Each ISP has one, also called default name server;
  • When host makes DNS query, query is sent to its local DNS server acting as a proxy and forwarding it into the hierarchy.
    Does NOT strictly belong to the hierarchy.
39
Q

What is the Iterated query?

A

Contacted server replies with name of server to contact like “I don’t know the name, but ask this server”.

40
Q

What is the Recursive query?

A

Puts the burden of name resolution on the contacted server.

41
Q

How does DNS Caching mapping works ?

A

Once (any) name server learns a mapping, it caches that mapping.
Cache entries timeout after some time (typically 2 days).
TLD servers are typically in local name servers so the root name servers are not so often visited.

42
Q

DNS Records

A

RR format : (name, value, type, timeToLive)
- Type = A
name is hostname, value is IP address
- Type = NS
name is domain (foo.com), value is hostname of authoritative server for this domain.
- Type = CNAME
name is alias name for some canonical name, with value being the canonical.
- Type = MX
value is name of mail server associated with name.

43
Q

DNS Protocol messages format

A

Message header with:
- Identification, 16 bit number identifying the query (its response uses the same number);
- Flags like e.g. (query or reply, recursion desired, recursion available, reply is authoritative)

44
Q

Dynamic DNS

A

Allows a domain name to point to a PC whose IP address changes.
Helpful to run servers at home.

45
Q

DNS Security

A

DDoS attacks consist in bombarding root servers or TLD servers with traffic.
Spoofing attacks consist in intercepting DNS queries returning bogus replies [DNS cache poisoning].

46
Q

File Distribution Time: P2P Formula

A
  • Server must send one copy:
    - F/u_server time
  • Client i takes F/d_each; time to download;
  • NF bits must be downloaded (aggregate);
  • Fastest possible upload rate: u_server + sum[u_each];
    Tpp = max {F/Us, F/min(d_each), (N x F)/(u, + sum[u_each])}