Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I suddenly came across the term "ephemeral port" in a Linux article that I was reading, but the author did not mention what it is.

What is an ephemeral port in UNIX?

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

In essence an ephemeral port is a random high port used to communicate with a known server port. For example, if I ssh from my machine to a server the connection would look like:

192.168.1.102:37852 ---> 192.168.1.105:22

22 is the standard SSH port I'm connecting to on the remote machine; 37852 is the ephemeral port used on my local machine

share|improve this answer
    
So in this case , 37852 is the ephemeral port ? –  The Dark Knight Feb 20 '13 at 14:18
    
you are correct –  h3rrmiller Feb 20 '13 at 14:19
add comment

Quoting from Wikipedia:

An ephemeral port is a short-lived transport protocol port for Internet Protocol (IP) communications allocated automatically from a predefined range by the TCP/IP software. It is used by the Transmission Control Protocol (TCP), User Datagram Protocol (UDP), or the Stream Control Transmission Protocol (SCTP) as the port assignment for the client end of a client–server communication to a well known port on a server.

The best example I know is FTP. And it's not a Unix-bound concept.

share|improve this answer
    
"FTP" isn't exactly an example of an ephemeral port –  Michael Mrozek Feb 20 '13 at 15:13
    
Not what I meant, I meant it's a protocol that uses the concept. –  schaiba Feb 20 '13 at 16:09
    
by default *nix systems all use the ephemeral concept. come to think of it windows does too. except each flavor of *nix has a slightly varying range. different windows versions use different ranges too. –  h3rrmiller Feb 20 '13 at 17:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.