![](https://csdnimg.cn/release/download_crawler_static/86276364/bg3.jpg)
11. For the call to sendto in the example program, the kernel has made three complete passes of the user data. Please
describe the detail. 1.9.3 p13
So far the kernel has made two complete passes of the 150 bytes of user data: once to copy the data from the user's
buffer into the kernel's mbufs, and now to calculate the UDP checksum. When the interface processes an mbuf that's on its
output queue, it copies the data to its transmit buffer and initiates the output. In our example, 192 bytes are copied to the
transmit buffer: the 14-byte Ethernet header, 20-byte IP header, 8-byte UDP header, and 150 bytes of user data. This is the
third complete pass of the data by the kernel.
(1)copy the data from the user’s buffer into the kernel’s mbuf; (2)calculate the UDP checksum; (3)copy the data to it’s
transmit buffer and initiates the output
12. Give an overview of the processing that takes place when a process calls sendto to transmit a single UDP
datagram.P14
13. In chapter 1, the textbook gives an example program: send a datagram to the UDP daytime server and read a response.
The program calls recvfrom to read the server's reply, after it calls sendto to send a datagram to the daytime server. If
the reply has not been received yet, the input queue for the specified socket is empty. What is the state of the process
at this point (the program calls recvfrom)? 1.9.6 P15
At this point our program calls recvfrom to read the server's reply. Since the input queue for the specified socket is
empty (assuming the reply has not been received yet), the process is put to sleep.
14. Is input processing synchronous or asynchronous? 1.10 P15
Asynchronous
15. Is the reception of an input packet triggered by a receive-complete interrupt to a network device driver, or by a system
call issued by the process? 1.10 P15
A receive-complete interrupt to the Ethernet device driver.
16. What does the Ethernet Input do in the 4.4BSD-Lite distribution?p15
The device driver passes the mbuf to a general Ethernet input routine which looks at the type field in the Ethernet
frame to determine which protocol layer should receive the packet. In this example, the type field will specify an IP
datagram, causing the mbuf to be added to the IP input queue. Additionally, a software interrupt is scheduled to cause
the IP input process routine to be executed. The device's interrupt handling is then complete.
17. The IP software interrupt is set by interface layer. (socket layer/protocol layer/interface layer) P15