LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-29-2011, 12:32 PM   #16
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176

Quote:
Originally Posted by ambrop7 View Post
Is there something stopping you from doing that? For a given interface, start a net.ipv4.arp_probe() for each subnet that you expect could appear on that interface. Here's an example. It's hardcoded to a single interface and a static set of subnets each with its single IP, for clarity; see the NCD program I made for you to see how it can be generalized, and the foreach thing.
I guess I'm thinking in terms of a very different way I envisioned a network manager (I have thought about doing one in the past). I was thinking of ONE probe process sending probes on ALL interfaces. Actually, my idea for a network manager would have been a single monolithic process doing everything, except for threads or child processes to do stuff that might block execution.

Quote:
Originally Posted by ambrop7 View Post
What list? They'll be just assigned. If the cables are swapped, NCD will detect that and reassign the IPs appropriately. This expected behaviour is implied by the reverse-execution of statements when some statement goes do down state. The NCD wiki explains how that works, http://code.google.com/p/badvpn/wiki...l_of_execution .
The list of IP addresses that need to be configured, if/when the interface(s) they need to be configured on comes up. And in both times of up and down, that list might be dynamically changed by some means.

Quote:
Originally Posted by ambrop7 View Post
Not so much, and the requirements do make sense. I don't think you're fully aware how much NCD can really do. I've added some more docs to the NCD wiki page, you might want to take a look.
NCD is a more complex design with a lot of capability. That means a lot more reading. What I had thought of (in addition to the idea about how to express configuration that started this thread) was something with far less programmability than NCD ... and so it would serve only a limited scope of needs (my focus being on a high reliability data center ... not home laptops). I'm still catching up on it.

I still think in a different kind of logic, like "probe all networks" and "collect a list of all subnets seen" and such.
 
Old 09-29-2011, 01:05 PM   #17
ambrop7
Member
 
Registered: May 2011
Distribution: Gentoo
Posts: 98

Rep: Reputation: 16
Quote:
Originally Posted by Skaperen View Post
I was thinking of ONE probe process sending probes on ALL interfaces. Actually, my idea for a network manager would have been a single monolithic process doing everything, except for threads or child processes to do stuff that might block execution.
I hope you're not confusing operating system processes and NCD processes. NCD (badvpn-ncd) is a single OS-level process. It's a single-threaded event-driven process. The NCD processes do not actually run in parallel. That's just an illusion. When you say manager->start(...), the NCD process that gets created based on a process template still does everything on behalf of the same badvpn-ncd OS process - no additional threads and no child processes.

In other words, NCD is a single monolithic process doing everything (except for child processes - e.g. IP config commands, wpa_supplicant, VPN clients).

Quote:
Originally Posted by Skaperen View Post
The list of IP addresses that need to be configured, if/when the interface(s) they need to be configured on comes up. And in both times of up and down, that list might be dynamically changed by some means
This "list" you can either hardcode into the NCD program, or you can make it an actual list and use foreach in NCD (see wiki). As far as its dynamic changing is concerned, I've already proposed how I could add easy run-time configurability to NCD. Any thoughts on that?

Quote:
Originally Posted by Skaperen View Post
NCD is a more complex design with a lot of capability. That means a lot more reading. What I had thought of (in addition to the idea about how to express configuration that started this thread) was something with far less programmability than NCD ... and so it would serve only a limited scope of needs (my focus being on a high reliability data center ... not home laptops). I'm still catching up on it.
Have you even tried actually running NCD? Have you tried running the example programs? Just read the NCD wiki page, it provides a lot of examples. Try to make something yourself. It's not as complex as it seems at first.

Last edited by ambrop7; 09-29-2011 at 01:11 PM.
 
Old 09-29-2011, 02:13 PM   #18
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by ambrop7 View Post
I hope you're not confusing operating system processes and NCD processes. NCD (badvpn-ncd) is a single OS-level process. It's a single-threaded event-driven process. The NCD processes do not actually run in parallel. That's just an illusion. When you say manager->start(...), the NCD process that gets created based on a process template still does everything on behalf of the same badvpn-ncd OS process - no additional threads and no child processes.
Not I'm not. But thanks for asking, because that could have been possible. What I'm thinking of is a "task state" which can be a process or a thread, as the OS sees it, or a context (list signal handlers use), or just a data structure in the interpreter of a higher level language. So it's multitasking, as opposed to multiplexing. In multiplexing, you'd have one "event loop" (typically) that polls multiple sources of events and work states to see what to do. This is a practical way to program when all the events that can trigger work will only trigger non-blocking short time work. I use this model for things like a network traffic redirector which might have dozens of open sockets, all in non-blocking mode, of course. It eliminates the need to do thread merging, or locking data queues between threads. It's one task doing multiplexing.

