GUET计算机网络习题课2
- 格式:pdf
- 大小:631.71 KB
- 文档页数:13
计算机网络教程知识点和习题B类和C类地址都是单播地址,D类地址用于多播,E类地址保留为以后用。
划分子网:1个C类地址空间仅能容纳254台主机,划分子网的编址方法大大减小了对A、B类地址空间的浪费。
截图3.CIDR:无分类域间选择(CIDR)无分类编址:1.网络地址=子网掩码ANDIP地址2.同样的IP地址和不同的子网掩码可以得出相同的网络地址,但不同的子网掩码的效果是不同的,最大地址是一样的,各自容纳的最大主机数是不一样的。
3.斜线记法(CIDR记法)中,斜线后面的数字就是地址掩码中1的个数。
CIDR记法提供了IP地址,子网掩码,能分配几个IP地址,也就是地址空间大小,并能计算最大,最小地址。
看书4.ARP协议:1.IP地址放在IP数据报的首部,而物理地址则放在MAC帧的首部。
在网络层和网络层以上使用的是IP地址,而数据链路层及以下使用的是物理地址。
2.地址解析协议ARP解决知道IP地址求物理地址,逆地址解析协议RARP解决知道物理地址求IP地址的。
3.每一个主机都设有一个ARP高速缓存,里面有所在的局域网上的各主机和路由器的IP地址到硬件地址的映射表。
4.ARP是解决同一个局域网上的主机或路由器的IP地址和硬件地址的映射问题。
否则只能通过路由器了。
5.RARP协议:第六章DHCP协议中介绍6.IP首部:1.一个IP数据报由首部和数据两部分组成。
首部的前一部分是固定长度,共20字节,是所有IP数据报必须具有的。
2.片偏移是起始位数除以8,IP数据报结构,截图7.路由表:看书8.默认路由:看书9.ICMP协议的应用:1.ICMP报文作为IP层数据报的数据,加上数据报的首部,组成IP数据报发送出去。
ICMP协议是IP层的协议。
2.ICMP 差错报告报文:终点不可达,源点抑制,超时,参数问题,改变路由(重定向),ICMP询问报文:回送请求和回答,时间戳请求和回答。
10.RIP协议:1.因特网把路由选择协议划分为内部网关协议(RIP和OSPF等)和外部网关协议(BGP)。
第二章1. (Q2)For a communication session between a pair of processes, which process is the client and which is the server?Answer:The process which initiates the communication is the client; the process that waits to be contacted is the server..2. (Q3) What is the difference between network architecture and application architecture?Answer:Network architecture refers to the organization of the communication processintolayers (e.g., the five-layer Internet architecture). Application architecture, on the other hand, is designed by an application developer and dictates the broadstructure of the application (e.g., client-server or P2P)3. (Q4) What information is used by a process running on one host to identify a process running on another host?Answer: The IP address of the destination host and the port number of the destinationsocket.4. (Q6) Referring to Figure 2.4, we see that none of the application listed in Figure 2.4 requires both no data loss and timing. Can you conceive of an application that requires no data loss and that is also highly time-sensitive?Answer: There are no good example of an application that requires no data loss and timing.If you know of one, send an e-mail to the authors5. (Q9) Why do HTTP, FTP, SMTP, and POP3 run on top of TCP rather than on UDP?Answer: The applications associated with those protocols require that all application databe received in the correct order and without gaps. TCP provides this servicewhereas UDP does not.6. (Q11) What is meant by a handshaking protocol?Answer: A protocol uses handshaking if the two communicating entities first exchangecontrol packets before sending data to each other. SMTP uses handshaking at theapplication layer whereas HTTP does not.7. (Q13) Telnet into a Web server and send a multiline request message. Include in the request message the If-modified-since: header line to force a response message with the 304 Not Modified status code.Answer: Issued the following command (in Windows command prompt) followed by theHTTP GET message to the “” web server:> telnet 80Since the index.html page in this web server was not modified since Fri, 18 May2007 09:23:34 GMT, the following output was displayed when the abovecommands were issued on Sat, 19 May 2007. Note that the first 4 lines are theGET message and header lines input by the user and the next 4 lines (startingfrom HTTP/1.1 304 Not Modified) is the response from the web server.8. (Q14) Consider an e-commerce site that wants to keep a purchase record for each of its customers. Describe how this can be done with cookies.Answer: When the user first visits the site, the site returns a cookie number. This cookie number is stored on the user’s host and is managed by the browser. During each subsequent visit (and purchase), the browser sends the cookie number back to the site. Thus the site knows when this user (more precisely, this browser) is visiting the site.9. (Q15) Suppose Alice, with a Web-based e-mail account (such as Hotmail or gmail), sends a message to Bob, who accesses his mail from his mail server using POP3. Discuss how the message gets from Alice’s host to Bob’s host. Be sure to list the series of application-layer protocols that are used to move the message between the two hosts.Answer: Message is sent from Alice’s host to her mail server over HTTP. Alice’s mail server then sends the message to Bob’s mail server over SMTP. Bob then transfers the message from his mail server to his host over POP3.10. (Q10) Recall that TCP can be enhanced with SSL to provide process-to-process securityservices, including encryption. Does SSL operate at the transport layer or the application layer? If the application developer wants TCP to be enhanced with SSL, what does the developer have to do?Answer: SSL operates at the application layer. The SSL socket takes unencrypted data fromthe application layer, encrypts it and then passes it to the TCP socket. If theapplication developer wants TCP to be enhanced with SSL, she has to include theSSL code in the application.11. (Q16) Print out the header of an e-mail message you have recently received. How manyReceived: header lines are there? Analyze each of the header lines in the message.Answer: from 65.54.246.203 (EHLO )Received:(65.54.246.203) by with SMTP; Sat, 19 May 2007 16:53:51 -0700from ([65.55.135.106]) by Received: with Microsoft SMTPSVC(6.0.3790.2668); Sat, 19 May 2007 16:52:42 -0700 Received: from mail pickup service by with Microsoft SMTPSVC; Sat,19 May 2007 16:52:41 -0700Message-ID: <*******************************************>Received: from 65.55.135.123 by with HTTP; Sat, 19 May 2007 23:52:36 GMTFrom: "prithuladhungel"<***************************>To: ******************Bcc:Subject: Test mailDate: Sat, 19 May 2007 23:52:36 +0000Mime-Version:1.0Content-Type: Text/html; format=flowedReturn-Path: ***************************Figure: A sample mail message headerReceived: This header field indicates the sequence in which the SMTP serverssend and receive the mail message including the respective timestamps.In this example there are 4 “Received:” header lines. This means the mailmessage passed through 5 different SMTP servers before being delivered to thereceiver’s mail box. The la st (forth) “Received:” header indicates the mailmessage flow from the SMTP server of the sender to the second SMTP server inthe chain of servers. The sender’s SMTP server is at address 65.55.135.123 andthe second SMTP server in the chain is .The third “Received:” header indicates the mail message flow from the secondSMTP server in the chain to the third server, and so on.Finally, the first “Received:” header indicates the flow of the mail message fromthe forth SMTP server to t he last SMTP server (i.e. the receiver’s mail server) inthe chain.Message-id: The message has been given this*************************************************(bybay0-omc3-s3.bay0.hotmail.com. Message-id is a unique string assigned by the mail systemwhen the message is first created.From: This indicates the email address of the sender of the mail. In the givenexample,**************************************To: This field indicates the email address of the receiver of the mail. In theexample, the ****************************Subject: This gives the subject of the mail (if any specified by the sender). In theexample, the subject specified by the sender is “Test mail”Date: The date and time when the mail was sent by the sender. In the example,the sender sent the mail on 19th May 2007, at time 23:52:36 GMT.Mime-version: MIME version used for the mail. In the example, it is 1.0.Content-type: The type of content in the body of the mail message. In theexample, it is “text/html”.Return-Path: This specifies the email address to which the mail will be sent if thereceiver of this mail wants t o reply to the sender. This is also used by the sender’smail server for bouncing back undeliverable mail messages of mailer-daemonerror messages. In the example, the return path is“***************************”.12. (Q18) Is it possible for an organizat ion’s Web server and mail server to have exactly thesame alias for a hostname (for example, )? What would be the type for the RR that contains the hostname of the mail server?Answer: Yes an organization’s mail server and Web server can have the sa me alias for ahost name. The MX record is used to map the mail server’s host name to its IPaddress.13. (Q19) Why is it said that FTP sends control information “out-of-band”?Answer:FTP uses two parallel TCP connections, one connection for sending controlinformation (such as a request to transfer a file) and another connection foractually transferring the file. Because the control information is not sent over thesame connection that the file is sent over, FTP sends control information out ofband.14. (P6) Consider an HTTP client that wants to retrieve a Web document at a given URL. The IPaddress of the HTTP server is initially unknown. What transport and application-layer protocols besides HTTP are needed in this scenario?Answer:Application layer protocols: DNS and HTTPTransport layer protocols: UDP for DNS; TCP for HTTP15. (P9) Consider Figure2.12, for which there is an institutional network connected to theInternet. Suppose that the average object size is 900,000 bits and that the average request rate from the institution’s browsers to the origin servers is 10 requests per second. Also suppose that the amount of time it takes from when the router on the Internet side of the access link forwards an HTTP request until it receives the response is two seconds on average (see Section 2.2.5).Model the total average response times as the sum of the average access delay (that is, the delay from Internet router to institution router) and the average Internet delay. For the average access delay, use △/(1-△β), where △is the average time required to send an object over the access link and βis the arrival rate of objects to the access link.a. Find the total average response time.b. Now suppose a cache is installed in the institutional LAN. Suppose the hit rate is 0.6. Findthe total response time.Answer:a.The time to transmit an object of size L over a link or rate R is L/R. The average timeisthe average size of the object divided by R:Δ= (900,000 bits)/(1,500,000 bits/sec) = 0.6 secThe traffic intensity on the link is (1.5 requests/sec)(0.6 sec/request) = 0.9. Thus, theaverage access delay is (0.6 sec)/(1 - 0.9) = 6 seconds. The total average response timeis therefore 6 sec + 2 sec = 8 sec.b.The traffic intensity on the access link is reduced by 40% since the 40% of therequestsare satisfied within the institutional network. Thus the average access delayis(0.6 sec)/[1–(0.6)(0.9)] = 1.2 seconds. The response time is approximately zero iftherequest is satisfied by the cache (which happens with probability 0.4); the averageresponse time is 1.2 sec + 2 sec = 3.2 sec for cache misses (which happens 60% of thetime). So the average response time is (0.4)(0 sec) + (0.6)(3.2 sec) = 1.92 seconds.Thusthe average response time is reduced from 8 sec to 1.92 sec.16. (P12) What is the difference between MAIL FROM: in SMTP and From: in the mail messageitself?Answer: The MAIL FROM: in SMTP is a message from the SMTP client that identifies the senderof the mail message to the SMTP server. TheFrom: on the mail message itself is NOTanSMTP message, but rather is just a line in the body of the mail message.17. (P16) Consider distributing a file of F = 5 Gbits to N peers. The server has an upload rate ofu s = 20 Mbps, and each peer has a download rate of d i =1 Mbps and an upload rate of u. For N = 10, 100, and 1,000 and u = 100 Kbps, 250 Kbps, and 500 Kbps, prepare a chart giving the minimum distribution time for each of the combinations of N and u for both client-server distribution and P2P distribution.Answer:For calculating the minimum distribution time for client-server distribution, we use thefollowing formula:D cs = max {NF/u s , F/d min }Similarly, for calculating the minimum distribution time for P2P distribution, we use thefollowing formula:D P 2P = max {F /u s ,F /d min ,NF /( u s + u i n i =1 )} Where,F = 5 Gbits = 5 * 1024 Mbits u s = 20 Mbps d min = d i = 1 MbpsClient Server:N 10 100 1000 200 Kbps10240 51200 512000 u 600 Kbps10240 51200 512000 1Mbps10240 51200 512000Peer to Peer:N 10 100 1000 200 Kbps10240 25904.3 47559.33 U 600 Kbps10240 13029.6 16899.64 1 Mbps10240 10240 10240。
计算机网络技术习题及答案一、选择题1、在 OSI 参考模型中,物理层的主要功能是()A 数据链路的建立、维护和拆除B 在物理媒体上传输比特流C 确定进程之间通信的性质,以满足用户的需要D 提供可靠的端到端服务答案:B解释:物理层主要负责在物理媒体上传输比特流,也就是将数字信号转换为物理信号进行传输。
2、以下哪种拓扑结构的网络中,任意两个节点之间的通信都需要通过中心节点进行转发()A 星型拓扑B 总线型拓扑C 环型拓扑D 网状拓扑答案:A解释:在星型拓扑结构中,所有节点都连接到一个中心节点,任意两个节点之间的通信都要通过中心节点进行转发。
3、 TCP/IP 模型中,()层负责将数据分组从源主机传输到目的主机。
A 网络接口层B 网际层C 传输层D 应用层答案:B解释:网际层(也称为网络层)的主要功能是将数据分组从源主机通过网络路由到目的主机。
4、在以太网中,使用()协议来解决冲突。
A CSMA/CDB CSMA/CAC PPPD HDLC答案:A解释:CSMA/CD(载波监听多路访问/冲突检测)是以太网中用于解决冲突的协议。
5、 IP 地址 1921681100 属于()类 IP 地址。
A A 类B B 类C C 类D D 类答案:C解释:C 类 IP 地址的范围是 192000 至 223255255255,1921681100 属于 C 类 IP 地址。
二、填空题1、计算机网络按覆盖范围可以分为_____、_____和_____。
答案:局域网、城域网、广域网2、网络协议的三要素是_____、_____和_____。
答案:语法、语义、同步3、在 TCP/IP 体系结构中,HTTP 协议工作在_____层。
答案:应用4、常用的有线传输介质有_____、_____和_____。
答案:双绞线、同轴电缆、光纤5、网络地址 1721600,子网掩码为 255255255192,该子网的可用IP 地址范围是_____至_____。
第一章概述习题1.什么叫计算机网络?计算机网络主要有哪几类?答:计算网络是一个将分散在各地的计算机、工作站、终端和外部设备等,通过通信线路(或称通信媒体)互相连接在一起,并按照有关协议实现相互通信,资源共享和进行分布处理的综合系统。
计算网络是一些互相连接的、自治的计算机的集合。
计算机网络从不同的角度来看计算机网络分类如下:2.计算机网络经历了哪几个发展阶段?答:计算机网络经历了:1.面向终端的计算机通信网2.分组交换网3.计算机网络体系结构的形成4.Internet等几个阶段。
3.试从多个方面比较电路交换、报文交换和分组交换的主要优缺点。
解:若要连续传送大量的数据,且其传送时间远大于呼叫建立时间,则采用数据通信前预先分配传输带宽的电路交换较为合适。
报文交换和分组交换不需要预先分配传输带宽,在传送实发数据时可提高整个网络的信道利用率。
分组交换比报交换的时延小,但其结点交换机必须具有更强的处理能力。
在电路交换中,只要整个通路中有一段链路不能使用,通信就会中止,而分组交换可选择另一条路由转发分组。
但是电路交换是完全透明的,发送方和接收方可以使用任何比特速率、格式或分帧方法,电信公司不知道也不用关心这些;而分组交换,电信公司决定基本参数。
此外,电路交换基于时间和距离收费,而分组交换基于所传分组的字节数及连接时间收费。
3.试从多个方面比较电路交换、报文交换和分组交换的主要优缺点。
解:若要连续传送大量的数据,且其传送时间远大于呼叫建立时间,则采用数据通信前预先分配传输带宽的电路交换较为合适。
报文交换和分组交换不需要预先分配传输带宽,在传送实发数据时可提高整个网络的信道利用率。
分组交换比报交换的时延小,但其结点交换机必须具有更强的处理能力。
在电路交换中,只要整个通路中有一段链路不能使用,通信就会中止,而分组交换可选择另一条路由转发分组。
但是电路交换是完全透明的,发送方和接收方可以使用任何比特速率、格式或分帧方法,电信公司不知道也不用关心这些;而分组交换,电信公司决定基本参数。
第 1 章概述1.假设你已经将你的狗Berníe 训练成可以携带一箱3 盒8mm 的磁带,而不是一小瓶内哇地. (当你的磁盘满了的时候,你可能会认为这是一次紧急事件。
)每盒磁带的窑最为7GB 字节;无论你在哪里,狗跑向你的速度是18km/h 。
请问,在什么距离范围内Berníe的数据传输速率会超过一条数据速率为150Mbps的传输线?答:狗能携带21千兆字节或者168千兆位的数据。
18 公里/小时的速度等于0.005 公里/秒,走过x公里的时间为x / 0.005 = 200x秒,产生的数据传输速度为168/200x Gbps或者840 /x Mbps。
因此,与通信线路相比较,若x<5.6 公里,狗有更高的速度。
6. 一个客户·服务器系统使用了卫星网络,卫星的高度为40 000km. 在对一个请求进行响应的时候,最佳情形下的延迟是什么?答:由于请求和应答都必须通过卫星,因此传输总路径长度为160,000千米。
在空气和真空中的光速为300,000 公里/秒,因此最佳的传播延迟为160,000/300,000秒,约533 msec。
9.在一个集中式的二叉树上,有2n -1 个路出器相互连接起来:每个树节点上都布一个路由器。
路由器i 为了与路由器j 进行通信,它要给树的根发送一条消息。
然后树根将消息送下来给j 。
假设所有的路由器对都是等概率出现的,请推导出当n很大时,每条消息的平均跳数的一个近似表达式。
答:这意味着,从路由器到路由器的路径长度相当于路由器到根的两倍。
若在树中,根深度为1,深度为n,从根到第n层需要n-1跳,在该层的路由器为0.50。
从根到n-1 层的路径有router的0.25和n-2跳步。
因此,路径长度l为:18.OSI 的哪一层分别处理以下问题?答:把传输的比特流划分为帧——数据链路层决定使用哪条路径通过子网——网络层.28.一幅图像的分辨率为1024X 768 像素,每个像素用3 字节来表示。
计算机网络练习题及参考答案一、选择题1. 在计算机网络中,OSI参考模型的第三层是指:A. 物理层B. 数据链路层C. 网络层D. 传输层参考答案:C2. 在TCP/IP参考模型中,网络层对应于OSI参考模型的:A. 物理层和数据链路层B. 数据链路层和网络层C. 网络层和传输层D. 传输层和应用层参考答案:C3. IP地址是IPv4的基本地址单位,一个IP地址共有几个字节?A. 2个字节B. 4个字节C. 8个字节D. 16个字节参考答案:B4. 下面哪个IP地址为保留地址?A. 192.168.0.1B. 172.16.0.1C. 10.0.0.1D. 169.254.0.1参考答案:D5. 在计算机网络中,DNS用于:A. 定位网站的IP地址B. 进行电子邮件的传输C. 进行文件的共享D. 数据加密传输参考答案:A二、填空题1. 在TCP/IP协议族中,TCP是一种基于_________的可靠传输协议。
参考答案:连接2. 在计算机网络中,HTTP是一种_________协议。
参考答案:应用层3. 在数据链路层中,_________是一种常用的失误检测方法。
参考答案:CRC4. 在网络层中,_________旨在为数据包选择合适的传输路径。
参考答案:路由选择5. 在物理层中,_________是一种传输数据的基本单位。
参考答案:比特(bit)三、简答题1. 简述TCP/IP四层模型的各个层级以及对应的功能。
参考答案:- 物理层:负责将数据转换为比特流进行传输。
- 数据链路层:负责将比特流转换为数据帧,并进行错误检测和纠正。
- 网络层:负责将数据帧封装成数据包,并进行路由选择。
- 传输层:提供端对端的可靠传输和流量控制。
2. 简述HTTP协议的基本原理以及常见的请求方法。
参考答案:- HTTP协议是一种基于客户端-服务器模型的协议,主要用于Web 应用中的数据传输。
- 客户端通过发送HTTP请求与服务器进行通信,服务器接收请求并给予响应。