Tags:
create new tag
, view all tags
The sink, as its name suggests, acts as a repository to sink all packets destined for it. Additionally, it is capable of emulating another channel within the sink – there is no write to or read from any serial port, so all the emulation happens through a software environment. In this case, the sink can be considered as a link layer emulation, where the N2A_queue is equivalent to the N2L_queue, pseudo_sink_queue can mimic an outbound buffer, and the sink emulation simply processes the information in the application layer frame and then deletes the packet.

There are two threads operating at the sink:

  • 1. One thread manages the upwards traffic flow from the N2A_queue, and places the frame and relevant information onto the pseudo_sink_queue.
  • 2. The other thread manages the pseudo_sink_queue and processes the frame at the sink emulation stage.
At the sink emulation, there is a different response for all the current programs based on a packet’s APP field:

  • Packet generator messages (APP_PKGEN) are displayed to stdout.

  • Chat messages (APP_CHAT) are displayed to stdout.

  • For file send (APP_FILE), the first packet (according to the preset file send protocol) contains the file name, whereas all other packets contain the file information except for the final “blank” packet which signifies EOF. Progress of the file send is written to the screen. The file is received to the /received_files/ directory.
On top of this, there is a different set of process for broadcast handling. As a general rule, broadcast chat and packet generator messages are sinked, however broadcast file send packets are rejected due to the nature of file sends.

To exit out from a sink program, a keyboard interrupt must be triggered (by pressing Control + C), which will in turn begin the termination of the rest of WiSeNeT running on that node.

  • Figure 12: Sink program landscape:
    f12.png

-- XiaohongWu - 2012-01-18

Topic revision: r3 - 2012-01-20 - XiaohongWu
 
This site is powered by the TWiki collaboration platformCopyright © 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback