欢迎来到三一办公! | 帮助中心 三一办公31ppt.com(应用文档模板下载平台)
三一办公
全部分类
  • 办公文档>
  • PPT模板>
  • 建筑/施工/环境>
  • 毕业设计>
  • 工程图纸>
  • 教育教学>
  • 素材源码>
  • 生活休闲>
  • 临时分类>
  • ImageVerifierCode 换一换
    首页 三一办公 > 资源分类 > PPT文档下载  

    【大学课件】A TopDown Approach Featuring the Internet.ppt

    • 资源ID:6229898       资源大小:3.78MB        全文页数:127页
    • 资源格式: PPT        下载积分:10金币
    快捷下载 游客一键下载
    会员登录下载
    三方登录下载: 微信开放平台登录 QQ登录  
    下载资源需要10金币
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    【大学课件】A TopDown Approach Featuring the Internet.ppt

    Computer Networking A Top-Down Approach Featuring the Internet计算机网络-自顶向下方法与Internet特色,Chapter 2 Application Layer,http:/,Chapter goals,principles of network applicationstransport-layer service modelsClient/server P2PProcesses Communicationapplication-level protocolsHTTP/FTP/SMTP/POP3/IMAP/DNSprogramming network applicationssocket APISocket Programming in Java,Chapter 2:roadmap,2.1 Principles of Network Applications2.2 The Web and HTTP2.3 File Transfer ProtocolFTP2.4 Electronic Mail in the Internet2.5 DNS-The Internet Directory Service2.6 P2P File sharing2.7 Socket Programming with TCP2.8 Socket Programming with UDP2.9 Building a Simple Web Server2.10 Summary,Creating a network application,Write programs thatrun on different end systems communicate over a network.e.g.,Web server/browserNo software written for devices in network core,2.1Principles of Network Applications,1.Application architectures,Application architecture is distinctly different from the network architecturenetwork architecture:fixed App architecture:how application is organized over various end systemsTypical application architectureClient-Server(C/S)Peer-to-Peer(P2P)Hybrid of client-server and P2P,2.1Principles of Network Applications,Client-Server architecture,server:always-on hostpermanent,well-known IP addressserver farms for scalingclients:communicate with servermay be intermittently connectedmay have dynamic IP addresses,C/S apps:Web,FTP,Telnet,e-maileasy managementserver is bottleneck,2.1Principles of Network Applications,Pure P2P architecture,no always on server at the center of appsarbitrary end systems directly communicatepeers intermittently connected and can change IP addresses example:GnutellaHighly scalableBut difficult to manage,2.1Principles of Network Applications,Hybrid of client-server and P2P,NapsterFile transfer P2PFile search centralized:Instant messagingChatting between two users is P2PPresence detection/location centralized:,2.1Principles of Network Applications,2.Processes communicating,Process:program running within a host.within same host,two processes communicate using inter-process communication(IPC,defined by OS).processes in different hosts communicate by exchanging messages through the network,2.1Principles of Network Applications,2.1 Client and Server Process,Client process:process that initiates communicationServer process:process that waits to be contacted,Note:applications with P2P architectures have both client processes&server processes,2.1Principles of Network Applications,2.2 Sockets,Any message sent from one process to another must go through the underlying network.A process sends message into,and receives messages from,the network through its socket,Developers can choice of transport protocol;ability to fix a few parameters,2.1Principles of Network Applications,2.3 Addressing processes,for a process to receive messages,it must have an identifier.,identifier must include both the IP address and port numbers.port numbers:HTTP server:80Mail server:25,Q:does the IP address of the destination host suffice for identifying the destination process?,2.1Principles of Network Applications,A:No,many processes can be running on same host,3.App-layer protocol,An Application-layer protocol defines:Types of messages exchanged e.g.,request&response messagesSyntax of message typeswhat fields in messages&how fields are delineatedSemantics of the fieldsie,meaning of information in fieldsRules for when and how processes send&respond to messages,2.1Principles of Network Applications,Public-domain protocols:defined in RFCs,allows for interoperabilitye.g.,HTTP,SMTPProprietary protocols:e.g.,KaZaAapplication vs.app-layer protocolprotocol is a piece of a app.,3.App-layer protocol,2.1Principles of Network Applications,4.What transport service does an app need?,reliable data transfersome apps(e.g.,audio)can tolerate some lossother apps(e.g.,file transfer,telnet)require 100%reliable data transfer,Timingsome apps(Internet telephony,interactive games)require low delay to be“effective”,bandwidthbandwidth sensitive app(e.g.,multimedia)elastic bandwidth apps(mail,FTP),2.1Principles of Network Applications,2.1.4 requirements of common apps,Applicationfile transfere-mailWeb documentsreal-time audio/videostored audio/videointeractive gamesinstant messaging,Data lossno lossno lossno lossloss-tolerantloss-tolerantloss-tolerantno loss,Bandwidthelasticelasticelasticaudio:5kbps-1Mbpsvideo:10kbps-5Mbpssame as above few kbps upelastic,Time Sensitivenononoyes,100s msecyes,few secsyes,100s msecyes and no,5.Internet services,TCP service:connection-oriented reliable transportflow control:congestion control:does not provide:timing,minimum bandwidth guarantees,UDP service:unreliable data transferdoes not provide:connection setupReliabilityflow controlcongestion controltiming,or bandwidth guarantee,Q:Why is there a UDP?congestion control is harmful to apps that have minimum bandwidth constraint;some apps are loss-tolerant,2.1Principles of Network Applications,Internet apps:application,transport protocols,Applicatione-mailremote terminal accessWeb file transferstreaming multimediaInternet telephony,Applicationlayer protocolSMTP RFC 2821Telnet RFC 854HTTP RFC 2616FTP RFC 959proprietary(e.g.RealNetworks)proprietary(e.g.,Dialpad),Underlyingtransport protocolTCPTCPTCPTCPTCP or UDPtypically UDP,Chapter 2:roadmap,2.1 Principles of Network Applications2.2 The Web and HTTP2.3 File Transfer ProtocolFTP2.4 Electronic Mail in the Internet2.5 DNS-The Internet Directory Service2.6 P2P File sharing2.7 Socket Programming with TCP2.8 Socket Programming with UDP2.9 Building a Simple Web Server2.10 Summary,The Web and HTTP,some jargonWeb page consists of base HTML-file which includes several referenced objectsObject can be HTML file,image,Java applet,audio file,if a web page contains a HTML file and 5 jpeg images,then the web page has 6 objects:the base HTML file and 5 images.Each object is addressable by a URLUniform Resource Locator,2.2 The Web and HTTP,Contents,1.Overview of HTTP 2.HTTP connectionsNon-persistent HTTP connectionPersistent HTTP connection3.HTTP message type and message formatRequest messageResponse message4.Cookies6.Web caching7.Conditional GET,2.2 The Web and HTTTP,1.Overview of HTTP,HTTP:hypertext transfer protocol,HTTP request,HTTP request,HTTP response,HTTP response,2.2 The Web and HTTP,Webs application layer protocolclient/server modeldefinesHow client requests web pages(written in HTML/XML)from server&how server transfers web pages to clientVersions:HTTP 1.0(RFC 1945)HTTP 1.1(RFC 2616),1.Overview of HTTP,HTTP Uses TCP as underlying transport protocol:client initiates TCP connection with the server at port 80HTTP messages exchanged between browser and Web server through their socketsHTTP is“stateless”server maintains no information about past client requestsProtocols that maintain“state”are complex!,2.2 The Web and HTTP,2.HTTP connections,Nonpersistent Connectionat most one object is sent over a TCP connection.HTTP/1.0 uses nonpersistent HTTP as defaultPersistent ConnectionMultiple objects can be sent over single TCP connection between client and server.HTTP/1.1 uses persistent connections in default mode,2.2 The Web and HTTP,2.1 nonpersistent HTTP connection,Suppose user enters URL in the address of browser www.someSchool.edu/someDepartment/home.index,1a.client initiates TCP connection to HTTP server,2.client sends HTTP request message,1b.server“accepts”connection,notifying client,3.server receives request message,forms/Creates response message,time,4.server closes the TCP connection.,5.client receives response message,6.Steps 1-5 repeated for each of 10 jpeg objects,2.1 nonpersistent HTTP connection,Question:How many connections?Each TCP connection transports exactly one request msg and one response msg11 TCP connectionsThese connections are parallel or serial?User can configures modern browsers to control the degree of parallelismMost browsers open 5 to 10 parallel TCP connections,and each connection handles one request-response transaction,2.2 The Web and HTTP,2.1 Response time modeling,RTT:time to send a small packet to travel from client to server and back.Response time:one RTT to initiate TCP connectionone RTT for HTTP request and first few bytes of HTTP response to returnfile transmission timetotal=2RTT+transmit time,time to transmit file,initiate TCPconnection,RTT,Request file,RTT,File received,time,time,2.2 The Web and HTTP,2.2 Persistent HTTP connection,Nonpersistent HTTP issues:requires 2 RTTs per objectOS must work and allocate host resources for each TCP connectionbrowsers often open parallel TCP connections to fetch the referenced objectsPersistent HTTPserver leaves connection open after sending responsesubsequent HTTP messages between same client/server are sent over the connection established previously,2.2 The Web and HTTP,2.2 Persistent HTTP connection,Persistent connection without pipelining:client issues new request only when previous response has been receivedone RTT for each referenced objectPersistent connection with pipelining:client sends requests as soon as it encounters a referenced objectas little as one RTT for all the referenced objectsdefault in HTTP/1.1,2.2 The Web and HTTP,3.HTTP Message format:request,Two types of HTTP message(RFC2616)request message and response messageRequest Message formatASCII(human-readable format),GET/somedir/page.html HTTP/1.1Host:www.someschool.edu User-agent:Mozilla/4.0Connection:close Accept-language:fr(extra carriage return,line feed),General format of a request messageMethodGETEntity body of the request message is emptyPOSTEntity body includes some parameters sent to serverThe server can create response message according to the parameters receivedHEADSimilar to GET,but the response message has no objectUsed for debug,3.1 HTTP Request Message,2.2 The Web and HTTP,3.1 HTTP Request Message:Example,3.1 Uploading form input,Post method:Web page often includes forms input is uploaded to server in entity body,GET+URL method:Uses GET methodInput is uploaded in the URL field of request line:,http:/,2.2 The Web and HTTP,3.1 Method types supported,HTTP/1.0Only three methods:GET/POST/HEADHTTP/1.1GET/POST/HEADPUTuploads file in entity body to path specified in URL fieldDELETEdeletes file specified in the URL field,2.2 The Web and HTTP,3.2 HTTP Response Message,2.2 The Web and HTTP,HTTP/1.1 200 OK Connection:closeDate:Thu,06 Aug 1998 12:00:15 GMT Server:Apache/1.3.0(Unix)Last-Modified:Mon,22 Jun 1998.Content-Length:6821 Content-Type:text/html data data data data data.,status line(protocolstatus codestatus phrase),header lines,data,e.g.,requestedHTML file,3.2 HTTP Response Message,2.2 The Web and HTTP,200 OKrequest succeeded,requested object is returned in the response message301 Moved Permanentlyrequested object moved,new location specified later in this message(Location:)400 Bad Requestrequest message not understood by server404 Not Foundrequested document not found on this server505 HTTP Version Not Supported,Status Code and phrase,3.2 HTTP Response Message,2.2 The Web and HTTP,Trying out HTTP for yourself,1.Telnet to your favorite Web server:,Opens TCP connection to port 80at cis.poly.edu.Anything typed in sent to port 80 at cis.poly.edu,telnet cis.poly.edu 80,2.Type in a GET HTTP request:,GET/ross/HTTP/1.1Host:cis.poly.edu,By typing this in(hit carriagereturn twice),you send this minimal(but complete)GET request to HTTP server,3.Look at response message sent by HTTP server!,2.2 The Web and HTTP,4.User-server Interaction:cookies,Many major Web sites use cookiesFour components:1)Set-cookie header line in the HTTP response message2)cookie header line in HTTP request message3)cookie file kept on users host and managed by users browser4)back-end database at Web site,Example:Susan access Internet always from same PCShe visits a specific e-commerce site for first timeWhen initial HTTP requests arrives at site,site creates a unique ID and creates an entry in backend database for ID,2.2 The Web and HTTP,Cookies:keeping“state”(cont.),servercreates ID1678 for user,entry in backend database,access,access,one week later:,4.Cookies(continued),What cookies can bring:authorizationshopping cartsrecommendationsuser session state(Web e-mail),Cookies and privacy:cookies permit sites to learn a lot about youyou may supply name and e-mail to sitessearch engines use redirection&cookies to learn yet moreadvertising companies obtain info across sites,aside,2.2 The Web and HTTP,6.Web Caching,user sets browserWeb accesses via proxybrowser sends all HTTP requests to the cacheCache acts as both client and serverTypically cache is installed by ISP,Goal:satisfy client request without involving origin server,2.2 The Web and HTTP,6.More about Web caching,Why Web caching?reduce response time.reduce traffic on the access link.Internet dense with caches enables“poor”content providers to effectively deliver content so does P2P file sharing,2.2 The Web and HTTP,6.Caching example,average object size=100,000 bitsavg.request rate from institutions browsers to origin servers=15/secdelay from institutional router to any origin server and back to router=2 sectotal delay=Internet delay+access delay+LAN delay=2 sec+minutes+milliseconds,2.2 The Web and HTTP,UtilizationLAN=(15 requests/sec)*(100kbits/Request)/10Mbps=0.15 UtilizationAccess=(15 Requests/sec)*(100kbits/Request)/1.5Mbps=1,Possible solutionincrease bandwidth of access link to 10 MbpsConsequencesutilization on LAN=15%utilization on access link=15%Total delay=Internet delay+access delay+LAN delay=2 sec+msecs+msecsoften a costly upgrade,6.Caching example,2.2 The Web and HTTP,Install a cachehit rate is 0.440%requests will be satisfied almost immediately(10ms)60%requests satisfied by origin serverutilization of access link reduced to 60%,resulting in negligible delays total avg delay=Internet delay+access delay+LAN delay=0.6*(2.01)s+0.4*(0.01)ms,6.Caching example,2.2 The Web and HTTP,7.Conditional GET,An HTTP request Message is so called conditional GET message if:Use GET method,andIncludes an If-Modified-Since:header lineGoal:dont send object if cache has up-to-date cached versioncache:specify date of cached copy in HTTP requestIf-modified-since:server:response contains no object if cached copy is up-to-date:HTTP/1.0 304 Not Modified,2.2 The Web and HTTP,cache,server,HTTP request msgIf-modified-since:,object not modified,HTTP request msgIf-modified-since:,HTTP responseHTTP/1.0 200 OK,object modified,7.Conditional GET:example,2.2 The Web and HTTP,Chapter 2:roadmap,2.1 Principles of Network Applications2.2 The Web and HTTP2.3 File Transfer ProtocolFTP2.4 Electronic Mail in the Internet2.5 DNS-The Internet Directory Service2.6 P2PFile sharing2.7 Socket Programming with TCP2.8 Socket Programming with UDP2.9 Building a Simple Web Server2.10 Summary,FTP:the file transfer protocol,transfer file to/from remote hostclient/server modelclient:side that initiates transfer(either to/from remote)ser

    注意事项

    本文(【大学课件】A TopDown Approach Featuring the Internet.ppt)为本站会员(sccc)主动上传,三一办公仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三一办公(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    备案号:宁ICP备20000045号-2

    经营许可证:宁B2-20210002

    宁公网安备 64010402000987号

    三一办公
    收起
    展开