[Click] nsclick promiscuous interface

Bart.Jooris bart.jooris at intec.ugent.be
Fri Jun 3 06:12:22 EDT 2005


Hi Nicolas,

Your explanation is just splendid ;-)

Thanks a lot,

Bart.

Nicolas Letor wrote:

>Hello Bart,
>
>It is a rather simple relation ( if I remember it correctly).
>By enabling the promiscous mode of an interface, the interface will
>install itself as a sniffer in the _tap variable in the MAC layer by
>calling the installTap function.
>
>When a packet is received in the MAC layer, the MAC layer will check
>if there is a sniffer installed ( the if check on tap_ ) and if it
>exists, send the packet to the sniffer (the tapping out). There are a
>couple checks to avoid duplicating packets.
>
>So what was the problem? Installing the tap was no problem, but in the
>802.3 mac the packets where never send up to the sniffers.  They were
>never tapped out.
>If you look in the 802.11 mac, you will see that the packets are tapped out.
>
>I hope you understand my explanation ;-)
>
>Greetings,
>Nicolas Letor
>UA
>
>On 6/3/05, Bart.Jooris <bart.jooris at intec.ugent.be> wrote:
>  
>
>>Hello Nicolas,
>>
>>I added your patch and the sniffer works like a charm :)
>>I would like to understand the code you added, I actually
>>expected some kind of relation to the setpromiscus(promisc)
>>in the mac/ll-ext.cc?
>>
>>Thanks a lot,
>>
>>Bart.
>>
>>Nicolas Letor wrote:
>>
>>    
>>
>>>Hello ,
>>>
>>>The ns2 802_3 MAC doesnt send any packets to the host sniffers
>>>(through to the tap). I fixed it by adding on line 302 of
>>>mac/mac-802_3.cc the following:
>>>
>>><      /* --- tap out     --- */
>>><      if (tap_ ){
>>><
>>><              if (!tap_filterown_ || ((dst != index_) && (dst != BCAST_ADDR))) {
>>><                      tap_->tap(p);
>>><              }
>>><
>>><      }
>>><      /* --- tap out end --- */
>>>
>>>Greetz,
>>>Nicolas Letor
>>>UA
>>>
>>>On 6/1/05, Bart.Jooris <bart.jooris at intec.ugent.be> wrote:
>>>
>>>
>>>      
>>>
>>>>Hello,
>>>>
>>>>Based on the information I found from Mike (November 2004 Archive) I added
>>>>a sniffer to the simple wired lan example (nsclick tutorial by Michael Neufeld).
>>>>
>>>>This is the code of my Sniffer.click:
>>>>
>>>> // Sniffer
>>>> //
>>>> FromSimDevice(eth0,4096) ->
>>>>       ToDump(Sniffer)->
>>>>       Discard;
>>>>
>>>> Idle->
>>>>       ToSimDevice(eth0);
>>>>
>>>>I inserted this code in the tcl script after the node generator for loop
>>>>
>>>> set i 4
>>>>
>>>> set node_($i) [$ns_ node]
>>>> $node_($i) add-wired-interface $chan_1_ $netll $netmac \
>>>>         $netifq 1 $netphy
>>>>*  $node_($i) setpromiscuous 0 1*
>>>> $node_($i) random-motion 0
>>>> $node_($i) topography $wtopo
>>>> $node_($i) nodetrace $tracefd
>>>> [$node_($i) set classifier_] setnodename "node$i­sniffer"
>>>> [$node_($i) entry] loadclick "Sniffer.click"
>>>>
>>>>
>>>>After running the simple wired lan example I opened the
>>>>Sniffer file with ethereal. There was only one entry, the arp broadcast :(
>>>>
>>>>any ideas on this?
>>>>
>>>>Thnx,
>>>>
>>>>Bart.
>>>>
>>>>
>>>>
>>>>Hello-
>>>>You can do promiscuous mode in nsclick, you just have to enable it from
>>>>the tcl part of your scripts. For example, to make eth0 go promiscuous:
>>>>
>>>>$node setpromiscuous 0 1
>>>>
>>>>-Mike
>>>>
>>>>
>>>>
>>>>Nicolas Letor wrote:
>>>>
>>>>
>>>>        
>>>>
>>>>>/ Hello,
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>/>/
>>>>/>/ In the nsclick user manual (p11) there is a  simple bridge example
>>>>/>/ with the following click script.
>>>>/>/ "
>>>>/>/ FromSimDevice(eth0, 4096) -> Queue -> ToDump(eth0.txt) -> ToSimDevice(eth1);
>>>>/>/ FromSimDevice(eth1, 4096) -> Queue -> ToDump(eth1.txt) -> ToSimDevice(eth0);
>>>>/>/ "
>>>>/>/
>>>>/>/ I tried it out, but it doesn't work because the bridge can only
>>>>/>/ forward packets who a broadcast address.  So I thought by enabling
>>>>/>/ promiscous mode the bridge example.
>>>>/>/
>>>>/>/ Unfortunately nsclick's FromSimDevice doesn't support promiscous mode.
>>>>/>/  Has anyone an idea to solve this problem of promiscous mode?
>>>>/>/
>>>>/>/ Thanks,
>>>>/>/ Letor Nico/
>>>>
>>>>--
>>>>Bart Jooris
>>>>Department of Information Technology (INTEC)
>>>>Gaston Crommenlaan 8 bus 201
>>>>B-9050 Ledeberg
>>>>
>>>>Location:
>>>>Complex Zuiderpoort - Blok C0 - Bureau 3.13
>>>>
>>>>
>>>>
>>>>_______________________________________________
>>>>click mailing list
>>>>click at amsterdam.lcs.mit.edu
>>>>https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>>>>
>>>>
>>>>
>>>>        
>>>>
>>>.
>>>
>>>
>>>
>>>      
>>>
>>--
>>Bart Jooris
>>Department of Information Technology (INTEC)
>>Gaston Crommenlaan 8 bus 201
>>B-9050 Ledeberg
>>
>>Location:
>>Complex Zuiderpoort - Blok C0 - Bureau 3.13
>>
>>E-mail: Bart.Jooris at intec.UGent.be
>>Tel. +32 9 33 14.977
>>Fax  +32 9 33 14.899
>>Gsm  +32 474 59.53.42
>>
>>
>>    
>>
>
>.
>
>  
>


-- 
Bart Jooris
Department of Information Technology (INTEC)
Gaston Crommenlaan 8 bus 201
B-9050 Ledeberg

Location:
Complex Zuiderpoort - Blok C0 - Bureau 3.13

E-mail: Bart.Jooris at intec.UGent.be
Tel. +32 9 33 14.977
Fax  +32 9 33 14.899
Gsm  +32 474 59.53.42




More information about the click mailing list