Internet performance on u-boot - networking

I'm looking for a way to run iperf -s command on u-boot. Is there any option in u-boot build configuration to enable iperf utility as available in Linux.
Thanks

There is not, and it is unlikely that it could be easily ported.

Related

systemd network service does not work?

Today, I install ubuntu 16.04 in my machine.
When I boot the system, I can not get the IP address from DHCP server.
The network interface is renamed to enp2s0 from eth0.
I only get the IP address after run command:
$ sudo ethtool -s enp2s0 autoneg off speed 100
I try to add this command in init script (/etc/rc.local) but it does not work after I reboot system.
So, from now, when my machine is booted, I always need to add the above command mannually to get IP address.
Could anyone help me to solve this problem?
Thanks in advance.
Best Regards,
Since you're using ubuntu, use command line and execute the following:
$ sudo crontab -e
and add your script that you want to execute upon restarts by adding this at the end:
#reboot ethtool -s enp2s0 autoneg off speed 100
Hope this helps.
systemd considers both "rc.local" and "crontabs" to be "legacy". It has replacements for both. However, Ubuntu 16.04 supports both concepts.
I think your issue is that now rc.local is run before the network is fully online, causing your command to fail.
Look at /lib/systemd/system/rc.local.service to see how systemd is running your rc.local file. In particular note that the line After=network.target.
Try creating this file:
/etc/systemd/systemd/rc.local.service.d/10-wait-for-network.conf
Add these lines to it:
[Unit]
After=network-online.target
Then reboot and see if that works for you.
References:
Force services to wait for the network to be configured
Using systemd Drop-In units
Also, in the future SO is not the best place for systemd questions. Consider http://askubuntu.com for Ubuntu question instead.
I'll also add that the behavior change you found might be considered a bug in how Ubuntu emulates rc.local support with systemd. If the proposed fix works, perhaps Ubuntu shoudl change the rc.local replacement to load after network-online instead of network.

QUIC traffic generation

I wanted to know if anyone in this community know/found a way to simulate QUIC traffic profile. For analyzing/simulating youtube over WLAN (WiFi), i wanted to know if there is a convenient package like iperf out there.
Thanks
Bharat C P
At the moment there are not any simulation frameworks that can be used to test QUIC traffic.
However there is a remarkable effort in order to provide stand alone implementations with the aim of testing and analyzing QUIC.
I cite just some references you might want to use to this purpose:
Official Google Guide which contains a sample server and client implementation in Chromium.
libquic a library extracted from Chromium's QUIC Implementation
quic-go is an implementation of the QUIC protocol in Go.
I was able to generate QUIC traffic using aioquic. I'm using KDE Neon, which is an Ubuntu derivative.
git clone https://github.com/aiortc/aioquic.git
sudo apt install libssl-dev python3-dev
virtualenv venv1
source venv1/bin/activate
cd aioquic/
pip install -e .
pip install asgiref dnslib httpbin starlette "werkzeug<2.1" wsproto
Then, in one terminal, run the server:
python examples/http3_server.py --certificate tests/ssl_cert.pem --private-key tests/ssl_key.pem
And in another, make an http3 request with the client:
python examples/http3_client.py --ca-certs tests/pycacert.pem https://localhost:4433/
Done.
You can see the traffic in Wireshark. The version that worked for me was 3.6.5. Note that you would need to sniff the loopback interface (Loopback: lo).
Here's how to install Wireshark 3.6.5:
sudo add-apt-repository ppa:wireshark-dev/stable
(need to press enter)
sudo apt update
sudo apt install wireshark

simple and quick tool on linux to watch a http request coming

A HTTP request is coming your way, hitting your machine on a port( assumed that you know the request url/route and the port)
what is a simple and quick tool which helps you watch its headers, parameters being passed, using any language, or any tiny web server proxy, any tool.
Being a ruby/rails guy, I quickly created a rails app, set its routes, ran it, and simply followed its logs.
Curious to know how other web app developers deal with this.
I use WireShark and it is very easy and configurable.
If you use debian or derivates:
sudo apt-get install wireshark
else:
http://www.wireshark.org/docs/wsug_html_chunked/ChapterBuildInstall.html
I'd do this with tcpdump. See the man page. There is also a version for windows.
edit
here's the requested example: tcpdump port 80 (yes, it's that simple). Run it with sudo or as root, otherwise you'll get no suitable device found.
If you need more verbose output, add -v or -vv.
Here is how to use wireshark on a Debian-derived GNU/Linux distro:
$ sudo apt-get install wireshark wireshark-doc
$ sudo dumpcap -i eth0
Ctrl+C
$ sudo chmod 644 /tmp/wireshark_pcapng_eth0...
$ wireshark /tmp/wireshark_pcapng_eth0...

Why doesn't wireshark detect my interface?

I just installed Wireshark, but when I click capture > interfaces, the dialog box appears, but it does not contain my network interface.
When click on capture > interfaces it appears as in the screenshot below. What can cause this?
This is usually caused by incorrectly setting up permissions related to running Wireshark correctly. While you can avoid this issue by running Wireshark with elevated privileges (e.g. with sudo), it should generally be avoided (see here, specifically here). This sometimes results from an incomplete or partially successful installation of Wireshark. Since you are running Ubuntu, this can be resolved by following the instructions given in this answer on the Wireshark Q&A site. In summary, after installing Wireshark, execute the following commands:
sudo dpkg-reconfigure wireshark-common
sudo usermod -a -G wireshark $USER
Then log out and log back in (or reboot), and Wireshark should work correctly without needing additional privileges. Finally, if the problem is still not resolved, it may be that dumpcap was not correctly configured, or there is something else preventing it from operating correctly. In this case, you can set the setuid bit for dumpcap so that it always runs as root.
sudo chmod 4711 `which dumpcap`
One some distros you might get the following error when you execute the command above:
chmod: missing operand after ‘4711’
Try 'chmod --help' for more information.
In this case try running
sudo chmod 4711 `sudo which dumpcap`
In Windows, with Wireshark 2.0.4, running as Administrator did not solve this for me. What did was restarting the NetGroup Packet Filter Driver (npf) service:
Open a Command Prompt with administrative privileges.
Execute the command sc query npf and verify if the service is running.
Execute the command sc stop npf followed by the command sc start npf.
Open WireShark and press F5.
Source: http://dynamic-datacenter.be/?p=1279
For *nix OSes, run wireshark with sudo privileges. You need to be superuser in order to be able to view interfaces. Just like running tcpdump -D vs sudo tcpdump -D, the first one won't show any of the interfaces, won't compalain/prompt for sudo privileges either.
So, from terminal, run:
$ sudo wireshark
As described in other answer, it's usually caused by incorrectly setting up permissions related to running Wireshark correctly.
Windows machines:
Run Wireshark as administrator.
By Restarting NPF, I can see the interfaces with wireshark 1.6.5
Open a Command Prompt with administrative privileges.
Execute the command "sc stop npf".
Then start npf by command "sc start npf".
Open WireShark.
That's it.
On Fedora 29 with Wireshark 3.0.0 only adding a user to the wireshark group is required:
sudo usermod -a -G wireshark $USER
Then log out and log back in (or reboot), and Wireshark should work correctly.
I hit the same problem on my laptop(win 10) with Wireshark(version 3.2.0), and I tried all the above solutions but unfortunately don't help.
So,
I uninstall the Wireshark bluntly and reinstall it.
After that, this problem solved.
Putting the solution here, and wish it may help someone......
Just uninstall NPCAP and install wpcap. This will fix the issue.

How to send DSCP-marked packets using iperf?

How to send DSCP-marked packets using iperf?
I did not find the option in 1.7.0 version on Windows. Are there any newer versions of iperf for Windows?
You have to run iperf with '-S' option:
iperf -c 10.19.4.10 -i 1 -u -b 5000K -r -S 0xB8
You can get your tos value here:
http://www.tucny.com/Home/dscp-tos
This posting explains how to enable DSCP in iperf. It's from 2003, so it should be in recent releases, I guess.
Ruby's packgen is good .

Resources