How to run netperf Omni-test with stream direction correctly - testing

netperf v2.7.0
When I test latency use stream or maerts direction, I doubt my test results are correct.
$ netperf -H 172.18.44.3 -p 12345 -l 10 -j -c -C -t omni -- -d steam -k THROUGHPUT,THROUGHPUT_UNITS,MIN_LATENCY,MAX_LATENCY,RT_LATENCY,STDDEV_LATENCY,P50_LATENCY,P90_LATENCY,P99_LATENCY,LOCAL_TRANSPORT_RETRANS,REMOTE_TRANSPORT_RETRANS,LOCAL_CPU_UTIL,REMOTE_CPU_UTIL
OMNI Send TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 172.18.44.3 () port 0 AF_INET
THROUGHPUT=442.84
THROUGHPUT_UNITS=10^6bits/s
MIN_LATENCY=1
MAX_LATENCY=233127
RT_LATENCY=-1.000
STDDEV_LATENCY=2226.74
P50_LATENCY=3
P90_LATENCY=4
P99_LATENCY=12354
LOCAL_TRANSPORT_RETRANS=292
REMOTE_TRANSPORT_RETRANS=0
LOCAL_CPU_UTIL=7.82
REMOTE_CPU_UTIL=91.48
MAX_LATENCY, STDDEV_LATENCY, etc. are very large. This is impossible. So where is the problem? thx all.

Related

iperf connects but does not report output

I am using iperf to test network bandwidth between two Ubuntu 16.04.2 hosts (10.0.0.1 and 10.0.0.51). I ran "iperf -s" on 10.0.0.51 and then ran "iperf -c 10.0.0.51 -T 10" on 10.0.0.1. I do see the connection establishment (i.e. local 10.0.0.51 port 5001 connected with 10.0.0.1 port 37680) on both the sides but I do not get the results. It just hangs. Any help is highly appreciated. Thanks
with iperf3, you can see the output in json format:
The command:
iperf3 -c <server-ip> -w 4000 -t 10 -i 2 -f MBytes -V -J --logfile test.log
Note: In this case make sure you can run iperf client and server same version i.e version 3 in both cases
Check for firewalls or packet filters, e.g. for linux use iptables -L to list them and iptables -F to delete them all. Also, what version of iperf? You might want to display interval reports (-i 1) and see what they are reporting.

How to remotely capture traffic across multiple SSH hops?

I want to debug another machine on my network but have to pass through one or more SSH tunnels to get there.
Currently:
# SSH into one machine
ssh -p 22 me#some_ip -i ~/.ssh/00_id_rsa
# From there, SSH into the target machine
# Note that this private key lives on this machine
ssh -p 1234 root#another_ip -i ~/.ssh/01_id_rsa
# Capture debug traffic on the target machine
tcpdump -n -i eth0 -vvv -s 0 -XX -w tcpdump.pcap
But then it's a pain to successively copy that .pcap out. Is there a way to write the pcap directly to my local machine, where I have wireshark installed?
You should use ProxyCommand to chain ssh hosts and to pipe output of tcpdump directly into wireshark. To achieve that you should create the following ssh config file:
Host some_ip
IdentityFile ~/.ssh/00_id_rsa
Host another_ip
Port 1234
ProxyCommand ssh -o 'ForwardAgent yes' some_ip 'ssh-add ~/.ssh/01_id_rsa && nc %h %p'
I tested this with full paths, so be carefull with ~
To see the live capture you should use something like
ssh another_ip "tcpdump -s0 -U -n -w - -i eth0 'not port 1234'" | wireshark -k -i -
If you want to just dump pcap localy, you can redirect stdout to filename of your choice.
ssh another_ip "tcpdump -n -i eth0 -vvv -s 0 -XX -w -" > tcpdump.pcap
See also:
https://serverfault.com/questions/337274/ssh-from-a-through-b-to-c-using-private-key-on-b
https://serverfault.com/questions/503162/locally-examine-network-traffic-of-remote-machine/503380#503380
How can I have tcpdump write to file and standard output the appropriate data?

How can my friend stream a game from my Xbox One to my RTMP server?

