Question: In the Cent OS 7, I use the `netstat -an` to check the network service:

```
[root@localhost etc]# netstat -an | grep ESTABLISHED
udp        0      0 192.168.1.25:41136      61.216.153.106:123      ESTABLISHED
udp        0      0 192.168.1.25:59141      202.112.29.82:123       ESTABLISHED
udp        0      0 192.168.1.25:53680      115.28.122.198:123      ESTABLISHED
udp        0      0 192.168.1.25:34255      42.51.22.35:123         ESTABLISHED

```

You can see up there the ephemeral `41136` port. If a service uses port `3306` we can know it is MySQL, if port is `8080` we can know it is Tomcat, but how about the ephemeral ports? how can we know which service is associated with these ports?

Answer: 
As for ephemeral ports:

> 
> The Internet Assigned Numbers Authority (IANA) suggests the range
>  49152 to 65535 (215+214 to 216−1) for dynamic or private ports. Many
>  Linux kernels use the port range 32768 to 61000
> 
> 
> 

Looking at the destination on the TCP/IP tuple as in the example you ask:

```
udp        0      0 192.168.1.25:41136      61.216.153.106:123

```

You can see it is the current machine using an NTP service UDP/123 on a remote server.

Or else, it is your machine doing an NTP request to an NTP server in China.

Actually, all those 4 lines are connections to NTP servers in China.

Usually, with the majority of protocols, when the known port service is on your side (first), you usually are the server receiving the connection, and the ephemeral port is on the right side; when it is the contrary, often it is your server that is using a remote service.

(Is your server in China? If not I would worry about possible malware)

You can also take the out `-n`, for resolving IP addresses/DNS and service names, however be aware that it introduces a noticeable lag in a machine/server with many connections (and/or with a slow DNS service). To have a feel of the difference try, I adapted your original `netstat` output for a possible output without `-n`:

```
$netstat -a | grep ESTABLISHED
udp        0      0 mylinux:41136      vns1.hinet.net:ntp        ESTABLISHED
udp        0      0 mylinux:59141      DNS1.SYNET.EDU.CN:ntp     ESTABLISHED
udp        0      0 mylinux:53680      rdns1.alidns.com:ntp      ESTABLISHED
udp        0      0 mylinux:34255      ns1.htudns.com:ntp        ESTABLISHED

```
As you can see in the `netstat` (**net**work **stat**istics) output, 

```
Proto Recv-Q Send-Q Local Address           Foreign Address         State   
udp        0      0 192.168.1.25:41136      61.216.153.106:123      ESTABLISHED

```

`192.168.1.25` is your local/source IP Address in LAN.

`41136` is the source port number.

`61.216.153.106` is destination IP Address.

`123` is the destination port number which represents Network Time Protocol (NTP)

The source port number (`41136`) serves analogues to the destination port (`123` or `NTP`), but is used by the sending host (`192.168.1.25`) to help keep track of new incoming connections and existing data streams.

Generally, clients/source address (`192.168.1.25`) set the source port number to a unique number that they choose themselves - usually based on the program that started the connection.

In this case, the source port number chosen by your computer is `41136`.

This number is random and normally bigger than 1024.

Look at another example. In this case, all destination ports is UDP 123 which is NTP while the source port number is different and random.

```
Proto Recv-Q Send-Q Local Address           Foreign Address         State   
udp        0      0 192.168.1.25:59141      202.112.29.82:123       ESTABLISHED
udp        0      0 192.168.1.25:53680      115.28.122.198:123      ESTABLISHED
udp        0      0 192.168.1.25:34255      42.51.22.35:123         ESTABLISHED

```