CMPT 371 - Application Layer

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/22

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 10:12 PM on 9/17/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

23 Terms

1
New cards

App design: client-server model

Server:

  • always-on host, with permanent IP address

  • often in data centers, for scaling


Clients:

  • contact, communicate with server; may be intermittently connected

  • may have dynamic IP addresses

  • do not communicate directly with each other

  • ex. HTTP, IMAP, FTP


<p>Server:</p><ul><li><p>always-on host, with permanent IP address</p></li><li><p>often in data centers, for scaling</p></li></ul><p></p><p>Clients:</p><ul><li><p>contact, communicate with server; may be intermittently connected</p></li><li><p>may have dynamic IP addresses</p></li><li><p>do not communicate directly with each other</p></li><li><p>ex. HTTP, IMAP, FTP</p></li></ul><p></p>
2
New cards

App design: peer-to-peer model

  • no always-on server; end systems directly communicate

  • peers request service from other peers, provide service in return to other peers

  • peers are intermittently connected and change IP addresses

    • complex managmenet

ex. P2P file sharing (BitTorrent)


3
New cards

TCP (Transmission Control Protocol)

Reliable transport protocol between sending and receiving (guarantees delivery)

  • flow control: sender won’t overwhelm receiver

  • congestion control: throttle sender when network overloaded

  • connection-oriented: setup required between client & server processes

  • DOES NOT PROVIDE: timing, minimum throughput guarantee, security


4
New cards

UDP (User Datagram Protocol)

Simple transport protocol that doesn’t not guarantee delivery

  • unreliable data transfer: between sending and receiving process

  • DOES NOT PROVIDE: reliability, flow control, congestion control, timing, throughput guarantee, security, or connection setup

  • however, is much speedier than TCP


5
New cards

process

program running on a host

  • within same host, two processes communicate using inter-process communication (defined by OS)

  • across different hosts, processes communicate by exchanging messages


6
New cards

client process / server process

client process: process that initiates communication

server process: process that waits to be contacted

7
New cards

socket

process sends/receives messages to/from its socket

socket is analogous to a door:

  • sending process shoves message out door

  • sending process relies on transport infrastructure on other side of door to deliver message to socket at receiving process

  • two sockets involved: one on each side


<p><strong>process sends/receives messages to/from its socket</strong></p><p>socket is analogous to a door:</p><ul><li><p>sending process shoves message out door</p></li><li><p>sending process relies on transport infrastructure on other side of door to deliver message to socket at receiving process</p></li><li><p>two sockets involved: one on each side</p></li></ul><p></p>
8
New cards

identifier (process)

to receive messages, a process must have an identifier

  • we use port numbers and IP addresses to identify processes

  • IP address alone is insufficient to identify as many processes run on the same host

  • example port numbers: HTTP server: 80, Mail server: 25


9
New cards

HTTP: Hypertext Transfer Protocol

The Web’s application layer protocol

  • eg. client sends HTTP server a request “Get me this image”

    • server sends HTTP response with the image


<p>The Web’s application layer protocol</p><ul><li><p>eg. client sends HTTP server a request “Get me this image”</p><ul><li><p>server sends HTTP response with the image</p></li></ul></li></ul><p></p>
10
New cards

How does HTTP use TCP (what is the process)?

  • client initiates TCP connection (socket) to server, on port 80 (standard port)

  • server accepts TCP connection from client

  • HTTP messages exchanged between browser (HTTP client) and Web server (HTTP server)

  • After they are done, the connection is then closed


11
New cards

HTTP is stateless; what does this mean?

The server maintains no information about past client requests

  • aside: protocols that maintain “state” are very complex!

    • past history must be maintained, client/server can have inconsistent views of “states”


12
New cards

HTTP connection: Non-persistent HTTP (old)

  1. TCP connection opened

  2. at most one object sent over TCP connection

  3. TCP connection closed


  • downloading multiple objects required multiple connections


13
New cards

HTTP connection: Persistent HTTP 1.1

  1. TCP connection opened

  2. Multiple objects can be sent over a single TCP connection between client, and that server

  3. TCP connection closed


14
New cards

HTTP request message: structure

  • ASCII (human-readable format)

  • (blocked portion): carriage return, line feed at start of line indicates end of header lines


<ul><li><p>ASCII (human-readable format)</p></li><li><p>(blocked portion): carriage return, line feed at start of line indicates end of header lines</p></li></ul><p></p>
15
New cards

HTTP request message: general format

knowt flashcard image
16
New cards

HTTP response message: structure

knowt flashcard image
17
New cards

HTTP response status codes

  • status code appears in 1st line in server-to-client response message


<ul><li><p>status code appears in 1st line in server-to-client response message</p></li></ul><p></p>
18
New cards

Cookies (maintaining user/server state)

cookies are a way for the server to remember state


<p>cookies are a way for the server to remember state</p><p></p>
19
New cards

Web caches

Goal: satisy client requests without involving origin server

  • user configures browser to point to a (local) Web cache

  • browser sends all HTTP requests to cache:

    • if object in cache: cache returns object toclient

    • else cache requests object from origin server, caches receives object, then returns object to client


<p>Goal: satisy client requests without involving origin server</p><ul><li><p>user configures browser to point to a (local) Web cache</p></li><li><p>browser sends all HTTP requests to cache:</p><ul><li><p>if object in cache: cache returns object toclient</p></li><li><p>else cache requests object from origin server, caches receives object, then returns object to client</p></li></ul></li></ul><p></p>
20
New cards

Why should we use a web cache (aka proxy server)?

  • reduce response time for client request

    • cache is closer to client

  • reduce traffic on an institution’s access link

  • Internet is dense with caches

    • enables “poor” content providers to more effectively deliver content


  • also: server explicitly tells cache whether to store the object in cache or not through the header lines (see photo)


<ul><li><p>reduce response time for client request</p><ul><li><p>cache is closer to client</p></li></ul></li><li><p>reduce traffic on an institution’s access link</p></li><li><p>Internet is dense with caches</p><ul><li><p>enables “poor” content providers to more effectively deliver content</p></li></ul></li></ul><p></p><ul><li><p>also: server explicitly tells cache whether to store the object in cache or not through the header lines (see photo)</p></li></ul><p></p>
21
New cards

Caching example

  • 2 options to resolve this issue:

    • 1. buy a faster access link (expensive!)

    • 2. install a web cache (cheap!)


<ul><li><p>2 options to resolve this issue:</p><ul><li><p>1. buy a faster access link (expensive!)</p></li><li><p>2. install a web cache (cheap!)</p></li></ul></li></ul><p></p>
22
New cards

Caching example: option 2 (how to calculate access link utilization, end-end delay with cache)

knowt flashcard image
23
New cards