2: Application Layer Flashcards
how do the client-server and p2p architectures differ?
C-S
server is an always on host, with a permanent IP address. data centers are used to scale
clients comm. with server, intermittent connections. have dynamic ip addresses and dont communicate directly with each other
P2P
no always on server
arbitrary end systems comm. with each other
peers
self scalable - more peers bring more capability
peers are intermittenly connected and change IP addresses - complex management!
how is a process addressed?
combination of port no and ip address. some are standardised like HTTP server 80 and mail server 25
what does the app layer protocol define?
the type of message e.g. request response
message sytnax
message semantics
rules for when and how processes send and respond
how does tcp differ to udp
tcp has reliable transport flow control congestion control connection oriented but doesnt provide timing, min throughput guarantee or security
how do we secure TCP?
using SSL, which provides an encrypted TCP connection, data integrity and end-point authentication.
SSL is at app layer, apps use SSL libraries that talk to TCP.
what transport protocol does HTTP use?
TCP
HTTP is stateful/stateless? why is this good?
stateless. stateful protocols are complex. if a client or server crashes, their view of state may be inconsistent
how is non-persistent HTTP different to persistent HTTP?
in non-p http
client initiates tcp connection, server accepts
client sents http request, server responds
server closes tcp connection
repeated for each object on the url
the response time is 2RTT (one for initiate one for request) + file transmission time
requires overhead for each tcp connection. browsers will often often parallel connections
in p http the server leaves the connection open after sending its response, subsequent messages use the same connection
what are the HTTP status codes?
200 ok 300 moved, new location specified later 400 bad request - didnt understnad 404 not found 505 http version not supported
how can we emulate state in HTTP
using cookies! cookies identifier stored on users browser and cookies themselves stored in backend db to allow a cookie-specific state
can be used for authorization, carts, recommendations
what is the function of a web cache? why?
to satisfy client requests without involving thje origin server. requests are made to the cache instead and if the object is there then its returned, else fetches it from origin. cache acts as a client and a server. usually installed by an ISP.
why?
reduces response time for client request
reduces traffic on the access link
how can HTTP levrage caches?
using conditional get, only get from server if its been updated
what are the 3 components of email? what are the steps?
user agents: outlook etc
mail servers: contains mailboxes for users, message queues.
SMTP simple mail transfer protocol
uses tcp
user agent to mail server open tcp with recipeint server to server to user agent
how is DNS structured? give example about how amazon.com might be accessed
a distributed database in a hierachy of many name servers
client queiries root server to find com DNS server
clien then queiries com DNS to get amazon DNS server
client queries amazon DNS to get ip for amamazon.com
what are TLD and authoratitive DNS servers, and local DNS?
TLD - top level domain
responsible for com, org, net, edu, aero, jobs, museums, and all top-level
country domains, e.g.: uk, fr, ca, jp
authoritative DNS servers: • organisation’ s own DNS server(s), providing authoritative hostname to IP mappings for organisation’ s named hosts
Local DNS name server
• does not strictly belong to hierarchy
• each ISP (residential ISP, company, university) has one
• also called “default name server”
• when host makes DNS query, query is sent to its local DNS
server
• has local cache of recent name-to-address translation pairs (but may
be out of date!)
• acts as proxy, forwards query into hierarchy