Application Layer Is an End-to-End Layer

A network application consists of programs running on different end systems that communicate by exchanging messages.

For example:

  • A YouTube client communicating with YouTube’s servers
  • Two peers exchanging pieces of a file
  • An e-mail client communicating with a mail server

The fundamental design process is:

  1. Choose an application architecture.
  2. Decide which processes communicate.
  3. Give each process an address.
  4. Define the messages they exchange.
  5. Choose TCP or UDP and access it through sockets.

Process

Process: program running within a host

  • within the same host, two processes communicate using inter-proces communication (defined by OS).
  • processes in different hosts communicate by exchanging messages.

Client Process

  • process that initiates communication.
  • may have dynamic IP addresses
    Server Process:
  • process that waits to be contacted.
  • usually permanent IP address

Addressing Processes

A process endpoint is identified using:

IP address + port number

The IP address selects the host. The port number selects the appropriate process or socket on that host:

Sockets: the application’s door to the network

A socket is the interface between an application process and the transport layer.

Thus, every exchange involves at least two sockets:

This provides interface between client and server.

Application Layer Procotols define:

  • Type of messages exchanged
    • e.g, request, response
  • Message Syntax
    • What fields in messages & how fields are structured
  • Message semantics
    • Meaning of information in fields
  • Rules for how processes send & respond to messages.

What service do we need from transport layer?

  • Reliable data transfer
    • Some apps require 100% reliability
    • Some apps can tolerate loss
  • Timing
    • Some apps require low delay to be effective
  • Throughput
    • Some apps require minimum amount of throughput to be effective
      • e.g. voice call
    • Some apps (elastic) make use of whatever throughput they get
      • e.g. file upload
  • Security
    • Encryption, data integrity, etc.

Requirement example of common applications

ApplicationData LossThroughoutTime sensitive?
File transferNo losselasticNo
EmailNo losselasticNo
Real-time audio/videoLoss-tolerantaudio: 5Kbps - 1Mbps
video: 10Kbps - 5Mbps
yes, 10’s msec
Interactive gamesLoss-tolerantKbps+yes, 10’s msec

Socket Programming

There are two socket types for transport layer services:

  • TCP: reliable, byte stream-oriented
  • UDP: unreliable datagram
ApplicationApplication-layer protocolTransport
File transferFTPTCP
E-mailSMTPTCP
Web documentsHTTP/1.1TCP
Internet telephonySIP, RTP, or proprietary protocolsTCP or UDP
Streaming audio/videoHTTP, DASHUDP or TCP
Interactive gamesProprietary game protocolsUDP or TCP

A project is done on socket programming: Socket Programming
More details are in 01-Transport Layer (UDP) Overview