Even if the "process" in NCD is just a struct you coded to manage the state of interpreting several instances of work, it's still a single work entity that is only working for one context. E.g. you could have a loop that wakes up every NN minutes and tests ONE interface, and have 8 of these as separate tasks for each of 8 interfaces (and create a new one for the 9th interface that arrives later). My orientation to programming would have ONE task with a list of interfaces to check, and it would check them all.

And maybe it's not even that ...

Quote:
Originally Posted by ambrop7 View Post
In other words, NCD is a single monolithic process doing everything (except for child processes - e.g. IP config commands, wpa_supplicant, VPN clients).


This "list" you can either hardcode into the NCD program, or you can make it an actual list and use foreach in NCD (see wiki). As far as its dynamic changing is concerned, I've already proposed how I could add easy run-time configurability to NCD. Any thoughts on that?



Have you even tried actually running NCD? Have you tried running the example programs? Just read the NCD wiki page, it provides a lot of examples. Try to make something yourself. It's not as complex as it seems at first.
Not yet. I need to study it more and find spare machine time to try it out. I'll probably end up making a SlackBuild script for it when I do, and that will make it easy to build a package for Slackware. One alternate project I'll probably try first is the one where I make USB memory sticks that boot up a Slackware derivative. I already programmed in a means to search for what device the root filesystem is on since that varies from one machine to another. These will need to be able to do multiple static IP addresses (as configured when built, and possibly altered later on) as well as DHCP, per interface.
 
Old 09-29-2011, 02:40 PM   #19
ambrop7
Member
 
Registered: May 2011
Distribution: Gentoo
Posts: 98

Rep: Reputation: 16
Quote:
Originally Posted by Skaperen View Post
In multiplexing, you'd have one "event loop" (typically) that polls multiple sources of events and work states to see what to do. This is a practical way to program when all the events that can trigger work will only trigger non-blocking short time work. I use this model for things like a network traffic redirector which might have dozens of open sockets, all in non-blocking mode, of course. It eliminates the need to do thread merging, or locking data queues between threads. It's one task doing multiplexing.
Quote:
Originally Posted by Skaperen View Post
Even if the "process" in NCD is just a struct you coded to manage the state of interpreting several instances of work
Right, that's exactly how NCD is implemented. It implements tasks by multiplexing.

Quote:
Originally Posted by Skaperen View Post
it's still a single work entity that is only working for one context. E.g. you could have a loop that wakes up every NN minutes and tests ONE interface, and have 8 of these as separate tasks for each of 8 interfaces (and create a new one for the 9th interface that arrives later).
Are you saying there's an issue with such an approach? What is it then? Is there something you'd want to do but this paradigm is preventing you from? I think it's a very good approach in the domain of network configuration.

Quote:
Originally Posted by Skaperen View Post
My orientation to programming would have ONE task with a list of interfaces to check, and it would check them all.
But then it would be much harder for this interface-checking thing to communicate the results. In my model, it's as simple as a statement changing state between down and up, and when up, exposing variables with various results. If you go for something more imperative, the automatic reverse-execution is no longer possible, which makes writing correct hotplug-aware network configs much more difficult; for instance, you are no longer automatically protected from various resource leaks.

Last edited by ambrop7; 09-29-2011 at 02:44 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
outlook express configuration soumalya Linux - Server 3 02-29-2008 04:26 AM
smoothwall express configuration nixonmohan Linux - Networking 2 09-28-2007 05:18 PM
Configuration Help w/ Smoothwall 2.0 Express mlitos Linux - Security 14 10-21-2004 04:42 PM
Smoothwall Express 2.0 - Configuration problems cgtueno Linux - Networking 2 06-17-2004 08:23 AM
Mandrake 9.1 alternate Internet configuration?? thibaut Linux - Distributions 4 04-11-2003 05:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration