[Click] Problem Click Router <-> socket application

Jeroen Hoebeke jeroen.hoebeke at intec.UGent.be
Wed Jan 18 10:27:39 EST 2006


Dear Click users:

we have encountered the following problem with Click Router:

The set-up is the following:
We have a Click Router configuration with an InfiniteSource element. 
Packets generated by this InfiniteSource element are sent to a fake0 
interface with IP 192.168.0.101 (using ToHost). In Linux a traffic sink
application is listening to these packets (using a socket). 

In a first experiment the packets generated by the InfiniteSource have
192.168.0.101 as the destination IP address. In this case, the generated
packets arrive at the traffic sink as it should be.

In the second experiment, the generated packets have 192.168.0.254 as
destination IP address. Next, before the packets are sent to fake0,
the address is changed into 192.168.0.101 and the checksum is recalculated
(obtaining the same packet as in the first experiment!). However in this case,
although the packets arrive on the fake0 interface, they do not arrive
at the traffic sink anymore.

So we have the following questions:
- how does the modified packet in the second experiment differs from the one 
in the first experiment?
- how can we modify the packet from the second experiment so it gets accepted 
by our traffic sink? We have looked at the "struct sk_buff" in order to identify any 
differences, but without any success...

Does anyone of you has already encountered this problem or know a solution to it?
Tanks in advance.

Kind regards,
Jeroen 

P.S. Below is a sample configuration file illustrating the above problem.

-------

FromHost(fake0, 192.168.0.101/24) -> Discard;
tohost :: ToHost(fake0);

elementclass FixIPChecksums {
      input -> SetIPChecksum
          -> ipc :: IPClassifier(tcp, udp, -)
          -> SetTCPChecksum
          -> output;
      ipc[1] -> SetUDPChecksum -> output;
      ipc[2] -> output
  }

InfiniteSource(DATA \<
  // Ethernet header
  0000 0000 0000 0101 0101 0101 0800
  // IP header
  4500 0062 9cc9 4000 3f11 1d0b c0a8 0001 c0a8 0065
  // UDP header and UDP payload
  80ca 1a0a 004e ac1e 0046 0001 43ce 4316 000d af6f 0000 0000 0000 0000 0000
  0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
  0000 0000 0000 0000 0000 0000 0000 0000 0000 
  >, LIMIT 1, BURST 1, STOP true) 

  -> Strip(14)
  -> CheckIPHeader()
  -> IPPrint("Destination 192.168.0.101")
  -> EtherEncap(0x0800, 01:01:01:01:01:01, 11:11:11:11:11:11)
  -> tohost;
  
//InfiniteSource(DATA \<
//  // Ethernet header
//  0000 0000 0000 0101 0101 0101 0800
//  // IP header
//  4500 0062 adba 4000 3f11 0b81 c0a8 0001 c0a8 00fe
//  // UDP header
// 1a 0a 80 ca 00 4e b8 3b
//  // UDP payload
//  0ca 1a0a 004e cb54 0046 0001 43ce 431b 0003 8fa5 0000 0000 0000 0000 0000
//  0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
//  0000 0000 0000 0000 0000 0000 0000 0000 0000
//>, LIMIT 1, BURST 1, STOP true)
//  -> Strip(14)
//  -> CheckIPHeader()
//  -> IPPrint("Destination 192.168.0.254")
//  -> StoreIPAddress(192.168.0.101, 16)
//  -> FixIPChecksums
//  -> CheckIPHeader() 
//  -> IPPrint("After rewriting")
//  -> EtherEncap(0x0800, 01:01:01:01:01:01, 11:11:11:11:11:11)
// -> tohost;

----------

-- 
********************************************************
ir. Jeroen Hoebeke
Ghent University - IBBT - IMEC vzw
Department of Information Technology (INTEC)
Gaston Crommenlaan 8 bus 201, B-9050 Gent

Tel.:            +32 (0)9 33 14975
Secr.:           +32 (0)9 33 14900	
Fax :            +32 (0)9 33 14899
E-mail:          jeroen.hoebeke at intec.UGent.be
Website:         http://www.ibcn.intec.UGent.be	
                 http://www.ibbt.be
********************************************************



More information about the click mailing list