Network Quality Warning in Ant Media Server - ant-media-server

I am using Ant Media Server as real-time media server. But sometimes I get the warning “Weak Network Connection” in the player.html, also “Your connection isn't fast enough to play this stream!” in the play.html even if I have high value of download rate.
Why does Ant Media Server generate this warning?

It's a great question. Let me explain
Typical Scenario
Some users complain about this problem by saying I'm having 1Gbps internet speed and I should not get this warning. Yes it can have 1Gbps internet speed but it can still have this warning.
Because the important thing is E2E network quality(QoS). I mean 1Gbps internet speed is the one that ISP provides to reach the internet. On the other hand, if the server is another continent or server does not have bandwidth. One can get this warning again. So it's not only related to your internet connection speed.
Reasons
Here are some reasons that decrease the network QoS so that you can get this warning
Bandwidth between Server and Client.
High Packet Loss (<%1)
High Round Trip Time (<150ms)
High Jitter (<30ms)
Solution
For the #1, both server side and client side has enough E2E bandwidth.
You can also get rid of #2, #3 and #4 by making the server and client as close as possible.
The last but not least, if you're in a WiFi/Mobile network and the access point is not close or network quality is bad in your environment. There will be high packet loss and it may be the cause of the problem. I mean you can even take a look at there is no problem in your local network.
Monitor the Stats
Ant Media Server provides some statistics that you can monitor. When I investigate the issues, I monitor the statistics. I see that one of the stats has a bad value.
Ideally, jitter should be below 30ms. Packet loss should be no more than 1%, and network latency shouldn’t exceed 150 ms one-way (300 ms return).
Stats can be monitored under the sample player or through JS SDK. Check the image https://ANT_MEDIA_SERVER:5443/WebRTCAppEE/player.tml
antmedia.io

You can disable that warning from play.html file.
Open /usr/local/antmedia/webapps/{your APP name}/play.html
Find and comment out below part:
/*
if(description.audioBitrate + description.videoBitrate > description.targetBitrate)
{
document.getElementById("networkWarning").style.display = "block";
setTimeout(function() {
document.getElementById("networkWarning").style.display = "none";
}, 3000);
}
*/
antmedia.io

Related

Determining how much of the network bandwith is utilized during/after a jmeter test

I want to understand how to determine whether my internet connection is a bottleneck or not during a jmeter stress test.
Here is a bit of background for my problem:
I made a stress test with a 2 hours duration, with 2000 threads ramped up over the whole 2 hours duration hoping to find the upper limit of the server, but I am thinking that maybe I hit some other limit and not the server's, as it's not shutting down, aka not responding with 4xx or 5xx error codes. I can only see in the report that the transactions per second go fairly quickly to 580, but they then will not go above.
When I run the stress test against one server endpoint and the load keeps increasing, I need to be connected to a VPN to have access to that endpoint.
Most of the stress test runs I tried, behave like this:
Although, the number of threads increases, like this:
And I only have Non-HTTP error response codes which are not reflected in the server logs, aka the server reports no 4xx or 5xx error codes:
The server will not go over 580 TPS, but it will not throw errors either:
As per this site, my internet connection (via cable or wifi, I see no major difference) has 1ms ping, 400-420 Mbps download capacity and around 250 Mbps upload capacity - granted, this is calculated with some server selected by them, located relatively near to my location.
How can I know how much of that "pipe" capacity is being used so that I can say with certainty that my internet connection is not a bottleneck?
Can the VPN be a bottleneck?
There are multiple options like:
Bytes Throughput Over Time chart which is a part of JMeter's HTML Reporting Dashboard
Bytes Throughput Over Time chart from JMeter Plugins project
JMeter PerfMon Plugin which provides complete Network IO metrics
Your operating system should provide built-in applications for network monitoring

How to test the stability of internet connection for this particular scenerio

I work for a company and we have a device that we are installing in small shops for their payment transactions. This device uses internet connection as the primary connection and in case internet goes down, it fails to 3G connection. During this time there is a downtime for few minutes
But we are having issues, where customers are calling us and says that their site goes down repeatedly throughout the day. When we look into our logs we see that our device has indeed failed over and back a number of times from primary to 3G and back to primary. We advise them that they need to check with ISP and make sure there is no internet drops.
Often customer say that they have consulted with ISP and they seem to say there are no issues from their end.
The only other possible reason that I can think of as to why the device keeps falling is due to faulty cabling. Are there are other way that we can test out that the problem is to do with Internet and not our device?
Perhaps you ought to expand the test routines included in the device, assuming the device has the memory capacity and/or libraries and computing power available.
For example, does your device determine the Internet is down only if it cannot reach a certain IP destination? If so, you may want to expand this by 1) testing to ensure timeouts aren't too short due to upstream congestion, 2) testing another known location such as Google's DNS server 8.8.8.8 when the intended destination IP fails, and 3) testing the internal gateway to determine if the ISP modem/router has rebooted for some reason.

network packet loss delay bandwidth simulation

So I have come across many network simulators and most of them are either on permanently (as in you have to close it to turn it off), or have a stop and start button. now, I have been looking for a network simulator than can simulate packet loss, delay, bandwidth speeds of choice for windows that can also be cycled on or off by a set time. I found one such program called FnLag, but the problem is (for me at least) is that it is not free.
basically the shorter version of my question is does anyone know of a network simulator for windows or linux that is free that can simulate packet loss, delay, bandwidth control, seperate downstream and upstream rules, tcp and udp selection that can be cycled on and off or burst/pulse feature? i can elaborate further if necessary.
There is a very good open source solution for network simulations called - WANEM
WANem is a wide area network emulator. It supports various features such a bandwidth limitation, latency, packet loss, network disconnection among other wide area network characteristics.
Here is the url: http://wanem.sourceforge.net

Network Monitoring devices for bandwidth tracking

I'm looking for preferably a device, but I'll settle for an application. I'd like to get an idea of what is out there. Something just to get a total count from what computer, And maybe by common ports.
I'm not looking for a detailed reporting like wireshark, unless wireshark can do summaries and be running for a whole month without issues.
Essentially, I just want an idea of where my monthly bandwidth is going and by what computers / devices. I.e. computer A does a lot of website traffic, computer B gets a lot of steam downloads, device C has got some virus setting out on an unknown port. Now to be clear, I would only know that Device C has some virus on it as the logs would show either lots of bandwidth on a unknown port which then gets be to investigate.
Being able to ignore / filter any traffic that stays behind the router would be nice. This computer as of this post has over a gig of traffic, but mostly to the networked drive I have, I'm really only interested in what uses internet bandwidth, and who's using it... and if possible, what it is.
If you ask for some tools,maybe google/superuser is better for you.
If you ask how to program, you can use Raw Socket.
RawSocket is able to work as network sniffer. So you can get your networking bandwidth using.

How Many Network Connections Can a Computer Support?

When writing a custom server, what are the best practices or techniques to determine maximum number of users that can connect to the server at any given time?
I would assume that the capabilities of the computer hardware, network capacity, and server protocol would all be important factors.
Also, do you think it is a good practice to limit the number of network connections to a certain maximum number of users? Or should the server not limit the number of network connections and let performance degrade until the response time is extremely high?
Dan Kegel put together a summary of techniques for handling large amounts of network connections from a single server, here: http://www.kegel.com/c10k.html
In general modern servers can handle very large numbers of concurrent connections. I've worked on systems having over 8,000 concurrently open TCP/IP sockets.
You will need a high quality servicing interface to handle that kind of load, check out libevent or libev.
That is a good question and it definitely is situational. What is your computer? Do you have a 4 socket machine filled with Quad Core Xeons, 128 GB of RAM, and Fiber Channel Connectivity (like the pair of Dell R900s we just bought)? Or are you running on a p3 550 with 256 MB of RAM, and 56K modem? How much load does each connection place on your server? What kind of response is acceptible?
These are the questions you need to answer. I guess the best way to find the answer is through load testing. Create a unit test of the expected (and maybe some unexpected) paths that your code will perform against your server. Find a load testing framework that will allow you to simulate 10, 100, 1000, 10000 users performing those tasks at the same time.
That will tell you how many connections your computer can support.
The great thing about the load/unit test scenario is that you can put in response time expectations in your unit tests and increase the load until you fall outside of your response time. If you have a requirement of supporting X number of Users with Y second response, you will be able to demonstrate it with your load tests.
One of the biggest setbacks in high concurrency connections is actually the routers involved. Home user oriented routers usually have a small NAT table, preventing the router from actually servicing the server the connections.
Be sure to research your router/ network infrastructure setup just as well.
I think you shouldn't limit the number of connections your server will allow - just catch and handle properly any exceptions that might occur when accepting and closing connections and you should be fine. You should leave that kind of lower level programming to the underlying OS layers - that way you can port your server easier etc.
This really depends on your operating system.
Different Unix flavors will support "unlimited" number of file handles / sockets others have high values like 32768.
A typical user limit is 8192 but it can usually be set higher.
I think windows is more limiting but the server version may have higher limits.

Resources