客户-服务器范式.ppt_第1页
客户-服务器范式.ppt_第2页
客户-服务器范式.ppt_第3页
客户-服务器范式.ppt_第4页
客户-服务器范式.ppt_第5页
已阅读5页,还剩174页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、2: Application Layer,1,Chapter 2Application Layer,Computer Networking: A Top Down Approach, 4th edition. Jim Kurose, Keith RossAddison-Wesley, July 2007.,A note on the use of these ppt slides: Were making these slides freely available to all (faculty, students, readers). Theyre in PowerPoint form so

2、 you can add, modify, and delete slides (including this one) and slide content to suit your needs. They obviously represent a lot of work on our part. In return for use, we only ask the following: If you use these slides (e.g., in a class) in substantially unaltered form, that you mention their sour

3、ce (after all, wed like people to use our book!) If you post any slides in substantially unaltered form on a www site, that you note that they are adapted from (or perhaps identical to) our slides, and note our copyright of this material. Thanks and enjoy! JFK/KWR All material copyright 1996-2007 J.

4、F Kurose and K.W. Ross, All Rights Reserved,2: Application Layer,2,Chapter 2: Application layer,2.1 Principles of network applications 2.2 Web and HTTP 2.3 FTP 2.4 Electronic Mail SMTP, POP3, IMAP 2.5 DNS,2.6 P2P Applications 2.7 Socket programming with TCP 2.8 Socket programming with UDP,2: Applica

5、tion Layer,3,Vocabulary and Term,Client-server paradigm 客户-服务器范式 Peer-to-Peer paradigm 对等范式 WWW(World Wide Web) 万维网 HTTP(HyperText Transfer Protocol) 超文本传输协议 Persistent HTTP 永久性/持续性HTTP,2: Application Layer,4,Chapter 2: Application Layer,Our goals: conceptual, implementation aspects of network appli

6、cation protocols transport-layer service models client-server paradigm peer-to-peer paradigm,learn about protocols by examining popular application-level protocols HTTP FTP SMTP / POP3 / IMAP DNS programming network applications socket API,2: Application Layer,5,Some network applications,e-mail web

7、instant messaging remote login P2P file sharing multi-user network games streaming stored video clips,voice over IP real-time video conferencing grid computing ,2: Application Layer,6,Creating a network application,write programs that run on (different) end systems communicate over network e.g., web

8、 server software communicates with browser software little software written for devices in network core network core devices do not run user applications applications on end systems allows for rapid application development, propagation,2: Application Layer,7,Chapter 2: Application layer,2.1 Principl

9、es of network applications 2.2 Web and HTTP 2.3 FTP 2.4 Electronic Mail SMTP, POP3, IMAP 2.5 DNS,2.6 P2P file sharing 2.7 Socket programming with TCP 2.8 Socket programming with UDP 2.9 Building a Web server,2: Application Layer,8,Application architectures,Client-server Peer-to-peer (P2P) Hybrid of

10、client-server and P2P,2: Application Layer,9,C/S Service Infrastructure,Client1,Client2,Client N,Server,request,response,2: Application Layer,10,Client-server architecture,server: always-on host permanent IP address server farms for scaling clients: communicate with server may be intermittently conn

11、ected may have dynamic IP addresses do not communicate directly with each other,2: Application Layer,11,Pure P2P architecture,no always-on server arbitrary end systems directly communicate peers are intermittently connected and change IP addresses example: Gnutella,Highly scalable but difficult to m

12、anage !,2: Application Layer,12,Hybrid of client-server and P2P,Skype voice-over-IP P2P application centralized server: finding address of remote party: client-client connection: direct (not through server) Instant messaging QQ chatting between two users is P2P centralized service: client presence d

13、etection /location user registers its IP address with central server when it comes online user contacts central server to find IP addresses of buddies,2: Application Layer,13,Processes communicating,Process: program running within a host. within same host, two processes communicate using inter-proce

14、ss 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,Note: applications with P2P architectures have client processes (2) ability to fix a few parameter

15、s (lots more on this later),2: Application Layer,15,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?,2: Application Layer,16,Addressing processes,to re

16、ceive 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: many processes can be running on the same host,identifier includes both IP address and port numbers associated with process o

17、n host. Example port numbers: HTTP server: 80 Mail server: 25 to send HTTP message to web server: IP address: 2 Port number: 80 more shortly,2: Application Layer,17,Application-layer protocol defines,Types of messages exchanged, e.g., request, response Message syntax:

