25.10. Passing Error Notifications to the Transport LayerWe saw in the section "L4 Protocol Registration" in Chapter 24 that when transport protocols register with the kernel, they provide an instance of an inet_protocol data structure. It includes one function pointer, err_handler, which is called by the ICMP protocol to propagate to the transport layer error notifications received with ingress ICMP messages. RFCs 1122 and 1256 specify, for hosts and routers, respectively, whether each ICMP message type should be propagated to the transport layer. All the error message types that require a notification to be sent to the transport layer are processed by icmp_unreach. At the end of that function, the transport layer is notified with err_handler. When the transport layer processes the notification, it uses the icmp_err_convert array defined in net/ipv4/icmp.c to convert the ICMP_DEST_UNREACH code into an error code that is better understood by the socket layer (see udp_err in net/ipv4/udp.c for an example). The transport layer passes that error code to the socket associated with the error (which is identified thanks to the ICMP payload, as described in the section "ICMP Payload"). Raw IP sockets are notified as well, by means of raw_err. Table 25-10 shows the conversion that is applied by icmp_err_convert. Note that the err_handler routines registered by tunneling protocols such as IPIP and GRE may generate new ICMP messages (see ipip_err in net/ipv4/ipip.c for an example).
|
Saturday, October 24, 2009
Section 25.10. Passing Error Notifications to the Transport Layer
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment