On = (setsockopt (sockfd, IPPROTO_IP, IP_HDRINCL, & on, (on) <
3. You can call the bind function on this original interface, but it is rare. The bind function only sets the local address because the original interface does not have a port.
4. You can call the connect function on this original interface, but it is rare. The connect function only sets the remote address, because the original socket does not have a port.
Original set interface output
The output of the original set of interfaces follows the following rules:
1. normal output is completed by calling sendto or sendmsg and specifying the IP address. If the set of interfaces has been connected, you can also call write, writev, or send.
2. If the IP_HDRINCL interface option is not enabled, the starting address of the data sent by the kernel by the process indicates the first byte after the IP header, because the kernel will construct the IP header and place it before the data from the process. The kernel sets the protocol field of the constructed IPv4 header to the 3rd parameter called by the socket.
3. If the IP_HDRINCL interface option is enabled, the starting address of the data sent by the kernel by the process indicates the first byte of the IP header. The data volume written by the process call output function must include the size of the IP header. The entire IP header is constructed by the process. However, (a) the IPv4 Id field can be set to 0 to inform the kernel to set this value. (B) The IPv4 header checksum field is always calculated and stored by the kernel; (c) The IPv4 Option field is optional.
4. The Kernel performs sharding for the original group that exceeds the MTU of the outbound interface.
Original set interface input
The original interface entry follows the following rules:
1. The received UDP group and TCP group are never transmitted to any original interface. If a process wants to read IP datagram containing UDP or TCP groups, it must read these groups at the data link layer.
2. Most ICMP groups transmit ICMP messages to the original interface after the kernel completes processing.
3. All IGMP groups are passed to the original set of interfaces after the kernel completes processing the IGMP messages.
4. the kernel does not know all IP datagram of the protocol field and transmits it to the original interface. The Kernel performs a unique process on these groups for the minimum verification of certain IP header fields: IP version, IPv4 header checksum, header length, and IP address.
5. If a data report arrives in the form of a fragment, no fragment group is transmitted to the original set interface before all its fragments arrive and the datagram is reorganized.