## 4 IETF 6 LoWPAN Working Group (IPv6)
### Key Protocols
#### 4.1.4 Mesh-Under Routing Support  
Routing involves calculating best paths (according to some metric) to a destination in a multi-hop network. If a single link layer technology (such as IEEE 802.15.4) is used at layer 2, the path  
Figure 7: 6 LoWPAN Fragmentation Header. **(a)** 6 LowPAN encapsulation header stack for the first fragment, containing the Fragmentation header (FRAG1) and IPv6 Header Compression header **(b)** 6 LowPAN encapsulation header stack for subsequent fragments, containing the Fragmentation header (FRAGN). calculation could be done at either layer 3 or layer 2. Layer 3 routing is usually referred to as route-over routing while forwarding at layer 2 is called mesh-under routing. Layer 3 routers build and maintain a routing-table which contains the next-hop to all known destination networks based on their network prefixes. This means that when a packet arrives at a router, the link-layer encapsulation is removed and the destination address in the IPv6 header is used to do a longest prefix match in the routing table to determine the next hop. Once the next hop router is known, the router re-encapsulates the packet with layer 2 headers and trailers. The layer 2 addresses indicate the current router as a source and the next hop router as the destination while the source and destination IP addresses remain unchanged. This is done at every forwarding router along the path of the packet. Mesh-under routing on the other hand, uses link layer addresses to make forwarding decisions. Every forwarding layer 2 router along the path of a packet is expected to maintain its own forwarding-table based on link layer addresses in order to make forwarding decisions based on these addresses. Just as in route-over routing, four addresses are required to forward the packet at an intermediate node--the originator address, the final destination address, the current forwarding router address and the next hop router address. The IEEE 802.15.4 source and destination MAC addresses of the frame indicates the current forwarding router and the next-hop router, respectively. A way of transmitting the originator and final destination addresses is required to fully support mesh-under routing. RFC 4944 introduces the Mesh Address Header (Figure 8) for this purpose. The mesh address header contains the dispatch byte and the originator and final destination link layer addresses. The OA and FD bits in the header indicate which of the two 802.15.4 addressing formats are used for the Originator and Final Destination address fields: short 16-bit or long 64-bit addresses. The hop count takes up an additional 4 bits, supporting up to 14 hops. The value 0 xF is reserved to indicate that one more byte follows to support more than 14 hops. As an example of mesh-under routing, assume that node A sends a packet to node B which is located some hops away from node A in an IEEE 802.15.4 network. First, node A, construct a mesh addressing header with its own link-layer address as Originator address and the link-layer address of node B as Final Destination address. Based on its layer 2 \"routing-table\", node A identifies its next hop  
Figure 8: 6 LoWPAN Mesh Addressing Header. router (node C). Accordingly, it puts node C's link layer address as the destination address and its own link-layer address as the source address in the 802.15.4 Mac Header. The resulting frame contains the following addresses in the 6 LoWPAN mesh addressing header: Originator address (node A), final destination address (node B) and in the IEEE 802.15.4 MHR: Source address (node A) and destination address (node C). Once the router, node C, receives the frame, it checks the Mesh Addressing Header to check whether it is the final destination. Since node B is the final destination, node C will also forward the packet to its next hop. After determining the next hop, node C re-encapsulates the frame with its own link layer address as the source and the next hop's link layer address as the destination address in the MHR. This process continues until the packet reaches node B.