Application Layer Introduction; HTTP; FTP

Tom Kelliher, CS 325

Feb. 6, 2008

Administrivia

Announcements

Assignment

Read 2.4-2.6.

From Last Time

Packet-switched network characteristics; protocol layers and models.

Outline

  1. Introduction to the application layer.

  2. HTTP protocol.

  3. FTP protocol.

Coming Up

SMTP, DNS, and P2P.

Application Layer Introduction

Internet applications have an abstract Internet view:

\begin{figure}\centering\includegraphics[width=4in]{Figures/fig02_01.eps}\end{figure}

Internet Application Architectures

The Internet has an architecture; so do applications.

  1. Client-Server architecture

    \begin{figure}\centering\includegraphics[width=3in]{Figures/fig02_02CS.eps}\end{figure}

    1. Well-defined roles.

    2. Infrastructure intensive -- server farms. Expensive.

    3. ``Always on''

    4. Hierarchical, centralized (ironic) -- scalability problems, isolation vulnerabilities.

    5. Examples: Google, Amazon, etc.

  2. Peer-To-Peer Architecture

    \begin{figure}\centering\includegraphics[width=3in]{Figures/fig02_02P2P.eps}\end{figure}

    1. Roles not so well-defined.

    2. Not infrastructure intensive. Cheap.

    3. ``Sometimes on.''

    4. Flat, decentralized -- scales well, less vulnerable.

    5. May have some centralization features.

    6. Examples: BitTorrent, LimeWire, Skype.

Process Communication

  1. Request messages (from client), response messages (from server).

  2. The Transport Layer provides the socket API:

    \begin{figure}\centering\includegraphics[width=5in]{Figures/fig02_03.eps}\end{figure}

Transport Service Properties

Two key Transport Layer protocols:

  1. TCP is a connection-oriented service with reliable data transfer.

    The connection must be established before messages can be sent.

    Uses congestion control.

  2. UDP is a connectionless service with no data transfer reliability -- packets can be lost, arrive out of order, or be duplicated.

    Just ``throw'' messages out there.

    No congestion control.

Properties:

  1. Reliable data transfer (TCP, not UDP).

  2. Throughput (neither has any guarantees).

  3. Latency (neither has any guarantees).

    UDP has less overhead, an advantage.

  4. Security (neither has security built in).

    Layer SSL over TCP for security.

Streaming media uses buffering to mitigate some of these problems.

Realtime applications may use UDP to reduce latency.

Service access:

  1. By IP address, port number.

  2. A service on a host ``listens'' for service requests at a ``well-known address'' -- its service port.

    Example ports: 13, daytime (TCP and UDP); 20, ftp data; 21, ftp control; 25, SMTP; 80, HTTP; 443, HTTPS.

Properties of various network applications:

\begin{figure}\centering\includegraphics[]{Figures/fig02_04.eps}\end{figure}

Protocol use of various network applications:

\begin{figure}\centering\includegraphics[]{Figures/fig02_05.eps}\end{figure}

HTTP Protocol

  1. HTTP uses client-server architecture:

    \begin{figure}\centering\includegraphics[width=4in]{Figures/fig02_06.eps}\end{figure}

  2. HTTP is stateless.

  3. A single web page can contain several objects. How do we minimize load time?

    Persistent and non-persistent TCP connections. Multiple, parallel TCP connections.

    \begin{figure}\centering\includegraphics[width=5in]{Figures/fig02_07.eps}\end{figure}

  4. HTTP client methods: GET, HEAD, PUT, POST, DELETE.

    HTTP client request format:

    \begin{figure}\centering\includegraphics[]{Figures/fig02_08.eps}\end{figure}

  5. HTTP server response format:

    \begin{figure}\centering\includegraphics[]{Figures/fig02_09.eps}\end{figure}

  6. Example exchange:
    bluebird:~
    % telnet phoenix http
    Trying 10.32.3.39...
    Connected to phoenix.
    Escape character is '^]'.
    GET / HTTP/1.1
    Host: phoenix.goucher.edu
    
    HTTP/1.1 200 OK
    Date: Sun, 03 Feb 2008 20:40:29 GMT
    Server: Apache/2.0.52 (Red Hat)
    Accept-Ranges: bytes
    Cache-Control: max-age=3600
    Expires: Sun, 03 Feb 2008 21:40:29 GMT
    Transfer-Encoding: chunked
    Content-Type: text/html; charset=ISO-8859-1
    
    19f
    <HTML>
    <HEAD>
    <TITLE>Welcome to Phoenix!</TITLE>
    ...
    </BODY>
    </HTML>
    
    0
    
    Connection closed by foreign host.
    

  7. Cookies allow association with state information:

    \begin{figure}\centering\includegraphics[]{Figures/fig02_10.eps}\end{figure}

    This provides a single- or multi-session layer on top of stateless HTTP.

  8. Proxy servers can be used to lessen congestion at a bottleneck:

    \begin{figure}\centering\includegraphics[width=4in]{Figures/fig02_13.eps}\end{figure}

    Client browsers are configured to send all requests to the proxy, which caches web objects. The proxy makes the real requests, on behalf of the clients.

FTP Protocol

HTTP and FTP are both basically file transfer protocols. What are the differences?

  1. FTP elements:

    \begin{figure}\centering\includegraphics[width=5in]{Figures/fig02_14.eps}\end{figure}

  2. FTP uses out-of-band control signaling:

    \begin{figure}\centering\includegraphics[width=5in]{Figures/fig02_15.eps}\end{figure}

  3. FTP retains session state information: login, current directory, idle time.

    More overhead because of statefullness

  4. ASCII and binary data transfers.

  5. Transfer modes:
    1. Active: client opens a random data port, sends port number to server over control connection, which connects to client at given port (role reversal).

      Problems result if there's a firewall at the client.

    2. Passive: server opens a random data port, sends port number to client over control connection, which connects to server at given port number.



Thomas P. Kelliher 2008-02-03
Tom Kelliher