The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Special Forums > IP Networking
.
google unix.com



IP Networking Learn TCP/IP, Internet Protocol, Routing, Routers, Network protocols in this UNIX and Linux forum.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
pid from port number in AIX solaix14 UNIX for Dummies Questions & Answers 1 12-30-2008 12:51 PM
port number tukuna82 UNIX for Dummies Questions & Answers 2 09-06-2008 10:27 PM
Need to know port number shaan_dmp UNIX for Dummies Questions & Answers 1 10-26-2007 03:38 PM
FTP Port Number mbb UNIX for Advanced & Expert Users 2 04-22-2004 07:27 AM
get number of a port hoang Security 2 05-08-2002 08:08 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-24-2009
vijaypdp2006 vijaypdp2006 is offline
Registered User
  
 

Join Date: Jul 2009
Posts: 9
Smile Binding the port number.

Hi all,

Application A is using an port number 100 and is binded to an interface 1.

Application B is using an port number 100 and is binded to an interface 2.

can we bind the two applications on same port number based on interfaces.

what i want to know is two applications using two interfaces can use the same port number.


Thanks in advance........
  #2 (permalink)  
Old 07-24-2009
gratuitous_arp gratuitous_arp is offline
Registered User
  
 

Join Date: Jul 2009
Posts: 7
Tried starting httpd on a port already in use for a tcp session and it seems to work.

Code:
user@computer:/home/user# netstat -an | head -n4
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 192.168.22.1:48135      0.0.0.0:*               LISTEN
tcp        0      0 192.168.30.2:48135       74.125.47.156:80        ESTABLISHED
  #3 (permalink)  
Old 07-24-2009
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,209
Yes, you can do that.

The ports do not have to be unique for the server, only for the address. It does not even matter if the address is on a real or logical interface.
  #4 (permalink)  
Old 07-28-2009
vijaypdp2006 vijaypdp2006 is offline
Registered User
  
 

Join Date: Jul 2009
Posts: 9
Hi,

We can use the same port number for two applications based on protocols.(i.e one application is based on TCP and the other application based on UDP).

But i don't know about interfaces, can anyone one help........

1) Can we use same port number for different applications on a single interface.

2) Can we use same port number for different applications on different interfaces(interfaces have separate ip address).


Consider that same port number can be used on different applications, then won,t it be a problem in receiving the packets.

Applications using UDP protocol.
--------------------------------

1) Application 1 is binded to the port number 1500 and ip address of an interface.(Transfer the packet through the selected interface).

2) Application 2 is binded to the port number 1500 and ip address is 0.0.0.0

Now, inorder to transfer the packet of Application 2 an interface has to be selected based on destination's ip address.
If application 2 want's to transfer packets with different destination ip adresses, then different interfaces will be selected for different interfaces.(so application 2 may transfer packet through any one of the available interface and where as application 1 will transfer through the specific interface).

--->After receiving the packet, how should i select the socket of application 1 and application 2.

Problem is both sockets are binded to same port number and interface on which application 2 is transferring the packets are not fixed.

Last edited by vijaypdp2006; 07-28-2009 at 10:58 AM..
Reply

Bookmarks

Tags
port number.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:50 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0