Nп/п : 39 из 60
 От   : Theo                                2:5075/128        07 сен 23 19:40:45
 К    : pozz                                                  07 сен 23 21:43:01
 Тема : Re: Configure network of an embedded device
----------------------------------------------------------------------------------
                                                                                 
@MSGID: lzOpz@news.chiark.greenend.org.uk>
46079a13
@REPLY: 2@dont-email.me> 9223627d
@REPLYADDR Theo
<theom+news@chiark.greenend.org.uk>
@REPLYTO 2:5075/128 Theo
@CHRS: CP866 2
@RFC: 1 0
@RFC-Message-ID:
lzOpz@news.chiark.greenend.org.uk>
@RFC-References: 1@dont-email.me>
FNJpz@news.chiark.greenend.org.uk> 2@dont-email.me>
@TZUTC: 0100
@PID: tin/1.8.3-20070201 ("Scotasay") (UNIX)
(Linux/5.10.0-22-amd64 (x86_64))
@TID: FIDOGATE-5.12-ge4e8b94
pozz <pozzugno@gmail.com> wrote:
> Il 06/09/2023 22:56, Theo ha scritto:
> > pozz <pozzugno@gmail.com> wrote:
> >> So I`m wondering if there`s a standard or quasi-standard way to manage
> >> network configuration of devices on the same LAN.
> >>
> >> The situation isn`t so uncommon. IPCams are network oriented devices
> >> that can be controller by a Cloud service from the manufacturer, but
> >> mainly from a web page. It usually happens that more than one IPCam are
> >> installed on the same LAN.
> > 
> > There are several ways to do this.
> > 
 > > If there`s ethernet, it`s not too complicated. When the device
boots, make a
> > DHCP request and provide your hostname as the device name plus a serial
> > number.  For example, supposing your product is called `HomeBox` and the
> > device`s serial number (MAC address?) is 12:34:56:78:90:ab.  Then make a
> > DHCP request and specify your hostname as `homebox90ab`.  Use enough digits
> > to minimise the changes of name collisions.  A user can either look on the
> > router for the `homebox` device, 

> This isn`t an option for typical users without technical knowledge.


> > or you print instructions telling the user
> > to go to http://homebox90ab/ on a label.  

> Interesting. That URL has a simple hostname that must be resolved by the 
> router. Is it guaranteed that the router is able to resolve the host in 
> URL in the device with the same hostname? 

It`s the way most consumer routers work, there`s no guarantees that somebody
doesn`t have a different setup though.  It is possible to use multicast DNS
(aka mDNS aka Bonjour) in which case http://homebox90ab.local/ will be
resolvable (since any .local address is resolved by sending out multicasts
asking who has it, rather than asking a central DHCP server).

> What happens if more than one 
> device on the LAN make DHCP requests with the same hostname?

That`s why you include a probably-unique hostname with a serial number.  If
they still clash, I imagine the DHCP server hands out a different address
for device #2 and refuses to assign it a hostname already allocated.

> > On an enterprise network, maybe expecting any kind of DHCP is too much.  In
> > which case the initial setup could be its own DHCP server: you plug in a
> > laptop which gets an IP address handed out by the device, and go to
> > http://192.168.1.1/ (or http://homebox90ab/) which is the device.  

> Are you thinking to have a DHCP server running *on* the embedded device? 

Yes.

> How does the device know if send a DHCP request (to receive an IP 
> address from an external DHCP server) or launch a DHCP server?
> Maybe it can try a DHCP request a revert back to internal DHCP server if 
> that fails.

The device out of the box is a DHCP server.  Once somebody logs into it and
configures it, it reboots to become a DHCP client.  To revert back to being
a DHCP server again somebody has to hold down the factory reset button.
(or equivalent physical signal, eg smart lightbulbs you have to turn them on
and off several times in a predefined sequence of flashes)

> > From
> > there you configure its IP address and other settings.  Next time it reboots
> > it uses the new settings.  If it is no longer accessible, there`s the
> > pinhole reset procedure.

> We can say that in professional environment (enterprise network) it`s 
> simple to find experts with sufficient knowledge to set network 
> configuration of a device.

That applies to pretty much any device you want local-only access: somebody
has to configure it, whether via a web interface or a mobile app.  It can`t
just work by being plugged in, unless it talks to the cloud to pick up its
configuration.

If the admins have decided the devices on their network all need static
configuration, they will need to use the device`s config interface to set
that up.

> > While it`s possible for the device to answer at a specific hardcoded IP,
> > it`s a bit awkward from the user perspective - you have to configure your
> > laptop with a particular static IP, netmask and so on.  Many OSes make that
> > annoying, and you can`t easily switch to another network without going in
> > and deleting all the settings (eg you want to search for help while
> > configuring the device).

> It`s very strange there isn`t any protocol at MAC level that manages IP 
> configuration. MAC addresses are unique in the LAN and they could be 
> discovered or printed on a label.
> With this protocol, you could connect and power up all the devices and 
> use a simple software to manage network IP configurations.

There is, it`s called DHCP.  Or IPv6 SLAAC, as below.  As Don says, once
you`ve done DHCP everything is configured, but you either need to have a UI
to either the DHCP server or the device if you want to find out what
happened.  If it is specifically DNS you`re interested in, there`s mDNS,
which also does service discovery - connect a printer to the network and
it`ll become available to devices like phones without any config; this is
because the printer responds to mDNS queries from phones, laptops, etc
saying what services it offers and the devices configure themselves
automatically (the printer also says it accepts certain standard formats
like raster or PDF so no need for drivers).

> > On IPv6, a lot of these problems go away if SLAAC is enabled: you know your
> > network prefix, you know what the device`s MAC address, so it`s trivial to
> > work out the device`s static IP, or at least one IP that it`ll respond to if
> > you try to connect to it.

Theo
--- tin/1.8.3-20070201 ("Scotasay") (UNIX) (Linux/5.10.0-22-amd64 (x86_64))
 * Origin: University of Cambridge, England (2:5075/128)
SEEN-BY: 5001/100 5005/49 5015/255 5019/40 5020/715
848 1042 4441 12000
SEEN-BY: 5030/49 1081 5058/104 5075/128
@PATH: 5075/128 5020/1042 4441



   GoldED+ VK   │                                                 │   09:55:30    
                                                                                
В этой области больше нет сообщений.

Остаться здесь
Перейти к списку сообщений
Перейти к списку эх