Review of "Computer Network" at the end of the term (review of previous years' test questions)

foreword

Our exam question types are:
short answer (6 questions, 5 points/question),
application (6 questions, 5 points/point)
calculation (5 questions, 8 points/point)

The following content is also classified according to these three types of questions. After reading the papers, I feel that the division of test points between calculation questions and application questions is not obvious, so I will not subdivide application questions and calculation questions, and review them together. There are two sections for the full text: ① Short answer questions; ② Major questions

It is worth noting that the answers to all the following questions are my answers, not standard answers! It is normal if the answer is wrong! ! !


After the exam, let’s restore our exam content from memory (20220105):

short answer questions

  • Describe the store-and-forward mechanism in packet-switched networks
  • Describe the three main parts of the Internet mail access protocol, their respective functions, and write a process of mail transmission
  • The benefits of IPv6 over IPv4 (write two points)
  • It seems that the test is flow control and congestion control
  • The principle of the write queuing delay is still something, I can’t remember clearly
  • Describe the operation of the sender and receiver in selective retransmission

Application questions

  • A scenario is set up, both a and b send information to c, and ask c to distinguish between a and b and accept it correctly (see the role of the destination address and original address of the network layer ip and transport layer tcp for details)
  • IP addressing subnetting gives the coding range and starting address of the corresponding subnet (hard question)
  • Given an HTTP request message, just read the message
  • Code division multiple access, a chip is given, and it is required to write the bit stream for transmission 010
  • Cryptography (email only considers confidentiality)

Calculation problems

  • Classic topic calculation delay
  • Iterative calculation of the RTT formula (really, five data are given, and each data is calculated according to the formula given in the title)
  • Calculate the waiting time according to the CSMA/CD principle
  • Dijkstra routing
  • Cyclic Redundancy Code CRC


short answer questions

1. Draw a picture to illustrate the three-way handshake message exchange process of the TCP protocol, and further explain what disadvantages it solves for the two-way handshake?
insert image description here
The reason for the TCP three-way handshake is to prevent the confusion caused by repeated connection initialization in history, and to prevent the two parties communicating using the TCP protocol from establishing a wrong connection.

我们可以想象以下场景:(如果通信的双方建立连接使用两次握手)
发送方一旦发送了建立连接请求之后就无法撤销此次请求
      若网络状况较差,发送方会重复发送请求
      或者发送方突发意外,不想建立连接了
接收方可以选择接受或者拒绝此次请求
      但接受方无法判断当前获取的请求是否由于网络原因已过期

所以为了判断此次连接是否有效,优化为了3次握手:
- 并在连接引入SYN和SEQ等控制信息
         当接收方当收到连接请求时,会将发送方发来的 SEQ 进行+ 1以回应
         再发送回发送方
         由发送方决定此次连接是否正式建立(正式建立SYN赋值0)
- 使用三次握手和控制信息是希望发送方决定是否
- 因为只有发送方才有足够的上下文判断当前连接是错误的或者过期的。

2. Briefly describe the DNS server type, function and hierarchical relationship?
There are four types of DNS servers: root DNS servers, top-level DNS servers, authoritative DNS servers, and local DNS servers.
Hierarchical relationship: ① Only the root DNS server, top-level DNS server, and authoritative DNS server constitute the distributed and hierarchical system; ② The local DNS server acts as a proxy to connect the host's request to the root DNS.
Functions: ①Root DNS server: Provide IP address of TLD server; ②Top-level DNS server: Provide IP address of authoritative DNS server; ③Authoritative DNS server: cache host-IP mapping; ④Local DNS server: Proxy host request.


3. Briefly describe the two basic methods for solving pipeline error recovery, that is, go back N steps and select retransmission?
Back N steps : When using a sliding window for data transmission between the sender and the receiver, if a frame is lost/damaged, the receiver will not send back an ACK, causing the sender to wait for the receiver to return the ACK confirmation timer to time out, and the sender will start from At the beginning of the last data frame confirmed by ACK, the unacknowledged error frame and all subsequent N frames are retransmitted.

Selective retransmission : Only retransmit frames that are not received correctly, instead of retransmitting all frames. The sender sets a timer for each sent frame, and stops counting when it receives the ACK confirmation. If no response is received after the timeout, it means that the frame is lost or has an error, and the frame is resent. If the party sends an ACK response signal and finds that the serial number is discontinuous and there is a frame loss phenomenon, it will send a NAK signal to the sender, requesting to resend the frame with the specified serial number.


4. Briefly describe the 4 steps of DHCP client-server interaction?
DHCP (Dynamic Host Configuration Protocol): Dynamic Host Configuration Protocol. It is an efficient IP address allocation method,

  1. Discovery phase : That is, the phase in which the DHCP client searches for the DHCP server. The DHCP client computer sends information by broadcasting to find the DHCP server, and only the DHCP server will respond.
  2. Provisioning stage : the stage in which the DHCP server provides an IP address. The server selects one of the IP addresses that have not been rented out and assigns it to the DHCP client.
  3. Selection phase : That is, the phase in which the DHCP client selects the IP address provided by a certain DHCP server.
  4. Confirmation stage : the stage in which the DHCP server confirms the provided IP address.

5. Briefly describe what is the hidden terminal problem of wireless links?
In the field of wireless communication, base station A sends information to base station B, and base station C also sends information to B without detecting A, so A and C send signals to B at the same time, causing signal conflicts, and eventually the signals sent to B are lost .


6. Briefly describe the working principle of the public key cryptosystem, assuming that the message Alice wants to send to Bob is m?
Both sides of the communication use a pair of keys, one of which is known to the whole world as the public key, and the other requires only one person to know it as the private key. According to needs:
①The sender uses the public key of the receiver to encrypt the message, and only the receiver can restore the message with its own private key. This ensures a certain level of confidentiality.
②The sender signs the message with its own private key, and the receiver decrypts the message with the sender's public key, so that the identity of the sender can be identified.


7. Suppose the message Alice wants to send to Bob is m, the random symmetric session key used for confidentiality is K s , Alice’s public key and private key are K + A , K - A , Bob’s public key and The private keys are K + B and K - B respectively ; the hash function used for authentication is H. Please draw a picture to illustrate an email system that can provide confidentiality, sender authentication, and message integrity. Note: Please draw Alice's sending process and Bob's receiving process completely?

insert image description here
insert image description here


8. Briefly describe the two types of services provided by the Internet to applications and the characteristics of each type of service?

There are two types of services that the Internet provides to applications: connectionless services and connection-oriented services

Connection-oriented services must first establish a connection before data exchange. The connection should be terminated when the data exchange is complete. Connection-oriented services are more suitable for sending many messages to the same destination within a certain period of time.

In the case of connectionless service, the communication between two entities does not need to establish a connection first, so the relevant resources of the lower layer do not need to be reserved in advance. These resources will be allocated dynamically during data transfer. Another characteristic of a connectionless service is that it does not require both communicating entities to be active at the same time. It must be active only when the sending entity is sending. At this time, the entity at the receiving end does not necessarily have to be active. It must be active only when the receiving entity is receiving. The advantage of connectionless service is that it is flexible, convenient and relatively fast. However, connectionless services cannot prevent packet loss, duplication, or out-of-sequence. Connectionless services are especially suitable for transmitting a small number of sporadic messages.


9. Briefly describe the difference between flow control and congestion control?
Congestion control is to avoid the problem of network resource exhaustion. It is realized through the congestion window (its development is beneficial to the Internet as a whole, and it is global). Flow control
focuses on the essential requirements of TCP transmission. Its purpose is to solve the problem of the sender and receiver. The problem of rate mismatch is realized by sliding window (controlling the number of packets sent but not ACKed)

拥塞控制
- A与B之间的网络发生堵塞导致传输过慢或者丢包,来不及传输。
- 通过拥塞窗口实现
     - 拥塞窗口指 发送端 在RTT内可以发送的最大数据包数
     - 拥塞窗口根据网络情况一直动态变化
- 实现过程经历两个阶段:
     - 1. 慢启动(指从1开始指数增长到限定大小的过程)
     - 2. 拥塞避免(超过限定大小后出现丢包,将拥塞窗口改为1,限定大小减半)



流量控制
- A给B发数据,A发送的太快导致B没法接收(B缓冲窗口过小或者处理过慢)
- 通过滑动窗口实现,有发送端窗口和接收端窗口之分
       - 窗口的大小在 接收端 指能够接收的最大字节数! 
       - 窗口的大小在 发送端 指能够发送的数据的大小
       - 窗口大小在TCP报文中设置
       - 窗口大小可以根据设置动态变化,但在某通信过程中,确定了就不变了

10. Compare and explain the network performance of bus network and token ring network running CSMA/CD protocol under light and heavy load?
Compared with CSMA/CD network, token ring network is more suitable for heavy load environment.
Each station of CSMA/CD network sends data randomly, and conflicts occur.
The conflict intensifies when the load is heavy.
On the other hand, each station of the Token Ring network uses the token to send data in turn, no matter what the network load is, there is no conflict, which is its outstanding advantage.


11. Briefly describe the types of delays in packet-switched networks and the relationship between these delays and the total delay of nodes?
The total node delay d nodal = node processing delay d proc + queuing delay d queue + transmission delay d trans + propagation delay d prop

  • Processing delay dproc : The time it takes for a router to examine a packet header and decide where to direct the packet.
  • Queuing delay d queue : When packets are transmitted through the network, they have to pass through many routers. Therefore, when the packet enters the router, it must be queued in the input queue for processing; after the router determines the forwarding interface, it must be queued in the output queue for forwarding.
  • Transmission delay d trans : It is the time required for the host or router to send a data frame, that is, the time required to send the first bit of the data frame to the time required for the last bit of the frame to be sent - the length of the data frame (b) / channel bandwidth (b/s)
  • Propagation delay d prop : The time spent in transporting a packet between two routers. This speed of propagation depends on the physical medium of the link (fiber optics, twisted pair copper wire, etc.).

12. Briefly describe the slow start process of the TCP protocol?
Set the value of the congestion window size to cwind and the value of the congestion limit to ssthresh

  • TCP initialization, the congestion window is set to 1 : When the host starts to send data, because it does not know the network situation, it will try first, so the value of the congestion control window is set to a small value.
  • Execute the slow start algorithm, and cwind grows according to the law : every time an ACK confirmation for a new segment is received, the limit value cwind of the congestion window is increased, and more data can be transmitted than before
  • When cwind==ssthress performs congestion avoidance : the initial setting value of ssthresh has been reached at this time, but the network has not been congested, indicating that ssthress can be increased to release more data
  • The network is blocked, update the ssthresh value to half of the ssthresh value before the congestion, and reset cwnd to 1
    insert image description here

13. Briefly describe the composition and establishment process of a virtual circuit (VC)?
The sender sends a specific control information block (such as a call packet) containing address information, and each intermediate node passed by the information block allocates LC according to the current logical channel (LC) usage status, and establishes input and output LC mapping Table, the concatenation of LC allocated by all intermediate nodes forms a virtual circuit (VC).

The composition of a virtual circuit:

  1. The path between the source and destination hosts (i.e., a series of links and routers)
  2. VC number, a number for each link along the path
  3. Forwarding table entries in each route along the path

The process of establishing a virtual circuit:

  1. In the establishment phase, the sending transport layer contacts the network layer, specifies the address of the receiver, and waits for the network to establish a virtual circuit. The network layer determines the path between the sender and the receiver, that is, a series of links and routers that all packets of the virtual circuit must pass through.
  2. The network layer also determines a VC number for each link along the path. Finally, the network layer adds an entry to the forwarding table of each router along the path. During the establishment of a virtual circuit, the network layer can also reserve resources on the path of the virtual circuit.

14. Briefly describe the function and scope of address resolution protocol ARP?
Address Resolution Protocol (Address Resolution Protocol, ARP): The APR module in the sending host will take any IP address on the same LAN as input, and then return the corresponding MAC address

ARP only resolves IP addresses for hosts and router interfaces on the same subnet


15. Briefly describe the meaning and function of the message authentication code MAC?
Meaning: Use the authentication key s to concatenate the message m, the generated m+s, and the calculated password hash H(m+s) is called the message authentication code Function: it is appended to the message and transmitted at the same
time For the recipient, the recipient can calculate the MAC of the message and compare it with the received MAC. If they are the same, the message has not been changed during the journey, ensuring the reliability of the data.


16. Briefly describe the similarities and differences between switches and routers?

相同点:
1. 都可用来交换网络设备 
2. 都是用来扩展网络的


不同点:
1. 工作层次不同
         交换机工作在数据链路层
         而路由器工作在网络层
2. 数据转发所依据的对象不同
         交换机利用MAC地址确定转发数据的目的地址
         路由器则是利用IP地址来确定数据转发的地址

17. Compare the characteristics of LS algorithm and DV algorithm?

The LS algorithm is the link state algorithm, which is the algorithm with global state information.
The DV algorithm is the distance vector algorithm.

1. 工作原理不同
   LS算法中,网络拓扑和所有的链路费用都是已知的
   DV算法:要求每个路由器都要向其他邻接的路由器发布一个距离向量
           距离向量是该路由器到其他已知的各网络的相对距离
2. 算法结构不同
   LS算法:是一种全局信息的算法
   DV算法:是一种迭代的、异步的和分布式的算法
3. 跳数的限制
   LS没有跳数的限制,使用“图形理论”算法或最短路径优先算法
   DV使用跳数或向量来确定从一个设备到另一个设备的距离
4. 路由表的更新
   LS算法:每个节点都有一个全局的拓扑结构,根据此拓扑结构计算路由表,
   DV算法根据相邻节点的路由信息更新自己的路由表

18. Many services provided by the data link layer are very similar to those provided by the transport layer. Please describe the similarities and differences between the two?

Similarity: Both the link layer and the transport layer provide reliable transmission, flow control, and error detection.

the difference:

  • Transfer services are different. The transport layer protocol provides reliable transmission between two processes on an end-to-end basis ; the reliable link layer protocol provides reliable transmission services between two nodes connected by a link.
  • Flow control is different: Flow control in transport layer protocols is provided on an end-to-end basis, whereas in link layer protocols it is provided on an inter-node basis.

19. Does the size of the sending window depend on flow control or congestion control?
The size of the sending window=min{the receiving window size of the flow control, the congestion window}
LastByteSent - LastByteAcked ≤ min{rwnd,cwnd,}
cwnd is the congestion window (congestion control)
rwnd is the acceptance window (flow control)


Question about IP addressing

Read this blog, it's well written!


big question

The first question type: Chapter 1 delay, channel utilization

1. The distance from the moon to the earth is about 3.9 x 10 5 Km, and a 200Kbps point-to-point link is set up between them, and the signal propagation speed is the speed of light (3 x 10 8 m /s), and a photo from the moon The time required to send back to the earth is 501.3s, Q: the number of bytes of this picture.

分析这道题,显然只有传输时延和传播时延
传播时延=3.9x10^8m / 3x10^8m/s=1.3s
传输时延=501.3-1.3=500s
字节数= 传输时延*带宽=500x200Kbps=100000Kb

2. Assume that there is a 15Mbps microwave link between the geostationary satellite and its earth base station, and the distance between the satellite and the earth is 36000Km. Every minute the satellite takes a digital photo and sends it to the base station, assuming a propagation speed of 2.4x108m/s.
(1) What is the propagation delay of this link?
(2) What is the bandwidth-delay product R·dprop? (product of bandwidth and round-trip communication delay)

(1)36000km/2.4x10^8m/s=150ms
(2)150x15Mbps

The second question type: Chapter 3 Reliable Data Transmission at the Transport Layer (Error Recovery Sliding Window)

1. Consider a GBN protocol with a sender window of 4 and a sequence number range of 1024. Assume that at time t, the sequence number of the next ordered packet expected by the receiver is k. It is assumed that the media will not reorder packets. Answer the following questions
1) At time t, what is the possible sequence number of the message in the sender's window? Justify your answer.
2) At time t, what are all possible values ​​of the ACK field in all possible packets currently being propagated back to the sender? Justify your answer.

