remote surgery allows the surgeon to perform surgery from remote locations without being physically present at the patient side .
the high   demands of this application include efficient surgical device robots and dedicated network links with reliable and high speed communication .
surgeons in the us performed the first ever remote surgery , operating on a patient located in france via a trans - atlantic link .
the surgery involves transferring of efficient medical information consisting of medical data such as real - time video , medical imaging , and operating surgical robots .
when such real - time data with high reliability requirement is transmitted via lossy networks , the quality of temporal information gets degraded and affects the entire application . in this paper
we introduce surgnet , a telesurgery system which enables efficient and reliable transfer of force feedback device information and medical images via lossy networks .
our system creates a closed loop architecture , that is , the update received from the remote patient side is used to perform the next movement of the force feedback device .
the temporal information and irregular updates can cause the surgery device to move in the wrong direction restricting the purpose of the telesurgery .
we propose algorithms that compensate for the network effects and ensure reliable transfer of such real - time data with two different synchronization techniques : intrastream and interstream .
the intrastream synchronization technique modifies the output time or the rendering time at the receiver side to synchronize it with the source , and intermedia synchronization technique ensures that the closed loop structure of the architecture is maintained . in order to improve the intra - media synchronization ,
the authors discuss the impact of delay jitter management and   discuss a moving average adaptive buffer . a dead reckoning technique which is introduced in  
however these works do not propose an integrated approach which improves the synchronization scheme for both packet loss and delay jitter . in this paper , we propose an integrated scheme which synchronizes force feedback data transmission over varying networking conditions dealing with both packet loss and delay jitter .   on the therapist side ,
we run a therapist panel gui which shows various features of the current position of the device to the surgeon . a detailed explanation of the panel is given in the server architecture presented in section 2.1.1 . at the patient side ( described in section 2.1.3 ) we have developed and implemented an enhanced adaptive predictor algorithm which employs an adaptive extrapolation and interpolation technique to predict the lost packets .
our scheme also compensates for the intrastream synchronization by modifying the playout time of the data packet .
the varying network conditions are emulated using nistnet emulator ( see section 2.1.2 ) .  
we discuss surgnet system which includes the functional description of the server ( therapist ) and client ( patient ) architectures as well as the nistnet emulator .
the therapist operates the device from the server side which in turn moves the surgical device on the patient which is represented by an applet at the client side .
the output of the applet can be used to update another device which performs the actual surgery on the patient .
the updated positional information is sent at constant rate to the therapist wherein future movements of the device are controlled .
the therapist can view the current position of the device on the therapist panel . in the next subsection we provide a detailed description of the server and client architectures as well as the network emulator . 

we have a force feedback device ( microsoft sidewinder joystick ) that generates real - time data .
an activex control communicates with the joystick reads the positional information of the device , and records the movement in both x and y axes .
the end device movement controls the maximum and minimum deviation of the device and transfers it to the data processing unit which packetizes the data as udp and sends it to the network emulator .
since udp is an unreliable transport protocol , we run real - time transport protocol ( rtp ) over udp to make the communication reliable .
a detailed description of the data acquisition adapter which is designed in matlab is given in figure 3 . here
the positional and force information is obtained from the device and is transformed to update the applet at the remote location .
the data obtained from the device is transmitted as udp packets with each packet containing the positional information of the device .
we run an rtp over udp to transfer the synchronization information which includes the sequence number of each packet and the timestamp of the occurrence of each positional data .
the therapist panel consists of image analysis techniques which enable the surgeon to perform various manipulations on the current image received from the client ( patient ) side .
such manipulations are required in order to identify the requirements of the next positional movement .
figure 4 shows a snapshot of the therapist panel which displays the current position of the device at the remote side .
when the panel is operated in the monitor mode , the updated data is captured at regular intervals from the remote side and is updated in the panel . when the surgeon decides to inspect and manipulate a particular image , the panel switches to the playback mode , wherein the particular image is loaded for analysis . during this time the current data from the receiver side is received and stored in the buffer .
various image manipulations can be performed during the playback mode such as gray - scale transformation techniques which can control the brightness and contrast of the image .
region of interest ( roi ) is used to select one particular location of the image to consider for further processing .
image rotation is used to rotate the picture either in the clockwise or anticlockwise direction .
the server will update the client ( patient ) side to modify the capture location and concentrate on a particular region for further analysis .
the nistnet network emulator   is a general - purpose tool for emulating performance dynamics in ip networks .
the tool is designed to allow controlled reproducible experiments with network performance sensitive / adaptive applications and control protocols in a simple laboratory setting . by operating at the ip level
, nistnet can emulate the critical end - to - end performance characteristics imposed by various network situations .
packets are modified based on the specification provided in the gui supported by the emulator .   in our experiments we tested surgnet system with different packet loss percentages and delays .
the emulator which implements this functionality consists of an instrumented version of a live network implementation .
nistnet consists of two main parts : a loadable kernel module , which hooks into the normal linux networking and real - time clock code , implements the run - time emulator and exports a set of control apis ; and a set of user interfaces which use the apis to configure and control the operation of the kernel emulator .  
the nistnet kernel module makes use of two hooks into the linux kernel . in order to inspect all incoming packets for potential handling ,
all ip packets received by network devices are then passed directly to the nistnet module .
after packet matching determines ( based on the table of emulator entries ) whether and how packet processing should affect the packet , nistnet then ( possibly after delay ) passes the packet on to the linux ip level code .
the fast timer takes control of the system real - time clock and uses it as a timer source for scheduling delayed packets . in the process
, it reprograms the clock to interrupt at a sufficiently high rate for fine - grained packet delays .
the adaptive buffer at the client ( patient ) side receives the packet and passes it to the control unit which checks the arrival sequence of packets and compensates based on the loss or delay before updating the applet ( see figure 6 ) . at the client side
updated position and force information from the joystick are used to control the movement in the applet .  
the delay variations and packet loss cause each data unit to arrive at the client with different time delays and varying packet loss . due to the network impact
, the data packets received at the client side do not match the data packets sent by the server , causing irregularities in the movement of the applet . to address these issues we propose an integrated synchronization scheme which is described in the next section .
the control unit at the client side checks for the sequence of arriving packets to determine which synchronization algorithm to run . in case
there is no loss but there is delay jitter we invoke the enhanced time adjustment algorithm that maintains 1 millisecond time difference   between consecutive packets .
if the time difference between consecutive packets is more than 1 millisecond , then time contraction is selected and if the difference is less than 1 millisecond , then time expansion is selected .  
when a packet is lost , the control unit runs the adaptive predictor algorithm to predict the missing positional value .
force feedback rendering is tested based on the synchronized movement of the two devices at the server and client sides . in our architecture we have implemented a virtual reality applet which runs on the browser on the client side ( see figure 8) . the applet is similar to the vrcrane_joystick applet which is supported by the matlab virtual reality toolbox .
we have modified the applet to work in our application and enable the control from the remote application .
when the source sidewinder joystick device is moved at the therapist side , we control the applet movement running on the client machine .
the applet which is developed in matlab   contains a load hanging on the crane .
initial movement of the joystick will set the place where the load will move and when the force is applied then the actual movement of the load will take place .
this will result in both the position and force value transferred from the server to the client side . in our application
the joystick at the therapist side generates the data and sends it to the data acquisition adapter .
once the data reaches the client side , the adaptive buffer will store it and process it in the control unit .
the control unit decides whether to run the adaptive predictor algorithm , if there is a packet loss , or passes the packet to the virtual time rendering algorithm which determines when to update the applet based on the timestamp and adjusts the difference in the actual received time of consecutive data .
our compensation techniques involve a combination of an adaptive predictor algorithm and an enhanced time adjustment algorithm .
therefore , retransmission of lost packets is not desirable . in order to compensate for the packet loss
when sufficient future packets are received we use interpolation techniques to predict the missing packet . in case a number of consecutive packets are lost we invoke extrapolation techniques .  
since udp is unreliable , we run rtp over udp to make a reliable connection . since the packets are generated every millisecond , the receiver checks the sequence number of all arriving packets .
once it detects loss , the control unit sends the packet to the predictor unit which predicts the value of the position of the device based on the previously arrived packet . for interpolation ,
as the rate of change in position is lower than the rate at which the packets are generated , we determine the position of the lost packet based on the neighbor packets .  
extrapolation techniquewe denote packet n as pn and assume that if that packet is lost , then the predictor determines the value of the lost packet based on the value of packets pn1 , pn2 . in our experiment ,
the extrapolation prediction model is given by 
									 ( 1)pn=1ni=1n(pn - i)2 , 
								 where n = 2 ( previous two packets are included).the prediction model is a mathematical operation in estimating future values as a linear function . in ( 1 ) the root mean square criterion or the quadratic mean
