[Recruitment interview, end-of-term review] Computer network

Foreword: The blogger sorted out some computer network-related knowledge points during the summer vacation, for the purpose of interviewing for postgraduate research. Reference textbook 《计算机网络》(第8版,谢希仁编著). In the process of sorting out, some other materials on the Internet were also used for reference, most of which are no longer available for reference. If there is any infringement, we will notify you to delete it.


Chapter 1 Overview

1. Computer network : At present, a better definition of computer network is as follows: computer network is mainly interconnected by some general-purpose, programmable hardware, which can be used to transmit various types of data , and can adapt to growing applications.

2. Functions of computer network :
① Shared hardware resources (it can provide sharing of expensive equipment such as processing resources, storage resources, input and output resources within the entire network, so that users can save investment, and it is also convenient for centralized management and balanced load sharing.)
②Sharing software resources (such as accessing remote files through file transfer services)
③Information exchange between users (email and the like)
④Distributed processing (when a computer system in the computer network is overloaded, it can be processed assign a complex task to other computer systems in the network, thereby utilizing idle computer resources to increase overall system utilization.)

3. The composition of the Internet : From the perspective of working methods, it includes the edge part and the core part, or in other words, the network topology is divided into the edge part and the core part. Edge part: composed of all hosts connected to the Internet, used to transmit data, audio, video, or share resources, directly used by users; core part: composed of networks and routers, used to provide services for the edge part.

4. There are two types of communication between end systems at the edge of the network : client-server (C/S) and peer-to-peer (P2P).
C/S: The relationship between the service and the service between two processes. The client is the requester of the service, and the server is the provider of the service.
P2P: No distinction is made between service providers and requesters. Hosts communicate peer-to-peer.

5. Router : It is a special-purpose computer, mainly used to realize packet switching, and its function is to forward received packets.

6. Packet switching : Using store-and-forward technology, a message is divided into several groups before transmission. (Plug the header in front of the data to form a packet.)
Advantages and disadvantages of packet switching: See P16
information exchange methods: packet switching, message switching, circuit switching
Circuit switching: the bit stream of the entire message is continuously from The source point goes straight to the destination point, as if transported in a pipe.
Message exchange: The entire message is transmitted to the adjacent node first, and after all is stored, the forwarding table is searched and forwarded to the next node.
Packet switching: A single packet (a part of the entire message) is transmitted to the adjacent node, stored and searched for the forwarding table, and forwarded to the next node.

7. Bandwidth : The highest data rate that can pass through the network per unit time. (bit/s)

8. Throughput : the actual amount of data passed in the network per unit time (bit/s)

9. Latency :
Sending Latency: The time it takes for the host to send data. The time taken from sending the first data frame to sending the last data frame.
Propagation Delay: The time it takes for an electromagnetic wave to travel through a channel.
Processing delay: The time it takes for a router to process a packet after it is received.
Queuing delay: After the packet enters the router, it must wait in the queue for the first time.
10. Delay-bandwidth product : = propagation delay * bandwidth. Think of a link as a pipeline, and the delay-bandwidth product represents how many bits can be accommodated on this link.

11. Round-trip time RTT : the total elapsed time from the start of data transmission to the sender receiving confirmation from the receiver.

12. The architecture of the computer network : the various layers of the computer network and the collection of their protocols.
The five-layer architecture described in the book, from top to bottom, is: application layer, transport layer, network layer, link layer, and physical layer.
(1) 物理层: The unit of data transmission is bit. When the sender sends 1, the receiver should receive 1; when the sender sends 0, the receiver should receive 0. Therefore, the physical layer needs to consider how much voltage represents "1" and "0", how many pins the cable plug has, and how the pins are connected.
(2) 数据链路层: Data link = physical link + communication protocol. ①The data transmission between two hosts is always transmitted on a segment-by- segment link, which requires the use of a special link layer protocol; ②When transmitting data, the data link layer will hand over the network layer IP data packets are encapsulated into frames, and the frames are transmitted on the links of adjacent nodes. Frame = data + control information. Then the frame extracts the data part and hands it over to the network layer.
(3) 网络层: Provide communication services for different hosts on the packet switching network. There are two main tasks: ① Through a certain algorithm, generate a forwarding table for forwarding packets on each router in the Internet; ② When each router receives a packet, it forwards the packet according to the path specified in the forwarding table. forward to the next router.
(4) 运输层: Responsible for providing general data transmission services for the communication between the processes of the two hosts. The transport layer has multiplexing and demultiplexing functions, and mainly uses two protocols: TCP/UDP.
(5) 应用层: Complete specific network applications through the interaction between application processes. For different network applications, different protocols are required, and the application layer protocol specifies the rules for communication and interaction between application processes.

