I have an implementation of TFTP server through Python socket module. The TFTP client sends 5 RRQ requests one after the other. My TFTP server picks up the first three of these RRQ requests and sends the files (.bin), receives acknowledgment, everything works perfectly. But does not detect the fourth and fifth RRQ requests, after the first three transfers are successful.
The following are the sizes of the 5 files in sequence:
(1) file 1 - < 50 KB
(2) file 2 - < 50 KB
(3) file 3 - = 2900 KB
(4) file 4 - < 50 KB
(5) file 5 - = 49000 KB
When I try skipping the third file - the fourth request is received, sends sucessfully but blocks again at the fifth RRQ (begins to send but stops at 10% of sending) The following is the piece of codes that listens for these RRQ requests.
def pollTFTP(self):
netconfig = self.winParent.get_iface_config()
if not netconfig:
raise BSPError('Bad network configuration.Check Network manager...')
host = self.config.get_config('tftpaddress', netconfig and netconfig['server'])
if not host:
raise BSPError('TFTP address no defined')
port = int(self.config.get_config('tftpport', str(TFTP_PORT)))
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.sock.append(sock)
sock.bind((host, port))
while self.winParent.ongoing==True:
r,w,e = select.select(self.sock, [], self.sock, self.timeout)
for sock in r:
data, addr = sock.recvfrom(516)
t = TftpConnection(self,self.winParent)
print "t :" , t
thread.start_new_thread(t.connect, (addr, data))
This Python code runs perfectly under Linux but fails to work under Windows.
self.timeout = 2.0 seconds TFTP port = 69
I can see that the client sends the fourth RRQ request through Wireshark. I am supposed to receive the socket object created in the following line
r,w,e = select.select(self.sock, [], self.sock, self.timeout)
EDIT: I found that certain packets are blocked through Firewall hence this might be a problem. Any idea if firewall has a time limit or size limit of UDP packets and port 69? How to configure this? I am working within Corporate firewall