1834903 Members
2661 Online
110071 Solutions
New Discussion

Port Question?

 
SOLVED
Go to solution
brian_31
Super Advisor

Port Question?

Hi Admins:

To give a little background...

We have 2 xmotif applications and a process(VM)(which
communicates between these 2 apps) running on nclass
using UDP through a dedicated port. Since only one VM
process is running currently, this port no.(9947) is
maintained in the VMconfig file. Apps read this value
and communicate to each other at this port. Now there
is a proposal to start mutiple VM processes for faster
communication between apps.
Since each instance of VM requires a dedicated port
for its use and the no. of VMs to be started is not
fixed, the total no. of VMs to be started will be
mentioned in the VMconfig file apart from the 1st port
VM can use.There is a shell script which would take
care of bringing up the required no. of VMs on
consecutive ports.
Question:
1. Is it better if i use /etc/services for defining
the port no?
2. how do i handle consecutive ports?
3. what is the advantage of using services file as to
config file?
4. can i use /etc/ports?
Please advise.
TIA and cheers.
Brian.
5 REPLIES 5
harry d brown jr
Honored Contributor

Re: Port Question?

Can you further explain what "VM" is, and how it is used between the xmotif applications, and where the applications are running?

The use of /etc/services isn't needed unless you want inetd to handle the execution of the VM process. And in this case, how would the xmotif applications know to use the ports defined in /etc/services?

I'd go to the writers of the software and ask them how this can be accomplished.

live free or die
harry
Live Free or Die
brian_31
Super Advisor

Re: Port Question?

Hi harry:
Thanks.
All i know is the VM is a process which communicates between the two xmotif apps by creating sockets thru the port 9947.To attach to a desired VM instance each xmotif app will pass the port no. on which the VM is running as an argument.A tool will be provided which returns the port number. Can you tell me the answer for questions 2,3 &4.

Thanks
Brian.
Craig Rants
Honored Contributor

Re: Port Question?

brian,
There is no "advantage" to using /etc/services. However, when using certain commands, such as netstat -a the service will not show up as named port i.e.

192.168.1.2.22 as opposed to
192.168.1.2.sshd

I like having things in /etc/services not matter what because that way other SA's will know what a specific port is used for if they get curious.

That's just me however.

GL,
C
"In theory, there is no difference between theory and practice. But, in practice, there is. " Jan L.A. van de Snepscheut
harry d brown jr
Honored Contributor

Re: Port Question?

Brian,

2. how do i handle consecutive ports?

Multiple lines in /etc/services

3. what is the advantage of using services file as to
config file?

No advantage, other than inetd controls (usually) the process, so when a message comes in on a port, and the application is not running, it will start it up.

4. can i use /etc/ports?

What is /etc/ports???

live free or die
harry
Live Free or Die
Ceesjan van Hattum
Esteemed Contributor
Solution

Re: Port Question?

Hi,

The file /etc/ports is not commenly used on HPUX. Although it is used in many Linux versions (Debian,FreeBSD,SuSE) and also AIX.
See
http://www-2.cs.cmu.edu/afs/andrew.cmu.edu/usr/shadow/www/ibmrt/faqs/aix3.txt

But here we are talking about linespeeds and parities.. i.e. modemports.. here we are talking about different OSI layers:
/etc/services: Session layer
/etc/ports: Data link layer

So do not experiment with /etc/ports for communication between applications.