One application / process using more than 6200 UDP ports

Im having an CCTV recorder application running on a Windows 2008 R2 server with aprox 40 videocamera's recording to it. Each camera seems to be establishing one TCP connection on misc port above 49000, one TCP connection on 554 (RTSP). However, the same application are making alot (aprox 6200) of open UDP ports (showing in netstat -ano as ).
The number of active ports keep increasing after a server reboot and keeps going until it reaches 65535 and then when a camera is going offline (network issues or whatever) it refuses to reconnect.

Sample from netstat -ano
UDP    *:*   6848
UDP    *:*   6848
UDP    *:*   6848
UDP    *:*   6848

Anyone know what might lead to such a behavior from an application or is this by any chance a OS problem ?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan McCauleyEnterprise Analytics ManagerCommented:
I'd suspect one of two things is going on:

The camera application has some kind of bug in it where it's connecting to the server and then never closing connections once it's done with them. Instead, it just opens up a new connection once it needs it again, and the old one stays open forever. In this case, you'd need to talk to the camera application developer.
The camera application is closing ports properly, but for some reason, your server isn't releasing them as expected so they can be reused. The application asks for the next available port and gets it, but your server eventually runs out of ports to hand out. This is a server problem, though the application could just as easily reuse the ports it already has as opposed to continually closing and re-opening new ports.

The format of the example you give suggests that the application (in this case, whatever is running at PID 6848 - your camera server?) is actively listening on all those ports. I don't suspect it's your cameras that are the problem, but rather the server application. If all the open ports are listed in this format, then the application is waiting for incoming connections on all those ports, and there's no reason it needs to do that (on thousands of ports at the same time).

As a test, what happens if you kill the process associated with those listening connections (PID 6848, in your example above)? Are the listening ports immediately closed, or do they remain open even though the process is stopped? If they remain open, that's clearly an OS problem, but if they close when the process is ended, it could still be a server/OS problem, but I'd lean towards the application never closing ports its done with, which points back to a bug the developer would need to address.

Hopefully that's enough to get you started, but I'd contact the developer and share the behavior with them to see if they're aware of a fix for it. Good luck!
XMineAuthor Commented:
Seems like the problem is related to the CCTV application. When stopping this service all UDP ports are released and when starting it back up it starts to build them back up..
Seems like I need to take this with the developer of the system.

Thanks for the guidance.
Ryan McCauleyEnterprise Analytics ManagerCommented:
I'd definitely share this with the developer and see if they can give you some help. If the application stops working when ports are all used anyways, then a temporary work-around might be periodically restarting the server application. If it's a Windows service, you can use the "Windows Scheduled Task" admin tool to schedule something like the following command:

net stop YourService && net start YourService

Open in new window

If it's just a server application and not a service, you may have to do it manually, but at least that will keep it working until you have a resolution.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Internet Protocols

From novice to tech pro — start learning today.