TCP/IP FAQ (1)

Source: Internet
Author: User

TCP/IP FAQ (1)
[Data Link] 1. Must the loopback interface address be 127.0.0.1? Class A IPs such as 127. x can be used as the address of the loopback interface, but 127.0.0.1 is commonly used. 2. Why is there no input for the loop interface? The datagram sent to the loop interface is actually sent to the input queue at the network layer. Therefore, if the datagram does not leave the network, it is impossible to receive the data frame whose destination address is the loop interface address from the link, therefore, input processing does not exist. 3. What are the differences between SLIP, loopback, and Ethernet interfaces? The SLIP and loopback interfaces do not have the link layer header and hardware address, and the loopback interfaces do not have input processing, while the Ethernet interfaces do. 4. How do SLIP and Ethernet interfaces use input frames and loop interfaces use output groups? SLIP puts frames directly into the IP input queue. The Ethernet interface places frames in the corresponding protocol Input Queue according to the frame type field. The loopback interface places frames in the corresponding Input Queue according to the target address family. [ARP & RARP] 1. When will ARP requests be sent and when will ARP requests be answered? When unicast fails to send IP data and query ARP high-speed cache, an ARP request asking the hardware address of the target host is broadcasted; when the host receiving the ARP request is the target host or the ARP proxy server of the target host, an ARP response is unicast. 2. Why are the two Ethernet frames of different types? The ARP value is 0x0806, And the RARP value is 0x8035. In fact, for the sender, the op field of ARP can be used to distinguish RARP. However, for the receiver, as ARP is implemented in the kernel, RARP is generally implemented as a server, so to make it easier to distinguish, It is identified by another value. 3. What are the problems with RARP server design? First, how to send Ethernet frames to respond to requests is related to the system. Second, when multiple servers exist, sending response frames at the same time will cause Ethernet conflicts, which can be avoided through optimization by dividing the master-slave servers and random latencies. 4. How does ARP process multiple packets sent to a given destination while waiting for a response? In most implementations, when waiting for an ARP response, only the last packet is sent to the specific target host. Host Requirements RFC requires that the implementation of this type of ARP flood be prevented. The maximum speed is recommended to be once per second. 5. What is the function of free ARP? Common ARP requests are used to query the target hardware address and wait for a response. Free ARP does not necessarily expect a response, which can be used in two ways: 1) One host can determine whether there is another host with the same IP address. 2) when the local hardware address changes, other hosts are notified to update the ARP cache. 6. How does ARP map an IP multicast address? Obtain the 23-bit lower IP address of the multicast address, and then press the constant 0x01005e7f0000. The result is the corresponding multicast hardware address. [IP] 1. When and where are parts? When the datagram length is greater than the MTU of The Link Interface and DF = 0, fragment is started. fragment can occur on the source host or on the intermediate router. 2. How to partition? 1) Calculate the data length of each shard (excluding the IP header). Except for the last Shard, the Data Length of other shards is a multiple of 8 bytes. 2) In addition to copying the corresponding data, you can also copy the first and (partial) options of the original group to each new shard, update the header length, total length, MF mark, and offset of the new part header. If the original group is already a shard, then MF = 1; otherwise, the last shard MF = 0 and the remaining MF = 1. 3. When and where to reinstall? Because the shards can have different routes and the routers may shard again, only the target host can reload all the shards. When the receiving end receives a group with a non-zero MF or offset for the first time, the group is a part that must be reinstalled, so it starts to reload. 4. How to reinstall it? 1) Use 4 tuples {source address, target address, protocol, and 16-bit identifier} to find the datagram to which the current shard belongs (Partition Table). If not, create a partition table, insert the current part to the partition table at the offset and start the reinstallation timer. 2) if a complete IP datagram is not assembled after the reinstallation timer times out, if the first Shard is received, an ICMP timeout error is returned to the source host, and all the shards received are discarded; otherwise, submit the data to the appropriate transport layer for processing. 5. Which groups can be forwarded and when will they be forwarded? A group that arrives at a non-final destination system and can be forwarded only when the system is configured as a forward or a group contains a source route, except for the following groups: 1) Link Layer broadcast 2) loop group 3) network 0 and Class E destination addresses 4) Class D destination address. [ICMP] 1. What types of ICMP messages are there? When and where are these messages generated? There are four types of requests, responses, errors, and redirection. The first two types can be unified as query types. Requests are generated by the process when they need to be queried, and responses are generated when the kernel receives the request message. When the datagram sent by the host cannot be successfully submitted to the target host, the IP address or transmission protocol of the target host or intermediate router generates an error message and returns it to the original system. 2. How does the Kernel Handle received ICMP packets? ICMP is a Transport Layer Protocol. Its Protocol number is 1. When an ICMP packet is received by the IP layer, it is used for ICMP protocol input. ICMP protocol input is processed according to its type: 1) request --- generate appropriate response packet 2) Error --- submit to appropriate transport layer protocol for processing 3) response --- submit to process waiting for ICMP packet 4) Redirect --- Update route table, and submit it to the waiting process. 3. How to send ICMP packets? Construct an ICMP packet --> compute ICMP test --> encapsulate it into an IP datagram-> submit it to the IP protocol for output processing. for user processes, the original IP mechanism must be used for sending. [TCP & UDP] 1. Why does the TCP Header have a header length field, but UDP does not? The TCP Header has options, such as mss, timestame, nop, and wscale. 2. Why are source and target ports in front of the two protocol headers? When TCP receives an ICMP error, it must check the two port numbers to determine which connection the error corresponds to. The user process will receive an ICMP error only when the UDP interface is connected to the peer end, for example, when the server is not running, the returned ICMP port cannot reach the message. 3. How can I submit a TCP or UDP packet to the application layer? Submit it to the plug-in bound to the target address or the wildcard address. If both are bound (implemented by setting SO_REUSRADDR), submit it to the plug-in of the target address. 4. Why should we introduce a pseudo-header for testing the computing header? This is because TCP and UDP need to verify whether the packets are delivered to the correct protocol and target host considering possible errors at the IP layer. 5. When will UDP calculate the test and how to distinguish whether the test is used? The UDP test is optional. when the system does not prohibit (udpcksum is not zero), the sender calculates the test and the receiver also needs to input the group test and non-zero to calculate the test. If the check and field are non-zero, they are used. Otherwise, no.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.