Internet Protocol Stack
How many addresses has an IPV4 address ?
It has 32 bits and so 2^32 = 4294967296
What is needed to send or receive a message ?
An IP address (IPV4 or IPV6) and a port number
What does the Application Layer demands from the Transport Layer Services ?
Characteristics of the TCP service:
DOES NOT PROVIDE:
- Timing, minimum throughput or security.
Security in TCP
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.
Client-Server Architecture
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.
What does TCP provide ?
TCP provides a reliable, in-order transfer of bytes (“pipe”) between client and server.
What does UDP provide ?
UDP provides unreliable transfer of groups of bytes (“datagrams”) between client and server.
Characteristics of TCP:
Characteristics of UDP:
HTTP Overview
What is a Web Page?
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).
Types of HTTP connections
What is the Non-persistent HTTP ?
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).
What is Persistent HTTP ?
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.
What is the response time in Non-persistent HTTP ?
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.
What are the issues of Non-persistent HTTP ?
What is the response time in Persistent HTTP ?
HTTP request message:
HTTP Response Message
[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 …
HTTP Response: Status Line Codes
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
What’s the goal of the Conditional GET
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>
What is the purpose of cookies ?
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.