Figure 6-4 on this page illustrates the actions taken by the layers in a switch when performing packet forwarding from one link to another within the same subnet. The packet's DLID field is used to perform a lookup in the switch's Forwarding Table. The lookup produces the switch output port through which the packet is to be relayed.
Figure 6-5 on this page illustrates the actions taken by the layers in a router when performing packet forwarding from one subnet to another.
Figure 6-6 on page 115 defines the actions taken by the layers within a CA upon receipt of a packet. If the Transport Layer determines that it must return a response packet back to the requester, it formulates the response and passes it back to the port's lower layers for packet formatting and transmission.