-#
\ No newline at end of file
+#
+
+```shell
+
+
+sudo ip netns exec net1 iperf3 -s -p 5001
+-----------------------------------------------------------
+Server listening on 5001 (test #1)
+-----------------------------------------------------------
+
+```
+
+#
+
+```shell
+iperf$ sudo iperf3 -c 192.168.62.6 -p 5001 -t 60 -i
+1
+Connecting to host 192.168.62.6, port 5001
+[ 5] local 192.168.62.5 port 41342 connected to 192.168.62.6 port 5001
+[ ID] Interval Transfer Bitrate Retr Cwnd
+[ 5] 0.00-1.00 sec 4.91 GBytes 42.2 Gbits/sec 0 478 KBytes
+[ 5] 1.00-2.00 sec 5.00 GBytes 42.9 Gbits/sec 0 600 KBytes
+[ 5] 2.00-3.00 sec 5.06 GBytes 43.5 Gbits/sec 0 600 KBytes
+[ 5] 3.00-4.00 sec 5.03 GBytes 43.2 Gbits/sec 0 600 KBytes
+^C[ 5] 4.00-4.53 sec 2.67 GBytes 43.6 Gbits/sec 0 600 KBytes
+- - - - - - - - - - - - - - - - - - - - - - - - -
+[ ID] Interval Transfer Bitrate Retr
+[ 5] 0.00-4.53 sec 22.8 GBytes 43.2 Gbits/sec 0 sender
+[ 5] 0.00-4.53 sec 0.00 Bytes 0.00 bits/sec receiver
+iperf3: interrupt - the client has terminated
+
+```
+
+```shell
+
+Accepted connection from 192.168.62.5, port 41336
+[ 5] local 192.168.62.6 port 5001 connected to 192.168.62.5 port 41342
+[ ID] Interval Transfer Bitrate
+[ 5] 0.00-1.00 sec 4.91 GBytes 42.2 Gbits/sec
+[ 5] 1.00-2.00 sec 5.02 GBytes 43.1 Gbits/sec
+[ 5] 2.00-3.00 sec 5.08 GBytes 43.7 Gbits/sec
+[ 5] 3.00-4.00 sec 5.06 GBytes 43.4 Gbits/sec
+[ 5] 3.00-4.00 sec 5.06 GBytes 43.4 Gbits/sec
+- - - - - - - - - - - - - - - - - - - - - - - - -
+[ ID] Interval Transfer Bitrate
+[ 5] 0.00-4.00 sec 22.8 GBytes 48.9 Gbits/sec receiver
+iperf3: the client has terminated
+-----------------------------------------------------------
+Server listening on 5001 (test #2)
+-----------------------------------------------------------
+
+```
\ No newline at end of file
#include "iperf_s.h"
+char mode = 's';
+int port = 5001;
+int client_num = 1;
+uint8_t client_buff[MAXCLIENT][MAXBUFFLEN];
+
+static void help(){
+
+ printf("arguments: mode port client_num\n");
+
+ printf("mode: s - select, p - poll, e - epoll\n");
+}
+
int main(int argc, char** argv){
+ int result = -1;
+
+
+ if(argc != 4){
+
+ help();
+
+ return -1;
+ }
+
+ memset(client_buff, 0, MAXCLIENT * MAXBUFFLEN);
+
+ if(strcmp(argv[1], "s") == 0){
+
+ mode = 's';
+ } else if(strcmp(argv[1], "p") == 0){
+
+ mode = 'p';
+ } else if(strcmp(argv[1], "e") == 0){
+
+ mode = 'e';
+ } else {
+
+ printf("invalid mode: %s\n", argv[1]);
+ help();
+
+ return -2;
+ }
+
+ sscanf(argv[2], "%d", &port);
+
+ printf("port to use: %d\n", port);
+
+ sscanf(argv[3], "%d", &client_num);
+
+ printf("client num: %d\n", client_num);
+
+
+ if(mode == 's'){
+
+ result = run_select();
+
+ } else if (mode == 'p') {
+
+ result = run_poll();
+
+ } else if (mode == 'e') {
+
+ result = run_epoll();
+ }
return 0;
}
\ No newline at end of file
--- /dev/null
+#!/bin/bash
+
+
+echo "creating interface..."
+
+sudo ip netns add net1
+
+sudo ip link add dev veth11 type veth peer name veth12 netns net1
+
+sudo ip link set up veth11
+
+sudo ip netns exec net1 ip link set up veth12
+
+sudo ip addr add 192.168.62.5/24 dev veth11
+
+sudo ip netns exec net1 ip addr add 192.168.62.6/24 dev veth12
+