18、what fields in messages transfer starting 425 Cant open data connection 452 Error writing file,2: Application Layer,69,T (Trivial) FTP,Its purpose is often used for router bootstrap; Adopted in two nodes communication, one with no disk; Transmission Protocol: UDP RFC 1350,2: Application Layer,70,Cha

19、pter 2: Application layer,2.1 Principles of network applications 2.2 Web and HTTP 2.3 FTP 2.4 Electronic Mail SMTP, POP3, IMAP 2.5 DNS,2.6 P2P file sharing 2.7 Socket programming with TCP 2.8 Socket programming with UDP 2.9 Building a Web server,2: Application Layer,71,Vocabulary and Term,EMAIL(Elec

20、tronic Mail) 电子邮件 SMTP(Simple Mail Transfer Protocol) 简单邮件传输协议 POP3(Post Office Protocol Version 3) 邮局协议-版本3 IMAP4(Internet Mail Access Protocol Version 4) 互联网邮件访问协议-版本4 Web Mail,2: Application Layer,72,Email History-1,1970s: Invention In the early 1970s, Engineer from BBN Company Ray Tomlinson chos

21、e the commercial at symbol to combine the user and host names, and userhost is the standard for email addressing . Larry Roberts of IPTO wrote RD in one three-day weekend to sort and order email headers by subject and date in their Inbox, and to read, save, and delete messages in the order they wish

22、ed.,pdzhumail.gfkd.mtn,mingxugfkd.mtn,2: Application Layer,73,Email History-2,1980s: Development Mid-term in 1980s: Spread with the PC; 1988: Steve Dorner developed Eudora- the first mail management with GUI( Graphics User Interface); 1989: Lotus (莲花)Company released 35000 Lotus Notes email systems.

23、,2: Application Layer,74,Email History-3,1990s: prevail(鼎盛) Mid-term in 1990s: Spread quickly with the WWW 1996:Microsoft Outlook 1.0 1998: Microsoft Acquires (收购) Hotmail Success of Hotmail led to Email Service by Yahoo!, netscape,Exicite , Lycos, Sina, Sohu, Portal sites (门户网站) and companies.,2: A

24、pplication Layer,75,Email History-4,New Century 2001: 30th anniversary 2004 :Googles GMail has Giga-byte Mailbox New Competitions Email plays more important role in our life and its security problems become prominent.,2: Application Layer,76,Features of Email,Asynchronous Communication Media between

25、 People people send and read messages when it is convenient for them, not at the same time Comprehensive Media include text, images, sound and even video. To communicate ideas, advertisement, file sharing,2: Application Layer,77,Working Process,Internet,Mail Server,mingxu user Mailbox,San zhang user

26、 Mailbox,gfkd System Mailbox,XD System Mailbox,2: Application Layer,78,Electronic Mail,Three major components: user agents mail servers simple mail transfer protocol: SMTP User Agent a.k.a. “mail reader” composing, editing, reading mail messages e.g., Eudora, Outlook, elm, Mozilla Thunderbird outgoi

27、ng, incoming messages stored on server,2: Application Layer,79,Electronic Mail: mail servers,Mail Servers mailbox contains incoming messages for user message queue of outgoing (to be sent) mail messages SMTP protocol between mail servers to send email messages client: sending mail server “server”: r

28、eceiving mail server,2: Application Layer,80,Electronic Mail: SMTP RFC 2821,uses TCP to reliably transfer email message from client to server, port 25 direct transfer: sending server to receiving server three phases of transfer handshaking (greeting) transfer of messages closure command/response int

29、eraction commands: ASCII text response: status code and phrase messages must be in 7-bit ASCII,2: Application Layer,81,Scenario: Alice sends message to Bob,1) Alice uses UA to compose message and “to” 2) Alices UA sends message to her mail server; message placed in message queue 3)

30、 Client side of SMTP opens TCP connection with Bobs mail server,4) SMTP client sends Alices message over the TCP connection 5) Bobs mail server places the message in Bobs mailbox 6) Bob invokes his user agent to read message,1,2,3,4,5,6,2: Application Layer,82,Sample SMTP interaction,S: 220 hamburge

31、 C: HELO crepes.fr S: 250 Hello crepes.fr, pleased to meet you C: MAIL FROM: S: 250 alicecrepes.fr. Sender ok C: RCPT TO: S: 250 . Recipient ok C: DATA S: 354 Enter mail, end with . on a line by itself C: Do you like ketchup? C: How about pickles? C: . S: 250 Message accepted f

32、or delivery C: QUIT S: 221 closing connection,2: Application Layer,83,Try SMTP interaction for yourself:,telnet servername 25 see 220 reply from server enter HELO, MAIL FROM, RCPT TO, DATA, QUIT commands above lets you send email without using email client (reader),2: Application Layer

33、,84,SMTP: final words,SMTP uses persistent connections SMTP requires message (header 1st approx: client queries a root server to find com DNS server client queries com DNS server to get DNS server client queries DNS server to get IP address for ,2: Application Layer,106,DNS: Root name servers,contac

34、ted by local name server that can not resolve name root name server: contacts authoritative name server if name mapping not known gets mapping returns mapping to local name server,13 root name servers worldwide,b USC-ISI Marina del Rey, CA l ICANN Los Angeles, CA,e NASA Mt View, CA f Internet Softwa

35、re C. Palo Alto, CA (and 36 other locations),i Autonomica, Stockholm (plus 28 other locations),k RIPE London (also 16 other locations),m WIDE Tokyo (also Seoul, Paris, SF),a Verisign, Dulles, VA c Cogent, Herndon, VA (also LA) d U Maryland College Park, MD g US DoD Vienna, VA h ARL Aberdeen, MD j Ve

36、risign, ( 21 locations),2: Application Layer,107,TLD and Authoritative Servers,Top-level domain (TLD) servers: responsible for com, org, net, edu, etc, and all top-level country domains uk, fr, ca, jp. Network Solutions maintains servers for com TLD Educause for edu TLD Authoritative DNS servers: or

37、ganizations DNS servers, providing authoritative hostname to IP mappings for organizations servers (e.g., Web, mail). can be maintained by organization or service provider,2: Application Layer,108,Local Name Server,does not strictly belong to hierarchy each ISP (residential ISP, company, university)

38、 has one. also called “default name server” when host makes DNS query, query is sent to its local DNS server acts as proxy, forwards query into hierarchy,2: Application Layer,109,requesting host ,,root DNS server,1,2,3,4,5,6,authoritative DNS server ,7,8,

39、TLD DNS server,DNS name resolution example,Host at wants IP address for ,iterated query: contacted server replies with name of server to contact “I dont know this name, but ask this server”,2: Application Layer,110,recursive query: puts burden of name resolution on cont

40、acted name server heavy load?,DNS name resolution example,2: Application Layer,111,DNS: caching and updating records,once (any) name server learns mapping, it caches mapping cache entries timeout (disappear) after some time TLD servers typically cached in local name servers Thus root name servers no

41、t often visited update/notify mechanisms under design by IETF RFC 2136 /html.charters/dnsind-charter.html,2: Application Layer,112,DNS records,DNS: distributed db storing resource records (RR),Type=NS name is domain (e.g. ) value is hostname of authoritative name server for this do

42、main,Type=A name is hostname value is IP address,Type=CNAME name is alias name for some “canonical” (the real) name is really value is canonical name,Type=MX value is name of mailserver associated with name,2: Application Layer,113,DNS protocol, messages,DNS protocol : query and reply messages, both

43、 with same message format,msg header identification: 16 bit # for query, reply to query uses same # flags: query or reply recursion desired recursion available reply is authoritative,2: Application Layer,114,DNS protocol, messages,Name, type fields for a query,RRs in response to query,records for au

44、thoritative servers,additional “helpful” info that may be used,2: Application Layer,115,Inserting records into DNS,example: new startup “Network Utopia” register name at DNS registrar (e.g., Network Solutions) provide names, IP addresses of authoritative name server (primary and secondary) registrar

45、 inserts two RRs into com TLD server: (, , NS) (, , A) create authoritative server Type A record for ; Type MX record for How do people get IP address of your Web site?,2: Application Layer,116,DNS (Domain Name Service),DNS is an infrastructural service (基础服务)by the Internet like routin

46、g and data forwarding Mapping between domain name and IP address,DNS,9,Review,2: Application Layer,117,Domain Space,com,net,org,edu,gov,mil,coop,biz,info,aero,int,cn,uk,hk,js,sh,bj,org,net,gov,edu,com,ac,pku,fudan,sjtu,tsinghua,Root,cctv,ibm,hp,mot,Top Level Domain Name,Local Domain Name

47、,mail,ep,mail,csnetl,seu,Local Domain Name,Local Domain Name,Authoritative Domain Name,2: Application Layer,118,Chapter 2: Application layer,2.1 Principles of network applications app architectures app requirements 2.2 Web and HTTP 2.4 Electronic Mail SMTP, POP3, IMAP 2.5 DNS,2.6 P2P file sharing 2.

48、7 Socket programming with TCP 2.8 Socket programming with UDP 2.9 Building a Web server,2: Application Layer,119,P2P file sharing,Example Alice runs P2P client application on her notebook computer intermittently connects to Internet; gets new IP address for each connection asks for “Hey Jude” applic

49、ation displays other peers that have copy of Hey Jude.,Alice chooses one of the peers, Bob. file is copied from Bobs PC to Alices notebook: HTTP while Alice downloads, other users uploading from Alice. Alices peer is both a Web client and a transient Web server. All peers are servers = highly scalab

50、le!,2: Application Layer,120,Content for the Section,1.Overview of Peer-to-Peer Applications 1.1 What is P2P ? 1.2 Why is P2P so popular? 1.3 Who are P2P applications? 2.How does P2P work? 2.1 Centralized: Napster 2.2 Fully Distributed :Gnutella 2.3 Hierarchical: KaZaA 2.4 Bit Torrent (BT) Supplemen

51、tary,补充的 3.Where to go: Issues and Future Directions,2: Application Layer,121,Vocabulary and Term,Peer 对等体 P2P (Peer-to-Peer) Application/ Network 对等应用、对等网络 Centralized/Distributed/Hierarchical 集中的、分布的、层次的 Free Riding 免费搭车,2: Application Layer,122,Content for the Section,1.Overview of Peer-to-Peer A

52、pplications 1.1 What is P2P ? 1.2 Why is P2P so popular? 1.3 Who are P2P applications? 2.How does P2P work? 2.1 Centralized: Napster 2.2Fully Distributed :Gnutella 2.3 Hierarchical: KaZaA 2.4 Bit Torrent (BT) Supplementary,补充的 3.Where to go: Issues and Future Directions,2: Application Layer,123,Clie

53、nt-Server Mode,d1,F bits,d2,d3,d4,upload rate us,Server becomes bottleneck (CPU/Bandwidth),Internet,2: Application Layer,124,Peer-to-Peer Mode,d1,F bits,d2,d3,d4,upload rate us,Pieces of one file can be downloaded from Multiple Sources,Internet,u1,u2,u3,u4,Different Hosts Download from Multiple Sour

54、ces,A,B,C,D,2: Application Layer,125,Why is P2P so Popular?,P2P networks generate more traffic than any other internet application 2/3 of all bandwidth on some backbones,2: Application Layer,126,Killer Application,1st generation: “raw” Internet Killer Application: EMAIL 2nd generation: the Web Kille

55、r Application: WWW Client Server Mode 3rd generation: P2P Network Killer Application: P2P Applications Peer-to-Peer Mode: Every PC acts as active participant to provide service (file sharing, BLOG/PODCAST) Peer-to-Peer Mode: “I work for everyone, and everyone for me”(我为人人,人人为我),2: Application Layer,

56、127,Advantages of P2P model,High Performance(高性能) Help find the shared resources Speed up the file distribution Reliability (可靠性) Client-server mode: The whole network will depend on the highly loaded server to function properly There is zero reliance on centralized serviced or resources for operati

57、ons Scalability (扩展性) In client-server mode: there is a higher demand for computing power, storage space, and bandwidth associated with the server-side.,2: Application Layer,128,Who are P2P Applications?,Napster,BitTorrent,Skype,PPLive,File Sharing,Downloading,Video Streaming,VOIP,2001 2003 2004 200

58、5,Basic Applications,Advanced Applications,2: Application Layer,129,Who are P2P Applications?,File Share P2P Download Accelerator(加速器),KuGoo(酷狗),PPGou,2: Application Layer,130,2.How does file-sharing P2P application work?,Approaches to Search for the file Central directory (Napster) Centralized Fully Distributed (Gnutella) the other extreme:另一极端 Hierarchical (KazaA) compromise:折衷,2: Application Layer,131,P2P: centralized directory,original “Napster” design 1) when peer connects, it informs central server: IP

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论