[Click] Problem with packet's transport fields

Yogesh Mundada yhm at cc.gatech.edu
Sun Jul 12 16:26:30 EDT 2009


Hi,

Summary: Packet's transport header fields (TCP ports, ICMP type and code)
are not set correctly in linux driver (userlevel works fine).

Details:

System: kernel 2.6.24.7, click source checked out on 27th May 2009 (could
not verify with the latest source as repository is down since yesterday)

Observation:
1. I have written an element (works only with linuxmodule) that reads
incorrect values for  pkt->tcp_header()->th_sport (or th_dport),
pkt->icmp_header()->icmp_type.
2. I verified that packet.hh:transport_header() returns
skb_transport_header(skb()) by putting a debug message there.
3. Printed the click_tcp/click_icmp structures byte by byte in the log. They
do not match with what is captured in tcpdump (the printed bytes start
somewhere in IP header).

I am not sure if this is an issue with alignment or if really a bug. I did
not see anyone else reporting similar issue in google cache. If its indeed a
bug and if someone wants to take a look, I will be happy to share the access
to the setup temporarily.

Alternatively, it can be reproduced as follows

Steps to reproduce ICMP problem:
1. I wrote a simple element called Logger that works with both usredriver
and linuxdriver. All it does is accept a packet, print above mentioned
headers and discard the packet.  (I am attaching it with this email)
2. I first ran it in linuxdriver using following configuration.

FromDevice(eth4, PROMISC true) -> Print("Got from eth4") -> T0 :: Tee ->
Logger;
T0[1] -> ToHostSniffers;

3. I sent ICMP echo requests on that host's eth4 device (by manipulating arp
table entries on the sending host to avoid arp queries). Logger printed the
ICMP type to be 69. I captured packets by running tcpdump on eth4 (attaching
the pcap file)
4. Later I ran click with userdriver, reading from the pcap file generated
earlier and directing packets to logger. Logger printed ICMP type to be 8
this time. I used following configuration

fd :: FromDump(FILENAME /data/click/ping.eth4.logger-test.pcap, FORCE_IP
true);
lg :: Logger;
fd -> lg;

-Yogesh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logger.tgz
Type: application/x-gzip
Size: 932 bytes
Desc: not available
Url : http://amsterdam.lcs.mit.edu/pipermail/click/attachments/20090712/cc42475d/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ping.eth4.pcap
Type: application/cap
Size: 1056 bytes
Desc: not available
Url : http://amsterdam.lcs.mit.edu/pipermail/click/attachments/20090712/cc42475d/attachment.pcap 


More information about the click mailing list