## 5 Proposed Source Authentication Schemes
### MAC Based Source Authentication (MBSA)  
MBSA makes use of peer-to-peer MACs to support any variable-size packets. However, MACs do not provide authenticity of the BS, which means that MACs authenticate the corresponding node only rather than the BS. To provide an authenticity of the BS, we employ a hash chain per page. Note that the previous SPA scheme uses a hash chain per packet.  
In this scheme, a new code image is split into pages only unlike Deluge, after which all pages are indexed sequentially. Similar to the SPA scheme, a hash value on the next page is calculated and appended to the end of the page for the entire image, which together form a _basic page_ as follows:  
\[BPage_{i}\ =\ \left\{\begin{array}{ll}Page_{i}\ ||\ h_{i+1},&\ h_{i+1}\ =\ H(BPage_{i+1}),\ i\in[1,x-1]\\ Page_{i},&\ i=x\end{array}\right. \tag{4}\]  
where \(Page_{i}\) is a \(i\)-th page and \(h_{i}\) is a hash value on the basic page containing \(Page_{i}\). \(x\) is the number of pages in the code image. Finally, the hash of the first page is signed by the BS with the BS's private key. This is illustrated in Figure 6a.  
When sending a new code image, the BS first sends a hash value on the first basic page (\(h_{1}\)) with a digital signature (\(sig(h_{1})\)) to a neighbor node. The receiver verifies the digital signature of the hash using a BS's public key and keeps the hash value which is used to authenticate the subsequent basic page. The BS then decides the packet size depending on the link quality and attaches a MAC to the end of the packet using a symmetric key between the BS and the receiver. It is important to note that each node is assumed to have a symmetric key with neighbor nodes using any kind of key distribution schemes.  
The resulting packet format for transmission in the MBSA scheme is expressed as follows:  
\[BS\rightarrow*:\ [header||payload_{i}||MAC(payload_{i})] \tag{5}\]  
where \(payload_{i}\) is the part of the basic page which can have any size. Figure (b)b illustrates how to send packets using MACs in the sender. Upon receiving a packet, the receiver node first verifies the attached MAC. If it is not valid, the packet is not from the sender, thus discarded. If the packet is successfully verified as valid, it is parsed and kept in the internal buffer for making up a page. Once all packets in one page are received, the hash of the total page is calculated and compared to the hash value included in the previous page. The entire page is considered authentic if:  
\[h_{i}\ ==\ H(BPage_{i}),\ \ \ \ \ \ \ \ \ \ i\in[1,x] \tag{6}\]  
where \(h_{i}\) is the previously received hash value for the \(i\)-th basic page and \(BPage_{i}\) is the currently received \(i\)-th basic page. Figure (c)c,d shows the procedure of packet-level verification using MACs and page-level verification using the hash chain, respectively.  
Figure 6: An example of MBSA.  
The MBSA scheme supports source authentication for fully variable packet size by combining both hop-by-hop authentication via MACs and source authentication via a page-level hash chain. Since this scheme needs only one MAC for variable-size packet, this scheme has less communication overhead than the SPA scheme. Moreover, it is more efficient in terms of energy consumption because it supports fully variable packet size so that it can be optimized for the link quality. The disadvantage of this scheme is that it can be vulnerable to node capture attacks. In this case, attackers can forge malicious packets with the valid MAC. However, it can be easily detected by the page-level hash chain.