OSI的七层协议: physical layer, data link layer, network layer, transport layer, session layer, presentation layer, application layer.
TCP/IP四层协议: link layer, internet layer, transport layer, application layer.
Presentation layer: data compression, encryption, and data description, so that the application does not need to care about the different internal formats of the data in each host.
Session layer: establish and manage sessions.
The five-layer protocol does not have a presentation layer and a session layer, but leaves these functions to the application developer.

Chapter 2 Physical Layer

1. The role of the physical layer : The physical layer considers how to transmit data bit streams on the transmission media connected to various computers, rather than specific transmission media.
The characteristics of the physical layer:
①Mechanical characteristics: the shape, size, arrangement and other information of the connector.
②Electrical characteristics: The voltage range of the cable
③Functional characteristics: Explain the meaning of a certain level of voltage on a certain line
④Process characteristics: The order of occurrence of various possible events for different functions

2. Simplex communication : There can only be communication in one direction
Half-duplex communication : Communication in two directions is allowed, but cannot be sent at the same time
Duplex communication : Communication in two directions is allowed, and can be sent at the same time

The following are several channel multiplexing techniques.
3. Time division multiplexing : All users occupy the same frequency bandwidth at different times.
Frequency division multiplexing : All users occupy different bandwidth resources at the same time.
Wavelength Division Multiplexing : Frequency division multiplexing of light.
Code division multiplexing CDM : Each user can use the same frequency band for communication at the same time. Since each user uses a different code pattern selected, they will not interfere with each other.

Chapter 3 Data Link Layer

1. Data link : physical line for data transmission + communication protocol for controlling data transmission

2. Three basic issues in the data link layer :
封装成帧: Add headers and tails before and after the data. The start mark of the frame is SOH, the end mark is EOT
透明传输: In order to prevent the data part from containing SOH/EOT and to prevent the boundary of the frame from being found by mistake, escape characters should be added in front of these special characters.
差错检测: Bits may have errors during transmission, so find these errors. Methods include: cyclic redundancy check (CRC). (Used to detect bit errors, such as 0 becomes 1, 1 becomes 0, etc.)
However, error detection cannot guarantee reliable transmission, because error detection cannot detect conditions such as frame loss, frame repetition, and frame out-of-sequence.
There are two types of channels used by the data link layer: point-to-point channels and broadcast channels.

3. Point-to-point protocol PPP is
a data link layer protocol used for communication between user computers and ISPs.

4. Use the data link layer of the broadcast channel
The broadcast channel can perform one-to-many communication. The topological structure of the local area network includes: star network (hub), ring network, bus network.
Different users need to share the channel. There are two ways to share the channel. The first is to use the methods such as time division multiplexing introduced above, and the second is to use the dynamic media access control method. The dynamic medium access control method includes two methods: random access and controlled access. The characteristic of random access is that users can send messages randomly. If two users send messages at the same time and conflict occurs, then a collision protocol to resolve the conflict is required; the characteristic of controlled access is that users cannot send messages randomly but must obey certain rules. control, such as accepting polling, etc.

5. The role of the adapter/network card : the computer communicates with the LAN through the adapter. ① Convert serial and parallel data. ②Cache the data (because the data rate on the network is not the same as the data rate on the computer bus). ③ Install the device driver that manages the adapter into the computer operating system. ④ Realize the Ethernet protocol.

