Having a better understanding of packet processing helps you decide how to implement routing functions.
The following simplified flow chart shows the logical process that takes place when an IP packet (datagram) reaches your iSeries™ server. The actual flow might be different, but the outcome should be the same. The following logic only describes the default packet processing scenarios. If advanced routing techniques are used, packet processing might be slightly different.
First, the destination address in the IP header is compared to all the defined addresses on the system. If it is determined that the packet is destined for your system, the packet is passed up the IP stack to a higher level software, such as TCP, and then to the application that is listening on the destination port.
If the packet is not accepted locally, the next check that is performed is the IP forwarding attribute. If IP forwarding is set to *YES, then this system is configured to forward packets like a router. If the attribute is set to *NO in the TCP/IP attributes or in the PPP profile, the packet is destroyed.
The destination address of the packet is compared to all the *DIRECT routes known to your system. This is done by including the destination address of the packet with the subnet mask specified in the *DIRECT routing entries of the defined interfaces to determine if the packet is destined for a network that is directly attached to this system. Checking is done from the most specific routes to the least specific.
Then, if the iSeries server is not directly connected to the remote host, the routing table is searched. Once again this is done from the most specific host (subnet mask 255.255.255.255) to the least specific different route (subnet mask 0.0.0.0). If a route is found, the packet is forwarded to the next hop gateway.
The last point in the flow chart shows that if no matching routing entry is found, the packet is destroyed.