在调试gprs模块时,教程里面提示使用网络调试工具先建立一个服务器端的tcp监听端口.然后使用gprs模块来建立连接,发送数据.想到公司当前有现成的阿里云服务器,linux版.就顺势在里面建立一个连接岂不很好.请教了hp.
参考网络命令: nc -l 1234直接建立监听端口. nc -l 1234 > fileout 可以接收数据.
windows: http analyzer fiddler
Ubuntu Network Monitoring Tools
-
Unlike the admin-targeted Linux distributions,which come with bunches of all sorts of tools,Ubuntu doesn't,simply because it is not meant to be a distribution for administering a network. However,this doesn't mean that you are out of options. You can do quite a lot of network monitoring and here are some ways to do it.
Simple Network Statistics with netstat
One of the easiest ways to get data about the network activity of your computer is with the help of the netstat command. In a console,type netstat and you will see something like this (the xx-xxx-xxx-xxx being your actual IP):
Active Internet connections (w/o servers)Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 xx-xxx-xxx-xxx.dd:33796 74.125.232.217:www TIME_WAIT
tcp 0 0 xx-xxx-xxx-xxx.dd:47761 fra07s07-in-f103.1e:www ESTABLISHED
The information isn't very useful but you can see the open connections and their destination (the IP of the party you are connected to). If you are interested only in interfaces,you can use the ifstat tool instead.
-
More Detailed Network Stats with iptraf
Most likely,the output of the netstat command won't suffice and you will need a more advanced Ubuntu network monitoring tool. The choice here is really rich because there are dozens of applications that give more detailed network stats. One of them is iptraf. In order to use it,you first need to install it. In a console,type:
sudo apt-get install iptrafAfter you have installed it,type iptraf to start it. You will see a welcome screen and then you will see its main screen,as shown in the screenshot below:
Navigate up and down the menu and check what you want to know. You can set filters and configure the application,so that it monitors exactly what you want it to monitor. The configuration menu is shown in the next screenshot:
The data gathered and shown by iptraf is very comprehensive and you can even log it for further analysis. This is a lightweight but very useful Ubuntu network monitoring tool. Its GUI might look archaic but the program itself does a really good job.