1d0a7e049SShuo Chen** icmpecho
2b9400f6cSShuo Chenreply every ping command.
3b9400f6cSShuo Chen
4b9400f6cSShuo Chento try it:
5b9400f6cSShuo Chen1. make
6b9400f6cSShuo Chen2. sudo ./icmpecho
7b9400f6cSShuo Chen3. in another window, set ip of tun0 device.
8b9400f6cSShuo Chen   sudo ifconfig tun0 192.168.0.1/24
9b9400f6cSShuo Chen   or
10b9400f6cSShuo Chen   sudo ifconfig tun0 10.0.0.1/24
11b9400f6cSShuo Chen4. ping 192.168.0.2
12b9400f6cSShuo Chen   or
13b9400f6cSShuo Chen   ping 192.168.0.3
14b9400f6cSShuo Chen   or
15b9400f6cSShuo Chen   ping 192.168.0.4
16b9400f6cSShuo Chen   or
17b9400f6cSShuo Chen   ping 192.168.0.254
18d0a7e049SShuo Chen
19d0a7e049SShuo Chen** rejectall
20d0a7e049SShuo Chenreject all tcp connections.
21d0a7e049SShuo Chen
22d0a7e049SShuo Chento try it:
23d0a7e049SShuo Chen1. make
24d0a7e049SShuo Chen2. sudo ./rejectall
25d0a7e049SShuo Chen3. in another window, set ip of tun0 device.
26d0a7e049SShuo Chen   sudo ifconfig tun0 192.168.0.1/24
27d0a7e049SShuo Chen   or
28d0a7e049SShuo Chen   sudo ifconfig tun0 10.0.0.1/24
29d0a7e049SShuo Chen4. nc 192.168.0.2 1000
30d0a7e049SShuo Chen   or
31d0a7e049SShuo Chen   nc 192.168.0.3 1000
32d0a7e049SShuo Chen   or
33d0a7e049SShuo Chen   nc 192.168.0.3 4000
34d0a7e049SShuo Chen
35d0a7e049SShuo Chen** acceptall
36d0a7e049SShuo Chenaccept all tcp connections.
37d0a7e049SShuo Chen
38d0a7e049SShuo Chento try it:
39d0a7e049SShuo Chen1. make
40d0a7e049SShuo Chen2. sudo ./acceptall
41d0a7e049SShuo Chen3. in another window, set ip of tun0 device.
42d0a7e049SShuo Chen   sudo ifconfig tun0 192.168.0.1/24
43d0a7e049SShuo Chen   or
44d0a7e049SShuo Chen   sudo ifconfig tun0 10.0.0.1/24
45d0a7e049SShuo Chen4. nc 192.168.0.2 1000
46d0a7e049SShuo Chen   or
47d0a7e049SShuo Chen   nc 192.168.0.3 1000
48d0a7e049SShuo Chen   or
49d0a7e049SShuo Chen   nc 192.168.0.3 4000
50d0a7e049SShuo Chen
51d0a7e049SShuo Chen** discardall
52d0a7e049SShuo Chenaccept all tcp connections, and discard all incoming data.
53d0a7e049SShuo Chen
54d0a7e049SShuo Chento try it:
55d0a7e049SShuo Chen1. make
56d0a7e049SShuo Chen2. sudo ./discardall
57d0a7e049SShuo Chen3. in another window, set ip of tun0 device.
58d0a7e049SShuo Chen   sudo ifconfig tun0 192.168.0.1/24
59d0a7e049SShuo Chen   or
60d0a7e049SShuo Chen   sudo ifconfig tun0 10.0.0.1/24
61d0a7e049SShuo Chen4. nc 192.168.0.2 1000
62d0a7e049SShuo Chen   or
63d0a7e049SShuo Chen   nc 192.168.0.3 1000
64d0a7e049SShuo Chen   or
65d0a7e049SShuo Chen   nc 192.168.0.3 4000
66d0a7e049SShuo Chen
67d0a7e049SShuo Chen** connectmany
68d0a7e049SShuo Chenconnect to ip:port for many times concurrently.
69d0a7e049SShuo Chen
70d0a7e049SShuo Chento try it:
71d0a7e049SShuo Chen1. make
72d0a7e049SShuo Chen2. sudo ./connectmany 192.168.0.1 2007 1000
73d0a7e049SShuo Chen3. in another window, set ip of tun0 device.
74d0a7e049SShuo Chen   sudo ifconfig tun0 192.168.0.1/24
75d0a7e049SShuo Chen4. start a concurrent tcp server which listens port 2007
76d0a7e049SShuo Chen   eg. muduo/examples/simple/echo
77d0a7e049SShuo Chen5. hit ENTER in 1st window, start connecting
78