## 3 Architecture and Design Methodology of the LHM-N Model
### Design Methodology of the LHM-N Model
#### 3.2.2 Design Methodology  
There are two phases in the design methodology. The packet size forwarding engine and the model. Phase 1: Packet-Size Forwarding Engine Algorithm: The function of the packet-size forwarding engine (PSFE) algorithm is to forward packets from the multihomed input interface to the appropriate output chipset interfaces. This will enable each chipset interface to transfer the packet to its final destination. The PSFE algorithm will forward data packets to appropriate interfaces based on their respective payload size threshold. Specifically, data packets forwarded or destined to the 5G RedCap IoT device interface will work according to the optimized model transmission mechanism. However, data packets forwarded to other interfaces will be transmitted normally. The data packet format has three major field parameters, which are represented as header, trailer, and payload. The header contains source and destination information, including fragments and the current sectional numbers. The trailer field includes a frame checksum sequence for error control with cyclic redundancy check (CRC) or parity bits. The payload is the actual data information being transmitted. Each field holds a size or length of data bits; the header and trailer have a smaller length, while the payload has a longer length containing the actual data bits information. Figure 3 shows the packet length information. Actually, packet forwarding uses information in the header field to forward the payload data to the appropriate chipset interfaces. **Formulation of Optimization Problem for the PSFE**: The forwarding of packets is carried in the forwarding plane of the multihomed gateway/ED. The length of a packet is denoted as \(L\) and a chunk or block of packets is denoted as \(B\). A block of packet length is represented as \(BL\). A block of originating packet length from the input of the gateway to be forwarded to the output chipset interface is denoted by \(BL_{O}\). This packet length is based on the payload size. For a packet to be forwarded, a number of optimization problem conditions must be met:  
1. The payload must attain a general minimum threshold size denoted as \(BL_{GMin}\) or a block of general minimum threshold packet length. 2. The specific port address must be known, which is denoted as \(Port_{Addr}\). 3. The block of the originating packet length \(BL_{O}\) must move to the block of the packet forwarding state, denoted as \(BL_{F}\). Hence, the probability of packet forwarding \(Pr_{PF}\) is the probability of \(BL_{GMin}\) or \(BL_{F}\) and \(Port_{Addr}\), which is expressed as \(Pr_{PF}\). \[Pr_{PF}=Pr[((BL_{GMin})+(BL_{F}))*(Port_{Addr})] \tag{1}\]  
Then, the probability of no packet forwarding is  
\[Pr_{NPF}=1-Pr_{PF} \tag{2}\]  
Algorithm 1 illustrates the PSFE for forwarding a block of data packets to the respective chipset interfaces. Figure 3: Packet Length information. ```
1. Initializes\(\rightarrow\)\(BL_{O}\); \(BL_{G\mathit{Min}}\)\(BL_{F}\) ; % Block of originating, general minimum threshold, and forwarding packet length, respectively;
2. For \(BL_{G\mathit{Min}}\)\(\leftarrow\)\(BL_{F}\);
3. Move packet block to forwarding state;
4. if \(BL_{O}\)\(\rightarrow\)\(\mathit{=BL_{G\mathit{Min}}}\);
5. Determine interface port address;
6. if \(BL_{O}\)\(\leftarrow\)\(BL_{(\mathit{min-RC})}\);
7. re-route or find appropriate interface;
8. else if \(Port_{Addr}\)\(=\)\(Port_{RC}\)\(\&\&\)\(BL_{O}\)\(>=\)\(BL_{(\mathit{min-RC})}\)\(\&\&\)\(BL_{O}\)\(<=\)\(BL_{(\mathit{max-RC})}\) ;
9. Forward \(BL_{O}\) to RedCap;
10. else if \(Port_{Addr}\)\(=\)\(Port_{NB}\)\(\&\)\(\&\)\(BL_{O}\)\(>=\)\(BL_{(\mathit{min-NB})}\)\(\&\&\)\(BL_{O}\)\(<=\)\(BL_{(\mathit{max-NB})}\);
11. Forward \(BL_{O}\) to NB2-IoT;
12. else if \(Port_{Addr}\)\(=\)\(Port_{LR}\)\(\&\)\(BL_{O}\)\(>=\)\(BL_{(\mathit{min-LR})}\)\(\&\&\)\(BL_{O}\)\(<=\)\(BL_{(\mathit{max-LR})}\)
13.