PDA

View Full Version : [ubuntu] Are ports shared between UDP & TCP?



bluedalmatian
February 5th, 2009, 10:29 PM
This may sound a silly question and I apologise but if something is using TCP port 1000 say, would that prevent another program using UDP port 1000?

In other words, does IP & port & transport protocol determine the endpoint or just IP& port

Thanks

redmk2
February 5th, 2009, 11:13 PM
Interesting question. What do you mean by endpoint?

See:
OSI Networking model (http://www.laynetworks.com/osi.htm)

and
TCP/UDP Ports (http://www.bleepingcomputer.com/tutorials/tutorial38.html)

Edit: TCP ports are different than UDP ports. They are values in the header of the data packet

fwre01
February 5th, 2009, 11:37 PM
hi bluedalmatian, those two links above are good reads, and well worth a look for a more comprehensive understanding of TCP/IP. In short the answer is NO, running a 'socket' (as it's refered to) on tcp port 1000 will have NO affect if you are also running a socket on UDP 1000.

albinootje
February 5th, 2009, 11:38 PM
This may sound a silly question and I apologise but if something is using TCP port 1000 say, would that prevent another program using UDP port 1000?

If you look at /etc/services you can see that some protocols only use tcp, or only udp.
When a program only uses tcp, then it should be possible to run another program on the same port using udp afaik.

redmk2
February 5th, 2009, 11:50 PM
...then it should be possible to run another program on the same port using udp afaik.

albinootje.

They are NOT the same port. As I said they are not a physical thing. They are values in a packet header. The values are NOT the same, hence not the same port (socket). As an aside TCP/UDP sockets are not the same as UNIX sockets either.