6. CSMA/CD protocol :
key points of the protocol:
多点接入: Indicates that this network is a bus network. Computers are connected to a bus in a multipoint manner.
载波监听: Monitor while sending. Whether it is before sending data or during sending data, the channel must be continuously monitored. Mainly to avoid conflicts. If data transmission is detected before sending data, no data will be sent temporarily. If data transmission is detected in the sent data, the sending is terminated.
碰撞检测: The adapter monitors the voltage change on the channel while sending data. When the voltage exceeds a certain threshold, it is considered that at least two stations on the bus are sending data at the same time, that is, a collision has occurred.
So CSMA/CD can only perform half-duplex communication .
Contention period/collision window : twice the bus end-to-end propagation delay 2τ. After a station sends data, if no collision is detected after the contention period, it means that there will be no collision.
Truncated Binary Exponential Backoff: Determines when to retransmit after a collision. Select a random number from a set, and the time after retransmission should be r times the contention period.
Enhanced collision : When a station sending data finds a collision, in addition to immediately stopping sending data, it also needs to send a 32 or 48-bit man-made interference signal to let all users know that a collision has occurred.
Backoff algorithm : ① The basic backoff event is 2τ. ②Randomly select a number r from the set of discrete integers [0,1,...,2kth power-1], and the retransmission delay time is r times the contention period. k=min[number of retransmissions, 10] ③ When the retransmission reaches 16 times and still fails, discard the frame and report to the upper layer.

7. Hub : A device at the center of a hub-star topology. After using the hub, the network is physically a star, logically a bus, and the protocol used is still the CSMA/CD protocol. Hubs work at the physical layer.

8. Virtual local area network : Divide a larger local area network into some smaller local area networks, and each local area network is a smaller broadcast domain. A logical group, independent of physical location, of LAN segments that share certain common requirements. Virtual local area network is actually a service provided to users, not a new type of local area network.

9. The difference between the Internet, the Internet, and Ethernet
计算机网络(network) : When more than one computer is interconnected, the interconnected computers can communicate and share information. This is the network.
互联网(internet): "Network of networks", is a general term that refers to a network that connects multiple computer networks.
因特网(Internet): It is a kind of Internet, which is currently the world's largest, open, and specific computer network network formed by many interconnected networks.
以太网(Ethernet): Ethernet (Ethernet) is a data link layer technology designed to realize local area network communication, which specifies the content of the connection, electronic signal and medium access layer protocol including the physical layer. Ethernet is currently the most widely used LAN technology, replacing other LAN standards such as Token Ring, FDDI, and ARCNET.
Local Area Network: A network formed by directly connecting several computers and data communication devices within a small area.

10. Extended Ethernet
method one : use fiber optic modem and optical fiber to connect different Ethernet networks.
Advantages: Enable the computers on the Ethernet of different departments of the college to communicate; expand the geographical range covered by Ethernet.
Disadvantage: The collision domain becomes larger, but the throughput rate remains the same. At any time, only one station in each collision domain is sending data. That means that when two stations are transmitting data, other departments cannot communicate at this time; if different departments use different Ethernet technologies, then it is impossible to connect them with a hub.

Method 2 : Extend Ethernet at the data link layer. Use a switch.
Switches: full duplex, with parallelism. The hosts that communicate with each other monopolize the transmission medium and transmit data without collision. Each port of an Ethernet switch is directly connected to a single host or another Ethernet switch. There will be no collision problem, and the CSMA/CD protocol is not used.

Chapter 4 Network Layer

1. Two services provided by the network layer : virtual circuit service and datagram service. See P117 for comparison


2. There are three protocols used in conjunction with the Internet Protocol IP and the Internet Protocol IP, Address Resolution Protocol ARP, Internet Control Message Protocol ICMP, and Internet Group Management Protocol IGMP. See book P119
because the computer networks participating in the interconnection all use the same Internet protocol IP, so the computer network after the interconnection can be regarded as a virtual interconnection network.
The transmission process of packets in the Internet: the source host H1 wants to send an IP datagram to the destination host H2, and first searches its own forwarding table to see whether the destination host H2 is on the network. If it is, then deliver it directly to complete the task; if not, send the IP datagram to a certain router R1, and R1 forwards the datagram to R2 for indirect delivery after looking up its own forwarding table, and keeps forwarding like this , until delivered to the destination host.

3. IP address : Assign a unique 32-bit identifier to each interface of each host connected to the Internet, so that we can easily address it. The IP address consists of two parts: network number + host number. For the classification of IP addresses, please refer to the book P124.
insert image description here
In the class A address, the network number is all 0, which means "this network"; the network number is all 1, which is reserved for local software loopback testing. Among the host numbers of Class A addresses, those whose host numbers are all 0 and all 1 are generally not assigned. If the host number is all 0, it means that the IP address is a single network address connected to "this host", and if the host number is all 1, it means all the hosts on the network.

