2/5/20 1 COMP 3825 Networking and Information Assurance Network Applications: Principles, Web and Http 1 COMP 3825 - Kan Yang 1 Some network apps 2 COMP 3825 - Kan Yang 2 Learning Objectives Principles of Network Applications 1. Application Architecture 2. Transport Service Requirements 3. Process Communicating and Addressing Network Application: Web and Http 1. Web and Http 2. How browser renders a page 3. Cookies 3 COMP 3825 - Kan Yang 3 Creating a network app write programs that: • run on (different) end systems • communicate over network • e.g., web server software communicates with browser software no need to write software for network-core devices • network-core devices do not run user applications • applications on end systems allows for rapid app development, propagation application transport network data link physical application transport network data link physical application transport network data link physical 4 COMP 3825 - Kan Yang 4
11
Embed
COMP 3825 Networking and Information Assurancekanyang/COMP3825/Lecture 5 Network Appli… · Network Application: Web and Http 1.Web and Http 2.How browser renders a page 3.Cookies
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
2/5/20
1
COMP 3825 Networking and Information Assurance
Network Applications: Principles, Web and Http
1COMP 3825 - Kan Yang
1
Some network apps
2COMP 3825 - Kan Yang
2
Learning Objectives
Principles of Network Applications1. Application Architecture2. Transport Service Requirements3. Process Communicating and Addressing
Network Application: Web and Http1. Web and Http2. How browser renders a page3. Cookies
3COMP 3825 - Kan Yang
3
Creating a network appwrite programs that:• run on (different) end systems• communicate over network• e.g., web server software communicates with
browser software
no need to write software for network-core devices• network-core devices do not run user
applications • applications on end systems allows for rapid app
Client-server architectureserver: • always-on host• permanent IP address• data centers for scaling
clients:• communicate with server• may be intermittently connected• may have dynamic IP addresses• do not communicate directly with each otherclient/server
Examples: – Web and Http– Email – DNS
This Lecture
Lecture 6
2-6COMP 3825 - Kan Yang
6
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
• Example: BitTorrent
peer-peer
2-7COMP 3825 - Kan Yang
7
tracker: tracks peers participating in torrent
torrent: group of peers exchanging chunks of a file
Alice arrives …
§ file divided into 256Kb chunks§ peers in torrent send/receive file chunks
… obtains listof peers from tracker… and begins exchanging file chunks with peers in torrent
P2P file distribution: BitTorrent
8COMP 3825 - Kan Yang
8
2/5/20
3
§ peer joining torrent: – has no chunks, but will accumulate them over time from other peers– registers with tracker to get list of peers, connects to subset of peers
(“neighbors”)
§ while downloading, peer uploads chunks to other peers§ peer may change peers with whom it exchanges chunks§ churn: peers may come and go§ once peer has entire file, it may (selfishly) leave or
(altruistically) remain in torrent
P2P file distribution: BitTorrent
9COMP 3825 - Kan Yang
9
BitTorrent: requesting, sending file chunks
requesting chunks:§ at any given time, different peers have different subsets of file chunks§ periodically, Alice asks each peer for list of chunks that they have§ Alice requests missing chunks from peers, rarest first
sending chunks: tit-for-tat§ Alice sends chunks to those four peers currently sending her chunks at highest rate
• other peers are choked by Alice (do not receive chunks from her)• re-evaluate top 4 every10 secs
§ every 30 secs: randomly select another peer, starts sending chunks• “optimistically unchoke” this peer• newly chosen peer may join top 4
10COMP 3825 - Kan Yang
10
BitTorrent: tit-for-tat(1) Alice “optimistically unchokes” Bob(2) Alice becomes one of Bob’s top-four providers; Bob reciprocates(3) Bob becomes one of Alice’s top-four providers
Learning ObjectivesPrinciples of Network Applications
1. Application Architecture2. Transport Service Requirements3. Process Communicating and Addressing
Network Application: Web and Http1. Web and Http2. How browser renders a page3. Cookies
12COMP 3825 - Kan Yang
12
2/5/20
4
App-layer protocol
• 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
The application layer protocol defines:
13COMP 3825 - Kan Yang
13
Requirements on Transport Servicesdata 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, …
14COMP 3825 - Kan Yang
14
Transport service requirements: common apps
application
file transfere-mail
Web documentsreal-time audio/video
stored audio/videointeractive games
text messaging
data loss
no lossno lossno lossloss-tolerant
loss-tolerantloss-tolerantno loss
throughput
elasticelasticelasticaudio: 5kbps-1Mbpsvideo:10kbps-5Mbpssame as above few kbps upelastic
time sensitive
nononoyes, 100’s msec
yes, few secsyes, 100’s msecyes and no
15COMP 3825 - Kan Yang
15
Internet transport protocols servicesTCP service:• reliable transport between sending and receiving process• flow control: sender won’t overwhelm receiver • congestion control: throttle sender when network overloaded• does not provide: timing, minimum throughput guarantee, security• connection-oriented: setup required between client and server processes
UDP service:• unreliable data transfer between sending and receiving process• does not provide: reliability, flow control, congestion control, timing, throughput
Learning ObjectivesPrinciples of Network Applications
1. Application Architecture2. Transport Service Requirements3. Process Communicating and Addressing
Network Application: Web and Http1. Web and Http2. How browser renders a page3. Cookies
18COMP 3825 - Kan Yang
18
Processes communicatingprocess: 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
Have both client processes & server processes
client–server architecture
P2P architectures
19COMP 3825 - Kan Yang
19
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
Internet
Controlled by OS
controlled byapp developer
transport
application
physicallinknetwork
process
transport
application
physicallinknetwork
processsocket
2-20COMP 3825 - Kan Yang
20
2/5/20
6
Securing TCP
TCP & UDP § no encryption§ cleartext passwds sent into socket
traverse Internet in cleartext
SSL§ provides encrypted TCP connection§ data integrity§ end-point authentication
SSL is at app layer• apps use SSL libraries, that “talk” to
TCP
SSL socket API§ cleartext passwords sent into socket
traverse Internet encrypted § see Chapter 8
21COMP 3825 - Kan Yang
21
Learning ObjectivesPrinciples of Network Applications
1. Application Architecture2. Transport Service Requirements3. Process Communicating and Addressing
Network Application: Web and Http1. Web and Http2. How browser renders a page3. Cookies
22COMP 3825 - Kan Yang
22
Web and HTTPFirst, 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
COMP 3825 - Kan Yang 23
23
HTML (HyperText Makeup Language)• A language to create structured documents• One can embed images, objects, or create interactive forms