this measure is specifically used when the variants are both positive and negative . in our experiment
the x - axis position varies in both positive and negative direction and hence this technique predicts efficiently the closest value .
we denote packet n as pn and assume that if that packet is lost , then the predictor determines the value of the lost packet based on the value of packets pn1 , pn2 . in our experiment , our results show better performance when considering the last two packets during extrapolation .
the extrapolation prediction model is given by 
									 ( 1)pn=1ni=1n(pn - i)2 , 
								 where n = 2 ( previous two packets are included ) . the prediction model is a mathematical operation in estimating future values as a linear function . in ( 1 ) the root mean square criterion or the quadratic mean
this measure is specifically used when the variants are both positive and negative . in our experiment
the x - axis position varies in both positive and negative direction and hence this technique predicts efficiently the closest value .
interpolation techniqueif the buffer contains packet pn+1 , we use this information to consider an interpolation technique to predict the lost packet .  
the interpolation prediction model is given by 
									 ( 2)pn=1n[i=1n(pn - i)2+(pn+1)2 ] , 
								 where n = 3 ( previous two packets and one future packet are included).equation ( 2 ) shows the calculation for interpolation where the quadratic mean uses three values .
the optimization of the parameter can be adaptively selected and set to reduce the error .
the data that is received in the buffer arrive at high data rate ( 1 millisecond ) and hence considering the closest arrived packets in such calculations gives better results .
if the buffer contains packet pn+1 , we use this information to consider an interpolation technique to predict the lost packet .  
the interpolation prediction model is given by 
									 ( 2)pn=1n[i=1n(pn - i)2+(pn+1)2 ] , 
								 where n = 3 ( previous two packets and one future packet are included ) .
equation ( 2 ) shows the calculation for interpolation where the quadratic mean uses three values .
the optimization of the parameter can be adaptively selected and set to reduce the error .
the data that is received in the buffer arrive at high data rate ( 1 millisecond ) and hence considering the closest arrived packets in such calculations gives better results .
the time adjustment algorithm modifies the play out time of the packet which modifies the update rate of the applet to ensure that it synchronizes with the source .
the intrapacket arrival time to the client side is variable . as explained above , in order to deliver to the applet the force feedback information as generated by the joystick we need to keep a constant interpacket arrival delay of 1 millisecond .
there are two cases that we have to consider : the time gap is smaller or larger than 1 millisecond . in such cases we need to run time expansion and time contraction , respectively .
the time adjustment algorithm works similar to , but we do not assume any random process to the arrival of the data , as our approach runs the predictor algorithm .
adaptively the algorithm checks the arrival time of the packets and selects either virtual time contraction or virtual time expansion to adjust the intrapacket difference between the packets to be 1 millisecond .
before we describe the time adjustment algorithm , we first define the following terms :   tsn  the timestamp of nth data when generated at the server , 
 trn  the timestamp of nth data when received at the client ,  
 tdn  the timestamp of nth data when updated in the applet , 
 packet processing delay at the receiver side .
the following inter - arrival times between two consecutive packets are defined as follows   source ( at the server )   inter - arrival time 
										 ( 3)tsi = tsn+1-tsn .
received ( at the client ) inter - arrival time 
										 ( 4)tri = trn+1-trn .
time adjustment factor 
										 ( 6)=tdi-1 . the applet update time tai+1 uses the following time adjustment algorithm :  
 ( 7)tai+1  = tdn+1- ;  if  >0 , 
 ( 8)tai+1=tdn+1+ ;  if  <0 . 
 
the buffering scheme receives the packets from the network , and the control unit checks for continuity of packets by analyzing the sequence number with the rtp information .
if the packets arrive in order then the packets are passed to the time adjustment algorithm .
equation ( 4 ) calculates the time difference between the received sequential packets from the network .
each packet in the receiver takes different processing time , and ( 5 ) calculates the time change after processing .
the applet update time is the time when the actual applet movement takes place corresponding to the movement of the force feedback device at the server side .
hence a time adjustment factor is required to readjust the time difference between the packets before updating the applet . by default the time difference between the packets
the processed time depends on the time adjustment factor  that selects to run either the time contraction or time expansion to adaptively run and synchronize the server and client .
if the time difference after processing time between the packets is more than 1 millisecond (  > 0 ) , ( 7 ) time contraction is processed with the first packet time as reference time and adjusting the sequential packet time to 1 millisecond more . if the time difference is less than 1 millisecond (  < 0 ) , ( 8) time expansion is processed with the first packet time as reference and adjusting the sequential packet time .
as depicted in figure 9 the testbed consists of a server ( see section 2.1 ) , nistnet emulator ( see section 2.2 ) and a client ( see section 2.3 ) .  
serverthe microsoft sidewinder force feedback device which is connected to the server has a rendering rate of 1 khz . for convenience ,
the generated data x - axis position also moves in the negative axis due to the fact that the base of the handle in the sidewinder joystick is located in the center .
we programmed the joystick to output negative values when the handle moves to the left and positive values when it moves to the right .
the server runs the matlab processing unit which takes input from the joystick and reads the axis and button values from the data acquisition adapter .
the server runs on a dell inspiron 5150 windows xp machine , with 2.8 ghz and memory of 512 ram .
the microsoft sidewinder force feedback device which is connected to the server has a rendering rate of 1 khz . for convenience ,
the generated data x - axis position also moves in the negative axis due to the fact that the base of the handle in the sidewinder joystick is located in the center .
we programmed the joystick to output negative values when the handle moves to the left and positive values when it moves to the right .  
the server runs the matlab processing unit which takes input from the joystick and reads the axis and button values from the data acquisition adapter .
the server runs on a dell inspiron 5150 windows xp machine , with 2.8 ghz and memory of 512 ram .
nistnet emulatorthe network emulator ( nistnet ) is setup on an ibm centrino , linux machine .
the machine is treated as a router which takes input from the server , processes the packets ( drops and/or delays them ) , and sends them to the client side .
nistnet emulator runs on a fedora core 2.6.11 machine with real time clock setup as separate module from the kernel .  
the network emulator ( nistnet ) is setup on an ibm centrino , linux machine .
the machine is treated as a router which takes input from the server , processes the packets ( drops and/or delays them ) , and sends them to the client side .
nistnet emulator runs on a fedora core 2.6.11 machine with real time clock setup as separate module from the kernel .  
the client side runs on an intel pentium 4 , xp with 2 ghz and 256 of ram memory .
the client side runs on an intel pentium 4 , xp with 2 ghz and 256 of ram memory .
we first verify the proposed synchronization algorithms for the case in which only loss occurs in the network .
positional data variations are within the maximum limit of 100 in the positive axis and 100 in the negative axis .
the deviation between the generated data and the predicted data received at the client side is shown in figure 11(b ) .
figure 12 which depicts the positional data comparison between the server and the client side shows an almost perfect synchronization ( with the maximum percentage deviation of 2.89% . ) . we also calculated the maximum percentage deviation for various percentages of loss
we first verify the proposed synchronization algorithms for the case in which only loss occurs in the network .
positional data variations are within the maximum limit of 100 in the positive axis and 100 in the negative axis .
the deviation between the generated data and the predicted data received at the client side is shown in figure 11(b ) .
figure 12 which depicts the positional data comparison between the server and the client side shows an almost perfect synchronization ( with the maximum percentage deviation of 2.89% . ) .
we also calculated the maximum percentage deviation for various percentages of loss the results are tabulated in table 1 .   
the emulator introduces random variable delay for each packet sent from the server . for each packet sent from the server
figure 13(a ) shows the packets received at the client after the random delay has been introduced , and figure 13(b ) shows the time adjusted position which modifies the time difference between the packets to 1 millisecond .  

for each packet sent from the server , the time difference between the packets should be 1 millisecond .
figure 13(a ) shows the packets received at the client after the random delay has been introduced , and figure 13(b ) shows the time adjusted position which modifies the time difference between the packets to 1 millisecond .  
figure 14(a ) shows both packet loss and delay jitter between packets . in our integrated approach
the control unit predicts the lost packet and passes the packet to the time adjustment unit which modifies the playback time .
figure 14(b ) shows the output of predicted packet with delay and the corresponding integrated synchronization scheme .             
figure 15 gives a comparative analysis between the data generated at the server side and predicted and time adjusted data at the client side .  
the results indicate the efficiency of our integrated algorithms and show their effectiveness in controlling the applet by the force feedback device .
the control unit first runs the packet predictor algorithm and then the time adjustment algorithm before updating the applet .
the total delay for the first 50 packets was 127 milliseconds , but after readjusting the delay , the inter - packet delay between the packets is modified to 1 millisecond and hence the overlap occurs in time . 

figure 14(a ) shows both packet loss and delay jitter between packets . in our integrated approach
the control unit predicts the lost packet and passes the packet to the time adjustment unit which modifies the playback time .
figure 14(b ) shows the output of predicted packet with delay and the corresponding integrated synchronization scheme .             
figure 15 gives a comparative analysis between the data generated at the server side and predicted and time adjusted data at the client side .  
the results indicate the efficiency of our integrated algorithms and show their effectiveness in controlling the applet by the force feedback device .
the control unit first runs the packet predictor algorithm and then the time adjustment algorithm before updating the applet .
the total delay for the first 50 packets was 127 milliseconds , but after readjusting the delay , the inter - packet delay between the packets is modified to 1 millisecond and hence the overlap occurs in time .
surgnet enables the use of a force feedback device in remote surgery in spite of severe network impairments .
the proposed algorithms address both the packet loss and delay jitter issues which are major constraints in time varying networks .
we have also integrated medical image analysis functionality along with the force feedback data by introducing the therapist panel .
our results show that in spite of severe loss and network delay conditions , the proposed algorithms successfully synchronized the applet at the patient side with the device on the therapist side , enabling a smooth manipulation of the surgical instruments . in our future work
 remote surgery information requires quick and reliable transmission between the surgeon and the patient site . however , the networks that interconnect the surgeon and patient sites are usually time varying and lossy which can cause packet loss and delay jitter . in this paper 
 we propose surgnet , a telesurgery system for which we developed the architecture , algorithms and implemented it on a testbed . 
 the algorithms include adaptive packet prediction and buffer time adjustment techniques which reduce the negative effects caused by the lossy and time varying 
 networks . 
 to evaluate the proposed surgnet system , at the therapist site , we implemented a 
 therapist panel which controls the force feedback device movements and provides image analysis 
 functionality . at the patient site we controlled a virtual reality applet built in matlab . 
 the varying 
 network conditions were emulated using nistnet emulator . 
 our results show that even for severe 
 packet loss and variable delay jitter , the proposed integrated synchronization techniques 
 significantly improve surgnet performance . 
1. Introduction
2. Remote Surgery Application
3. Synchronization Techniques 
4. Experiments
5. Conclusion and Future Work