1)对于退回N步协议:
        接收方一定是按序确认的,发送方也必须等到窗口内的分组都确认才移动
   所以接收方想要第k个
        意味着k之前所有分组接收方一定已经接受并发送ACK了
        但发送方不一定都接受到了ACK,也有可能都收到了
        所以发送方窗口中左极限为:k-4
                           (只要[k-4,k-1]的ACK信号全部到达,滑动窗口自然移到k)
                       右极限为:k+3
                           ([k,k+3]已发送,但还没到达接收方)
   发送窗口内的报文序号就有以下排列:
   - (k-4,k-3,k-2,k-1) 发送方ACK(k-4)~ack(k-1)都没有收到;
   - (k-3,k-2,k-1,k) 发送方收到了ACK(k-4),ACK(k-3)~ACK(k-1)发送方还没有收到;
   - (k-2,k-1,k,k+1) 发送方收到了ACK(k-3),ACK(k-2)~ACK(k-1)都没有收到
   - (k-1,k,k+1,k+2) 发送方收到了ACK(k-2),ACK(k-1)~ACK(k)都没有收到
   - (k,k+1,k+2,k+3) 发送方收到了ACK(k-1),接收方还没收到k


2)第一题已经把情况都列举出来了,照着写就好了
   - (k-5,k-4,k-3,k-2,k-1),(k-4,k-3,k-2,k-1)(情况1.1)
   - (k-3,k-2,k-1)(情况1.2)
   - (k-2,k-1)(情况1.3)
   - (k-1)(情况1.4)
   - ()(情况1.5)
分析出来也能知道:k-5发送方一定收到了。

The third question type: Chapter 3 Comparison of Transport Layer TCP and UDP

The fourth question type: Chapter 4 Network Layer IP Address, IP Fragmentation

The fifth question type: Chapter 5 Network Layer Routing Algorithm

1. Dijkstra algorithm
insert image description here
insert image description here

2. Distance vector routing algorithm
insert image description here
insert image description here

The sixth question type: Chapter 6 Link Layer CRC

  1. The two sides of the communication adopt the CRC cyclical check code, the agreed generator polynomial is 100110, the information to be sent is 10010110, and the cyclic redundancy check code is calculated
G = 100110 有6位
所以循环冗余校验码有5位: r = 5
CRC =reminder[ D * 2^5/G ]= reminder[10001111……10]=00010
数据报 DR = 10010110 00010

  1. When CRC check is used, the data receiver receives a data with a bit sequence of 10101001111, and the generator polynomial is G(x) = x 3 + 1. Is there any error in the received bit sequence? Please calculate the answer and ask to write the check process.
G = 1001 有4位
所以循环冗余校验码有3位: r = 3
CRC = 111
数据报 DR = 10101001111
用 DR / G = 10111110……1
余数不为0,故收到的比特序列有错。

  1. When using CRC check, G(x) = x 4 +x 3 +1, the receiver receives a bit sequence of 110101101101, ask, how many binary numbers should the CRC cyclic redundancy code be? Is there an error in this sequence? It is required to write out the verification process.
G = 11001 有5位
所以循环冗余校验码有4位: r = 4
CRC = 1101
数据报 DR = 110101101101
用 DR / G = 10010101……0
余数为0,故收到的比特序列正确。

The seventh question type: Chapter 6 Multi-access Protocol

CDMA

一个bit时间划分为m个短的间隔,称为码片。码片序列的编码如下:
假设发送端的码片为:01010101
将发送端的每一bit信号进行编码:
          信号1,则用01010101表示
          信号0,则发送其反码10101010
同时为了提升发送信号的抗干扰性,一般将编码中0用-1代替。

Consider the CDMA situation of a single transmission. If the CDMA code of the sender is (1,-1,1,-1,1,-1,1,-1), if two data bits 0 and 1 are to be sent, the sender What is the output? Please draw a picture to illustrate.

由题意可得发送方的码片为:10101010
然后把01扩展到码片上表示:
0       1
01010101  10101010
然后用-1代替0
发送方的输出即为:-1 1 -1 1 -1 1 -1 1 1 -1 1 -1 1 -1 1 -1

If you draw a picture, you can refer to this:
insert image description here

CSMA/CD
1. Assume that node A and node B are on the same 10Mbps Ethernet bus, and the propagation delay of these two nodes is 225 bit times. Assume that A and B send frames at the same time, and the frames collide, and then A and B B chooses different K values ​​in the CSMA/CD algorithm.
1) Assuming no other nodes are active, will the retransmissions from A and B collide?
2) Suppose A and B start transmitting at t=0 bit time, and they both detect a collision at t=225 bit time. They are at t=225+48=273 bit time to complete the transmission of the blocking signal. Assume KA=0, KB=1.
2.1) When will B adjust its retransmission?
2.2) When does A start sending?
2.3) When will A's signal reach B?
2.4) Will B control the transmission at its scheduled time?

The propagation delay experienced by B's signal to A is 225, and the transmission delay for A to obtain the blocked signal is 48. KA= means that A retransmits immediately, and A sends the data to be transmitted to the link to consume another transmission delay, so A's time has three segments:
273+225: Waiting for the propagation delay of B's ​​blocking signal
498+48: A obtains B's blocking signal, plus 48, A is ready to transmit its own data,
so A starts to transmit at 594

On the other hand, after B's own blocking signal is sent out, there is a propagation delay of 225 for waiting for A's blocking signal, and then there is a transmission delay of 48 for obtaining A's blocking signal, and then KB=1, which means that B waits for a propagation delay. Delay 225, B prepares its own data and another transmission delay 48, B totals 273+225+48+225+48 =881 to start retransmission

A starts transmission at 594 and arrives at B after a propagation delay of 225, which is 819
819<881, and A arrives before B starts, so the two will not collide
insert image description here

The eighth question type: Chapter 8 Cryptography Key

There was a short-answer question, and it was written in great detail, so I won’t go into details here.

Ninth question type: processing of physical layer bit stream

1. Draw the Manchester encoding diagram of 1101001100
Manchester encoding: jumping from high to low means "1", and jumping from low to high means "0".

insert image description here


2. Please draw the differential Manchester encoding of 011010100111.
Differential Manchester encoding: use a jump to "0" at the beginning of each bit, and "1" if there is no jump.
insert image description here

Guess you like

Origin blog.csdn.net/KQwangxi/article/details/122276723