application layer Flashcards
Examples of network applications
- web navigation
- text messaging
- remote login
- P2P file sharing
- multi-user gaming
- video streaming
- voice over IP
- video conferencing
- social networking
- dating apps
- weather forecasting
- …
How to create a network app?
- write programs (C, Java, Python, …) that:
- run on (different) end systems
- communicate over network
- No need to write software for network-core devices (network-core devices (routers, switches) do not run user applications).
- application’s architecture (costomizable by app developer) is distinctly different from the network architecture (fixed for app developer)
2 types of app
- Client-server architecture:
An always-on end device (server), which responds to the requests of other end devices (clients).
Clients do not communicate between each other directly.
a single server isn’t enough we use data centers ( = a virtual server composed of multiple physical servers) - Peer-to-peer (P2P) architecture:
direct communication between pairs of intermittently connected hosts, called peers.
peers are not owned by the service provider, but devices controlled by users.
each peer adds service capacity to the system. (pro = scalability, con = security, performances and reliability) - hybrid architectures
what is a process
a program that is running within an end system (an app consists of different processes)
how do processes communicate
exchanging messages across the network
process can be… (2 types)
- process that initiates the communication = client
- process that waits to be contacted to begin the session = server
what is a socket
- it’s a software interface through which a process sends messages into the network and receive them.
- They are the interfaces between the application layer and the transport layer.
- they are also referred to as the Application Programming Interface (API).
- app developer can choose the transport layer protocol in the socket transport-layer side
how does a process willing to send packets to another process can identify it?
- IP address (=address of the host)
- destination port number
transport layer protocols
- TCP (connection oriented, reliable, glow and congestion control, no guarantees on timing, throughput, security)
- UDP (connectionless, unreliable, no guarantees on reliability, flow control, timing, throughput, security, connection setup)
what is a web page
- consists of a main base HTML which includes several objects
- objects = HTML file, jpeg, audio file, hyperlinks,…
- each object is addressable by a URL ( = Uniform Resource Locator)
application-layer protocol
- HTTP = HyperText Transfer Protocol
- it’s implemented in two programs: a client program and a server program.
- defines how Web clients request Web pages from Web servers and how servers transfer Web pages to clients
- uses TCP as its underlying transport protocol
different types of HTTp connections
- persistent (Multiple objects can be sent over a single TCP connection)
- non persistent (At most one object over a single TCP connection, multiple connections to download multiple objects)
HTTP request
- it’s ASCII encoded (human readable)
- it’s a GETrequest
composed of: - request line
- header lines
- blank line
- entity body
HTTP statuse codes
1xx: information
2xx: success
3xx: redirection (correct request but redirected to another server)
4xx: client error (wrong request)
5xx: server error (internal server failures)
error 3 vuol dire che un sito ha cambiato server quindi io apro sito vecchio e
solitamente nell’entity body ho il link per il nuovo server
HTTP is stateless so how app can identify users
using cookies
- Cookie is a way to introduce user memory into a stateless protocol
cookies components:
(1) a cookie header line in the HTTP response message;
(2) a cookie header line in the HTTP request message;
(3) a cookie file kept on the user’s end system and
managed by the user’s browser;
(4) a back-end database at the Web site.