• No results found

Routing protocol and load balancing implementation

Chapter 5. Implementation in QualNet

5.3. Routing protocol and load balancing implementation

The Mesh control layer uses a list structure (shown in Figure 23) to keep track of information concerning the routing and the load balancing. The list is composed of three elements, all allocated using dynamic memory; the first element contains the size of the table and the pointers to the first and last element of the list; the second element represents the atom of the list, and the third is the data structure to save the routing information. In each atom there are three pointers, two are used to point to the next and previous atom, while the third pointer is a generic pointer used to point on the real data. This hierarchical organization allows us to have an independent list structure, which is saved in the mesh control layer, and a specialized data element stored in atoms using generic pointers. The data element can be tailored to store different routing information which is generated by any routing protocol that might be used in the mesh network such as HWMP, Ra-OLSR, and the mesh protocol.

The right side of Figure 23 shows the data element structure for the mesh protocol. In this element it is possible to recognize the field where to save the destination MAC address called “destMAC”, which is used to uniquely identify each element in the list.

There are also variables to indentify rather the MAC address belongs to a Wi-Fi user which is connected to this node. Due to the fact that only MAP is able to collect traffic from Wi-Fi this variable are used from the MAP nodes only. From the figure it is possible to recognize two pointers, used to anchor two lists, in the data element structure.

One list is used to save the LLs associated with the same MAC destination address (the search key), and the second one is used to identify the users’ traffic toward the destination node. In Figure 23, in pink colour are represented the variable used for the Load Balancing (LB) procedure.

Figure 23: List structure to save the switch table structure.

As shown in Paragraph 5.1, when a node receives a data frame and all the preliminary controls are executed (and if required the header conversion was performed), the function “mesh control layer routing incoming frame”, which is plotted with a green box in Figure 22 and Figure 23, is invoked.

The below Figure 24 plots the function “control layer routing incoming frame”; as previously introduced, this function is called to forward a data frame to the next hop and performing the load balancing.

  Figure 24: Mesh control layer routing frame, flow chart.

The function “control layer routing incoming frame” checks if the two extra addresses are used in the data frame header. In the affirmative case the sixth address, which corresponds to the STA address, is saved in a local variable called “source”; otherwise

the fourth address is saved. The address saved in the “source” variable with the third address in the data frame header is used to find which LL should be used to forward this frame. The third address in the data frame header contains an MPP, which is the final destination inside the mesh network. This function returns null if no LL are assigned for that pair of addresses; in fact the goal for this function is to forward all the frames, belonging at the same source, with the same LL. This condition avoids the “out of order” problem at transport layer (if the TCP is adopted).

When the frame has been sent by a STA, the function “mesh routing get next hop”

returns null and the frame is received by the MAP’s access point interface. For this packet, no MPP has been assigned yet, so the mesh portal list is queried and the best MPP that provides the actual best balancing in the network is selected. Instead, when a frame is received by a MP node, “mesh routing get next hop” function returns the best LL to the assigned MPP. It is selected according to the local network information such as SNIR and to the number of users using the LL in the node.

Upon the selection of the LL, a sequence number for this frame is saved in the switching table element associated with the pair of source address and MPP destination. The sequence number is used to solve the loop problem that often occurs with the load balancing technique.

On the other flow chart branch, when “mesh routing get next hop” function is able to find the appropriate LL, the sequence number in the mesh data frame header is checked with the local value. If the sequence number is less or equal to the value in the switching table element, the frame is dropped and a special management frame is sent to the frame’s sender to inform it about the presence of a loop (as explained in the previous chapter). If the index is correct, the frame is propagated and the sequence number, in the switch table element, is updated.