#!/bin/sh echo "1" >/proc/sys/net/ipv4/ip_forward #add ethernet device and routing for VIP 128.198.63.10 /sbin/ifconfig eth0:1 128.198.63.10 broadcast 128.198.63.255 netmask 255.255.255.0 #setup_ipvsadm_table #clear ipvsadm table /sbin/ipvsadm -C #installing LVS services with ipvsadm #add http to VIP with round robin scheduling /sbin/ipvsadm -A -t 128.198.63.10:http -s rr /sbin/ipvsadm -A -t 128.198.63.10:ssh -s rr #forward http to realserver using NAT /sbin/ipvsadm -a -t 128.198.63.10:http -r 10.1.1.101 -m /sbin/ipvsadm -a -t 128.198.63.10:http -r 10.1.1.102 -m #forward ssh to realserver using NAT /sbin/ipvsadm -a -t 128.198.63.10:ssh -r 10.1.1.101 -m /sbin/ipvsadm -a -t 128.198.63.10:ssh -r 10.1.1.102 -m #displaying ipvsadm settings /sbin/ipvsadmNote that there is feature called local node which allows the LVS load balancer
Using lower frequencies would help in extending the communications range due to low path loss attenuation. With low propagation path loss, the antenna gain would not become an important factor in the system link budget. However, low frequencies require larger sized antennas. If the density of deployment allows for few meters spacing between the nodes, the choice of lower frequencies would be a good choice. Very low operating frequencies (70 MHz or even lower) may provide better solutions for some wireless sensor applications. Table 2 shows the frequencies and communications ranges of some commercial WSNs.
From Table 2, for data rate of 38.4 kbaud and operating at 433 MHz, the current drawn is 25 mA. Achieving the same data rate but at 868/916 MHz requires 27 mA current. In addition, the communication range of the 433-MHz systems is twice the range of the 868/916-MHz systems. Therefore, choosing low frequencies would contribute to power savings and extending the system reach.
http://www.mwrf.com/Files/30/11071/Table_02.html
configuration Sense { // this module does not provide any interface } implementation { components Main, SenseM, LedsC, TimerC, Temp, Sounder; Main.StdControl -> SenseM; Main.StdControl -> TimerC; Main.StdControl -> Sounder; SenseM.ADC -> Temp; SenseM.ADCControl -> Temp; SenseM.SounderControl -> Sounder; SenseM.Leds -> LedsC; SenseM.Timer -> TimerC.Timer[unique("Timer")]; }Here is the content of SenseM.nc for SenseSounder application.
Main.StdControl -> SenseM;
Main.StdControl -> TimerC;
Main.StdControl -> Sounder;
SenseM.ADC -> Temp;
SenseM.ADCControl -> Temp;
SenseM.SounderControl -> Sounder;
SenseM.Leds -> LedsC;
SenseM.Timer -> TimerC.Timer[unique("Timer")];
}
The SenseM.nc for SenseSounder is as follows:
module SenseM { provides { interface StdControl; } uses { interface Timer; interface ADC; interface StdControl as ADCControl; interface StdControl as SounderControl; interface Leds; } } implementation { // declare module static variables here /** * Module scoped method. Displays the lowest 3 bits to the LEDs, * with RED being the most significant and YELLOW being the least significant. * * @return returnsSUCCESS
**/ // display is module static function result_t display(uint16_t value) { /* code to be filled in here */ return SUCCESS; } /** * Initialize the component. Initialize ADCControl, Leds * * @return returnsSUCCESS
orFAILED
**/ // implement StdControl interface command result_t StdControl.init() { if (! call SounderControl.init()) return FAIL; return rcombine(call ADCControl.init(), call Leds.init()); } /** * Start the component. Start the clock. * * @return returnsSUCCESS
orFAILED
**/ command result_t StdControl.start() { return call Timer.start(TIMER_REPEAT, ); /* fill in the number here*/ } /** * Stop the component. Stop the clock. * * @return returnsSUCCESS
orFAILED
**/ command result_t StdControl.stop() { return call Timer.stop(); } /** * Read sensor data in response to theTimer.fired
event. * * @return The result of calling ADC.getData(). **/ event result_t Timer.fired() { return call ADC.getData(); } /** * Display the upper 3 bits of sensor reading to LEDs * in response to theADC.dataReady
event. * @return Always returnsSUCCESS
**/ // ADC data ready event handler async event result_t ADC.dataReady(uint16_t data) { display(data); return SUCCESS; } }