Sockets and the Promiscous Mode

Tristan B. Kildaire deavmi at disroot.org
Thu Oct 5 16:07:40 UTC 2017


On 2017/09/30 17:17, fichtknick wrote:
> Hello all
> 
> only for learning purposes and my interest for deeper network 
> programming. I wanted to write a program and filter the entire traffic 
> in my network. I have a server and various computers in my network, but 
> I dont know, as I in D the promiscous mode for sockets can switch on.
> 
> Is this possible in D ? I dont want back to C and in Rust.. Rust.... :)
> I Love to write some Code in D, its a beautyful language.
> 
> And so sorry for my english, i understand good, but to write english, i 
> must more learn :)
> 
> happy greetings
> 
> fichtknick
Promiscuous mode works on the layer 2 layer. In most cases this would be 
ethernet. With it on you would be able to see all ethernet frames (with 
payloads in them, like IP packets). This includes those not destined to 
your computer (by it's MAC address (a.k.a. hardware address)).

Promiscuous mode only works if you are using a hub (or a switch that you 
can control) as hubs simply bit replicate all incoming frames to all 
other ports hence computers will even receive ethernet frames not 
intended for them. Hubs are not common these days as a switch actually 
sends etheret frames to the correct hosts (after its dictionary is fully 
built) but WiFi (because the electro-megnetic radiation goes everywhere 
(all devices receive the ethernet frames) and hence it is a hub.

Anyway, networking is not my strongest point (I am studying it too 
currently). From what I know Dlang only allows one to use layer 3 
protocols (like IP).


More information about the Digitalmars-d-learn mailing list