The question doesn't really say much about the special devices and the software which communicates with them and how it knows which ethernet address to connect to.
Lukariello added in comments:
The point is that such kind of connection (several devices connected to the same switch) has never been tried before. Up to now the connection between the PC and each device was made “point to point”. Now, for logistic constraints it can't be made this way any more. So that is the reason I need a little switch (or at least I think a switch will do the job) at each pole, collecting all the data (2 devices + ipcam), and a switch at PC side, connecting each single pole switch to the PC. So, if I use switches how to “talk” with each device? How to realize a point-to-point connection?
You really need to find this out as it completely changes what you have to do for the networking.
This leads us to two cases:
- where the software can choose which device to communicate with, perhaps by selecting the ethernet address
- where the software only works if it has a single device visible on the ethernet
The following describes what to do for these two cases. As an observation, the complexity involved is exactly what internet protocol is for: it takes away all these difficulties, and -- still amazing to me -- works perfectly over high-speed LAN and global WAN.
1. On the assumption you can choose which device to connect to by ethernet address: use a single flat ethernet
If your sensors are layer-2 ethernet only, you must have just switches (and no routers) between two communicating devices. So if your devices communicate with the PC, that means they must all plug into the same switch, or a network of switches. One obvious setup is exactly what you describe: have a small switch per sensor group, and link the seven sensor-group switches to a main switch next to the PC, by fibre or cable depending on distance and speed. But it all depends on the physical layout.
If you additionally have layer-3 cameras, they will work fine because internet protocol will sit perfectly well on top of ethernet.
In the diagrams, C1 is camera 1, S12 is room 1 special device 2. Switches are ===+===
.
S11 S12 C1 S21 S22 C2
| | | | | |
==+===+===+===+== =+===+===+===+== ... Simple room switches
| |
| +--------------+ <-- fibre if far
| | copper if not
| | other rooms
| | | | | | |
==+===+===+===+===+===+===+===+== Simple main switch
|
PC
You only need routers if you have different layer-3 networks which need to communicate. A so-called "layer 3 switch" is actually a switch with a router built in to the same box: you don't need one.
Additionally, if you have VLANs, communicating layer-2 devices must be on the same VLAN. (Thanks @Criggie) This would only be the case if for some reason you were obliged to use VLANs, such as an existing set of switches with VLAN per room or something similar. If you're starting with new equipment, and about 20 devices, a simple single flat ethernet made up of plain switches (no VLANs, no layer-3 features) will be best. Especially if you're in a regulated environment which requires simplicity -- which I'll guess means you don't want to share infrastructure with other purposes. One of the risks of a network which is only used for configuration is that is is used infrequently, and it can be tricky to ensure that it will work when you need it.
Other relatively exotic setups are also possible: bridges and wireless access points count as switches here, as do hubs and coax ethernet. If the PC behaves as a trunk you could conceivably use different VLANs. However, simplest will almost certainly be best.
2. If you can't select a device by ethernet address (CABLE SOLUTION)
My assumption is that the software running on the PC will connect to the one special device on layer 2 ethernet. (As an opinion, this is horrible, but if this is what the equipment does you might have to work with it.)
Consider just running the cables! (You don't say how far it is.) It's very simple and so long as the distance isn't too far, will work perfectly.
Here you simply have three ethernet cables per room, running back to a patch panel next to the PC. Plug all the cameras and the PC into the switch. Configure all these with IP addresses in the ordinary way. Plug only one of the special devices into the switch, here shown as S71.
C1 S11 S12 C2 S21 S22 C7 S71 S72
+ + + + + + + + + Patch panels in rooms
| | | | | | ... | | | <- building wiring
+ + + + + + + + + Patch panel near PC
| +-+ | \______
+-------+ | \_____ \ <-- "selector" patch cable
| | other cameras \ |
| | | | | | | | |
==+===+===+===+===+===+===+===+===+===+== Switch
|
PC
3a. If you can't select a device by ethernet address (VLAN SOLUTION + 2 NIC)
This is considerably more complex for the networking, but nonetheless easily achievable. It's basically a VLAN variant for the cabling solution.
This is an illustration of one scheme, many variations are possible.
We'll use a central switch and one switch per room. The switches must be capable of VLANs. We put each special device in its own VLAN. Special device 1 of room 1 goes in VLAN 11, device 2 of room 7 goes in VLAN 72. (You can pretty much make up whatever scheme you like for this.) Additionally, we use VLAN 1 for the cameras. On the PC, we put two network cards, NIC1 and NIC2. NIC1 is put into VLAN1 and configured with an IP address in the ordinary way, and this communicates with the cameras. NIC2 is plugged into a port in the main switch and you change the VLAN of this port to connect to a different special device.
For example, if you put the NIC2 port into VLAN 52, by using the switch's control panel or command line, there will be an ethernet with Room 5's device 2 and the PC. You then run your software. With a suitable switch and PC you might be able to script this easily if that helps.
This scheme is good if the rooms are far apart and cabling is expensive; also good if you want to use fibre optic links for distance or electrical insulation.
Switches now show as ==1===2===T==
, where 1
and 2
indicates access ports on VLAN 1, 2 etc, and T
shows a trunk port.
Two NIC solution:
S11 S12 C1 S21 S22 C2
| | | | | |
===11===12===1===T=== ===21===22===1===T=== ...
| |
| +-------------------+ <-- fibre if far
| | copper if not
| | other rooms
| | | | | | |
==T===T===T===T===T===T===T===1===?===
| |
| |
| |
nic1 nic2
PC
With this scheme, you tell the switch to make the appropriate socket an access port on a particular VLAN (the socket NIC2 is on). With a suitable switch (eg Cisco with command-line interface), suitable configuration (eg SSH with keys so password not required), and suitable client (scriptable SSH client), you could automate this easily with scripts to run on the PC.
This scheme is the most likely to work, but depends on whether the software which runs on the PC is able to select which NIC to use. If it's so fussy as to only take a particular NIC, you'll have to use that one.
3b. If you can't select a device by ethernet address (VLAN SOLUTION + 1NIC)
One NIC solution: if the PC supports trunking (depends on operating system), you can configure the main interface to be VLAN 1, connecting to the cameras. Then, according to which special device you want, you configure a subinterface in the required VLAN and run your software.
rooms
| | | | | | |
==T===T===T===T===T===T===T===T==
|
PC <- needs trunks
With this scheme, the PC can change the VLAN of one of its subinterfaces and get a connection through to a single special device. You'd have to try this with your operating system to see if your software works with the subinterfaces; if it does this is likely to be the least aggravating solution.