COMP 431 Application-Layer Protocols Internet Services & Protocols Outline application application transport ◆ Example client/server systems and network their application-level protocols: link physical Application-Layer Protocols » The World-Wide Web (HTTP) » Reliable file transfer (FTP) Peer-to-Peer Systems, Media Streaming » E-mail (SMTP & POP) & Content Delivery Networks regional ISP » Internet Domain Name System (DNS) ◆ Example p2p applications systems: Jasleen Kaur » BitTorrent ◆ Other protocols and systems: February 13, 2020 » Streaming media — DASH » Content delivery networks (CDNs) Institutional network 1 2
The Application Layer The Application Layer application application application application The client-server paradigm The peer-to-peer-paradigm transport transport network Client network ◆ Typical network application has link link ◆ No “always-on” server physical two pieces: client and server physical ◆ Arbitrary end systems directly ◆ Client — Initiates contact communicate regional ISP » Requests service from server reply » Peers request service from other regional ISP » Does not communicate with other peers, provide service in return to clients other peers request ◆ Server — Provided requested ◆ Self scalability – new peers bring service to client new service capacity, as well as new service demands » “Always” running Institutional network » Typically has a static IP address ◆ Peers are intermittently application application application application Institutional network transport » A server may be a logical machine connected and change IP addresses transport network network » Implemented by one of thousands ◆ Complex management link Server link of physical servers in a data center physical physical 3 4
Peer-to-Peer Systems The Application Layer application application Peer-to-peer v. client/server file distribution The peer-to-peer-paradigm transport network ◆ Question: How much time is required to distribute link ◆ No “always-on” server physical a file from one server to N peers? ◆ Arbitrary end systems directly » In the case when peer upload/download capacity is the limiting communicate resource ◆ Examples: » Peers request service from other regional ISP peers, provide service in return to » File distribution (BitTorrent) u s : server upload other peers capacity » Streaming (KanKan) ◆ Self scalability – new peers bring » VoIP (Skype) d i : peer i download new service capacity, as well as u 1 d 1 capacity file, size F u 2 u s d 2 new service demands server d i ◆ Peers are intermittently application u N application network (with abundant Institutional network transport connected and change IP addresses u i bandwidth) d N network ◆ Complex management link u i : peer i upload physical capacity 5 6
Peer-to-Peer Systems Peer-to-Peer Systems Client/server file distribution time Peer-to-Peer file distribution time ◆ Server must also upload at least one ◆ Server must sequentially send copy F F (upload) N file copies: » Time to send one copy: F / u s u s u s » Time to send one copy: F / u s ◆ Each client must download a copy of d i d i the file » Time to send N copies: NF / u s network network u i u i » Minimum client download time = F / d min ◆ Each client must download a copy of ◆ In aggregate, clients must download NF the file bits » d min = minimum client download rate » Max upload rate (thus, the limiting max download rate) is u s + Σ u i » Minimum client download time = F / d min time to distribute F time to distribute F P2P approach D P2P ≥ max # # "# D cs ≥ max "# # to N clients using $ % , ' ()* , to N clients using $ % , $ % +∑ $ ) client-server approach ' ()* increases linearly in N … Increases linearly in N … but so does this, as each peer brings service capacity 7 8
Peer-to-Peer Systems Peer-to-Peer File Distribution Peer-to-peer v. client/server example BitTorrent ◆ Files are divided into 256Kb chunks Client upload rate = u , F/u = 1 hour, u s = 10u, d min ≥ u s ◆ Peers in the “torrent” send and receive file chunks 3.5 torrent: group of peers P2P D cs ≥ max "# # tracker: tracks peers Minimum Distribution Time $ % , 3 Client-Server ' ()* participating in torrent exchanging chunks of a file 2.5 2 1.5 1 Alice arrives … 0.5 D P2P ≥ max # # "# … obtains list of peers from $ % , ' ()* , $ % +∑$ ) tracker 0 … and begins exchanging file 0 5 10 15 20 25 30 35 chunks with peers in torrent N 9 10
Peer-to-Peer File Distribution BitTorrent BitTorrent Requesting & sending file chunks ◆ When a peer joins a torrent: ◆ Requesting chunks: ◆ Sending chunks: “tit-for-tat” » It has no chunks, but will accumulate » At any given time, different » Alice sends chunks to the four them over time from other peers peers have different subsets peers currently sending her of file chunks chunks at the highest rate » It registers with the tracker to get a list of peers ❖ Other peers are “choked” by Alice » Periodically, Alice asks (do not receive chunks from her) » Connects to subset of peers (“neighbors”) each peer for the list of ❖ Re-evaluate top 4 every10 secs chunks that they have ◆ While downloading, peer uploads chunks to other peers » Every 30 secs the peer » Alice requests missing randomly select another peer & ◆ A peer may change peers with whom it exchanges chunks chunks from peers, starting starts sending chunks » (“Churn” — peers may come and go) with the “rarest” chunk first ❖ “Optimistically unchoke” this peer ◆ Once the peer has the entire file, it may (selfishly) leave ❖ Newly chosen peer may join top 4 or (altruistically) remain in torrent 11 12
Application-Layer Protocols BitTorrent Video streaming and content delivery networks Tit-for-tat ◆ Video streaming is the major consumer of Internet (1) Alice “optimistically unchokes” Bob bandwidth (2) Alice becomes one of Bob’s top-four providers; Bob reciprocates » Netflix, YouTube: 37%, 16% of downstream (3) Bob becomes one of Alice’s top-four providers residential ISP traffic » ~2B YouTube users, ~160M Netflix users ◆ How do you design a service to reach ~2B users? » A single mega-video server won’t work ◆ How do you deal with end-system heterogeneity? » Different users have different capabilities ( e.g ., wired versus mobile; bandwidth rich versus bandwidth poor) higher upload rate means you find better ◆ Solution: A distributed, application-level delivery trading partners & get file faster! infrastructure 13 14
Video Streaming Video Streaming spatial coding example: instead spatial coding example: instead Multimedia basics Multimedia basics of sending N values of same of sending N values of same color (all purple), send only two color (all purple), send only two values: color value ( purple) values: color value ( purple) ◆ Video is a sequence of images and number of repeated values and number of repeated values displayed at constant rate ◆ CBR (constant bit rate): Video ( N) ( N) …………………….. …………………….. is encoded at a rate fixed ……………….……. ……………….……. » e.g ., 24 images/sec ◆ Each image is a (2D) array of ◆ VBR (variable bit rate): Video pixels encoding rate changes as amount of spatial, temporal » Each pixel represented by some redundancy changes number of bits ◆ Coding: use redundancy within frame i frame i ◆ Examples: and between images to » MPEG 1 (CD-ROM) 1.5 Mbps decrease the number of bits » MPEG 2 (DVD) 3-6 Mbps used to encode image » MPEG 4 (often used for Internet » Spatial (within image) temporal coding temporal coding streaming) < 1 Mbps » Temporal (from one image to example: instead of example: instead of frame i+1 frame i+1 sending complete frame sending complete frame next) at i+1, send only at i+1, send only differences from frame i differences from frame i 15 16
Video Streaming Video Streaming Application-layer protocols Application-layer protocols Internet Internet video server video server client client (stored video) (stored video) ◆ DASH: Dynamic, Adaptive Streaming over HTTP ◆ DASH: Dynamic, Adaptive Streaming over HTTP ◆ Server functions: » Divides video file into multiple chunks ◆ “Intelligence” at the client determines: » Each chunk stored, encoded at different rates » When to request chunks (so that buffer starvation, or overflow does not occur) » Provides a “manifest file” with URLs for different chunks » What encoding rate to request (higher quality when more ◆ Client: bandwidth available) » Periodically measures server-to-client bandwidth, » Where to request chunk (can request from Web server that is » Requests one chunk at a time chooses maximum coding rate “close” to client or has high available bandwidth) sustainable given current bandwidth 17 18
Recommend
More recommend