4. Non-classified addressing CIDR
The notation of CIDR is: IP address = network prefix + host number. Compared with the original, the biggest difference is that the length n of the network prefix is ​​not fixed, and any value can be selected between 0-32. For example: 128.45.35.7/20.
If the prefix n=32, no host number, this is the host route.
If the prefix n=31, there are only two IP addresses in the address block, which is a point-to-point link.
If the prefix n=0, and the IP address is all 0, that is, 0.0.0.0/0, this is the default route.

5. Address mask : help to quickly calculate the network address from the IP address. The address mask consists of a string of 1s and 0s, and the number of 1s is the length of the network prefix. For example: 255.0.0.0/8 is the address mask. Address mask AND IP address = network address.

6. Route aggregation : A large CIDR address block often contains many small address blocks, so in the forwarding table of the router, a larger address block is used to replace many smaller address blocks. This method is called route aggregation. This compresses the size of the forwarding table and saves space; it also reduces the time spent looking up the table.

7. MAC address and IP address : The difference between the two is that the MAC address is an address used at the data link layer, while the IP address is an address used at the network layer and above, and is a logical address. When the IP address is delivered to the data link layer, it is encapsulated into a MAC frame, and the addresses used in the MAC frame are all MAC addresses.

8. The role of Address Resolution Protocol ARP
: already know the IP address of a certain machine, how to know its MAC address?
ARP cache: Each host has an ARP cache, which stores the mapping table from IP address to MAC address on the local area network. Note: ARP solves the IP address and MAC mapping problem of hosts or routers on the same LAN.
The operation process of ARP is as follows: host A sends a message to host B in the local area network, firstly finds whether there is any IP address of B in ARP, if yes, checks the corresponding MAC address of B, if not, then runs ARP.
① Host A broadcasts an ARP request packet on the local area network. (I am host A, my IP address is blabla, now I know the IP address of host B is blabla, I want to know the MAC address of host B) ② Then all the
hosts running ARP process on this local area network have received the packet
③ Host After B receives the ARP request packet, it sends an ARP response packet to A.
④ Host A receives the response packet, gets B's MAC address and writes it into the ARP cache.
ARP maintains a lifetime for each item in the cache, and items that exceed the lifetime are deleted from the cache.
P135 four typical situations.

9. IP Datagram Format Book P136

10. The process of forwarding packets at the IP layer
① Host H1 sends a message to the destination host H2. First, determine whether H2 is in the network. If it is, it will be delivered directly, and there is no need to use a router. If not, then leave things to the router.
②The router looks up the forwarding table, and if there is a route to the destination network in the routing table, it sends the datagram to the next-hop router. Otherwise, the datagram is sent to the default route.
(The destination address and the subnet mask of this network are ANDed to obtain the network address. If the network address is this network address, then it will be delivered) The
longest prefix

11. The main function of the Internet Control Message Protocol ICMP
: to report errors or abnormalities in the host or router, thereby improving the chance of successful delivery of IP datagrams and effectively forwarding IP datagrams.
ICMP messages are divided into two types: ICMP error report messages (destination unreachable, time exceeded, parameter update, route change), ICMP query messages (request or reply, timestamp request).
Application of ICMP: PING/TRACEROUTE

12. Interior Gateway Protocol RIP (Routing Protocol)
Routing protocol based on distance vector. Advantages: Simple and low overhead; Disadvantages: Only suitable for small networks; Bad news spreads slowly.
Features of RIP: ①Exchange information only with adjacent routers; ②The information exchanged by routers is all the information that the current router knows; ③Exchange information according to a fixed time interval (for example, 30s) Algorithm process: See book P162 for an example ① For the address
is
X For a RIP message sent by an adjacent router, first modify all items in the message. Change the addresses in the next hop fields to X, and add 1 to all point distance fields.
② For all items in the modified message

if原来路由表中没有目的网络Net
		把这个项目添加到路由表中
else 
		if下一条路由器地址是X
			把收到的项目替换原来路由表中的项目
		else
			if收到项目中的距离d小于路由表中的距离
				进行更新
			else
				什么也不做

Bad news spreads slowly: When a network failure occurs, it takes a long time to transmit the failure information to all routers.

13. Interior gateway protocol OSPF
features: ① Send information to all routers in the autonomous system, such as using flooding method (routers send information to adjacent routers through all output ports). ② The information sent is the link status of all routers adjacent to this router. ③When the link state changes or at regular intervals, the router sends link state information to all other routers by flooding.
All routers finally build a link state database, which is actually a topology diagram of the entire network.

14. Exterior Gateway Protocol BGP
is a protocol for exchanging routing information between routers in different autonomous systems, and is an exterior gateway protocol.
BGP strives to select a better route that can reach the destination network prefix, rather than calculating an optimal route. There is still a lot of content to read about P173

Chapter 5 Transport Layer

The transport layer provides communication services to the application layer above it, providing services for communication between application processes. Functions such as multiplexing, demultiplexing, and error detection are realized. There are two main protocols in the transport layer: User Datagram Protocol UDP and Transmission Control Protocol TCP.

1. Port : Equivalent to a door between the application layer and the transport layer. Processes in the application layer need to pass through this door in order to be sent to the Internet through the transport layer. Each port is marked with a port number, and the port number is to distinguish different processes on the same computer.
Port number:
The port number used by the server is well-known port number (0-1023) registered port number (1024-49151)
the port number used by the client is 49152-65535 (only dynamically selected when the client runs the process)

2. User Datagram Protocol UDP
is connectionless, best-effort delivery (reliable delivery is not guaranteed), message-oriented (UDP does not merge or split the messages handed over from the application layer, and UDP sends them as they are), There is no congestion control (network congestion will not reduce the sending rate of the host), multiplexing and demultiplexing (after multiple application processes send data to the transport layer, they share a network layer protocol.|The network layer is based on the port number in the header. different, transfer data to the corresponding port)

3. Transmission Control Protocol TCP
is connection-oriented (before using the TCP protocol, establish a TCP connection first), reliable delivery, full-duplex communication, and TCP connections are point-to-point and byte-oriented.
Socket: IP address + port number. This is the endpoint of the TCP connection.

4. The working principle of reliable transmission
(1) Stop and wait protocol: stop sending every time a packet is sent, and wait for the confirmation of the other party. Send the next packet after receiving the acknowledgment. There are three cases
: ① No error situation
② Error occurs: If no confirmation is received, timeout retransmission
③ Confirmation loss and confirmation late
If the confirmation is lost, then a timeout retransmission is required, and after the timeout retransmission, the packet is found to be duplicated , then the duplicate packet is discarded and the acknowledgment is sent again. After receiving the late acknowledgment, A does nothing.
(2) Continuous ARQ protocol: The sender maintains a sending window, and the n packets located in the sending window can be sent out continuously without waiting for the confirmation of the other party, which improves the utilization rate of the channel. Then, each time the sender receives an acknowledgment, it slides the sending window forward by one packet.

5. The difference between the confirmation number and the serial number of the TCP structure
: the serial number is the serial number of the first byte of the data sent by this message segment, and the confirmation number is the first data byte expected to receive the next message segment of the other party serial number.

6. Realization of TCP reliable transmission
①Sliding window protocol
②Selection of timeout retransmission time

7. TCP flow control
Meaning: Let the sender not send too fast, and let the receiver have time to receive.
This is achieved using a sliding window mechanism. The sending window of the sender cannot exceed the value of the receiving window given by the receiver.
Confused window syndrome: The receiver's buffer is full, and the application process only reads 1 byte from the receiving buffer at a time, then sends an acknowledgment to the sender, and sets the window size to 1 byte. Then, the sender sends another 1 byte of data. In this way, only 1 byte of data is transmitted each time, resulting in very low transmission efficiency. Solution: Ask the receiver to wait for a while, and then send a confirmation message after the accommodated message segment becomes longer.

8. TCP congestion control
prevents too much data from being injected into the network, so that routers or links in the network will not be overloaded.
Methods: slow start, congestion avoidance, fast retransmission, fast recovery.
Slow start: When sending data on the established TCP connection at the beginning, the load of the network is not known, so the value of the congestion window is gradually increased from small to large. Each time the sender receives an acknowledgment for a new segment, it increments the sender's congestion control window by 1. ,
In order to prevent network congestion caused by excessive growth of the congestion window cwnd, it is also necessary to set a slow start threshold. If cwnd<ssthresh, use slow start algorithm; if cwmd>ssthresh, use congestion avoidance algorithm.
Congestion avoidance: Every time a round-trip time RTT passes, the size of the congestion window cwnd of the sender is +1, instead of multiplying like the slow start.
Fast retransmission: Sometimes if a packet loss occurs, the receiver will retransmit over time, thinking that the network is congested, and then execute the slow start algorithm. But at this time the network is not congested, and executing the slow start algorithm will only reduce the efficiency of the network. Therefore, when packet loss occurs in the network, the receiver sends three repeated confirmations to the sender, so that the sender knows that it is not congestion, but the receiver receives one less segment.
Fast recovery: The sender knows that only a few segments are lost, so instead of starting the slow start, it starts the fast recovery algorithm. In the fast recovery algorithm, the sender adjusts the threshold: ssthresh=cwnd/2, cwnd=ssthresh.
Additive increase AI: In the congestion avoidance phase, the congestion window increases linearly.
Multiply to reduce MD: Once timeout or 3 repeated confirmations occur, the threshold value should be set to the value of the current congestion window, and the value of the congestion window should be greatly reduced.

9. TCP connection establishment
(1) Connection establishment Assume that A is the client and B is the server
① A sends a connection request segment to B
② After B receives the connection request segment, if it agrees to the connection, it sends a confirmation to A. After A receives the confirmation, it enters the established state.
③ After B receives A's confirmation, it also enters the established state.
Why does A send a confirmation to B at the end? Because this is to prevent the invalid connection request segment from being sent to B suddenly.
(2) Connection release
①A first sends a connection release segment, stops sending data, and actively closes the TCP connection
②B immediately sends an acknowledgment after receiving the connection release segment. At this time, the connection in the direction from A to B is released, and the TCP connection is in a half-closed state at this time.
②If B has no data to send to A, then B sends a connection release segment.
③A sends an acknowledgment after receiving the connection release segment from B.

10. Now that there is a network layer, why do we need a transport layer?
The network layer is used to implement communication between hosts, and the transport layer provides services for communication between application processes on the basis of the network layer. Because in essence, the communication between two hosts is the communication between the application processes in the two hosts.

11. What is multiplexing and demultiplexing?
These two are functions of the transport layer. Multiplexing means that multiple different processes of the sender can use the same transport layer protocol to transmit data; demultiplexing means that the transport layer of the receiver can correctly deliver the data to each application process (according to the port number ). See book P217 for details

13. Active queue management AQM
in order to avoid the global synchronization phenomenon in the network. When the queue length reaches a certain warning value (that is, when there is a slight symptom of network congestion), it will actively discard the arriving packets. In this way, the sender can be reminded to slow down the sending rate, so that the degree of network congestion is reduced. Once a popular method had randomized early detection of RED.
Global synchronization phenomenon: Router tail discards often cause a series of packet loss, which affects multiple TCP connections, causing many TCP connections to enter the slow start state at the same time.

Chapter 6 Application Layer

1. DNS domain name resolution protocol?
Domain name resolution refers to the process of mapping domain names to IP addresses or mapping IP addresses to domain names. The former is called forward analysis, and the latter is called reverse analysis. When the client needs domain name resolution, it constructs a DNS request message through the local DNS client and sends it to the local domain name server in the form of UDP datagram.
There are two ways of domain name resolution: recursive query and query combining recursion and iteration.
What is a domain name? Any host or router connected to the Internet has a unique hierarchical name, that is, a domain name.

2. Domain
name The domain name is composed of labels separated by ".".
For example: nju . edu . cn
third-level domain name second-level domain name top-level domain name

3. Domain name server
Root domain name server: know the IP addresses and domain names of all top-level domain name servers. If the local domain name server cannot resolve the IP address, it will first request the root domain name server.
Top-Level Domain Name Servers: These domain name servers are responsible for managing all second-level domain names registered under that top-level domain name server.
Authoritative domain name server: Authoritative domain name server. Responsible for the domain name server of a zone, saving the mapping of all host domain names to IP addresses in the zone. A district may refer to a part of a company, etc.
Local domain name server: When a host sends a DNS request, the query request message is sent to the local domain name server. If the local server can query it, the domain name will be converted into an IP address immediately; otherwise, the root domain name server needs to be queried.

4. Domain name resolution process
(1) The host queries the local domain name server: recursive query
(2) The local domain name server queries the root domain name server: iterative query
insert image description here

5. The World Wide Web WWW
The World Wide Web is a large-scale, online information repository that can be accessed from one site on the Internet to another very conveniently. The World Wide Web is a distributed hypermedia system. He is an extension of the hypertext system. A link can be used to access another document on the Internet.
The World Wide Web works on a client-server basis. The browser is the World Wide Web client program on the user's host; the host where the World Wide Web document resides is the server. The client program sends a request to the server program, and the server program sends back the World Wide Web documents required by the client to the client program.
(1)怎样标志分布在互联网上的万维网文档?——URL uniform resource locator
URL format:
protocol://hostname: port/path
For example: http://www.tsinghua.edu.cn. The path name and port are not written here

(2)用什么协议来实现万维网上的各种链接?——Hypertext Transfer Protocol HTTP
http is connectionless and stateless.
The working process of the World Wide Web: ① Establish a TCP connection; ② The browser sends an HTTP request message; ③ The server sends an HTTP response message; ④ Release the TCP connection.
The server process is constantly listening on TCP port 80 in order to discover client requests. These requests and responses need to follow certain rules, and this rule is the Hypertext Transfer Protocol HTTP.
Proxy server: temporarily store some recent requests and responses in the local disk. When a new request arrives, if the proxy server finds that the request is the same as the temporarily stored request, it returns the temporarily stored response. There is no need to go to the Internet to access the resource again according to the address of the URL.
Store user information on the server:
(for example, the server needs to remember what the user puts in the shopping cart)
using cookies. The working method of cookies: When user A browses a website that uses cookies, the server of the website will generate an identification code for A, and use this as an index to generate an item in the server back-end database. Then in the HTTP response message to A, add a header line called set-cookie. When A receives the file, its browser can add a line to the specific cookie file it manages, including the server's host name and identification code.
When A continues to browse this website, every time an HTTP request message is sent, his browser will take out the identification code of this website from the cookie file. then. The website is then able to track user A's activities.
(3)怎样使不同作者创作不同风格的万维网文档?——Hypertext Markup Language HTML
Static World Wide Web Document: After the document is created, it is stored in the World Wide Web server, and the content will not change during the process of being browsed by users.
Dynamic Web documents: Document content is dynamically created by applications when browsers access Web servers.
Active Web Documents: This technique offloads all the work to the browser. P287
(4)怎样使用户能够很方便地获取所需信息?——Using search engines

other

1. Communication method between hosts?
Client-Server (C/S): The client is the requester of the service, and the server is the provider of the service.
Peer-to-peer (P2P): No distinction is made between clients and servers.

2. What is the difference between end-to-end communication and point-to-point communication?
Essentially, the communication subnet composed of physical layer, data link layer and network layer provides point-to-point services for hosts in the network environment, while the transport layer provides end-to-end communication for hosts in the network.
The communication between directly connected nodes is called point-to-point communication, which only provides communication between one machine and another machine, and does not involve the concept of program or process. At the same time, point-to-point communication cannot guarantee the reliability of data transmission, nor can it explain which two processes are communicating between the source host and the destination host. These tasks are all done by the transport layer. End-to-end communication is based on point-to-point communication. It is composed of a segment of point-to-point communication channels. It is a higher-level communication method than point-to-point communication. communication between. "End" refers to the port of the user program, and the port number identifies different processes in the application layer.

3. Synchronous and asynchronous?
In computer networks, Synchronous has a broad meaning and there is no uniform definition. For example, one of the three elements of the protocol is "synchronization". The "synchronization" often mentioned in network programming mainly refers to the execution method of a certain function, that is, the function caller needs to wait for the function to be executed before proceeding to the next step. Asynchronous (Asynchronous) can simply be understood as "asynchronous". In data communication, there is a big difference between synchronous communication and asynchronous communication.
The communication parties of synchronous communication must first establish synchronization, that is, the clocks of both parties must be adjusted to the same frequency. The sender and receiver are constantly sending and receiving a continuous stream of synchronized bits. There are two main synchronization methods: one is network-wide synchronization, that is, a very accurate master clock is used to synchronize the clocks on all nodes in the entire network; the other is quasi-synchronization, that is, clocks of each node are allowed Small errors, and then use other measures to achieve synchronous transmission. The data rate of synchronous communication is higher, but the implementation cost is also higher.
When sending characters in asynchronous communication , the time interval between the sent characters can be arbitrary, but the receiving end must always be ready to receive. The sending end can start sending characters at any time, so a flag must be added at the beginning and end of each character, that is, the start bit and stop bit, so that the receiving end can correctly receive each character. Asynchronous communication can also use frames as the sending unit. At this time, some special bit combinations must be set at the head and tail of the frame, so that the receiving end can find out the beginning of a frame (ie frame delimitation). The communication equipment for asynchronous communication is simple and cheap, but the transmission efficiency is low (because the overhead of the sign is relatively large).

4. Try to analyze the difference and connection of the four network interconnection devices: repeaters, hubs, bridges and switches. These
four devices are all connection devices for interconnection and expansion of the LAN, but their working levels and functions are different. .
The repeater works at the physical layer and is used to connect two network segments with the same rate and the same data link layer protocol. Its function is to eliminate the distortion and attenuation caused by the digital signal passing through a long cable during baseband transmission. Make the waveform and strength of the signal meet the required requirements; the principle is signal regeneration.
The hub (Hub) also works at the physical layer, which is equivalent to a multi-interface repeater. It can connect multiple nodes into a shared local area network, but only one node can send data through the public channel at any time. .
The bridge works at the data link layer and can interconnect different physical layers, different MAC sublayers and Ethernets of different rates. The bridge has the functions of filtering frames and storing and forwarding frames, which can isolate collision domains, but cannot isolate broadcast domains.
The switch works at the data link layer, which is equivalent to a multi-port bridge and is the core device of the switched LAN. It allows multiple concurrent connections to be established between ports to realize concurrent transmission between multiple nodes. Therefore, the bandwidth occupied by each port node of the switch will not decrease due to the increase of the number of port nodes, and the total bandwidth of the entire switch will increase with the increase of the port nodes. Switches generally work in full-duplex mode. Some LAN switches use store-and-forward mode for forwarding, and some switches use cut-through switching mode (that is, when a frame is received, it immediately determines the forwarding port of the frame according to the destination MAC address of the frame, while don't have to be cached before processing).

5. SMTP Simple Mail Transfer Protocol
Simple Mail Transfer Protocol (Simple Mail Transfer Protocol, SMTP) is a protocol that provides reliable and effective email transmission, which controls the exchange of information between two SMTP processes that communicate with each other. Since SMTP uses the client/server approach, the SMTP process responsible for sending mail is the SMTP client, and the SMTP process responsible for receiving mail is the SMTP server. SMTP uses a TCP connection with port number 25. SMTP communication has the following three phases: (1) connection establishment (2) mail transmission (3) connection release.

6.POP3
Post Office Protocol (Post Offiffiffice Protocol, POP) is a very simple but limited mail reading protocol, and now uses its third version POP3. POP3 uses a "pull" (Pull) communication method. When the user reads the mail, the user agent sends a request to the mail server to "pull" the mail in the user's mailbox. POP also uses the working method of client/server, uses TCP in the transport layer, and the port number is 110. A POP client program must be running on the recipient's user agent, and a POP server program must be running on the recipient's mail server. POP works in two ways: "Download and Keep" and "Download and Delete". In the "download and keep" mode, after the user reads the mail from the mail server, the mail will still be saved on the mail server, and the user can read the mail from the server again; while using the "download and delete" mode, the mail will Once read, it is deleted from the mail server, and the user cannot read it from the server again.
With the popularity of the World Wide Web, there are currently many e-mails based on the World Wide Web, such as Hotmail and Gmail. The characteristic of this kind of email is that HTTP is used to send or receive mail between the user's browser and the mail server of Hotmail or Gmail, and SMTP is only used when sending mail between different mail servers.

Guess you like

Origin blog.csdn.net/rellvera/article/details/127104487