kohler / click

The Click modular router: fast modular packet processing and analysis
Other
747 stars 321 forks source link

Click and Iperf #289

Open tmtuanctu opened 8 years ago

tmtuanctu commented 8 years ago

Hi all,

I am a newbie in Click. I have been conducting a simple experiment with Click elements in Mininet. I created a simple topology of 3 nodes:

iperf client ------ Click ----- iperf server

My problem is that when iperf client sent packets, it did not get any responses from iperf server. I already checked that the packets did arrive at the interface of the iperf server. It seems that the packets were not forwarded to iperf process. Do you have any ideas/suggestions?

Best regards, Tuan Thai

Here is my Click configuration

//
in :: FromDevice(eth0, METHOD LINUX);
out :: ToDevice(eth0, METHOD LINUX);

arp_filter :: Classifier(
 12/0800,
 -);

ip_filer :: IPClassifier(
            src host 8.8.8.8,
            dst host 8.8.8.8,
            src udp port < 1024,
            dst udp port < 1024,
            src tcp port < 1024,
            dst tcp port < 1024,
            -);

in -> arp_filter;

arp_filter[0] -> Strip(14) -> CheckIPHeader ->  ip_filer; // ip packets
arp_filter[1] -> Discard; // other packets such as arp

ip_filer[0] -> Discard;  
ip_filer[1] -> Discard;  
ip_filer[2] -> Discard;  
ip_filer[3] -> Discard;  
ip_filer[4] -> Discard;  
ip_filer[5] -> Discard;  
ip_filer[6] -> Unstrip(14) -> Queue -> out;  // out
tbarbette commented 8 years ago

What is the physical configuration? Is the from eth0, to eth0 (eth0 in both) intended? I doubt your iperf packets are actually sended to the link if they have to come back to the same interface. Linux will hit a local routing table before going to the main one.

BTW use METHOD PCAP, should be faster. They rely on the same socket facility but PCAP uses PACKET_MMAP feature which makes it a little faster.