Computer Network (Third Edition) Hu Liang After-Class Exercises Chapter 7 Answers

Computer Network (Third Edition) Hu Liang After-Class Exercises Chapter 7 Answers

1. In the OSI model, which layers of protocols are called high-level protocols?

The session layer, presentation layer and application layer are collectively called OSI high layers.

2. What is the difference between the application layer in the TCP/IP protocol and the OSI application layer?

The application layer in the TCP/IP protocol refers to the higher layers in OSI, namely the session layer, presentation layer and application layer. The OSI application layer simply refers to the application layer.

3. What types of host addresses are there on the Internet? Why not just use one addressing mechanism?

There are five types of host addresses in the Internet, namely Class A, Class B, Class C, Class D and Class E. They differ in the length of the network number and host number, as well as the highest number of digits in the network number. Different types of addresses are suitable for different size networks.

Why not just use one addressing mechanism? Because this can make more effective use of IP address space and avoid waste or shortage.
For example, if only Class A addresses are used, each network can have up to 16.77 million hosts, but many small networks do not require so many hosts, and only 128 Class A addresses are available. network number. If only Class C addresses are used, each network can have up to 254 hosts, but many large networks require more hosts, and Class C addresses only have 2.09 million available network numbers.

4. What is DNS? What does it do?

DNS (Domain Name Server) is the Internet domain name system, which translates domain names into IP addresses.

5. Explain the shortcomings of the HOSTS method.

  1. Traffic and load: SRI - NIC has excessive overhead in network traffic and processing load;
  2. Name conflict: There cannot be two hosts with the same name in HOSTS;
  3. Consistency: In an ever-expanding network, maintaining the consistency of HOSTS files becomes increasingly difficult.

6. What is a name server? Explain its working process.

The name server serves as the server part of the DNS client/server mechanism. It is responsible for maintaining a segment of information in the database and making it accessible to client resolvers.

work process:

  1. The name server receives the query from the client;
  2. The server parses the query request. If it is a query for data in this domain, it searches the local database;
  3. Return the searched data from the local database;
  4. The server parses the query request. If it is a query for non-local data, it first searches the local cache;
  5. Return the looked up data from the local cache;
  6. If no data is found in 2 and 4, the reference domain name server or root domain name server address is obtained from the DNS configuration file;
  7. Return query data or other domain name server addresses.

7. Give an example to illustrate the subdomain proxy mechanism of DNS.

  1. The client sends a domain name resolution request to the edu.cn domain name server to obtain the domain name www.jlu.edu.cn
  2. The edu.cn domain name server finds that the requested address has been proxied, so it returns the IP address of the jlu domain name server;
  3. The client queries the jlu.edu.cn domain name server for the IP address of www.jlu.edu.cn
  4. The client uses the IO address obtained from the query to think of www.jlu.edu, cn’s IP address 202.198.16.80
  5. The client uses the IP address obtained from the query to send an http request to www.jlu.edu.cn;
  6. Jilin University www server receives the request and returns the result to the client

8. Compare the difference between “domain” and “zone” in DNS

The domain is larger than the zone, and the zone refers to the remaining part of the domain after the domain name and data contained in the subdomain that is proxied. Domain refers to the explanation of each agent domain + unagented domain + the name of this layer

9. Explain the working process of repeated interpretation and recursive interpretation in DNS.

Repeat interpretation: In repeat interpretation, the name server simply returns the best answer it knows to the queryer, without requiring additional queries. The name server being queried retrieves its local data (including data in its cache) to find the requested data. If the name server does not find the required number, it will try its best to return an answer that can help the queryer continue the interpretation process. For example, the names and addresses of name servers that are closer to the data being searched.

Recursive interpretation: Recursive interpretation is the interpretation process used when a name server receives a recursive query. Recursive queries place most of the burden on a single name server. In recursive interpretation, the interpreter (client program) sends a recursive query request for the domain name to the name server. The name server can only return the queried data results, or return error messages such as the data type being queried does not exist or the domain name being queried does not exist. The operation and maintenance query is recursive. At this time, the name server cannot return the addresses of other name servers.

When an address is not found on the local server and continues to query other servers, the queried name server can send a recursive query to other name servers, thereby forcing them to find the answer and return it.

10. Compare the similarities and differences between DNS service and ARP service

DNS and ARP are both protocols used for address translation.

DNS performs translation between host names and IP addresses, that is, translation from application layer addresses to network layer addresses. ARP performs translation between IP addresses and MAC addresses, that is, translation from network layer addresses to link layer addresses.

DNS provides a global address service. The translation of host names and IP addresses around the world is provided through a single DNS system; while ARP provides a local address mapping extreme, and the scope of the service is on a LAN. .

DNS performs translation services through a dedicated DNS server, and ARP resides as a software module in each adapter interface of each host or router.

11. What parts does an email system consist of?

It mainly consists of three parts, user agent (UA), email server (Email Server) and protocols used by email, such as SMTP and POP3

User agent: The user's email interface, in most cases, is a program running on the user's computer, which sends and receives emails through a friendly interface. Including writing, display, processing and other functions.

Mail Server: The core building block of the email system. The function of the mail server is to send and receive mail, and to report the status of mail delivery to the sender.

Email Protocol: Two different protocols are required between mail servers, and between the user agent and the mail server. One protocol is used to send mail, such as SMTP; the other protocol is used to receive mail, such as Post Office Protocol (POP, Post Office Protocol)

12. Give examples to illustrate the working principles of POP protocol and IMAP protocol, and compare the differences.

The POP protocol is a simple protocol that only allows users to download emails from the server to the local computer and then edit them locally. After downloading, messages are usually deleted from the server (unless configured specifically). The disadvantage of this is that users cannot view mail on multiple devices simultaneously, nor can they manage mail folders on the server.

IMAP protocol is a more advanced protocol that allows users to view and operate emails directly on the server without downloading them locally. Users can create, delete, or rename mail folders on the server, and view mail simultaneously on multiple devices. The IMAP protocol also supports partial downloading and searching of email content.
In short, the IMAP protocol is more flexible, more complex, and more suitable for mobile office needs than the POP protocol.

13. How many steps does the SMTP protocol require when transmitting emails?

Mail transmission mainly includes three stages: connection establishment, mail transmission and connection termination.

   建立连接阶段:

   1.当SMTP客户端每隔一定时间对邮件缓存扫描一次,如发现有邮件,就使用SMTP的熟知端口号25与接收方的邮件服务器的SMTP服务器建立TCP连接。

   2.接收方SMTP服务器发出“220 Service ready"告诉客户端它已经准备好接收邮件。若服务器未就绪,它就发送代码421(服务器不可用)。

   3.客户发送HELO报文,并使用它的域名地址标志自己。目的是:用来把客户的域名通知服务器,值得注意的是, 在TCP的连接建立阶段,发送方和接收方都是通过它们的IP地址来告诉对方的 。(HELO报文是最初的,用户名和密码都不加密。现在改为EHLO,用户名和密码都进行base64编码发送)

   4.服务器响应代码250(请求命令完成)或根据情况的其他一些代码。

  报文传送阶段:

   在SMTP客户与服务器之间建立连接后,发件人就可以与一个或多个收件人交换单个的报文了。若收件人超过一个,则下面步骤3和步骤4将重复进行。

    1.客户发送MAIL FROM报文介绍报文的发送者。它包括发送人的邮件地址(邮箱名和域名,如house@qq)。这个步骤是必要的:因为可以给服务器在返回差错或报文时的返回邮件地址 。

    2.服务器响应代码250(请求命令完成)或其他适当的代码。

    3.客户发送RCPT(收件人)报文,包括收件人的邮件地址,RCPT命令的作用是 : 先弄清接收方系统是否已经准备好接收邮件的准备,然后才发送邮件,这样做视为了避免浪费通信资源,不至于发送了很长的邮件以后才知道是因地址错误 。

    4.服务器响应代码250或其他适当的代码。

    5.客户发送DATA报文对报文的传送进行初始化,DATA命令表示要开始传送邮件的内容了。

    6.服务器响应代码"354 Start mail input: end with <CRLF>.<CRLF>"或其他适当的报文(如421 服务器不可用,500 命令无法识别)。

    7.客户用连续的行发送报文的内容。每一行的行结束时输入 <CRLF>.<CRLF> ,即回车换行.回车换行,表示邮件内容结束。

    8.服务器响应代码(250 请求命令完成)或其他适当的代码。

    值得注意的是:虽然SMTP使用TCP连接试图使邮件的传送可靠,但它并不能保证不丢失邮件。也就是说,使用SMTP传送邮件只能说可以可靠地传送接收方的邮件服务器,在往后的情况就不知道了。接收方的邮件服务器也许会出故障,使收到的服务器全部丢失(在收件人读取信件之前)。

    终止连接

    在报文传送成功后,客户就终止连接。包括如下步骤:

    1.客户发送QUIT命令。

    2.服务器响应221(服务关闭)或其他代码。

    在连接终止阶段后,TCP连接必须关闭。

14. When using the SMTP protocol to transmit emails, one email generally requires forwarding by several email servers.

When an email is transmitted through the SMTP protocol, it often needs to be forwarded through multiple email servers until it reaches the email server where the final recipient is located. Usually, emails need to be forwarded by at least two mail servers: the mail server where the sender is located and the mail server where the recipient is located. If the mail needs to be transferred through other mail servers, there will be more mail servers to pass through.

15.What is the MIME protocol and what are its main extensions to the SMTP protocol?

The MIME (Multipurpose Internet Mail
Extensions) protocol is a standard that allows emails to contain different types of data, such as text, pictures, audio, and video. The MIME protocol allows emails to carry various types of attachments by adding multiple data types of headers and boundaries to emails.

The main extension of the MIME protocol is to allow non-ASCII characters to be added to emails, thereby supporting email content in multiple languages ​​and increasing the scalability of email content. The MIME protocol extends the SMTP protocol so that the SMTP protocol can transmit emails containing attachments, making the email content richer and more diverse.

16. What is the FTP protocol?

File transfer protocol is used to transfer files between two heterogeneous hosts.

17. What are the main features of the TFTP protocol?

The main features of the TFTP protocol include the following aspects:

  1. Simple: TFTP is a very simple protocol, with only a small amount of control information exchanged during the communication process, so TFTP is relatively easy to implement.

  2. Lightweight: TFTP data packets are relatively small, and the protocol itself does not require complex logic processing, so it takes up less resources.

  3. Stateless: The TFTP protocol is stateless, that is, the server does not need to save the connection state with the client, and each transmission is independent of each other.

  4. Support file transfer: TFTP protocol is mainly used for file transfer, which can easily upload or download files.

  5. Unsafe: The TFTP protocol does not provide any encryption or authentication mechanism, so data transmission is less secure and vulnerable to attacks.

To sum up, the TFTP protocol is a simple, lightweight, stateless protocol that supports file transfer but is insecure and is commonly used in file transfer scenarios on the network.

18. The FTP protocol requires several ports and explain their functions.

The FTP protocol requires two ports, one is the command port and the other is the data port. The command port is used to send and receive control information, such as username, password, file name, etc. Data port is used to transfer file content

19. What is FTP resume transfer? And explain its use occasions.

FTP's resumable transfer means that when downloading or uploading, the file is divided into multiple parts, and each part is transmitted using a thread. If the transmission is interrupted by a network failure or other reasons, you can continue from the completed part. transfer without starting from scratch

FTP's resumable transfer function is suitable for the transfer of large files, which can improve efficiency and reliability and avoid repeated transfers due to network fluctuations or other accidents.

20. What is hypertext?

Hypertext is an information management technology that can link electronic document information that may be geographically dispersedly stored to each other as needed. People can open another related document through a hyperlink pointer in a document.

21. What is a URL? Give an example of its composition format.

Uniform Resource Locator, (Uniform Resource
Locator) is a coding method specially designed to represent the location of resources on the Internet. It can help users navigate in the ocean of information on the Internet. Obtain the required information.

Components: Transmission protocol: //Host IP address or host domain name/resource path or file name

22. What is HTTP protocol and why is it said to be a stateless protocol?

HTTP protocol: a communication protocol for transmitting hypertext on the Internet.
Why stateless: The web server does not store any state information about the client during the process of sending the web page requested by the user.

23. Give examples to illustrate the concepts of persistent connections and non-persistent connections in the HTTP protocol.

Non-persistent connection: The server closes the TCP connection after sending each object. Each TCP connection transmits only a pair of request and response messages.

Continuous connection: The server continues to maintain the connection after completing an HTTP message interaction. Subsequent request and response messages between the unified client and the server can be carried out on the original connection.

24. Explain the components of a web browser

A web browser is an application that can access and display web resources, such as web pages, pictures, videos, etc. Web browser components can

Divided into the following aspects:

User Interface: The user interface is the operation and interaction part provided by the browser to the user, including the address bar, navigation bar, tab bar, bookmark bar, menu bar, etc.

Browser Engine: The browser engine is the core part of the browser. It is responsible for controlling the communication between the rendering engine and the user interface, as well as processing user events, managing child processes, etc.

Rendering Engine: The rendering engine is the part of the browser used to parse and display web resources. It can convert codes such as HTML, CSS and JavaScript into visual web pages. The rendering engine is sometimes called the "browser kernel". Different browsers may use different rendering engines, such as IE using Trident, Firefox using Gecko, Chrome and Safari using WebKit, etc.

Networking: The network is the part used by the browser to communicate with the server. It implements protocols such as HTTP, HTTPS, and FTP, and is responsible for requesting and receiving Web resources. The network module can also implement functions such as caching, proxy, and security.

JavaScript Interpreter: The JavaScript interpreter is the part of the browser used to execute JavaScript code. It can modify the content and style of web pages through the DOM and CSSOM interfaces to achieve dynamic effects and interactive functions. Different browsers may use different JavaScript interpreters, such as Chrome using V8, Firefox using SpiderMonkey, etc.

XML Parser (XML Parser): The XML parser is the part of the browser used to parse XML documents. It can convert XML documents into DOM trees for use by the rendering engine or JavaScript interpreter. An XML parser is usually a common, reusable component with a standardized interface.
Display Backend: The display backend is the part of the browser used to draw graphics and window primitives. It provides user interface controls, fonts, images and other resources, and calls the operating system Or display the graphical interface provided by the hardware.

Data Persistence: The data persistence layer is the part used by the browser to store various data, including bookmarks, history, cookies, certificates, cache, etc. The data persistence layer is generally implemented using a database or file system.

25. Give examples of static documents and dynamic documents

Static document: The content of the document does not change with the access time. The results obtained by the user every time they read the static document are the same.
Dynamic document: It is dynamically created by the application when the browser accesses the web server. Since the response to each request of the browser is generated temporarily, the user can see it through the dynamic document. The content needs to be constantly changing.

26. Describe popular web server architectures.

Composed of web server, middleware and database.

27. What is CGI and explain its main functions.

CGI is a universal gateway interface, which is used to build a communication bridge between HTML web pages and various database systems.

Guess you like

Origin blog.csdn.net/m0_46335449/article/details/129396838