본문 바로가기
SWE/네트워크

[리눅스][윈도우] 네트워크 성능 측정 툴 iperf 설치 방법 | UDP Multicast 송수신 테스트

by S나라라2 2022. 9. 20.
반응형

 

iperf란?

iperf는 컴퓨터 간의 네트워크 대역폭을 확인할 수 있는 툴이다.
클라이언트 모드, 서버 모드로 동작하여 데이터 패킷을 주고 받으며 테스트 할 수 있다.


 

리눅스 설치 방법

iperf3은 Multicast를 지원하지 않아서 iperf2를 설치하였다.
1) 설치 명령어

$ sudo wget -O /usr/bin/iperf https://iperf.fr/download/ubuntu/iperf_2.0.9

2) 설치 위치로 이동하여 확인

$ cd /usr/bin; ll | grep iperf

3) 권한 부여

$ sudo chmod 777 iperf

4) 실행 확인

$ iperf --help

iperf 사용법이 나온다면 설치가 잘 된 것이다.
'iperf를 찾을 수 없다'는 문구가 뜨면 해당 위치에 iperf가 있는지 2)번부터 다시 확인하자.


윈도우 설치 방법

1) 아래 링크에서 개인 PC 환경에 맞게 설치한다.
iPerf - Download iPerf3 and original iPerf pre-compiled binaries

 

iPerf - Download iPerf3 and original iPerf pre-compiled binaries

iPerf - The ultimate speed test tool for TCP, UDP and SCTPTest the limits of your network + Internet neutrality test Table of contents : Download iPerf for Windows Download iPerf3 for Android Download iPerf3 for iPhone / iPad Download iPerf3 for Apple macO

iperf.fr


나는 mulitcast 테스트를 위해, iperf 2.0.9 버전 설치했다.

 

* iperf3 은 ipv4,ipv6 모두 multicast를 지원하지 않는다.

참고: https://github.com/esnet/iperf/issues/617

2) zip 압축해제

압축을 풀면 위와 같이 5개의 파일이 있다.
설치 완료!


윈도우 실행 방법

Windows에서 실행방법은 cmd를 이용한다.
1) cmd 관리자 권한으로 실행

윈도우 검색에서 'cmd' 입력
'관리자 권한으로 실행'

2) 파일 위치로 이동하여 실행

 


UDP Multicast 수신 테스트

PC A에서 multicast 데이터그램을 전송하고, PC B에서 iperf를 서버모드로 동작시켜서 수신을 확인한다.

1) PC B 에서 서버모드로 실행

bind와 multicast group 조인 문구가 꼭 나와야 한다.
bind 실패하면 ip와 port, 방화벽 확인해보자.

-s : 서버 모드 실행
-u : udp
-B [ip address] : 바인드
-i : 수신 interval (sec)
-p [port]


2) PC A에서 테스트 코드 작성 및 실행

hello it's datagram 이라는 스트링을 송신한다.


3) PC B에서 수신 확인

어느 local ip와 port로 multicast group ip 에 연결됐는지 알려준다.
1초 간격으로 수신된 데이터를 보여준다.


iperf 사용법

Usage: iperf [-s|-c host] [options]
       iperf [-h|--help] [-v|--version]

Client/Server:
  -b, --bandwidth #[KMG | pps]  bandwidth to send at in bits/sec or packets per second
  -e, --enhancedreports    use enhanced reporting giving more tcp/udp and traffic information
  -f, --format    [kmKM]   format to report: Kbits, Mbits, KBytes, MBytes
  -i, --interval  #        seconds between periodic bandwidth reports
  -l, --len       #[KM]    length of buffer to read or write (default 8 KB)
  -m, --print_mss          print TCP maximum segment size (MTU - TCP/IP header)
  -o, --output    <filename> output the report or error message to this specified file
  -p, --port      #        server port to listen on/connect to
  -u, --udp                use UDP rather than TCP
  -w, --window    #[KM]    TCP window size (socket buffer size)
  -z, --realtime           request realtime scheduler
  -B, --bind      <host>   bind to <host>, an interface or multicast address
  -C, --compatibility      for use with older versions does not sent extra msgs
  -M, --mss       #        set TCP maximum segment size (MTU - 40 bytes)
  -N, --nodelay            set TCP no delay, disabling Nagles Algorithm
  -V, --ipv6_domain        Set the domain to IPv6

Server specific:
  -s, --server             run in server mode
  -U, --single_udp         run in single threaded UDP mode
  -D, --daemon             run the server as a daemon

Client specific:
  -c, --client    <host>   run in client mode, connecting to <host>
  -d, --dualtest           Do a bidirectional test simultaneously
  -n, --num       #[KM]    number of bytes to transmit (instead of -t)
  -r, --tradeoff           Do a bidirectional test individually
  -t, --time      #        time in seconds to transmit for (default 10 secs)
  -B, --bind [<ip> | <ip:port>] bind src addr(s) from which to originate traffic
  -F, --fileinput <name>   input the data to be transmitted from a file
  -I, --stdin              input the data to be transmitted from stdin
  -L, --listenport #       port to receive bidirectional tests back on
  -P, --parallel  #        number of parallel client threads to run
  -T, --ttl       #        time-to-live, for multicast (default 1)
  -Z, --linux-congestion <algo>  set TCP congestion control algorithm (Linux only)

Miscellaneous:
  -x, --reportexclude [CDMSV]   exclude C(connection) D(data) M(multicast) S(settings) V(server) reports
  -y, --reportstyle C      report as a Comma-Separated Values
  -h, --help               print this message and quit
  -v, --version            print version information and quit

[KM] Indicates options that support a K or M suffix for kilo- or mega-

The TCP window size option can be set by the environment variable
TCP_WINDOW_SIZE. Most other options can be set by an environment variable
IPERF_<long option name>, such as IPERF_BANDWIDTH.

Source at <http://sourceforge.net/projects/iperf2/>
Report bugs to <iperf-users@lists.sourceforge.net>

 



참고
https://blog.pages.kr/991
Multicast test를 위한 iperf2 설치 (sarc.io)

반응형