This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Promiscuous mode in TM4C1294 Connected LaunchPad - How to implement?



Dear Sirs,

Please give me an example of implementation of promiscuous mode for embedded ethernet of TM4C1294. I'm going to make something like network analyzer, one of it's function should be a CDP (Cisco Discovery Protocol) client/server (transmitter/receiver).

I need to receive ethernet frames with destination mac-address 01-00-0c-cc-cc-cc, while my device's own mac-address should remain unchanged, also I need to be able to send my CDP anounces to multicast mac-address 01-00-0c-cc-cc-cc.

Any ideas how to implement this? I'm newbee in Stellaris, may be it's not the best project to begin, but I want to try:) So if possible please give me an example how to use promiscuous mode with lwIP or any other IP implementation.

I've read SPMS433 document,it says:

p.p.60,1401 (about Ethernet port):

■ Multiple addressing modes
– Four MAC address filters
– Programmable 64-bit Hash Filter for multicast address filtering
– Promiscuous mode support

also p.1480:

Register 2: Ethernet MAC Frame Filter (EMACFRAMEFLTR), offset 0x004
The MAC Frame Filter register contains the filter controls for receiving frames. Some of the controls
from this register go to the address check block of the MAC, which performs the first level of address
filtering. The second level of filtering is performed on the incoming frame, based on other controls
such as Pass Bad Frames and Pass Control Frames.

But unfortunately I can nowhere find examples of using of this register.

Hope for your help very much!



Regards,

