force_local_traffic_through_external_ethernet_cable_by_using_ip_namespaces

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
force_local_traffic_through_external_ethernet_cable_by_using_ip_namespaces [10.02.2018 10:35]
Pascal Suter created
force_local_traffic_through_external_ethernet_cable_by_using_ip_namespaces [10.02.2018 10:47] (current)
Pascal Suter
Line 1: Line 1:
-====== force local traffic through external ethernet cable by using ip namespaces======+====== force local traffic through external ethernet cable by using ip namespaces ======
 lets say you want to run some performance benchmarks between two local network interfaces on a linux machine. if you assign an ip address to each of them and then run your benchmarks, your traffic will not go ghrough the cable but will be routed locally. It does not help to specify a listening interface or anything, you can also play with routes etc. you traffic will still be routed locally.  lets say you want to run some performance benchmarks between two local network interfaces on a linux machine. if you assign an ip address to each of them and then run your benchmarks, your traffic will not go ghrough the cable but will be routed locally. It does not help to specify a listening interface or anything, you can also play with routes etc. you traffic will still be routed locally. 
  
Line 29: Line 29:
 you should see your full bandwidth being used by the one netcat process in ''iftop'' you should see your full bandwidth being used by the one netcat process in ''iftop''
  
 +or you can run ''iperf'' if thats available to you to stress-test your network card with parallel transfers etc.: 
 +  ip netns exec ns_server iperf -s
 +and for the client:
 +  ip netns exec ns_client iperf -c 10.0.0.1 -d -P 20 -t 99999
 +''-d'' uses bidirectional transfers, ''-P 20'' runs 20 processes in parallel and ''-t 99999'' runs for 99999 seconds
  
 +===== cleaning up =====
 +once you are done, simply run 
 +  ip netns del ns_server
 +  ip netns del ns_client
 +and all your settings including the ip addresses etc. are gone. your interfaces will be back in the default namespace
  
  • force_local_traffic_through_external_ethernet_cable_by_using_ip_namespaces.1518255326.txt.gz
  • Last modified: 10.02.2018 10:35
  • by Pascal Suter