[Click] Building a packet reflector in click

Eddie Kohler kohler at cs.ucla.edu
Mon Sep 7 18:58:29 EDT 2009


Hey,

Long term we've been moving towards a model where the destination IP address 
annotation is set by default -- to avoid precisely this problem.  So IPMirror 
sets the annotation by default now.

Thanks,
Eddie


david johnson wrote:
> Wow thanks, that was simple, GetIPAddress(16) after IPMirror worked
> perfectly! So I'll keep the packet reflector as a nice simple example.
> 
> David
> 
> On Tue, 2009-08-25 at 13:08 -0700, Cliff Frey wrote:
>> I suspect the problem is that IPMirror does not set the dst_ip_anno
>> annotation, which is what ARPQuerier uses.
>>
>> If you add a GetIPAddress(IP dst) after the IPMirror, you might have
>> better luck.... but I'm not positive if that'll be enough.  It is hard
>> to know as I don't know what your exact device configuration (ip,
>> subnet, gateway, etc) is.
>>
>> I'd add ARPPrint elements after c[1] and arpq[1] to see what ARP
>> traffic you are generating/receiving.
>>
>> Cliff;
>>
>> On Tue, Aug 25, 2009 at 12:57 PM, david johnson
>> <david.lloyd.johnson at gmail.com> wrote:
>>         Hi
>>         
>>         I presented a course on click today - used a lot of material
>>         from
>>         University of Antwerp - thanks Bart and Michael. I thought up
>>         some
>>         tutorials for them to practice their concepts and I thought
>>         building a
>>         packet reflector would be easy - until I tried to solve it
>>         
>>         I tried something like this:
>>         
>>         define($DEV ath0)
>>         
>>         FromDevice($DEV)
>>          -> c :: Classifier(12/0800, 12/0806 20/0002)
>>          -> CheckIPHeader(14)
>>          -> IPMirror
>>          -> StripToNetworkHeader
>>          -> Print ("Before ARP",200)
>>          -> arpq :: ARPQuerier($DEV)
>>          -> Print ("After ARP",200)
>>          -> IPPrint
>>          -> q :: Queue
>>          -> ToDevice($DEV)
>>         
>>         
>>         arpq[1] -> q;
>>         c[1] -> [1] arpq;
>>         
>>         But it doesn't work - the IP address swapping is working - but
>>         it never
>>         gets to the Print("After ARP",200) statement.
>>         
>>         Is this a hard problem or is their a simple solution that I'm
>>         missing
>>         
>>         I'm trying to think out a set of click exercises that get
>>         progressively
>>         harder for the students to  do. Firstly without writing their
>>         own
>>         elements and then with including writing their own elements -
>>         any ideas
>>         will be most welcome. This would probably be a nice addition
>>         to the
>>         documentation - exercises like these and their solutions.
>>         
>>         Regards
>>         David
>>         
>>         _______________________________________________
>>         click mailing list
>>         click at amsterdam.lcs.mit.edu
>>         https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>>
> 
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click


More information about the click mailing list