Computer Networks
Computer Networks
user applications
• applications on end systems
allows for rapid app
development, propagation
Application architectures
clients:
• communicate with server
• may be intermittently connected
• may have dynamic IP addresses
• do not communicate directly
with each other
P2P architecture
• no always-on server
• arbitrary end systems directly
communicate
• peers request service from
other peers, provide service in
return to other peers
– self scalability – new
peers bring new service
capacity, as well as new
service demands
• peers are intermittently
connected and change IP
addresses
– complex management
Processes communicating
process: program running within a host
• within same host, two processes communicate using
inter-process communication (defined by OS)
• processes in different hosts communicate by
exchanging messages
client process: process that initiates communication
server process: process that waits to be contacted
• A side: applications with P2P architectures have
client processes & server processes
Sockets
• Process sends/receives messages to/from its socket
• socket analogous to 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
Addressing processes
• to receive messages, process must have identifier
• host device has unique 32-bit IP address
• Q: does IP address of host on which process runs suffice for
identifying the process?
• A: no, many processes can be running on same host
• identifier includes both IP address and port numbers
associated with process on host.
• example port numbers:
– HTTP server: 80
– mail server: 25
• to send HTTP message to gaia.cs.umass.edu web server:
– IP address: 128.119.245.12
– port number: 80
App-layer protocol defines
• types of messages exchanged,
– e.g., request, response
• message syntax:
– what fields in messages & how fields are delineated
• message semantics
– meaning of information in fields
• rules for when and how processes send & respond to messages
• open protocols:
• defined in RFCs
• allows for interoperability
• e.g., HTTP, SMTP
• proprietary protocols:
• e.g., Skype
What transport service does an app need?
data integrity
• some apps (e.g., file transfer, web transactions) require 100%
reliable data transfer
• other apps (e.g., audio) can tolerate some loss
timing
• some apps (e.g., Internet telephony, interactive games) require
low delay to be “effective”
throughput
• some apps (e.g., multimedia) require minimum
amount of throughput to be “effective”
• other apps (“elastic apps”) make use of whatever
throughput they get
security
• encryption, data integrity,
Web and HTTP
First, a review…
• web page consists of objects
• object can be HTML file, JPEG image, Java applet,
audio file,…
• web page consists of base HTML-file which includes
several referenced objects
• each object is addressable by a URL, e.g.,
www.someschool.edu/someDept/pic.gif
HTTP is “stateless”
• server maintains no information about past client requests
• protocols that maintain “state” are complex!
• past history (state) must be maintained
• if server/client crashes, their views of “state” may be
inconsistent, must be reconciled
HTTP connections
non-persistent HTTP
• at most one object sent over TCP connection
– connection then closed
• downloading multiple objects required
multiple connections
persistent HTTP
• multiple objects can be sent over single TCP
connection between client, server
Non-persistent HTTP
Non-persistent HTTP: response time
RTT (definition): time for a small
packet to travel from client to
server and back
HTTP response time:
• one RTT to initiate TCP
connection
• one RTT for HTTP request and
first few bytes of HTTP
response to return
• file transmission time
• non-persistent HTTP response
time =
2RTT+ file transmission
time
Persistent HTTP
non-persistent HTTP issues:
• requires 2 RTTs per object
• OS overhead for each TCP connection
• browsers often open parallel TCP connections to fetch
referenced objects
persistent HTTP:
• server leaves connection open after sending response
• subsequent HTTP messages between same client/server sent
over open connection
• client sends requests as soon as it encounters a referenced
object
• as little as one RTT for all the referenced objects
Uploading form input
POST method:
• web page often includes form input
• input is uploaded to server in entity body
URL method:
• uses GET method
• input is uploaded in URL field of request line:
Method types
HTTP/1.0:
• GET
• POST
• HEAD
– asks server to leave requested object out of response
HTTP/1.1:
• GET, POST, HEAD
• PUT
– uploads file in entity body to path specified in URL field
• DELETE
– deletes file specified in the URL field