Upload
lisa-atkinson
View
230
Download
8
Tags:
Embed Size (px)
Citation preview
Introduction to Computer Systems
1
Yun Zhang
Unit 5 Network Systems
Introduction to Computer Systems
2
Yun Zhang
Network Systems
bull Reading Sequence
bull 51 Internet Basics
bull 52 Local and Wide Area Networks
bull 53 Communication Strategies
bull 54 Data Transfer Technologies
bull 55 Internet Architecture
Introduction to Computer Systems
3
Yun Zhang
Network amp Internet
bull A communications network is the combination of hardware software and connecting links that transport data
bull The Internet refers to a global public network that uses TCPIP protocol and includes servers that handle e-mail Web sites file downloads and so on
Introduction to Computer Systems
4
Yun Zhang
Network Topology
点对点连接(这是最简单的网络)
总线网
星形网
集线器
环形网
Introduction to Computer Systems
5
Yun Zhang
51 Internet Basics
bull In a short period of time the Internet has become essential to how people and businesses communicate with each other around the world Using a browser and email are important skills today This section provides some general background on the Internet and helps you become more familiar with the features of your browser and email programs
Introduction to Computer Systems
6
Yun Zhang
The World Wide Web
bull Introduce the World Wide Web and its workings ndash Using the Web ndash Whats in the Web ndash Introduction to HTML Forms and Servlets
Introduction to Computer Systems
7
Yun Zhang
Using the Web
bull Surfing the Web
bull Your Web Pages
bull Clients Servers and URLs
bull Searching the Web
bull Commerce on the Web
bull Some Ethical Considerations
Introduction to Computer Systems
8
Yun Zhang
Surfing the Webbull Internet
bull World Wide Web
bull Surfing
bull Internet Service Provider ( ISP )
Introduction to Computer Systems
9
Yun Zhang
Internetbull Internet is a computer network that connects
millions of computers across a number of countries
bull There is no central authority that controls the Internet different organizations own different pieces of it
bull The Internet was originally conceived of by the Advanced Research Project Agency (ARPA) of the US government in the 1960s
Introduction to Computer Systems
10
Yun Zhang
Word Wide Webbull the Web WWW or W3
bull Portion of the computers on the Internet that can communicate with each other using a computer-network protocol called HTTP (Hypertext Transfer Protocol )
bull All browsers use HTTP to request and receive Web pages from other computers
Introduction to Computer Systems
11
Yun Zhang
Surfingbull Browse on the Web
bull page place site web sitendash Locations on the Web that you can visit
and view through a browser
bull homepage
bull No one can certify that information presented on the Web is accurate correct and up-to-date
Introduction to Computer Systems
12
Yun Zhang
Internet Service Provider ( ISP )
bull An ISP is any one of a number of companies that enable people not only to connect to the Internet and surf the Web but also to publish Web pages
bull All Web sites must have unique names or addressesmdashone per machine
Introduction to Computer Systems
13
Yun Zhang
Browse Sample
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
14
Yun Zhang
Introduction to Computer Systems
15
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
16
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
17
Yun Zhang
httpwwwwhueducnindexphp
Introduction to Computer Systems
18
Yun Zhang
URLsbull Uniform Resource Locator naming scheme
ndash Provides user with a way to access Web resources using a uniform means for addressing resources
[protocol][name of machine][name of resource]
Introduction to Computer Systems
19
Yun Zhang
URLs (Cont)bull [protocol][name of machine][name of resource]
ndash ex http wwwicarnegiecomcourseshtml
Hypertext Transfer Protocolmdashmdash a communication protocl
name of the machine hosting
the resource ndash ftp wwwicarnegiecomindexhtmndash http2021143566
name of the resource addressed by the URL
Introduction to Computer Systems
20
Yun Zhang
Basic Work Modelbull Client sends a request for a resource
ndash A protocol (How do I get the resource)ndash The server (What server has this resource)ndash The resource itself (What resource
specifically)
bull Serverndash Locates the resource requestedndash Transmits a copy of the resource back to the
client using the specified protocol
Introduction to Computer Systems
21
Yun Zhang
Browse Sample
Dynamic Web Content
mdashmdash extend the basic client-server model
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
22
Yun Zhang
Searching the Web
bull Browsing and searching
bull Search engine is a program that allows one to search for keywords in files at one or more Internet sites ndash Excite wwwexcitecom ndash AltaVista wwwaltavistacom ndash Lycos wwwlycoscom ndash Google wwwgooglecom
Introduction to Computer Systems
23
Yun Zhang
How to search
bull Use a search site
bull Type key words of your search into the search engine
bull Searchhellip
bull Use the help information offered by each search engine
Introduction to Computer Systems
24
Yun Zhang
A search Sample
httpwwwgooglecomintlzh-CN
Introduction to Computer Systems
25
Yun Zhang
Introduction to Computer Systems
26
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a search engine bull Sites of this type maintain indexes or
databases of the addresses of virtually all of the pages and documents on the Web These indexes and databases are updated regularly and automatically by programs known as spiders ldquocrawlerrdquo
Introduction to Computer Systems
27
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a Web directory bull it organizes information available on the Web
into different categories and subcategories
Introduction to Computer Systems
28
Yun Zhang
Search Engine
bull Full Text Search Enginendash Google FastAllTheWeb AltaVista Inktomi Wis
eNut Teoma Baidu Lycoshellip
bull Search indexDirectoryndash Yahoo LookSmart 搜狐 新浪 网易hellip
bull Meta Search Enginendash InforSpace Dogpile Vivisimo 搜星hellip
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
2
Yun Zhang
Network Systems
bull Reading Sequence
bull 51 Internet Basics
bull 52 Local and Wide Area Networks
bull 53 Communication Strategies
bull 54 Data Transfer Technologies
bull 55 Internet Architecture
Introduction to Computer Systems
3
Yun Zhang
Network amp Internet
bull A communications network is the combination of hardware software and connecting links that transport data
bull The Internet refers to a global public network that uses TCPIP protocol and includes servers that handle e-mail Web sites file downloads and so on
Introduction to Computer Systems
4
Yun Zhang
Network Topology
点对点连接(这是最简单的网络)
总线网
星形网
集线器
环形网
Introduction to Computer Systems
5
Yun Zhang
51 Internet Basics
bull In a short period of time the Internet has become essential to how people and businesses communicate with each other around the world Using a browser and email are important skills today This section provides some general background on the Internet and helps you become more familiar with the features of your browser and email programs
Introduction to Computer Systems
6
Yun Zhang
The World Wide Web
bull Introduce the World Wide Web and its workings ndash Using the Web ndash Whats in the Web ndash Introduction to HTML Forms and Servlets
Introduction to Computer Systems
7
Yun Zhang
Using the Web
bull Surfing the Web
bull Your Web Pages
bull Clients Servers and URLs
bull Searching the Web
bull Commerce on the Web
bull Some Ethical Considerations
Introduction to Computer Systems
8
Yun Zhang
Surfing the Webbull Internet
bull World Wide Web
bull Surfing
bull Internet Service Provider ( ISP )
Introduction to Computer Systems
9
Yun Zhang
Internetbull Internet is a computer network that connects
millions of computers across a number of countries
bull There is no central authority that controls the Internet different organizations own different pieces of it
bull The Internet was originally conceived of by the Advanced Research Project Agency (ARPA) of the US government in the 1960s
Introduction to Computer Systems
10
Yun Zhang
Word Wide Webbull the Web WWW or W3
bull Portion of the computers on the Internet that can communicate with each other using a computer-network protocol called HTTP (Hypertext Transfer Protocol )
bull All browsers use HTTP to request and receive Web pages from other computers
Introduction to Computer Systems
11
Yun Zhang
Surfingbull Browse on the Web
bull page place site web sitendash Locations on the Web that you can visit
and view through a browser
bull homepage
bull No one can certify that information presented on the Web is accurate correct and up-to-date
Introduction to Computer Systems
12
Yun Zhang
Internet Service Provider ( ISP )
bull An ISP is any one of a number of companies that enable people not only to connect to the Internet and surf the Web but also to publish Web pages
bull All Web sites must have unique names or addressesmdashone per machine
Introduction to Computer Systems
13
Yun Zhang
Browse Sample
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
14
Yun Zhang
Introduction to Computer Systems
15
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
16
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
17
Yun Zhang
httpwwwwhueducnindexphp
Introduction to Computer Systems
18
Yun Zhang
URLsbull Uniform Resource Locator naming scheme
ndash Provides user with a way to access Web resources using a uniform means for addressing resources
[protocol][name of machine][name of resource]
Introduction to Computer Systems
19
Yun Zhang
URLs (Cont)bull [protocol][name of machine][name of resource]
ndash ex http wwwicarnegiecomcourseshtml
Hypertext Transfer Protocolmdashmdash a communication protocl
name of the machine hosting
the resource ndash ftp wwwicarnegiecomindexhtmndash http2021143566
name of the resource addressed by the URL
Introduction to Computer Systems
20
Yun Zhang
Basic Work Modelbull Client sends a request for a resource
ndash A protocol (How do I get the resource)ndash The server (What server has this resource)ndash The resource itself (What resource
specifically)
bull Serverndash Locates the resource requestedndash Transmits a copy of the resource back to the
client using the specified protocol
Introduction to Computer Systems
21
Yun Zhang
Browse Sample
Dynamic Web Content
mdashmdash extend the basic client-server model
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
22
Yun Zhang
Searching the Web
bull Browsing and searching
bull Search engine is a program that allows one to search for keywords in files at one or more Internet sites ndash Excite wwwexcitecom ndash AltaVista wwwaltavistacom ndash Lycos wwwlycoscom ndash Google wwwgooglecom
Introduction to Computer Systems
23
Yun Zhang
How to search
bull Use a search site
bull Type key words of your search into the search engine
bull Searchhellip
bull Use the help information offered by each search engine
Introduction to Computer Systems
24
Yun Zhang
A search Sample
httpwwwgooglecomintlzh-CN
Introduction to Computer Systems
25
Yun Zhang
Introduction to Computer Systems
26
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a search engine bull Sites of this type maintain indexes or
databases of the addresses of virtually all of the pages and documents on the Web These indexes and databases are updated regularly and automatically by programs known as spiders ldquocrawlerrdquo
Introduction to Computer Systems
27
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a Web directory bull it organizes information available on the Web
into different categories and subcategories
Introduction to Computer Systems
28
Yun Zhang
Search Engine
bull Full Text Search Enginendash Google FastAllTheWeb AltaVista Inktomi Wis
eNut Teoma Baidu Lycoshellip
bull Search indexDirectoryndash Yahoo LookSmart 搜狐 新浪 网易hellip
bull Meta Search Enginendash InforSpace Dogpile Vivisimo 搜星hellip
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
3
Yun Zhang
Network amp Internet
bull A communications network is the combination of hardware software and connecting links that transport data
bull The Internet refers to a global public network that uses TCPIP protocol and includes servers that handle e-mail Web sites file downloads and so on
Introduction to Computer Systems
4
Yun Zhang
Network Topology
点对点连接(这是最简单的网络)
总线网
星形网
集线器
环形网
Introduction to Computer Systems
5
Yun Zhang
51 Internet Basics
bull In a short period of time the Internet has become essential to how people and businesses communicate with each other around the world Using a browser and email are important skills today This section provides some general background on the Internet and helps you become more familiar with the features of your browser and email programs
Introduction to Computer Systems
6
Yun Zhang
The World Wide Web
bull Introduce the World Wide Web and its workings ndash Using the Web ndash Whats in the Web ndash Introduction to HTML Forms and Servlets
Introduction to Computer Systems
7
Yun Zhang
Using the Web
bull Surfing the Web
bull Your Web Pages
bull Clients Servers and URLs
bull Searching the Web
bull Commerce on the Web
bull Some Ethical Considerations
Introduction to Computer Systems
8
Yun Zhang
Surfing the Webbull Internet
bull World Wide Web
bull Surfing
bull Internet Service Provider ( ISP )
Introduction to Computer Systems
9
Yun Zhang
Internetbull Internet is a computer network that connects
millions of computers across a number of countries
bull There is no central authority that controls the Internet different organizations own different pieces of it
bull The Internet was originally conceived of by the Advanced Research Project Agency (ARPA) of the US government in the 1960s
Introduction to Computer Systems
10
Yun Zhang
Word Wide Webbull the Web WWW or W3
bull Portion of the computers on the Internet that can communicate with each other using a computer-network protocol called HTTP (Hypertext Transfer Protocol )
bull All browsers use HTTP to request and receive Web pages from other computers
Introduction to Computer Systems
11
Yun Zhang
Surfingbull Browse on the Web
bull page place site web sitendash Locations on the Web that you can visit
and view through a browser
bull homepage
bull No one can certify that information presented on the Web is accurate correct and up-to-date
Introduction to Computer Systems
12
Yun Zhang
Internet Service Provider ( ISP )
bull An ISP is any one of a number of companies that enable people not only to connect to the Internet and surf the Web but also to publish Web pages
bull All Web sites must have unique names or addressesmdashone per machine
Introduction to Computer Systems
13
Yun Zhang
Browse Sample
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
14
Yun Zhang
Introduction to Computer Systems
15
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
16
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
17
Yun Zhang
httpwwwwhueducnindexphp
Introduction to Computer Systems
18
Yun Zhang
URLsbull Uniform Resource Locator naming scheme
ndash Provides user with a way to access Web resources using a uniform means for addressing resources
[protocol][name of machine][name of resource]
Introduction to Computer Systems
19
Yun Zhang
URLs (Cont)bull [protocol][name of machine][name of resource]
ndash ex http wwwicarnegiecomcourseshtml
Hypertext Transfer Protocolmdashmdash a communication protocl
name of the machine hosting
the resource ndash ftp wwwicarnegiecomindexhtmndash http2021143566
name of the resource addressed by the URL
Introduction to Computer Systems
20
Yun Zhang
Basic Work Modelbull Client sends a request for a resource
ndash A protocol (How do I get the resource)ndash The server (What server has this resource)ndash The resource itself (What resource
specifically)
bull Serverndash Locates the resource requestedndash Transmits a copy of the resource back to the
client using the specified protocol
Introduction to Computer Systems
21
Yun Zhang
Browse Sample
Dynamic Web Content
mdashmdash extend the basic client-server model
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
22
Yun Zhang
Searching the Web
bull Browsing and searching
bull Search engine is a program that allows one to search for keywords in files at one or more Internet sites ndash Excite wwwexcitecom ndash AltaVista wwwaltavistacom ndash Lycos wwwlycoscom ndash Google wwwgooglecom
Introduction to Computer Systems
23
Yun Zhang
How to search
bull Use a search site
bull Type key words of your search into the search engine
bull Searchhellip
bull Use the help information offered by each search engine
Introduction to Computer Systems
24
Yun Zhang
A search Sample
httpwwwgooglecomintlzh-CN
Introduction to Computer Systems
25
Yun Zhang
Introduction to Computer Systems
26
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a search engine bull Sites of this type maintain indexes or
databases of the addresses of virtually all of the pages and documents on the Web These indexes and databases are updated regularly and automatically by programs known as spiders ldquocrawlerrdquo
Introduction to Computer Systems
27
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a Web directory bull it organizes information available on the Web
into different categories and subcategories
Introduction to Computer Systems
28
Yun Zhang
Search Engine
bull Full Text Search Enginendash Google FastAllTheWeb AltaVista Inktomi Wis
eNut Teoma Baidu Lycoshellip
bull Search indexDirectoryndash Yahoo LookSmart 搜狐 新浪 网易hellip
bull Meta Search Enginendash InforSpace Dogpile Vivisimo 搜星hellip
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
4
Yun Zhang
Network Topology
点对点连接(这是最简单的网络)
总线网
星形网
集线器
环形网
Introduction to Computer Systems
5
Yun Zhang
51 Internet Basics
bull In a short period of time the Internet has become essential to how people and businesses communicate with each other around the world Using a browser and email are important skills today This section provides some general background on the Internet and helps you become more familiar with the features of your browser and email programs
Introduction to Computer Systems
6
Yun Zhang
The World Wide Web
bull Introduce the World Wide Web and its workings ndash Using the Web ndash Whats in the Web ndash Introduction to HTML Forms and Servlets
Introduction to Computer Systems
7
Yun Zhang
Using the Web
bull Surfing the Web
bull Your Web Pages
bull Clients Servers and URLs
bull Searching the Web
bull Commerce on the Web
bull Some Ethical Considerations
Introduction to Computer Systems
8
Yun Zhang
Surfing the Webbull Internet
bull World Wide Web
bull Surfing
bull Internet Service Provider ( ISP )
Introduction to Computer Systems
9
Yun Zhang
Internetbull Internet is a computer network that connects
millions of computers across a number of countries
bull There is no central authority that controls the Internet different organizations own different pieces of it
bull The Internet was originally conceived of by the Advanced Research Project Agency (ARPA) of the US government in the 1960s
Introduction to Computer Systems
10
Yun Zhang
Word Wide Webbull the Web WWW or W3
bull Portion of the computers on the Internet that can communicate with each other using a computer-network protocol called HTTP (Hypertext Transfer Protocol )
bull All browsers use HTTP to request and receive Web pages from other computers
Introduction to Computer Systems
11
Yun Zhang
Surfingbull Browse on the Web
bull page place site web sitendash Locations on the Web that you can visit
and view through a browser
bull homepage
bull No one can certify that information presented on the Web is accurate correct and up-to-date
Introduction to Computer Systems
12
Yun Zhang
Internet Service Provider ( ISP )
bull An ISP is any one of a number of companies that enable people not only to connect to the Internet and surf the Web but also to publish Web pages
bull All Web sites must have unique names or addressesmdashone per machine
Introduction to Computer Systems
13
Yun Zhang
Browse Sample
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
14
Yun Zhang
Introduction to Computer Systems
15
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
16
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
17
Yun Zhang
httpwwwwhueducnindexphp
Introduction to Computer Systems
18
Yun Zhang
URLsbull Uniform Resource Locator naming scheme
ndash Provides user with a way to access Web resources using a uniform means for addressing resources
[protocol][name of machine][name of resource]
Introduction to Computer Systems
19
Yun Zhang
URLs (Cont)bull [protocol][name of machine][name of resource]
ndash ex http wwwicarnegiecomcourseshtml
Hypertext Transfer Protocolmdashmdash a communication protocl
name of the machine hosting
the resource ndash ftp wwwicarnegiecomindexhtmndash http2021143566
name of the resource addressed by the URL
Introduction to Computer Systems
20
Yun Zhang
Basic Work Modelbull Client sends a request for a resource
ndash A protocol (How do I get the resource)ndash The server (What server has this resource)ndash The resource itself (What resource
specifically)
bull Serverndash Locates the resource requestedndash Transmits a copy of the resource back to the
client using the specified protocol
Introduction to Computer Systems
21
Yun Zhang
Browse Sample
Dynamic Web Content
mdashmdash extend the basic client-server model
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
22
Yun Zhang
Searching the Web
bull Browsing and searching
bull Search engine is a program that allows one to search for keywords in files at one or more Internet sites ndash Excite wwwexcitecom ndash AltaVista wwwaltavistacom ndash Lycos wwwlycoscom ndash Google wwwgooglecom
Introduction to Computer Systems
23
Yun Zhang
How to search
bull Use a search site
bull Type key words of your search into the search engine
bull Searchhellip
bull Use the help information offered by each search engine
Introduction to Computer Systems
24
Yun Zhang
A search Sample
httpwwwgooglecomintlzh-CN
Introduction to Computer Systems
25
Yun Zhang
Introduction to Computer Systems
26
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a search engine bull Sites of this type maintain indexes or
databases of the addresses of virtually all of the pages and documents on the Web These indexes and databases are updated regularly and automatically by programs known as spiders ldquocrawlerrdquo
Introduction to Computer Systems
27
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a Web directory bull it organizes information available on the Web
into different categories and subcategories
Introduction to Computer Systems
28
Yun Zhang
Search Engine
bull Full Text Search Enginendash Google FastAllTheWeb AltaVista Inktomi Wis
eNut Teoma Baidu Lycoshellip
bull Search indexDirectoryndash Yahoo LookSmart 搜狐 新浪 网易hellip
bull Meta Search Enginendash InforSpace Dogpile Vivisimo 搜星hellip
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
5
Yun Zhang
51 Internet Basics
bull In a short period of time the Internet has become essential to how people and businesses communicate with each other around the world Using a browser and email are important skills today This section provides some general background on the Internet and helps you become more familiar with the features of your browser and email programs
Introduction to Computer Systems
6
Yun Zhang
The World Wide Web
bull Introduce the World Wide Web and its workings ndash Using the Web ndash Whats in the Web ndash Introduction to HTML Forms and Servlets
Introduction to Computer Systems
7
Yun Zhang
Using the Web
bull Surfing the Web
bull Your Web Pages
bull Clients Servers and URLs
bull Searching the Web
bull Commerce on the Web
bull Some Ethical Considerations
Introduction to Computer Systems
8
Yun Zhang
Surfing the Webbull Internet
bull World Wide Web
bull Surfing
bull Internet Service Provider ( ISP )
Introduction to Computer Systems
9
Yun Zhang
Internetbull Internet is a computer network that connects
millions of computers across a number of countries
bull There is no central authority that controls the Internet different organizations own different pieces of it
bull The Internet was originally conceived of by the Advanced Research Project Agency (ARPA) of the US government in the 1960s
Introduction to Computer Systems
10
Yun Zhang
Word Wide Webbull the Web WWW or W3
bull Portion of the computers on the Internet that can communicate with each other using a computer-network protocol called HTTP (Hypertext Transfer Protocol )
bull All browsers use HTTP to request and receive Web pages from other computers
Introduction to Computer Systems
11
Yun Zhang
Surfingbull Browse on the Web
bull page place site web sitendash Locations on the Web that you can visit
and view through a browser
bull homepage
bull No one can certify that information presented on the Web is accurate correct and up-to-date
Introduction to Computer Systems
12
Yun Zhang
Internet Service Provider ( ISP )
bull An ISP is any one of a number of companies that enable people not only to connect to the Internet and surf the Web but also to publish Web pages
bull All Web sites must have unique names or addressesmdashone per machine
Introduction to Computer Systems
13
Yun Zhang
Browse Sample
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
14
Yun Zhang
Introduction to Computer Systems
15
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
16
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
17
Yun Zhang
httpwwwwhueducnindexphp
Introduction to Computer Systems
18
Yun Zhang
URLsbull Uniform Resource Locator naming scheme
ndash Provides user with a way to access Web resources using a uniform means for addressing resources
[protocol][name of machine][name of resource]
Introduction to Computer Systems
19
Yun Zhang
URLs (Cont)bull [protocol][name of machine][name of resource]
ndash ex http wwwicarnegiecomcourseshtml
Hypertext Transfer Protocolmdashmdash a communication protocl
name of the machine hosting
the resource ndash ftp wwwicarnegiecomindexhtmndash http2021143566
name of the resource addressed by the URL
Introduction to Computer Systems
20
Yun Zhang
Basic Work Modelbull Client sends a request for a resource
ndash A protocol (How do I get the resource)ndash The server (What server has this resource)ndash The resource itself (What resource
specifically)
bull Serverndash Locates the resource requestedndash Transmits a copy of the resource back to the
client using the specified protocol
Introduction to Computer Systems
21
Yun Zhang
Browse Sample
Dynamic Web Content
mdashmdash extend the basic client-server model
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
22
Yun Zhang
Searching the Web
bull Browsing and searching
bull Search engine is a program that allows one to search for keywords in files at one or more Internet sites ndash Excite wwwexcitecom ndash AltaVista wwwaltavistacom ndash Lycos wwwlycoscom ndash Google wwwgooglecom
Introduction to Computer Systems
23
Yun Zhang
How to search
bull Use a search site
bull Type key words of your search into the search engine
bull Searchhellip
bull Use the help information offered by each search engine
Introduction to Computer Systems
24
Yun Zhang
A search Sample
httpwwwgooglecomintlzh-CN
Introduction to Computer Systems
25
Yun Zhang
Introduction to Computer Systems
26
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a search engine bull Sites of this type maintain indexes or
databases of the addresses of virtually all of the pages and documents on the Web These indexes and databases are updated regularly and automatically by programs known as spiders ldquocrawlerrdquo
Introduction to Computer Systems
27
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a Web directory bull it organizes information available on the Web
into different categories and subcategories
Introduction to Computer Systems
28
Yun Zhang
Search Engine
bull Full Text Search Enginendash Google FastAllTheWeb AltaVista Inktomi Wis
eNut Teoma Baidu Lycoshellip
bull Search indexDirectoryndash Yahoo LookSmart 搜狐 新浪 网易hellip
bull Meta Search Enginendash InforSpace Dogpile Vivisimo 搜星hellip
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
6
Yun Zhang
The World Wide Web
bull Introduce the World Wide Web and its workings ndash Using the Web ndash Whats in the Web ndash Introduction to HTML Forms and Servlets
Introduction to Computer Systems
7
Yun Zhang
Using the Web
bull Surfing the Web
bull Your Web Pages
bull Clients Servers and URLs
bull Searching the Web
bull Commerce on the Web
bull Some Ethical Considerations
Introduction to Computer Systems
8
Yun Zhang
Surfing the Webbull Internet
bull World Wide Web
bull Surfing
bull Internet Service Provider ( ISP )
Introduction to Computer Systems
9
Yun Zhang
Internetbull Internet is a computer network that connects
millions of computers across a number of countries
bull There is no central authority that controls the Internet different organizations own different pieces of it
bull The Internet was originally conceived of by the Advanced Research Project Agency (ARPA) of the US government in the 1960s
Introduction to Computer Systems
10
Yun Zhang
Word Wide Webbull the Web WWW or W3
bull Portion of the computers on the Internet that can communicate with each other using a computer-network protocol called HTTP (Hypertext Transfer Protocol )
bull All browsers use HTTP to request and receive Web pages from other computers
Introduction to Computer Systems
11
Yun Zhang
Surfingbull Browse on the Web
bull page place site web sitendash Locations on the Web that you can visit
and view through a browser
bull homepage
bull No one can certify that information presented on the Web is accurate correct and up-to-date
Introduction to Computer Systems
12
Yun Zhang
Internet Service Provider ( ISP )
bull An ISP is any one of a number of companies that enable people not only to connect to the Internet and surf the Web but also to publish Web pages
bull All Web sites must have unique names or addressesmdashone per machine
Introduction to Computer Systems
13
Yun Zhang
Browse Sample
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
14
Yun Zhang
Introduction to Computer Systems
15
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
16
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
17
Yun Zhang
httpwwwwhueducnindexphp
Introduction to Computer Systems
18
Yun Zhang
URLsbull Uniform Resource Locator naming scheme
ndash Provides user with a way to access Web resources using a uniform means for addressing resources
[protocol][name of machine][name of resource]
Introduction to Computer Systems
19
Yun Zhang
URLs (Cont)bull [protocol][name of machine][name of resource]
ndash ex http wwwicarnegiecomcourseshtml
Hypertext Transfer Protocolmdashmdash a communication protocl
name of the machine hosting
the resource ndash ftp wwwicarnegiecomindexhtmndash http2021143566
name of the resource addressed by the URL
Introduction to Computer Systems
20
Yun Zhang
Basic Work Modelbull Client sends a request for a resource
ndash A protocol (How do I get the resource)ndash The server (What server has this resource)ndash The resource itself (What resource
specifically)
bull Serverndash Locates the resource requestedndash Transmits a copy of the resource back to the
client using the specified protocol
Introduction to Computer Systems
21
Yun Zhang
Browse Sample
Dynamic Web Content
mdashmdash extend the basic client-server model
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
22
Yun Zhang
Searching the Web
bull Browsing and searching
bull Search engine is a program that allows one to search for keywords in files at one or more Internet sites ndash Excite wwwexcitecom ndash AltaVista wwwaltavistacom ndash Lycos wwwlycoscom ndash Google wwwgooglecom
Introduction to Computer Systems
23
Yun Zhang
How to search
bull Use a search site
bull Type key words of your search into the search engine
bull Searchhellip
bull Use the help information offered by each search engine
Introduction to Computer Systems
24
Yun Zhang
A search Sample
httpwwwgooglecomintlzh-CN
Introduction to Computer Systems
25
Yun Zhang
Introduction to Computer Systems
26
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a search engine bull Sites of this type maintain indexes or
databases of the addresses of virtually all of the pages and documents on the Web These indexes and databases are updated regularly and automatically by programs known as spiders ldquocrawlerrdquo
Introduction to Computer Systems
27
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a Web directory bull it organizes information available on the Web
into different categories and subcategories
Introduction to Computer Systems
28
Yun Zhang
Search Engine
bull Full Text Search Enginendash Google FastAllTheWeb AltaVista Inktomi Wis
eNut Teoma Baidu Lycoshellip
bull Search indexDirectoryndash Yahoo LookSmart 搜狐 新浪 网易hellip
bull Meta Search Enginendash InforSpace Dogpile Vivisimo 搜星hellip
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
7
Yun Zhang
Using the Web
bull Surfing the Web
bull Your Web Pages
bull Clients Servers and URLs
bull Searching the Web
bull Commerce on the Web
bull Some Ethical Considerations
Introduction to Computer Systems
8
Yun Zhang
Surfing the Webbull Internet
bull World Wide Web
bull Surfing
bull Internet Service Provider ( ISP )
Introduction to Computer Systems
9
Yun Zhang
Internetbull Internet is a computer network that connects
millions of computers across a number of countries
bull There is no central authority that controls the Internet different organizations own different pieces of it
bull The Internet was originally conceived of by the Advanced Research Project Agency (ARPA) of the US government in the 1960s
Introduction to Computer Systems
10
Yun Zhang
Word Wide Webbull the Web WWW or W3
bull Portion of the computers on the Internet that can communicate with each other using a computer-network protocol called HTTP (Hypertext Transfer Protocol )
bull All browsers use HTTP to request and receive Web pages from other computers
Introduction to Computer Systems
11
Yun Zhang
Surfingbull Browse on the Web
bull page place site web sitendash Locations on the Web that you can visit
and view through a browser
bull homepage
bull No one can certify that information presented on the Web is accurate correct and up-to-date
Introduction to Computer Systems
12
Yun Zhang
Internet Service Provider ( ISP )
bull An ISP is any one of a number of companies that enable people not only to connect to the Internet and surf the Web but also to publish Web pages
bull All Web sites must have unique names or addressesmdashone per machine
Introduction to Computer Systems
13
Yun Zhang
Browse Sample
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
14
Yun Zhang
Introduction to Computer Systems
15
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
16
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
17
Yun Zhang
httpwwwwhueducnindexphp
Introduction to Computer Systems
18
Yun Zhang
URLsbull Uniform Resource Locator naming scheme
ndash Provides user with a way to access Web resources using a uniform means for addressing resources
[protocol][name of machine][name of resource]
Introduction to Computer Systems
19
Yun Zhang
URLs (Cont)bull [protocol][name of machine][name of resource]
ndash ex http wwwicarnegiecomcourseshtml
Hypertext Transfer Protocolmdashmdash a communication protocl
name of the machine hosting
the resource ndash ftp wwwicarnegiecomindexhtmndash http2021143566
name of the resource addressed by the URL
Introduction to Computer Systems
20
Yun Zhang
Basic Work Modelbull Client sends a request for a resource
ndash A protocol (How do I get the resource)ndash The server (What server has this resource)ndash The resource itself (What resource
specifically)
bull Serverndash Locates the resource requestedndash Transmits a copy of the resource back to the
client using the specified protocol
Introduction to Computer Systems
21
Yun Zhang
Browse Sample
Dynamic Web Content
mdashmdash extend the basic client-server model
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
22
Yun Zhang
Searching the Web
bull Browsing and searching
bull Search engine is a program that allows one to search for keywords in files at one or more Internet sites ndash Excite wwwexcitecom ndash AltaVista wwwaltavistacom ndash Lycos wwwlycoscom ndash Google wwwgooglecom
Introduction to Computer Systems
23
Yun Zhang
How to search
bull Use a search site
bull Type key words of your search into the search engine
bull Searchhellip
bull Use the help information offered by each search engine
Introduction to Computer Systems
24
Yun Zhang
A search Sample
httpwwwgooglecomintlzh-CN
Introduction to Computer Systems
25
Yun Zhang
Introduction to Computer Systems
26
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a search engine bull Sites of this type maintain indexes or
databases of the addresses of virtually all of the pages and documents on the Web These indexes and databases are updated regularly and automatically by programs known as spiders ldquocrawlerrdquo
Introduction to Computer Systems
27
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a Web directory bull it organizes information available on the Web
into different categories and subcategories
Introduction to Computer Systems
28
Yun Zhang
Search Engine
bull Full Text Search Enginendash Google FastAllTheWeb AltaVista Inktomi Wis
eNut Teoma Baidu Lycoshellip
bull Search indexDirectoryndash Yahoo LookSmart 搜狐 新浪 网易hellip
bull Meta Search Enginendash InforSpace Dogpile Vivisimo 搜星hellip
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
8
Yun Zhang
Surfing the Webbull Internet
bull World Wide Web
bull Surfing
bull Internet Service Provider ( ISP )
Introduction to Computer Systems
9
Yun Zhang
Internetbull Internet is a computer network that connects
millions of computers across a number of countries
bull There is no central authority that controls the Internet different organizations own different pieces of it
bull The Internet was originally conceived of by the Advanced Research Project Agency (ARPA) of the US government in the 1960s
Introduction to Computer Systems
10
Yun Zhang
Word Wide Webbull the Web WWW or W3
bull Portion of the computers on the Internet that can communicate with each other using a computer-network protocol called HTTP (Hypertext Transfer Protocol )
bull All browsers use HTTP to request and receive Web pages from other computers
Introduction to Computer Systems
11
Yun Zhang
Surfingbull Browse on the Web
bull page place site web sitendash Locations on the Web that you can visit
and view through a browser
bull homepage
bull No one can certify that information presented on the Web is accurate correct and up-to-date
Introduction to Computer Systems
12
Yun Zhang
Internet Service Provider ( ISP )
bull An ISP is any one of a number of companies that enable people not only to connect to the Internet and surf the Web but also to publish Web pages
bull All Web sites must have unique names or addressesmdashone per machine
Introduction to Computer Systems
13
Yun Zhang
Browse Sample
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
14
Yun Zhang
Introduction to Computer Systems
15
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
16
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
17
Yun Zhang
httpwwwwhueducnindexphp
Introduction to Computer Systems
18
Yun Zhang
URLsbull Uniform Resource Locator naming scheme
ndash Provides user with a way to access Web resources using a uniform means for addressing resources
[protocol][name of machine][name of resource]
Introduction to Computer Systems
19
Yun Zhang
URLs (Cont)bull [protocol][name of machine][name of resource]
ndash ex http wwwicarnegiecomcourseshtml
Hypertext Transfer Protocolmdashmdash a communication protocl
name of the machine hosting
the resource ndash ftp wwwicarnegiecomindexhtmndash http2021143566
name of the resource addressed by the URL
Introduction to Computer Systems
20
Yun Zhang
Basic Work Modelbull Client sends a request for a resource
ndash A protocol (How do I get the resource)ndash The server (What server has this resource)ndash The resource itself (What resource
specifically)
bull Serverndash Locates the resource requestedndash Transmits a copy of the resource back to the
client using the specified protocol
Introduction to Computer Systems
21
Yun Zhang
Browse Sample
Dynamic Web Content
mdashmdash extend the basic client-server model
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
22
Yun Zhang
Searching the Web
bull Browsing and searching
bull Search engine is a program that allows one to search for keywords in files at one or more Internet sites ndash Excite wwwexcitecom ndash AltaVista wwwaltavistacom ndash Lycos wwwlycoscom ndash Google wwwgooglecom
Introduction to Computer Systems
23
Yun Zhang
How to search
bull Use a search site
bull Type key words of your search into the search engine
bull Searchhellip
bull Use the help information offered by each search engine
Introduction to Computer Systems
24
Yun Zhang
A search Sample
httpwwwgooglecomintlzh-CN
Introduction to Computer Systems
25
Yun Zhang
Introduction to Computer Systems
26
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a search engine bull Sites of this type maintain indexes or
databases of the addresses of virtually all of the pages and documents on the Web These indexes and databases are updated regularly and automatically by programs known as spiders ldquocrawlerrdquo
Introduction to Computer Systems
27
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a Web directory bull it organizes information available on the Web
into different categories and subcategories
Introduction to Computer Systems
28
Yun Zhang
Search Engine
bull Full Text Search Enginendash Google FastAllTheWeb AltaVista Inktomi Wis
eNut Teoma Baidu Lycoshellip
bull Search indexDirectoryndash Yahoo LookSmart 搜狐 新浪 网易hellip
bull Meta Search Enginendash InforSpace Dogpile Vivisimo 搜星hellip
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
9
Yun Zhang
Internetbull Internet is a computer network that connects
millions of computers across a number of countries
bull There is no central authority that controls the Internet different organizations own different pieces of it
bull The Internet was originally conceived of by the Advanced Research Project Agency (ARPA) of the US government in the 1960s
Introduction to Computer Systems
10
Yun Zhang
Word Wide Webbull the Web WWW or W3
bull Portion of the computers on the Internet that can communicate with each other using a computer-network protocol called HTTP (Hypertext Transfer Protocol )
bull All browsers use HTTP to request and receive Web pages from other computers
Introduction to Computer Systems
11
Yun Zhang
Surfingbull Browse on the Web
bull page place site web sitendash Locations on the Web that you can visit
and view through a browser
bull homepage
bull No one can certify that information presented on the Web is accurate correct and up-to-date
Introduction to Computer Systems
12
Yun Zhang
Internet Service Provider ( ISP )
bull An ISP is any one of a number of companies that enable people not only to connect to the Internet and surf the Web but also to publish Web pages
bull All Web sites must have unique names or addressesmdashone per machine
Introduction to Computer Systems
13
Yun Zhang
Browse Sample
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
14
Yun Zhang
Introduction to Computer Systems
15
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
16
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
17
Yun Zhang
httpwwwwhueducnindexphp
Introduction to Computer Systems
18
Yun Zhang
URLsbull Uniform Resource Locator naming scheme
ndash Provides user with a way to access Web resources using a uniform means for addressing resources
[protocol][name of machine][name of resource]
Introduction to Computer Systems
19
Yun Zhang
URLs (Cont)bull [protocol][name of machine][name of resource]
ndash ex http wwwicarnegiecomcourseshtml
Hypertext Transfer Protocolmdashmdash a communication protocl
name of the machine hosting
the resource ndash ftp wwwicarnegiecomindexhtmndash http2021143566
name of the resource addressed by the URL
Introduction to Computer Systems
20
Yun Zhang
Basic Work Modelbull Client sends a request for a resource
ndash A protocol (How do I get the resource)ndash The server (What server has this resource)ndash The resource itself (What resource
specifically)
bull Serverndash Locates the resource requestedndash Transmits a copy of the resource back to the
client using the specified protocol
Introduction to Computer Systems
21
Yun Zhang
Browse Sample
Dynamic Web Content
mdashmdash extend the basic client-server model
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
22
Yun Zhang
Searching the Web
bull Browsing and searching
bull Search engine is a program that allows one to search for keywords in files at one or more Internet sites ndash Excite wwwexcitecom ndash AltaVista wwwaltavistacom ndash Lycos wwwlycoscom ndash Google wwwgooglecom
Introduction to Computer Systems
23
Yun Zhang
How to search
bull Use a search site
bull Type key words of your search into the search engine
bull Searchhellip
bull Use the help information offered by each search engine
Introduction to Computer Systems
24
Yun Zhang
A search Sample
httpwwwgooglecomintlzh-CN
Introduction to Computer Systems
25
Yun Zhang
Introduction to Computer Systems
26
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a search engine bull Sites of this type maintain indexes or
databases of the addresses of virtually all of the pages and documents on the Web These indexes and databases are updated regularly and automatically by programs known as spiders ldquocrawlerrdquo
Introduction to Computer Systems
27
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a Web directory bull it organizes information available on the Web
into different categories and subcategories
Introduction to Computer Systems
28
Yun Zhang
Search Engine
bull Full Text Search Enginendash Google FastAllTheWeb AltaVista Inktomi Wis
eNut Teoma Baidu Lycoshellip
bull Search indexDirectoryndash Yahoo LookSmart 搜狐 新浪 网易hellip
bull Meta Search Enginendash InforSpace Dogpile Vivisimo 搜星hellip
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
10
Yun Zhang
Word Wide Webbull the Web WWW or W3
bull Portion of the computers on the Internet that can communicate with each other using a computer-network protocol called HTTP (Hypertext Transfer Protocol )
bull All browsers use HTTP to request and receive Web pages from other computers
Introduction to Computer Systems
11
Yun Zhang
Surfingbull Browse on the Web
bull page place site web sitendash Locations on the Web that you can visit
and view through a browser
bull homepage
bull No one can certify that information presented on the Web is accurate correct and up-to-date
Introduction to Computer Systems
12
Yun Zhang
Internet Service Provider ( ISP )
bull An ISP is any one of a number of companies that enable people not only to connect to the Internet and surf the Web but also to publish Web pages
bull All Web sites must have unique names or addressesmdashone per machine
Introduction to Computer Systems
13
Yun Zhang
Browse Sample
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
14
Yun Zhang
Introduction to Computer Systems
15
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
16
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
17
Yun Zhang
httpwwwwhueducnindexphp
Introduction to Computer Systems
18
Yun Zhang
URLsbull Uniform Resource Locator naming scheme
ndash Provides user with a way to access Web resources using a uniform means for addressing resources
[protocol][name of machine][name of resource]
Introduction to Computer Systems
19
Yun Zhang
URLs (Cont)bull [protocol][name of machine][name of resource]
ndash ex http wwwicarnegiecomcourseshtml
Hypertext Transfer Protocolmdashmdash a communication protocl
name of the machine hosting
the resource ndash ftp wwwicarnegiecomindexhtmndash http2021143566
name of the resource addressed by the URL
Introduction to Computer Systems
20
Yun Zhang
Basic Work Modelbull Client sends a request for a resource
ndash A protocol (How do I get the resource)ndash The server (What server has this resource)ndash The resource itself (What resource
specifically)
bull Serverndash Locates the resource requestedndash Transmits a copy of the resource back to the
client using the specified protocol
Introduction to Computer Systems
21
Yun Zhang
Browse Sample
Dynamic Web Content
mdashmdash extend the basic client-server model
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
22
Yun Zhang
Searching the Web
bull Browsing and searching
bull Search engine is a program that allows one to search for keywords in files at one or more Internet sites ndash Excite wwwexcitecom ndash AltaVista wwwaltavistacom ndash Lycos wwwlycoscom ndash Google wwwgooglecom
Introduction to Computer Systems
23
Yun Zhang
How to search
bull Use a search site
bull Type key words of your search into the search engine
bull Searchhellip
bull Use the help information offered by each search engine
Introduction to Computer Systems
24
Yun Zhang
A search Sample
httpwwwgooglecomintlzh-CN
Introduction to Computer Systems
25
Yun Zhang
Introduction to Computer Systems
26
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a search engine bull Sites of this type maintain indexes or
databases of the addresses of virtually all of the pages and documents on the Web These indexes and databases are updated regularly and automatically by programs known as spiders ldquocrawlerrdquo
Introduction to Computer Systems
27
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a Web directory bull it organizes information available on the Web
into different categories and subcategories
Introduction to Computer Systems
28
Yun Zhang
Search Engine
bull Full Text Search Enginendash Google FastAllTheWeb AltaVista Inktomi Wis
eNut Teoma Baidu Lycoshellip
bull Search indexDirectoryndash Yahoo LookSmart 搜狐 新浪 网易hellip
bull Meta Search Enginendash InforSpace Dogpile Vivisimo 搜星hellip
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
11
Yun Zhang
Surfingbull Browse on the Web
bull page place site web sitendash Locations on the Web that you can visit
and view through a browser
bull homepage
bull No one can certify that information presented on the Web is accurate correct and up-to-date
Introduction to Computer Systems
12
Yun Zhang
Internet Service Provider ( ISP )
bull An ISP is any one of a number of companies that enable people not only to connect to the Internet and surf the Web but also to publish Web pages
bull All Web sites must have unique names or addressesmdashone per machine
Introduction to Computer Systems
13
Yun Zhang
Browse Sample
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
14
Yun Zhang
Introduction to Computer Systems
15
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
16
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
17
Yun Zhang
httpwwwwhueducnindexphp
Introduction to Computer Systems
18
Yun Zhang
URLsbull Uniform Resource Locator naming scheme
ndash Provides user with a way to access Web resources using a uniform means for addressing resources
[protocol][name of machine][name of resource]
Introduction to Computer Systems
19
Yun Zhang
URLs (Cont)bull [protocol][name of machine][name of resource]
ndash ex http wwwicarnegiecomcourseshtml
Hypertext Transfer Protocolmdashmdash a communication protocl
name of the machine hosting
the resource ndash ftp wwwicarnegiecomindexhtmndash http2021143566
name of the resource addressed by the URL
Introduction to Computer Systems
20
Yun Zhang
Basic Work Modelbull Client sends a request for a resource
ndash A protocol (How do I get the resource)ndash The server (What server has this resource)ndash The resource itself (What resource
specifically)
bull Serverndash Locates the resource requestedndash Transmits a copy of the resource back to the
client using the specified protocol
Introduction to Computer Systems
21
Yun Zhang
Browse Sample
Dynamic Web Content
mdashmdash extend the basic client-server model
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
22
Yun Zhang
Searching the Web
bull Browsing and searching
bull Search engine is a program that allows one to search for keywords in files at one or more Internet sites ndash Excite wwwexcitecom ndash AltaVista wwwaltavistacom ndash Lycos wwwlycoscom ndash Google wwwgooglecom
Introduction to Computer Systems
23
Yun Zhang
How to search
bull Use a search site
bull Type key words of your search into the search engine
bull Searchhellip
bull Use the help information offered by each search engine
Introduction to Computer Systems
24
Yun Zhang
A search Sample
httpwwwgooglecomintlzh-CN
Introduction to Computer Systems
25
Yun Zhang
Introduction to Computer Systems
26
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a search engine bull Sites of this type maintain indexes or
databases of the addresses of virtually all of the pages and documents on the Web These indexes and databases are updated regularly and automatically by programs known as spiders ldquocrawlerrdquo
Introduction to Computer Systems
27
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a Web directory bull it organizes information available on the Web
into different categories and subcategories
Introduction to Computer Systems
28
Yun Zhang
Search Engine
bull Full Text Search Enginendash Google FastAllTheWeb AltaVista Inktomi Wis
eNut Teoma Baidu Lycoshellip
bull Search indexDirectoryndash Yahoo LookSmart 搜狐 新浪 网易hellip
bull Meta Search Enginendash InforSpace Dogpile Vivisimo 搜星hellip
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
12
Yun Zhang
Internet Service Provider ( ISP )
bull An ISP is any one of a number of companies that enable people not only to connect to the Internet and surf the Web but also to publish Web pages
bull All Web sites must have unique names or addressesmdashone per machine
Introduction to Computer Systems
13
Yun Zhang
Browse Sample
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
14
Yun Zhang
Introduction to Computer Systems
15
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
16
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
17
Yun Zhang
httpwwwwhueducnindexphp
Introduction to Computer Systems
18
Yun Zhang
URLsbull Uniform Resource Locator naming scheme
ndash Provides user with a way to access Web resources using a uniform means for addressing resources
[protocol][name of machine][name of resource]
Introduction to Computer Systems
19
Yun Zhang
URLs (Cont)bull [protocol][name of machine][name of resource]
ndash ex http wwwicarnegiecomcourseshtml
Hypertext Transfer Protocolmdashmdash a communication protocl
name of the machine hosting
the resource ndash ftp wwwicarnegiecomindexhtmndash http2021143566
name of the resource addressed by the URL
Introduction to Computer Systems
20
Yun Zhang
Basic Work Modelbull Client sends a request for a resource
ndash A protocol (How do I get the resource)ndash The server (What server has this resource)ndash The resource itself (What resource
specifically)
bull Serverndash Locates the resource requestedndash Transmits a copy of the resource back to the
client using the specified protocol
Introduction to Computer Systems
21
Yun Zhang
Browse Sample
Dynamic Web Content
mdashmdash extend the basic client-server model
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
22
Yun Zhang
Searching the Web
bull Browsing and searching
bull Search engine is a program that allows one to search for keywords in files at one or more Internet sites ndash Excite wwwexcitecom ndash AltaVista wwwaltavistacom ndash Lycos wwwlycoscom ndash Google wwwgooglecom
Introduction to Computer Systems
23
Yun Zhang
How to search
bull Use a search site
bull Type key words of your search into the search engine
bull Searchhellip
bull Use the help information offered by each search engine
Introduction to Computer Systems
24
Yun Zhang
A search Sample
httpwwwgooglecomintlzh-CN
Introduction to Computer Systems
25
Yun Zhang
Introduction to Computer Systems
26
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a search engine bull Sites of this type maintain indexes or
databases of the addresses of virtually all of the pages and documents on the Web These indexes and databases are updated regularly and automatically by programs known as spiders ldquocrawlerrdquo
Introduction to Computer Systems
27
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a Web directory bull it organizes information available on the Web
into different categories and subcategories
Introduction to Computer Systems
28
Yun Zhang
Search Engine
bull Full Text Search Enginendash Google FastAllTheWeb AltaVista Inktomi Wis
eNut Teoma Baidu Lycoshellip
bull Search indexDirectoryndash Yahoo LookSmart 搜狐 新浪 网易hellip
bull Meta Search Enginendash InforSpace Dogpile Vivisimo 搜星hellip
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
13
Yun Zhang
Browse Sample
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
14
Yun Zhang
Introduction to Computer Systems
15
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
16
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
17
Yun Zhang
httpwwwwhueducnindexphp
Introduction to Computer Systems
18
Yun Zhang
URLsbull Uniform Resource Locator naming scheme
ndash Provides user with a way to access Web resources using a uniform means for addressing resources
[protocol][name of machine][name of resource]
Introduction to Computer Systems
19
Yun Zhang
URLs (Cont)bull [protocol][name of machine][name of resource]
ndash ex http wwwicarnegiecomcourseshtml
Hypertext Transfer Protocolmdashmdash a communication protocl
name of the machine hosting
the resource ndash ftp wwwicarnegiecomindexhtmndash http2021143566
name of the resource addressed by the URL
Introduction to Computer Systems
20
Yun Zhang
Basic Work Modelbull Client sends a request for a resource
ndash A protocol (How do I get the resource)ndash The server (What server has this resource)ndash The resource itself (What resource
specifically)
bull Serverndash Locates the resource requestedndash Transmits a copy of the resource back to the
client using the specified protocol
Introduction to Computer Systems
21
Yun Zhang
Browse Sample
Dynamic Web Content
mdashmdash extend the basic client-server model
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
22
Yun Zhang
Searching the Web
bull Browsing and searching
bull Search engine is a program that allows one to search for keywords in files at one or more Internet sites ndash Excite wwwexcitecom ndash AltaVista wwwaltavistacom ndash Lycos wwwlycoscom ndash Google wwwgooglecom
Introduction to Computer Systems
23
Yun Zhang
How to search
bull Use a search site
bull Type key words of your search into the search engine
bull Searchhellip
bull Use the help information offered by each search engine
Introduction to Computer Systems
24
Yun Zhang
A search Sample
httpwwwgooglecomintlzh-CN
Introduction to Computer Systems
25
Yun Zhang
Introduction to Computer Systems
26
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a search engine bull Sites of this type maintain indexes or
databases of the addresses of virtually all of the pages and documents on the Web These indexes and databases are updated regularly and automatically by programs known as spiders ldquocrawlerrdquo
Introduction to Computer Systems
27
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a Web directory bull it organizes information available on the Web
into different categories and subcategories
Introduction to Computer Systems
28
Yun Zhang
Search Engine
bull Full Text Search Enginendash Google FastAllTheWeb AltaVista Inktomi Wis
eNut Teoma Baidu Lycoshellip
bull Search indexDirectoryndash Yahoo LookSmart 搜狐 新浪 网易hellip
bull Meta Search Enginendash InforSpace Dogpile Vivisimo 搜星hellip
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
14
Yun Zhang
Introduction to Computer Systems
15
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
16
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
17
Yun Zhang
httpwwwwhueducnindexphp
Introduction to Computer Systems
18
Yun Zhang
URLsbull Uniform Resource Locator naming scheme
ndash Provides user with a way to access Web resources using a uniform means for addressing resources
[protocol][name of machine][name of resource]
Introduction to Computer Systems
19
Yun Zhang
URLs (Cont)bull [protocol][name of machine][name of resource]
ndash ex http wwwicarnegiecomcourseshtml
Hypertext Transfer Protocolmdashmdash a communication protocl
name of the machine hosting
the resource ndash ftp wwwicarnegiecomindexhtmndash http2021143566
name of the resource addressed by the URL
Introduction to Computer Systems
20
Yun Zhang
Basic Work Modelbull Client sends a request for a resource
ndash A protocol (How do I get the resource)ndash The server (What server has this resource)ndash The resource itself (What resource
specifically)
bull Serverndash Locates the resource requestedndash Transmits a copy of the resource back to the
client using the specified protocol
Introduction to Computer Systems
21
Yun Zhang
Browse Sample
Dynamic Web Content
mdashmdash extend the basic client-server model
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
22
Yun Zhang
Searching the Web
bull Browsing and searching
bull Search engine is a program that allows one to search for keywords in files at one or more Internet sites ndash Excite wwwexcitecom ndash AltaVista wwwaltavistacom ndash Lycos wwwlycoscom ndash Google wwwgooglecom
Introduction to Computer Systems
23
Yun Zhang
How to search
bull Use a search site
bull Type key words of your search into the search engine
bull Searchhellip
bull Use the help information offered by each search engine
Introduction to Computer Systems
24
Yun Zhang
A search Sample
httpwwwgooglecomintlzh-CN
Introduction to Computer Systems
25
Yun Zhang
Introduction to Computer Systems
26
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a search engine bull Sites of this type maintain indexes or
databases of the addresses of virtually all of the pages and documents on the Web These indexes and databases are updated regularly and automatically by programs known as spiders ldquocrawlerrdquo
Introduction to Computer Systems
27
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a Web directory bull it organizes information available on the Web
into different categories and subcategories
Introduction to Computer Systems
28
Yun Zhang
Search Engine
bull Full Text Search Enginendash Google FastAllTheWeb AltaVista Inktomi Wis
eNut Teoma Baidu Lycoshellip
bull Search indexDirectoryndash Yahoo LookSmart 搜狐 新浪 网易hellip
bull Meta Search Enginendash InforSpace Dogpile Vivisimo 搜星hellip
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
15
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
16
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
17
Yun Zhang
httpwwwwhueducnindexphp
Introduction to Computer Systems
18
Yun Zhang
URLsbull Uniform Resource Locator naming scheme
ndash Provides user with a way to access Web resources using a uniform means for addressing resources
[protocol][name of machine][name of resource]
Introduction to Computer Systems
19
Yun Zhang
URLs (Cont)bull [protocol][name of machine][name of resource]
ndash ex http wwwicarnegiecomcourseshtml
Hypertext Transfer Protocolmdashmdash a communication protocl
name of the machine hosting
the resource ndash ftp wwwicarnegiecomindexhtmndash http2021143566
name of the resource addressed by the URL
Introduction to Computer Systems
20
Yun Zhang
Basic Work Modelbull Client sends a request for a resource
ndash A protocol (How do I get the resource)ndash The server (What server has this resource)ndash The resource itself (What resource
specifically)
bull Serverndash Locates the resource requestedndash Transmits a copy of the resource back to the
client using the specified protocol
Introduction to Computer Systems
21
Yun Zhang
Browse Sample
Dynamic Web Content
mdashmdash extend the basic client-server model
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
22
Yun Zhang
Searching the Web
bull Browsing and searching
bull Search engine is a program that allows one to search for keywords in files at one or more Internet sites ndash Excite wwwexcitecom ndash AltaVista wwwaltavistacom ndash Lycos wwwlycoscom ndash Google wwwgooglecom
Introduction to Computer Systems
23
Yun Zhang
How to search
bull Use a search site
bull Type key words of your search into the search engine
bull Searchhellip
bull Use the help information offered by each search engine
Introduction to Computer Systems
24
Yun Zhang
A search Sample
httpwwwgooglecomintlzh-CN
Introduction to Computer Systems
25
Yun Zhang
Introduction to Computer Systems
26
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a search engine bull Sites of this type maintain indexes or
databases of the addresses of virtually all of the pages and documents on the Web These indexes and databases are updated regularly and automatically by programs known as spiders ldquocrawlerrdquo
Introduction to Computer Systems
27
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a Web directory bull it organizes information available on the Web
into different categories and subcategories
Introduction to Computer Systems
28
Yun Zhang
Search Engine
bull Full Text Search Enginendash Google FastAllTheWeb AltaVista Inktomi Wis
eNut Teoma Baidu Lycoshellip
bull Search indexDirectoryndash Yahoo LookSmart 搜狐 新浪 网易hellip
bull Meta Search Enginendash InforSpace Dogpile Vivisimo 搜星hellip
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
16
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
17
Yun Zhang
httpwwwwhueducnindexphp
Introduction to Computer Systems
18
Yun Zhang
URLsbull Uniform Resource Locator naming scheme
ndash Provides user with a way to access Web resources using a uniform means for addressing resources
[protocol][name of machine][name of resource]
Introduction to Computer Systems
19
Yun Zhang
URLs (Cont)bull [protocol][name of machine][name of resource]
ndash ex http wwwicarnegiecomcourseshtml
Hypertext Transfer Protocolmdashmdash a communication protocl
name of the machine hosting
the resource ndash ftp wwwicarnegiecomindexhtmndash http2021143566
name of the resource addressed by the URL
Introduction to Computer Systems
20
Yun Zhang
Basic Work Modelbull Client sends a request for a resource
ndash A protocol (How do I get the resource)ndash The server (What server has this resource)ndash The resource itself (What resource
specifically)
bull Serverndash Locates the resource requestedndash Transmits a copy of the resource back to the
client using the specified protocol
Introduction to Computer Systems
21
Yun Zhang
Browse Sample
Dynamic Web Content
mdashmdash extend the basic client-server model
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
22
Yun Zhang
Searching the Web
bull Browsing and searching
bull Search engine is a program that allows one to search for keywords in files at one or more Internet sites ndash Excite wwwexcitecom ndash AltaVista wwwaltavistacom ndash Lycos wwwlycoscom ndash Google wwwgooglecom
Introduction to Computer Systems
23
Yun Zhang
How to search
bull Use a search site
bull Type key words of your search into the search engine
bull Searchhellip
bull Use the help information offered by each search engine
Introduction to Computer Systems
24
Yun Zhang
A search Sample
httpwwwgooglecomintlzh-CN
Introduction to Computer Systems
25
Yun Zhang
Introduction to Computer Systems
26
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a search engine bull Sites of this type maintain indexes or
databases of the addresses of virtually all of the pages and documents on the Web These indexes and databases are updated regularly and automatically by programs known as spiders ldquocrawlerrdquo
Introduction to Computer Systems
27
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a Web directory bull it organizes information available on the Web
into different categories and subcategories
Introduction to Computer Systems
28
Yun Zhang
Search Engine
bull Full Text Search Enginendash Google FastAllTheWeb AltaVista Inktomi Wis
eNut Teoma Baidu Lycoshellip
bull Search indexDirectoryndash Yahoo LookSmart 搜狐 新浪 网易hellip
bull Meta Search Enginendash InforSpace Dogpile Vivisimo 搜星hellip
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
17
Yun Zhang
httpwwwwhueducnindexphp
Introduction to Computer Systems
18
Yun Zhang
URLsbull Uniform Resource Locator naming scheme
ndash Provides user with a way to access Web resources using a uniform means for addressing resources
[protocol][name of machine][name of resource]
Introduction to Computer Systems
19
Yun Zhang
URLs (Cont)bull [protocol][name of machine][name of resource]
ndash ex http wwwicarnegiecomcourseshtml
Hypertext Transfer Protocolmdashmdash a communication protocl
name of the machine hosting
the resource ndash ftp wwwicarnegiecomindexhtmndash http2021143566
name of the resource addressed by the URL
Introduction to Computer Systems
20
Yun Zhang
Basic Work Modelbull Client sends a request for a resource
ndash A protocol (How do I get the resource)ndash The server (What server has this resource)ndash The resource itself (What resource
specifically)
bull Serverndash Locates the resource requestedndash Transmits a copy of the resource back to the
client using the specified protocol
Introduction to Computer Systems
21
Yun Zhang
Browse Sample
Dynamic Web Content
mdashmdash extend the basic client-server model
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
22
Yun Zhang
Searching the Web
bull Browsing and searching
bull Search engine is a program that allows one to search for keywords in files at one or more Internet sites ndash Excite wwwexcitecom ndash AltaVista wwwaltavistacom ndash Lycos wwwlycoscom ndash Google wwwgooglecom
Introduction to Computer Systems
23
Yun Zhang
How to search
bull Use a search site
bull Type key words of your search into the search engine
bull Searchhellip
bull Use the help information offered by each search engine
Introduction to Computer Systems
24
Yun Zhang
A search Sample
httpwwwgooglecomintlzh-CN
Introduction to Computer Systems
25
Yun Zhang
Introduction to Computer Systems
26
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a search engine bull Sites of this type maintain indexes or
databases of the addresses of virtually all of the pages and documents on the Web These indexes and databases are updated regularly and automatically by programs known as spiders ldquocrawlerrdquo
Introduction to Computer Systems
27
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a Web directory bull it organizes information available on the Web
into different categories and subcategories
Introduction to Computer Systems
28
Yun Zhang
Search Engine
bull Full Text Search Enginendash Google FastAllTheWeb AltaVista Inktomi Wis
eNut Teoma Baidu Lycoshellip
bull Search indexDirectoryndash Yahoo LookSmart 搜狐 新浪 网易hellip
bull Meta Search Enginendash InforSpace Dogpile Vivisimo 搜星hellip
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
18
Yun Zhang
URLsbull Uniform Resource Locator naming scheme
ndash Provides user with a way to access Web resources using a uniform means for addressing resources
[protocol][name of machine][name of resource]
Introduction to Computer Systems
19
Yun Zhang
URLs (Cont)bull [protocol][name of machine][name of resource]
ndash ex http wwwicarnegiecomcourseshtml
Hypertext Transfer Protocolmdashmdash a communication protocl
name of the machine hosting
the resource ndash ftp wwwicarnegiecomindexhtmndash http2021143566
name of the resource addressed by the URL
Introduction to Computer Systems
20
Yun Zhang
Basic Work Modelbull Client sends a request for a resource
ndash A protocol (How do I get the resource)ndash The server (What server has this resource)ndash The resource itself (What resource
specifically)
bull Serverndash Locates the resource requestedndash Transmits a copy of the resource back to the
client using the specified protocol
Introduction to Computer Systems
21
Yun Zhang
Browse Sample
Dynamic Web Content
mdashmdash extend the basic client-server model
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
22
Yun Zhang
Searching the Web
bull Browsing and searching
bull Search engine is a program that allows one to search for keywords in files at one or more Internet sites ndash Excite wwwexcitecom ndash AltaVista wwwaltavistacom ndash Lycos wwwlycoscom ndash Google wwwgooglecom
Introduction to Computer Systems
23
Yun Zhang
How to search
bull Use a search site
bull Type key words of your search into the search engine
bull Searchhellip
bull Use the help information offered by each search engine
Introduction to Computer Systems
24
Yun Zhang
A search Sample
httpwwwgooglecomintlzh-CN
Introduction to Computer Systems
25
Yun Zhang
Introduction to Computer Systems
26
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a search engine bull Sites of this type maintain indexes or
databases of the addresses of virtually all of the pages and documents on the Web These indexes and databases are updated regularly and automatically by programs known as spiders ldquocrawlerrdquo
Introduction to Computer Systems
27
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a Web directory bull it organizes information available on the Web
into different categories and subcategories
Introduction to Computer Systems
28
Yun Zhang
Search Engine
bull Full Text Search Enginendash Google FastAllTheWeb AltaVista Inktomi Wis
eNut Teoma Baidu Lycoshellip
bull Search indexDirectoryndash Yahoo LookSmart 搜狐 新浪 网易hellip
bull Meta Search Enginendash InforSpace Dogpile Vivisimo 搜星hellip
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
19
Yun Zhang
URLs (Cont)bull [protocol][name of machine][name of resource]
ndash ex http wwwicarnegiecomcourseshtml
Hypertext Transfer Protocolmdashmdash a communication protocl
name of the machine hosting
the resource ndash ftp wwwicarnegiecomindexhtmndash http2021143566
name of the resource addressed by the URL
Introduction to Computer Systems
20
Yun Zhang
Basic Work Modelbull Client sends a request for a resource
ndash A protocol (How do I get the resource)ndash The server (What server has this resource)ndash The resource itself (What resource
specifically)
bull Serverndash Locates the resource requestedndash Transmits a copy of the resource back to the
client using the specified protocol
Introduction to Computer Systems
21
Yun Zhang
Browse Sample
Dynamic Web Content
mdashmdash extend the basic client-server model
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
22
Yun Zhang
Searching the Web
bull Browsing and searching
bull Search engine is a program that allows one to search for keywords in files at one or more Internet sites ndash Excite wwwexcitecom ndash AltaVista wwwaltavistacom ndash Lycos wwwlycoscom ndash Google wwwgooglecom
Introduction to Computer Systems
23
Yun Zhang
How to search
bull Use a search site
bull Type key words of your search into the search engine
bull Searchhellip
bull Use the help information offered by each search engine
Introduction to Computer Systems
24
Yun Zhang
A search Sample
httpwwwgooglecomintlzh-CN
Introduction to Computer Systems
25
Yun Zhang
Introduction to Computer Systems
26
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a search engine bull Sites of this type maintain indexes or
databases of the addresses of virtually all of the pages and documents on the Web These indexes and databases are updated regularly and automatically by programs known as spiders ldquocrawlerrdquo
Introduction to Computer Systems
27
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a Web directory bull it organizes information available on the Web
into different categories and subcategories
Introduction to Computer Systems
28
Yun Zhang
Search Engine
bull Full Text Search Enginendash Google FastAllTheWeb AltaVista Inktomi Wis
eNut Teoma Baidu Lycoshellip
bull Search indexDirectoryndash Yahoo LookSmart 搜狐 新浪 网易hellip
bull Meta Search Enginendash InforSpace Dogpile Vivisimo 搜星hellip
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
20
Yun Zhang
Basic Work Modelbull Client sends a request for a resource
ndash A protocol (How do I get the resource)ndash The server (What server has this resource)ndash The resource itself (What resource
specifically)
bull Serverndash Locates the resource requestedndash Transmits a copy of the resource back to the
client using the specified protocol
Introduction to Computer Systems
21
Yun Zhang
Browse Sample
Dynamic Web Content
mdashmdash extend the basic client-server model
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
22
Yun Zhang
Searching the Web
bull Browsing and searching
bull Search engine is a program that allows one to search for keywords in files at one or more Internet sites ndash Excite wwwexcitecom ndash AltaVista wwwaltavistacom ndash Lycos wwwlycoscom ndash Google wwwgooglecom
Introduction to Computer Systems
23
Yun Zhang
How to search
bull Use a search site
bull Type key words of your search into the search engine
bull Searchhellip
bull Use the help information offered by each search engine
Introduction to Computer Systems
24
Yun Zhang
A search Sample
httpwwwgooglecomintlzh-CN
Introduction to Computer Systems
25
Yun Zhang
Introduction to Computer Systems
26
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a search engine bull Sites of this type maintain indexes or
databases of the addresses of virtually all of the pages and documents on the Web These indexes and databases are updated regularly and automatically by programs known as spiders ldquocrawlerrdquo
Introduction to Computer Systems
27
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a Web directory bull it organizes information available on the Web
into different categories and subcategories
Introduction to Computer Systems
28
Yun Zhang
Search Engine
bull Full Text Search Enginendash Google FastAllTheWeb AltaVista Inktomi Wis
eNut Teoma Baidu Lycoshellip
bull Search indexDirectoryndash Yahoo LookSmart 搜狐 新浪 网易hellip
bull Meta Search Enginendash InforSpace Dogpile Vivisimo 搜星hellip
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
21
Yun Zhang
Browse Sample
Dynamic Web Content
mdashmdash extend the basic client-server model
浏览武大网站 httpwwwwhueducn
武汉大学的网页
Introduction to Computer Systems
22
Yun Zhang
Searching the Web
bull Browsing and searching
bull Search engine is a program that allows one to search for keywords in files at one or more Internet sites ndash Excite wwwexcitecom ndash AltaVista wwwaltavistacom ndash Lycos wwwlycoscom ndash Google wwwgooglecom
Introduction to Computer Systems
23
Yun Zhang
How to search
bull Use a search site
bull Type key words of your search into the search engine
bull Searchhellip
bull Use the help information offered by each search engine
Introduction to Computer Systems
24
Yun Zhang
A search Sample
httpwwwgooglecomintlzh-CN
Introduction to Computer Systems
25
Yun Zhang
Introduction to Computer Systems
26
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a search engine bull Sites of this type maintain indexes or
databases of the addresses of virtually all of the pages and documents on the Web These indexes and databases are updated regularly and automatically by programs known as spiders ldquocrawlerrdquo
Introduction to Computer Systems
27
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a Web directory bull it organizes information available on the Web
into different categories and subcategories
Introduction to Computer Systems
28
Yun Zhang
Search Engine
bull Full Text Search Enginendash Google FastAllTheWeb AltaVista Inktomi Wis
eNut Teoma Baidu Lycoshellip
bull Search indexDirectoryndash Yahoo LookSmart 搜狐 新浪 网易hellip
bull Meta Search Enginendash InforSpace Dogpile Vivisimo 搜星hellip
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
22
Yun Zhang
Searching the Web
bull Browsing and searching
bull Search engine is a program that allows one to search for keywords in files at one or more Internet sites ndash Excite wwwexcitecom ndash AltaVista wwwaltavistacom ndash Lycos wwwlycoscom ndash Google wwwgooglecom
Introduction to Computer Systems
23
Yun Zhang
How to search
bull Use a search site
bull Type key words of your search into the search engine
bull Searchhellip
bull Use the help information offered by each search engine
Introduction to Computer Systems
24
Yun Zhang
A search Sample
httpwwwgooglecomintlzh-CN
Introduction to Computer Systems
25
Yun Zhang
Introduction to Computer Systems
26
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a search engine bull Sites of this type maintain indexes or
databases of the addresses of virtually all of the pages and documents on the Web These indexes and databases are updated regularly and automatically by programs known as spiders ldquocrawlerrdquo
Introduction to Computer Systems
27
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a Web directory bull it organizes information available on the Web
into different categories and subcategories
Introduction to Computer Systems
28
Yun Zhang
Search Engine
bull Full Text Search Enginendash Google FastAllTheWeb AltaVista Inktomi Wis
eNut Teoma Baidu Lycoshellip
bull Search indexDirectoryndash Yahoo LookSmart 搜狐 新浪 网易hellip
bull Meta Search Enginendash InforSpace Dogpile Vivisimo 搜星hellip
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
23
Yun Zhang
How to search
bull Use a search site
bull Type key words of your search into the search engine
bull Searchhellip
bull Use the help information offered by each search engine
Introduction to Computer Systems
24
Yun Zhang
A search Sample
httpwwwgooglecomintlzh-CN
Introduction to Computer Systems
25
Yun Zhang
Introduction to Computer Systems
26
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a search engine bull Sites of this type maintain indexes or
databases of the addresses of virtually all of the pages and documents on the Web These indexes and databases are updated regularly and automatically by programs known as spiders ldquocrawlerrdquo
Introduction to Computer Systems
27
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a Web directory bull it organizes information available on the Web
into different categories and subcategories
Introduction to Computer Systems
28
Yun Zhang
Search Engine
bull Full Text Search Enginendash Google FastAllTheWeb AltaVista Inktomi Wis
eNut Teoma Baidu Lycoshellip
bull Search indexDirectoryndash Yahoo LookSmart 搜狐 新浪 网易hellip
bull Meta Search Enginendash InforSpace Dogpile Vivisimo 搜星hellip
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
24
Yun Zhang
A search Sample
httpwwwgooglecomintlzh-CN
Introduction to Computer Systems
25
Yun Zhang
Introduction to Computer Systems
26
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a search engine bull Sites of this type maintain indexes or
databases of the addresses of virtually all of the pages and documents on the Web These indexes and databases are updated regularly and automatically by programs known as spiders ldquocrawlerrdquo
Introduction to Computer Systems
27
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a Web directory bull it organizes information available on the Web
into different categories and subcategories
Introduction to Computer Systems
28
Yun Zhang
Search Engine
bull Full Text Search Enginendash Google FastAllTheWeb AltaVista Inktomi Wis
eNut Teoma Baidu Lycoshellip
bull Search indexDirectoryndash Yahoo LookSmart 搜狐 新浪 网易hellip
bull Meta Search Enginendash InforSpace Dogpile Vivisimo 搜星hellip
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
25
Yun Zhang
Introduction to Computer Systems
26
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a search engine bull Sites of this type maintain indexes or
databases of the addresses of virtually all of the pages and documents on the Web These indexes and databases are updated regularly and automatically by programs known as spiders ldquocrawlerrdquo
Introduction to Computer Systems
27
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a Web directory bull it organizes information available on the Web
into different categories and subcategories
Introduction to Computer Systems
28
Yun Zhang
Search Engine
bull Full Text Search Enginendash Google FastAllTheWeb AltaVista Inktomi Wis
eNut Teoma Baidu Lycoshellip
bull Search indexDirectoryndash Yahoo LookSmart 搜狐 新浪 网易hellip
bull Meta Search Enginendash InforSpace Dogpile Vivisimo 搜星hellip
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
26
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a search engine bull Sites of this type maintain indexes or
databases of the addresses of virtually all of the pages and documents on the Web These indexes and databases are updated regularly and automatically by programs known as spiders ldquocrawlerrdquo
Introduction to Computer Systems
27
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a Web directory bull it organizes information available on the Web
into different categories and subcategories
Introduction to Computer Systems
28
Yun Zhang
Search Engine
bull Full Text Search Enginendash Google FastAllTheWeb AltaVista Inktomi Wis
eNut Teoma Baidu Lycoshellip
bull Search indexDirectoryndash Yahoo LookSmart 搜狐 新浪 网易hellip
bull Meta Search Enginendash InforSpace Dogpile Vivisimo 搜星hellip
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
27
Yun Zhang
Searching the Web (Cont)
bull Tow types of Search Sites
ndash Sites that feature a Web directory bull it organizes information available on the Web
into different categories and subcategories
Introduction to Computer Systems
28
Yun Zhang
Search Engine
bull Full Text Search Enginendash Google FastAllTheWeb AltaVista Inktomi Wis
eNut Teoma Baidu Lycoshellip
bull Search indexDirectoryndash Yahoo LookSmart 搜狐 新浪 网易hellip
bull Meta Search Enginendash InforSpace Dogpile Vivisimo 搜星hellip
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
28
Yun Zhang
Search Engine
bull Full Text Search Enginendash Google FastAllTheWeb AltaVista Inktomi Wis
eNut Teoma Baidu Lycoshellip
bull Search indexDirectoryndash Yahoo LookSmart 搜狐 新浪 网易hellip
bull Meta Search Enginendash InforSpace Dogpile Vivisimo 搜星hellip
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
29
Yun Zhang
Commerce on the Web
bull Web-based Internet commerce
ndash Internet Service Providers (ISPs)
bull sell you access to the Internet
ndash Advertising
ndash Commercial Transactions
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
30
Yun Zhang
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
31
Yun Zhang
Some Ethical Considerations
bull Can you go to your favorite sports teams Web page make a copy of the jpeg or gif file that is their logo and put that logo on your Web page
bull Can you put a link on your page to the home page of your favorite sports team
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
32
Yun Zhang
Internet Languages
bull HTML
bull XML
bull JavaScript
bull Java
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
33
Yun Zhang
HTMLbull HTML stands for Hyper Text Markup Language An HTM
L file is a text file containing a set of predefined tags that are used to specify how data should be displayed in a browser or another application program For example inserting the built-in tag ltigt and ltigt around a phrase would italicized the phrase displayed Because HTML is composed of text you can create an HTML file using a text editor To enable the Web browser to interpret how you want the page to be displayed you must save the file with an htm or html file extension Note that lt and gt indicates the beginning and end of a tag respectively
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
34
Yun Zhang
HTML examplebull 1 Open a text editor application such as Notepadexebull 2 Copy the following text and paste it into the text editor
programbull lthtmlgt
ltheadgtlttitlegtPage titlelttitlegtltheadgtltbodygtThis is an example of a Web page ltbgtA tag is used to make this text appear boldltbgtltbodygtlthtmlgt
bull 3 Save the file on Desktop as samplehtmlbull 4 Open a Web browser application
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
35
Yun Zhang
XML
bull XML (eXtensible Markup Language)
bull Differences between HTML and XMLndash HTML tags are primarily concerned with how t
ext should be displayed XML tags can be used to describe what a piece of text means
ndash There are no predefined tags in XML Users have the freedom to define their own tags
ndash For example ltphonegt4125551212ltphonegt
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
36
Yun Zhang
JavaScriptbull JavaScript is a scripting language which
means the instructions the programmer writes are not compiled in advance Instead they are interpreted by an application when the script is run by the computer
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
37
Yun Zhang
JavaScript examplebull lthtmlgt
ltheadgt lttitlegtJavaScript Demonstrationlttitlegt ltscript type=textjavascript language=JavaScript12gt function display() documentbodybgColor = black
var ln1 = Hello World var ln2 = This is the + documenttitle + page var str = ln1fontcolor(lime) + ltbr gt + ln2fontcolor(red)
documentwriteln(str) ltscriptgt ltheadgt ltbodygt ltscript type=textjavascript language=JavaScript12gt display() ltscriptgt ltbodygtlthtmlgt
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
38
Yun Zhang
Java
bull Java is a high-level programming language that was developed by Sun Microsystems and has become a popular programming tool for web-based projects Small Java applications are called Java applets
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
39
Yun Zhang
Java examplebull import javaappletApplet
import javaawtGraphics
public class Demonstration extends Applet public void paint(Graphics g) gdrawRoundRect(5 5 100 50 10 10) gdrawString(Hello World 23 35)
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
40
Yun Zhang
52 Local and Wide Area Networksbull Reading Sequence
bull Textbook Subsection Internet Resources in Section 1B
bull Textbook Section 5B
bull Textbook Section 5D
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
41
Yun Zhang
Network Classifications
bull An internetwork or ldquointernetrdquo is a network that is composed of many smaller networks
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
42
Yun Zhang
Network Classifications
bull Intranet ldquoIntrardquo 的意思是ldquo内部的rdquo合起来就是ldquo内部网rdquo由于它主要是指企业内部的计算机网络所以也称ldquo企业内部网rdquo从原理上来说 Intranet 其实就是一个局域网只是功能非常全面在 Intranet内部可以象 Internet 上一样收发电子邮件进行 WWW 浏览当然这些操作都只限于在企业内部并不能直接从 Internet 获取信息
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
43
Yun Zhang
Network Classificationsbull LAN (Local Area Network 局域网 ) 在一个相对有
限的地理范围内由一组 PC 服务器打印机和类似的设备连接组成的网络
bull WAN (Wide Area Network 广域网 ) 是一种跨地区的数据通讯网络 通常包含一个国家或地区广域网通常由两个或多个局域网组成计算机常常使用电信运营商提供的设备作为信息传输平台 例如通过公用网 如电话网 连接到广域网 也可以通过专线或卫星连接
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
44
Yun Zhang
Network Classifications
bull MAN (Metropolitan Area Network 城域网 ) 是在一个城市范围内所建立的计算机通信网 范围在 80km 之内 80 年代末在 LAN 的发展基础上提出的
bull Wireless network 无线网络 就是利用无线电波作为信息传输的媒介构成的网络与有线网络的用途十分类似 最大的不同在于传输媒介的不同
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
45
Yun Zhang
53 Communication Strategies
bull Read
bull 531 Client-Server Framework Learning Goal Understanding thin and thick clients
bull 532 Peer-to-Peer Connectivity Learning Goal Understanding how each machine is both a client and a server and what impact this has on computing
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
46
Yun Zhang
client-server systemsbull Many network applications are organized as client-
server systems The client runs on the users computer and interacts with both the user and the server
bull The server can accept requests from any number of clients It performs some service for them and returns the results
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
47
Yun Zhang
Clients Serversbull Clients Servers
ndash A client application requests information from a server application or asks the server to perform some task
ndash Client asks for servicendash Server provides the service
请求服务
提供服务
The browser is
considered a client
The site that supplies the information
is considered a
server
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
48
Yun Zhang
Examplebull World Wide Web The client is the Web browser
program For a machine to host a Web site it must run a Web server program that clients can talk to
bull Email Microsoft Outlook is the client The server is a program that accepts and stores incoming mail for users and delivers the mail to them when their client requests it Servers can also forward mail to other servers if necessary
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
49
Yun Zhang
Clients Serversbull Server applications are typically run on
powerful computers since they need to be able to service concurrent requests from a number of clients
bull Client applications are typically run on less powerful computers such as PCs or workstations
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
50
Yun Zhang
client-server systemsbull thick clients amp thin clients bull based on how much work is done on the client
side a thin client does relatively little work A thick client carries out a substantial portion of the overall work of the system
bull Web surfing use the browser acts as a thin client while the work of searching a database and organizing the results is carried out by servers
bull a system might download a Java applet to the browser and that applet might act as a thick client
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
51
Yun Zhang
Peer-to-Peer Connectivity
bull Peer-to-peer (P2P) Instead of having a central server that all clients communicate with every member of a peer-to-peer network can communicate with any other member
bull Ega multi-player network game Napster emule
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
52
Yun Zhang
Clientserver amp Peer-to-peer
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
53
Yun Zhang
54 Data Transfer Technologies
bull Reading Sequence
bull Textbook Section 5A
bull Textbook Section 5C
bull Domain Name Service amp URL
bull OSI Layers
bull TCPIP Protocols
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
54
Yun Zhang
分组从 A 传送到 B 的过程
网络
网络
网络网络
网络
网络
网络
路由器
路由器
路由器
路由器
路由器
路由器
A
B
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
查找路由表
目 的 地 下一跳路由器
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
55
Yun Zhang
网络
网络
路由器
路由器
每个分组的首部都有 IP 地址信息
源 IP 地址目的 IP 地址
网络
路由器
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
根据目的 IP 地址查找路由表
查出下一跳路由器的地址
网络路由器
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
56
Yun Zhang
What is a URL
bull Every Web page has a unique address called a URL (Uniform resource locator 统一资源定位符 )
bull Most URLs begin with http
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
57
Yun Zhang
开放系统互连基本参考模型 (OSIRM)bull 国际标准化组织( International Standards Organization--
ISO )经过反复地研究在已有的网络体系结构 ( 如 DNA SNA 等 ) 的基础上制定了开放系统互连参考模型 (Open Systems Interconnection Reference ModelmdashOSIRM) 供设计实现和
应用各种计算机 网络参考1048698bull 一个系统是开放 的是指它可与世 界上任何地方的遵 守相同标准的其他 任何系统通信
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
58
Yun Zhang
5
4
3
2
1
5
4
3
2
1
H3
物 理 传 输 媒 体
数 据 部 分
数 据 部 分
数 据 部 分
数 据 部 分
10100110100101 比 特 流 11 010111010
T2
计算机 1
H5
H4
H2
首部
尾部
helliphellip
AP2AP1应 用 程 序 数 据
计算机 2
比特
帧
IP 数据报IP 分组
TCP 报文段UDP 报文段
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
59
Yun Zhang
protocol 协议bull 在计算机网络中协议 (protocol 网络协议 )
是通信双方必须严格遵守的规则是为进行网络中的数据交换而建立的规则标准或约定这些规则明确规定了所交换的数据的格式及有关同步问题
bull 协议精确地规定在网络通信中使用的各种控制信息的格式意义以及各种事件出现的先后顺序
bull 协议在计算机网络中起着非常重要的作用
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
60
Yun Zhang
划分层次的重要性bull 协议的三要素( 1 )语法数据与控制信息的结构或格
式( 2 )语义即需要发出何种控制信息完成何种动作以及做出何种应答
( 3 )同步即事件实现顺序的详细说明
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
61
Yun Zhang
IPTCP
bull 因特网使用的协议很多但其中最为重要的协议就是 IP 和 TCP
bull 分组在因特网中传送要使用 IP 协议计算机数据传输的可靠性由 TCP 协议来保证
bull 通常用 TCPIP 这样的记法表示以 TCP 和 IP 为核心的协议族
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
62
Yun Zhang
因特网
应用程序
TCP 协议保证了应用程序之间的可靠通信 应用
程序
IP 协议控制分组在因特网的传输但因特网不保证可靠交付
最重要的两个协议 IP 和 TCP
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
63
Yun Zhang
IP Protocol
bull 因特网的 IP 协议最重要它为分组在互连网中的发送传输和接收制定了详尽的规则
bull IP 是 Internet Protocol 的缩写中文标准译名是ldquo网际协议rdquo
bull 使用 IP 协议的互连网络常称为ndash IP 网络或 IP 网
bull 在 IP 网络传送的分组常称为ndash IP 分组或 IP 数据报 (IP datagram)
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
64
Yun Zhang
TCP Protocol bull TCP 是 Transmission Control Protocol 的缩写中文译名是传输控制协议
bull TCP 协议驻留在用户计算机中它的作用是保证应用程序之间端到端的可靠通信
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
65
Yun Zhang
TCP Protocol
bull TCP 给要传送的每一个字节的数据都进行编号ndash 接收端在收到数据后必须向发送端发送确认信
息ndash若发送端在规定的时间内没有收到对方的确认
就重传这部分数据bull 当网络中的通信量过大时 TCP 就告诉发
送端要放慢发送数据这叫做流量控制
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
66
Yun Zhang
HTTP (HyperText Transfer Protocol)
bull HTTP (hypertext Transfer Protocol超文本传送协议 ) is the communications standard thatrsquos instrumental in ferrying Web documents to all corners of the Internet
bull 万维网客户程序与服务器程序之间的交互遵守超文本传送协议 HTTP
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
67
Yun Zhang
bull 电子邮件是因特网最受欢迎的应用bull 电子邮件大大方便了人们的生活工作和学习
bull 电子邮件也改变了人们生活工作和学习的方式
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
68
Yun Zhang
发送方
邮件缓存 邮件服务器
因特网
使用 SMTP 协议
用户邮箱
接收方
发送邮件使用的协议mdashmdash简单邮件传送协议发送邮件使用的协议mdashmdash简单邮件传送协议 SMTP (Simple Mail Transfer Protocol)SMTP (Simple Mail Transfer Protocol)
邮件服务器
接收邮件使用的协议mdashmdash邮局协议版本接收邮件使用的协议mdashmdash邮局协议版本 33POP3 (Post Office Protocol version 3)POP3 (Post Office Protocol version 3)
发送端 ISP 接收端 ISP
使用 SMTP 协议
使用 POP3 协议
sinacom mailcctvcom
发信人地址 xyz5678sinacom 收信人地址 ab30mailcctvcom
邮件服务器的域名读作 ldquo atrdquo
用户名(用户邮箱)
邮件的传送仍然要使用 邮件的传送仍然要使用 IP IP 和 和 TCP TCP 协议协议
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
69
Yun Zhang
MIME Typesbull It is possible to attach images and other types of
documents to an email message This raises a problem how is the mail client supposed to know what to do with these documents
bull The solution is to give each attachment a label explaining what kind of document it is The labels are called MIME types (the acronym for Multipurpose Internet Mail Extension 多用途互联网邮件扩展 )
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
70
Yun Zhang
电子邮件的优点与缺点bull 优点
ndash快捷ndash价廉ndash 不打断对方工作或休息
bull 缺点ndash 有时邮件很慢或甚至丢失ndash 对垃圾邮件尚无有效对策
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
71
Yun Zhang
Exercise 5bull Question1 XML and HTMLbull One necessary component to facilitate electronic
commerce is the capability to exchange data over varying systems In this section you will strengthen your knowledge of XML as a portable language that enables data to be handled by any computer system
bull a What does the term ldquoXMLrdquo stand for What is the function of XML tags and how does the function of XML tags differ from the function of HTML tags
bull b Contrast the flexibility of using XML tags and HTML tags
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
72
Yun Zhang
Exercise 5
bull c What is one reason why storing data in XML may be preferred to enable multiple systems to exchange data
bull Download and save Movies100EXxml and displayhtml on your Desktop
bull Open Movies100EXxml using Notepadexe to see the content of the XML file
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
73
Yun Zhang
Exercise 5bull f For the movie titled ldquoTop Gunrdquo list the following
Year Score
bull Open displayhtml using Notepadexe to see the content of the HTML file Note that the references used to embed the xml file are highlighted in bold font below
bull lthtmlgtltbodygtltxml id=movies src=Movies100EXxmlgtltxmlgtThis is a nice use of non-standard HTML Do we really want to use IE only items Also since it is non-standard will the students have gained the knowledge necessary to answer this questionlttable border=1 datasrc=moviesgtlttrgtlttdgtltspan datafld=Titlegtltspangtlttdgtlttdgtltspan datafld=Yeargtltspangtlttdgtlttdgtltspan datafld=Scoregtltspangtlttdgtlttrgtlttablegtltbodygtlthtmlgt
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
74
Yun Zhang
Exercise 5bull Drag and drop displayhtml into an Internet Explorer wind
ow to see how it is displayedbull g Generate another HTML file that displays additional d
ata fields from the XML file listing Movie_id Title Year Score and Votes Save the HTML file as ldquomyXMLhtmlrdquo Copy and paste your HTML code
bull h Use Internet Explorer to display myXMLhtml Copy the screen shot of this file showing 20 movie entries and paste the screen shot into your assignment submission
bull Delete Movies100EXxml displayhtml and myXMLhtml from Desktop
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
75
Yun Zhang
Exercise 5 bull Question 2 Network Failurebull In addition to Tracert other network tools s
uch as IPconfig and Ping can be used to troubleshoot network issues
bull You can use ipconfig command to see whether your computer is connected to the Internet
bull Pull up the command console Type ldquoipconfig allrdquo
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
76
Yun Zhang
Exercise 5bull a Are you connected to the Internet Paste the screens
hot showing the result of the command ipconfigbull b What is your IP addressbull c What are the IP addresses of your DNS servers bull You can use Ping to test the response of the destination
serverbull d First launch the Windows Command Console Type
ldquoping wwwyahoocomrdquo Copy and paste the screenshot of the Ping command
bull e Did you get a response from the target server bull f List two possible explanation(s) for the result of the Pin
g command belowbull
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result
Introduction to Computer Systems
77
Yun Zhang
Exercise 5
bull Figure 2 Ping Result