www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Sockets and the Promiscous Mode

reply fichtknick <fichtknick gmx.ch> writes:
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
Sep 30
next sibling parent "Tristan B. Kildaire" <deavmi disroot.org> writes:
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).
Oct 05
prev sibling next sibling parent "Tristan B. Kildaire" <deavmi disroot.org> writes:
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
Hopefully I helped in someway. I do not know the method of doing low-level networking like looking at layer 2 (specifically ethernet) traffic. Godspeed.
Oct 05
prev sibling parent "Tristan B. Kildaire" <deavmi disroot.org> writes:
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
D is a good language.
Oct 05