Ilia V. Davidov

  • Sorry - have no clue/idea - but must memorialize, "promiscuous mode" as strong challenger to Brett's, "bamboozled" for, "Forum Word of the Month..."   "Duly Noted" (i.e. "code" for if/when we decide to get to it) falls to third position...

  • As you have read SPMS433, you know where to find the information you need. Your job is to translate the well written documentation into code. None of us can do that for you!

    Perhaps your question is how to use TivaWare to set up your application?

  • First of all,thanks for your answers!

    David Hubbard said:

    As you have read SPMS433, you know where to find the information you need. Your job is to translate the well written documentation into code. None of us can do that for you!

    If follow such "straight-forward logic", there shouldn't be any wiki, examples, labs and so on;) Even this forum is redundant - well written documentation (of >1500 pages) is enough!:)

    Of course,nobody should do my job except me - I just try to find the easiest way to do it. It's easier to learn small (relatively) example code and write own one.

    Even more - when I'll get success with my project, I'll try to publish some words about promiscuous mode :)

    David Hubbard said:

    Perhaps your question is how to use TivaWare to set up your application?

    Yes, my question may sound like "How to use Ethernet promiscuous mode in TivaWare-based application?" or "Simple network sniffer in TivaWare - example code"

    Any ideas?

  • cb1_mobile said:

    ... but must memorialize, "promiscuous mode" as strong challenger to Brett's, "bamboozled" for, "Forum Word of the Month..."   "Duly Noted" (i.e. "code" for if/when we decide to get to it) falls to third position...

    Sorry,I've understood nothing:( May be it's due to my poor English:( What are you talking about, please explain if possible :)

  • Technology is imposing a growing influence across many aspects of human endeavor.  Very recently - a good number of, "new" (primarily tech) words were added to multiple dictionaries around the world.  Some examples: "selfie, dubstep, hashtag, crowdfunding & big data."  By such recognition - these words gain "acceptability" - better entrance to the broader, social mainstream...  (I work @ intersection of tech & law - thus words/usage/composition have importance)

    Now your title, "Promiscuous Mode..." provides the flip-side of the above.  (i.e. tech steals/borrows from the social!)  Persons receiving such label (rightly or wrongly) may not be well pleased.   Thus the, "arrival" of, "promiscuous" into the (usually) uber sterile tech world deserves note.  (bet you that adult beverages were consumed as that label was proposed/debated...)

    Two other words landed my initial post - "bamboozled" simply for its being - and "duly noted" (as gentle, protest) for its inept defense of a (far too long/festering) tech sore (unwanted, NMI default) blotting this otherwise, top-cabin landscape... 

  • @cb1_mobile

    :) Thanks a lot for your explanation. As a networking engineer (it's my primary job), also as a man for whom English is foreign language ;) I knew nothing about the alternative meaning of "promiscuous" :)

    If you be so kind :) to explain me the last your sentence in other less "complex&context dependent" words:

    Two other words landed - former for its uniqueness - latter (duly noted) for its inept defense of a (far too long/festering) sore blotting this otherwise top-cabin landscape...

    It's offtop, of course, but it will be usefull for me:) btw,what is your native language?

    @All

    BTW, I'm now analyzing sources of lwIP and tiva-tm4c129.c driver, trying to understand where should I include CDP processing@link layer...

    So any ideas are welcome:)

  • Find your post very well constructed - organized - and presented.  Your grasp of English is quite good - I can "hear" your cadence w/in your sentence structure.  Good that you "steered" this thread back to its central theme.  I sought to poke some fun @ the "p" word's invasion into tech (and memorialize) - not hijack your thread.

    To your, "lwlP, CDP, and link layer" issues - often tech writing takes several "reads" and your active use of, "cut/paste" to capture key points from the MCU manual - and then import to a (smaller) separate file.  Also - we find it useful to review (selectively, of course) related documents/manuals from other ARM MCU vendors - which may provide, "just the missing piece" you require.  (this is a standard method employed in "law" where past/related cases/rulings are often "ripe" with insights and decisions which may speed/ease and enhance one's investigatory/data harvesting efforts...) 

  • @cb1_mobile:
    Some fun is as necessary for engineering, as a deep knowledge :) Also thanks for your help in improving my English:)
    The idea of compilation of resulting solution from a separate, even not too closely connected sources is interesting, I'm now doing something like you advise... Will see if it will help me to solve my problem.
    So, thanks a lot.

  • Ok, sorry for making it sound like we don't want to help, I had to be sure you weren't just getting your homework done for free on the internet. :)

    Here's something you might want to try: set up one of the lwIP examples, get it running on your board.

    tivaware/utils/lwiplib.c & tivaware/third_party/lwip-1.4.1/ports/tiva-tm4c129/netif/tiva-tm4c129.c are the code that might need changes. If you make some small change, compile it, and run it ok, you should be able to make good progress toward sniffing packets.

    I would start by looking at EMACFrameFilterSet() on line 264 of tiva-tm4c129.c in the function tivaif_init(). After I looked at the source code for a while, it appears that lwIP would work ok in promiscuous mode, it would just drop any unwanted packets. You might be able to add code in tiva-tm4c129.c to capture packets out of the buffers before they are passed on to lwIP.

  • David Hubbard said:
    just getting your homework done for free

    So David - are you suggesting that only those (sufficiently) promiscuous - are to get (their) homework done for free?

  • :) if she's cute maybe

  • Overheard: (Dreaded, "Monday morning meetings" when boss asks, "Why's that project not completed?")

    Uh - uh - well there's some lack of clarity w/in the, "Promiscuous Mode!"  (to be "fly on the wall" - that meeting - that conference table...)

  • David Hubbard said:

    Ok, sorry for making it sound like we don't want to help, I had to be sure you weren't just getting your homework done for free on the internet. :)

    It's OK :) I've read http://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/t/345186.aspx?pi297168=1 So I know about this problem :)

    David Hubbard said:

    I would start by looking at EMACFrameFilterSet() on line 264 of tiva-tm4c129.c in the function tivaif_init(). After I looked at the source code for a while, it appears that lwIP would work ok in promiscuous mode, it would just drop any unwanted packets. You might be able to add code in tiva-tm4c129.c to capture packets out of the buffers before they are passed on to lwIP.

    This is exactly what I am working on just now :) Thanks for your ideas :)

    Regards,

    Ilia

  •  Did you ever get the LWIP promiscuous mode packet sniffer working?  I am working on a very similar project where I am wanting to listen in on the network traffic of a small network and record the traffic log.  If you have had any success on this I would be very grateful for any tips.

    Thanks,

  • Hi, Gregg,

    Unfortunately I had to freeze that project, but now I'm about to resume it:) So we may work together - hope this will be usefull for us and for whole community. Feel free to post your ideas to this topic - it looks like there is very few information about this.

    Regards,

    Ilia

  • Ilia Davidov said:
    Unfortunately I had to freeze that project, but now I'm about to resume it:) So we may work together - hope this will be usefull for us and for whole community. Feel free to post your ideas to this topic - it looks like there is very few information about this.

     Hi Ilia, just stop CB1 freshness and unfreeze project in "secure mode" changing thread name to Ethernet promiscuous mode so it cannot do more humor about wording ;)

     I can be interested too also on WLAN side but can I suggest also study RTOS based example too? It can help more and function close to unix/linux network interface standard are simple to use. Porting working  UDP code from Linux to RTOS required me no more than a few hour. Just take care experimental silicon has some issue and it doesn't work if clock is greater than 70 80MHz.