My friend has just began streaming, but on his Xbox One. I use PC to stream my games and have never done it through Xbox One. Now he streams using the Twitch app. But i have this RTMP Server which i can use to stream his stream to Twitch with having some extra enhancements! How do i do this?
Setup transparent proxy for RTMP. kinda like this. A ddwrt router is probablly best, but any linux box should work.
#!/bin/sh
XBO=192.168.1.20
PROXY_IP=192.168.1.2
RTMP_PORT=1935
LAN_IP=`nvram get lan_ipaddr`
LAN_NET=$LAN_IP/`nvram get lan_netmask`
iptables -t nat -A PREROUTING -i br0 -s $XBO -d $LAN_NET -p tcp --dport $RTMP_PORT -j ACCEPT
iptables -t nat -A PREROUTING -i br0 -s ! $PROXY_IP -p tcp --dport $RTMP_PORT -j DNAT --to $PROXY_IP:$RTMP_PORT
iptables -t nat -I POSTROUTING -o br0 -s $LAN_NET -d $PROXY_IP -p tcp -j SNAT --to $LAN_IP
iptables -I FORWARD -i br0 -o br0 -s $LAN_NET -d $PROXY_IP -p tcp --dport $RTMP_PORT -j ACCEPT
Then configure nginx almost exactly like this. Modify the nginx config slightly (below) and started the broadcast on the ps4 this is the result
Just change the exec command to do whatever you want
rtmp {
server {
listen 1935;
chunk_size 4096;
application app {
live on;
record off;
exec ffmpeg -i rtmp://localhost/app/$name -filter_complex "drawtext=fontfile=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf:text='m3u8':fontsize=50:fontcolor=white#0.8:x=100:y=100" -c:v libx264 -g 2 -profile:v main -b:v 800K -s 640x480 -f flv -c:a aac -ac 1 -strict -2 -b:a 56k rtmp://live.twitch.tv/app/$name;
}
}
}

Richard Stevens' sock program - multicast clients

I've started sock program like this:
me#ASUS $ ./sock -v -s -F -j 224.0.0.1 -u 127.0.0.11 5555
IP_ADD_MEMBERSHIP set
But, when I try to connect a client, I get this error:
me#ASUS $ ./sock 127.0.0.11 5555 -j 224.0.0.1
IP_ADD_MEMBERSHIP setsockopt error: Address already in use
Am I invoking clients wrong? How to connect multiple multicast clients on a single host to a server?
Thanks.
I was trying to figure this out and bumped into this. The following commands worked for me (same host or from different hosts):
sock -u -i -n 10 224.0.0.4 1234
sock -v -s -i -u -j 224.0.0.4 1234
The second is the receiver (what most people call the server but that term confuses me for UDP stuff).

Get incoming ssh forwarded connection port number

I have a server who is forwarding connections to a set of other servers.
Here I forward all incomming connections on:
my.tunnel.com:33199 to my.server2.com:52222
And..
my.tunnel.com:33200 to my.server3.com:52222
.. until
my.tunnel.com:XXXXX to my.serverN.com:52222
I'm initiating this by the following command on each server, except the tunnel my.tunnel.com:
ssh -o StrictHostKeyChecking=no -l root -i /etc/ssh/id_rsa -R *:33199:127.0.0.1:22 -p 443 my.tunnel.com 0 33199
...
ssh -o StrictHostKeyChecking=no -l root -i /etc/ssh/id_rsa -R *:XXXXX:127.0.0.1:22 -p 443 my.tunnel.com 0 XXXXX
Well, this works fine!
But!
At the point of the launching of each of these commands I'd like to check on my.tunnel.com that my.server2.com wants my.tunnel.com to forward exactly from port 33199, but not another port! So at this point I'd like to get this port number.
Please let me know if the problem is still not enough clearly exposed.
Thanks!
To get the forwarded port
There is no such information in the environmental variables, so you must pass it yourself:
ssh -R 33199:127.0.0.1:22 my.tunnel.com "export MY_FWD_PORT=33199; my_command"
(my_command is the script you want to run on the server). More information about passing variables - https://superuser.com/q/163167/93604
To get the source port
Look at the environment variable SSH_CONNECTION in man ssh(1). Its meaning is:
source_ip source_port dest_ip dest_port
You probably want source_port, so just get the second part of it:
echo $SSH_CONNECTION | awk '{ print $2 }'
or
echo $SSH_CONNECTION | cut -d" " -f 2