LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-17-2014, 04:26 AM   #1
m4rtin
Member
 
Registered: Sep 2007
Posts: 261

Rep: Reputation: 16
Question TFTP server not listening on port defined


I started a tftp server with "atftpd -v --port 69 --bind-address 10.10.10.2 --daemon /srv/tftp/" command, but for some reason I do not see TFTP server listening on port 69 in ss/netstat output. However, if I connect to a TFTP server with TFTP client, I'm able to transfer files and automatically another instance of TFTP server starts(PID 5191):

Code:
# ss -l -4 -u
Recv-Q Send-Q                                 Local Address:Port                                     Peer Address:Port   
# ss -l -6 -u
Recv-Q Send-Q                                 Local Address:Port                                     Peer Address:Port   
# pgrep -lf tftp
4316 /usr/sbin/atftpd -v --port 69 --bind-address 10.10.10.2 --daemon /srv/tftp/
5191 in.tftpd --tftpd-timeout 300 --retry-timeout 5 --mcast-port 1758 --mcast-addr 239.239.239.0-255 --mcast-ttl 1 --maxthread 100 --verbose=5 /srv/tftp
#
in.tftpd is a symbolic link to /usr/sbin/atftpd. How are clients able to connect to TFTP server if the TFTP server is not listening on UDP port 69? Are there other servers which work in a same manner?
 
Old 06-17-2014, 07:50 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
udp is "stateless" so would does not have a "LISTEN" state.

To see your udp ports run "ss -a -u".

For network troubleshooting I prefer to use lsof which is available on many platforms including Linux:
lsof -i |grep -i udp

You can get a lot more detail about networking from it and also about many other open files (lsof = list open files).
 
Old 07-03-2014, 04:08 AM   #3
m4rtin
Member
 
Registered: Sep 2007
Posts: 261

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by MensaWater View Post
udp is "stateless" so would does not have a "LISTEN" state.

To see your udp ports run "ss -a -u".

For network troubleshooting I prefer to use lsof which is available on many platforms including Linux:
lsof -i |grep -i udp

You can get a lot more detail about networking from it and also about many other open files (lsof = list open files).
I see. So none of the servers using UDP protocol like TFTP, DHCP, NTP and others can not be seen with "ss -l -u" because they are stateless? In addition, looks like if atftpd is started without "--daemon" then it uses inetd process for listening incoming UDP requests and then inetd will launch the atftpd process. In my example the "5191 in.tftpd --tftpd-timeout 300 --retry-timeout 5 --mcast-port 1758 --mcast-addr 239.239.239.0-255 --mcast-ttl 1 --maxthread 100 --verbose=5 /srv/tftp" shown in my previous post. Is this a common practice to use inetd for listening (multiple) servers? From troubleshooting point of view it's bit more clear if inetd is not used as one can have a clear overview which processes with corresponding arguments are running.

Last edited by m4rtin; 07-03-2014 at 04:13 AM.
 
Old 07-03-2014, 09:59 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
inetd/xinetd was introduced long ago because some services do NOT need to be running all the time. They only need to be run on request. For such services inetd/xinetd simply "LISTEN" for anything requesting that port then they launch the program that actually relies on that port.

Some services are in use all the time or so frequently or take long enough to launch that it makes sense to run them as standalone utilities rather than via inetd/xinetd. (e.g. sshd usually runs as a standalone daemon.)

You can enable standalone daemons for most things as a choice (of course you'd disable them in inetd/xinetd if already enabled there). However, if you were only making 1 tftp connection to this server every day that lasted for an hour it means you're wasting resources for the other 23 hours of the day. All by themselves individual services may not take up that much but since inetd/xinetd can be and is used to configure many different services the cumulative resource saving of not running them all 24 hours a day is well worth using inetd/xinetd.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SFTP server port blocked on Uni network, need to change the listening port. sammyboy161 Linux - Newbie 2 10-21-2010 12:03 PM
sshd server not listening to port 22 apulu Linux - Newbie 17 02-25-2008 05:16 AM
Find the port on which Apache server is listening sharathkv Programming 5 04-14-2007 02:11 PM
X server crashing - port listening time112852 Linux - Software 9 10-06-2003 12:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration