w2lan [options] interface
Part of the parameter check consist on making sure that w2lan is running on a 802.11 wireless Ad-Hoc Ethernet interface. Although the protocol can operate in any Ethernet network, it is only in Ad-Hoc networks where the partial visibility problem shows, hence w2lan proves useful (maybe in futures versions it can be an option for testing/developing purposes, since not every PC has a wireless adapter, and most have Ethernet -or at least a loopback-).
w2lan splits each Ethernet frame into 3 new Ethernet frames: w2lan announce (34 bytes), w2lan request (20 bytes) and w2lan data (the same size than the original Ethernet frame).
A node executing w2lan, reacts when a reception of a w2lan frame occurs:
If a w2lan announce frame is received, the node checks if such conversation has been handled before. In the case it is a new conversation, the node updates its conversations list and it sends the corresponding w2lan request frame.
If a w2lan request frame is received, the node checks if he has announced such conversation. If that is the case, a request counter is updated accordingly.
If a w2lan data frame is received, the node checks if he has requested such conversation. If that is the case, the original Ethernet frame is reconstructed with the recently received w2lan data frame and the previously received w2lan announce frame. Next, the newly reconstructed Ethernet frame is announced, and if the Ethernet frame destination field is either for the node, multicast or broadcast, the frame is injected to the network (to be used by the node protocol stack). After a certain time, specified in "w2lan.h" by TIMEOUT_REQUEST_SECONDS, the node will check the counter associated with the newly announced frame, and if there is any interest (counter different of 0) the corresponding w2lan data frame will be generated.
Also, a node executing w2lan in "always" mode or sometimes in "reactive" mode (see the OPTIONS section), when it sends an Ethernet frame, it also sends a corresponding w2lan announce frame, that consist on a w2lan announce header plus a payload consisting on a new conversation ID plus the header of the previously sent Ethernet frame. In a certain time, specified in "w2lan.h" by TIMEOUT_REQUEST_SECONDS, the node might receive w2lan requests frames from its neighbours. If that is the case, the node proceeds by sending a w2lan data frame, consisting on a w2lan data header, which includes the conversation ID field, plus the payload of the previously sent Ethernet frame.
Universidad Politecnica de Cartagena - http://www.upct.es