Finding device on network without its ip - linux

We have developed a device that is connected to our clients network and we would like to be able to get its ip or set the ip without knowing its ip.
The device has a Linux OS.
We can save the device MAC Address before giving it to customers. We can program a service to broadcast the device IP and MAC Address to a certain IP or port/socket. We can listen to a certain port/socket for commands. Is this the right direction? Should we investigate in other network protocols other than TCP/IP?
We have seen this feature in hardware/device manufacturers provide a CD with a software that can locate their devices on a network even if they have been newly added to the network without network or ip configuration.
Best regards,
Hussam Kazah

Using propriety broadcasting protocol is a very common technique for detecting devices on network without knowing it's name.
However there's a better option:
UPNP, is an excellent protocol for achieving your goals.
libupnp can get you started in no time.

There's a standard protocol called DHCP which allows a network device to make a broadcast request for its IP address. This protocol is widely used by network appliances. On the other hand you may scan your local network for all connected devices using ARP (address resolution protocol) using for example arp-scan utility.

Related

Need ideas for networking like multi-tenant unit VLAN for working from home

For better security of working from home, I need to separate network traffics into different groups so that:
These groups all have access to the Internet, e.g. for work, for home entertainment, etc.; but
they cannot reach each other
Moreover, I need cable connections on all the groups for better transmission speed, so the guest WIFI doesn't satisfy the need.
I heard MTU VLAN (Multi-Tenant Unit VLAN) uses a shared uplink port connected to the Internet. And the other ports can send and receive data on the uplink port, but not between each other.
I have a layer-2 smart switch, but I didn't find direct support of MTU VLAN.
My Questions:
I wonder if there is a way to set up traffic segmentation with Internet access? E.g. by using the security features of traffic segmentation, etc.?
Please remind me if I missed something about this hardware; for example, not sure if there is an equivalent feature to MTU VLAN.
Or, after all, is it feasible to use traffic segmentation in home networking? I do see a lot of discussions about this demand, though.
I am unfamiliar with networking, and don't understand many of the terminologies listed in the text block below. So I highly appreciate any suggestions, links, videos, tutorials, etc.
More Details:
List of the switch's functionalities:
DGS-1100-08V2
System
System Information Settings
System Information
IPv4 Interface
Port Configuration
Port Configuration
Management
Password Access Control
SNMP
SNMP Global Settings
SNMP Community Table Settings
SNMP Host Settings
D-Link Discovery Protocol
L2 Features
FDB
Static FDB
Unicast Static FDB
Multicast Static FDB
MAC Address Table Settings
MAC Address Table
VLAN
802.1Q VLAN
Port-Based VLAN
Management VLAN
Asymmetric VLAN
Surveillance VLAN
Voice VLAN
Spanning Tree
STP Global Settings
STP Port Settings
Loopback Detection
Link Aggregation
L2 Multicast Control
IGMP Snooping
IGMP Snooping Settings
IGMP Snooping Groups Settings
QoS
802.1p/DSCP Default Priority
Port Rate Limiting
Security
Traffic Segmentation
Storm Control
Port Security
OAM
Cable Diagnostics
Monitoring
Statistics
Port Counters
Mirroring Settings
Green
EEE
Screenshot of the switch's menu (Not sure if my username has enough points to upload this picture, if not, please refer to the text block above.)

DDS configuration with multicast and unicast

I am still trying to understand DDS and its concepts.
I have a configuration where 2 laptops run dds based application. My environment does not permit multicast so I decided to go for peer to peer connection(unicast). To bring both the laptops in the same network, I connected them using ethernet cable (Not sure if it was necessary or not).
Now I did not change anything in the QoS i.e. i did not do any settings for unicasting. But now my applications are communicating with each other.
Question :
How are the participants being discovered ? Multicasting ? as I did not do any settings for unicasting.
Was it necessary to bring them under one network i.e. connect with ethernet cable if I wanted to use unicasting ?
EDIT :
Configuration is as follows :
First laptop : Windows OS : Native DDS based application : Publisher : Multicast not allowed.
Second Laptop : Linux : ROS2 based subscriber : Multicast no problem
Out of the box, DDS is required to support Multicast and Unicast Discovery. Anonymous connections are handled through multicast. If you know the IP address of the recipient, you can manually configure those addresses into the unicast discovery list (each vendor will have their own way to name/process this list).
"Multicast is not permitted on our network", in most cases, means that your IT department has turned off multicast packet forwarding at the switch (or the switches) that define the fabric that is your network.
The as-shipped, standard-compliant DDS configuration, however, has no knowledge of this local policy (how could it?). If you haven't changed the configuration in line with your local policies, the DDS Participants are still going to try to connect via Multicast, because you haven't turned it off.
If the DDS-using machines are connected to the same hub, or to an unmanaged switch (defined here as one that your IT department doesn't care about, or is misconfigured), and the network topology does not cross a managed switch, and they are using the default configuration, and they find each other, then they are using Multicast anonymous discovery.
Figure out how to configure your DDS implementation, to add the unicast ip addresses of the machines that need to communicate. Because discovery is usually only needed in one direction (if A discovers B, then it is true that B has discovered A, assuming neither A nor B are configured to ignore the other[1]).
Once you have configured for unicast discovery, you can configure for no-multicast. If the machines are on IP hopping networks (WiFi, etc) it will be difficult unless the DDS implementation understands multipathing. Talk to the vendor to see if this is the case.
[1] DDS is nothing if not overly configurable.
How are the participants being discovered ? Multicasting ? as I did not do any settings for unicasting.
It is not possible for me to answer this question with complete certainty since you are using DDS as part of the ROS2 framework and I am not familiar with the exact details of how the two are set up to interact together. Having said that, from your description it does seem that the participants are indeed using multicast to discover each other.
The best way to get a conclusive answer is by sniffing the network -- assuming that you have the required privileges to do so. For example you can use Wireshark , which comes with an RTPS dissector that allows you to filter on RTPS messages. (RTPS is the name of the standardized DDS wire protocol.) Check out the destination address and see if you detect any addresses in the multicast range. You can do this while firing up a single DDS-based application. It will start announcing itself over the network immediately.
Was it necessary to bring them under one network i.e. connect with ethernet cable if I wanted to use unicasting ?
If you want to use unicasting, you will need to know IP addresses or host names of all peer nodes. As long as those peer nodes can reach each other over UDP, you are good to go. Often, but not always, ping will let you know whether this is the case. Firewalls are a typical cause of problems.
However, be aware that different types of network have their own specific properties that you might have to adjust your configuration to. Over WiFi for example, the likelihood of packets being dropped (especially with bursts of data) is much larger than when connecting nodes directly with a wire. DDS allows for tuning its protocol to deal with that.

Why volumio.local was able to access the raspberry since it connected to local network

After setting up volumio on raspberry, an interest feature was that you can use 'volumio.local' as the address to access the webpage hosted by raspberry, and there was not much to worry whether the ip address changed every time the raspberry connected to the local network. I was wondering how did volumio do that and how to setup an custom address for an raspberry to do the same.
It uses a system called Bonjour, which can locate devices and services on a local network using multicast Domain Name System (mDNS). See this Wikipedia article.

providing DNS client and Ping client

I have a device firmware which runs on Ubuntu operating system. And the device has Ethernet connectivity and will connected on the network.
Now i need provide these two functionalities on the device
ICMP ping client - so that a device can ping the other devices on the network.
DNS client - for faster hostname to IP resolution instead of going to DNS server all the time.
I am trying to find how can i provide these features ? Do i need to implement these features or i can get some ready made source code or libraries which i can integrate with the existing code and get the features working.
Thanks in advance.
Sagar

multiple ethernet over USB devices

we have an embedded Linux device that primarily uses the Ethernet to communicate. We also allow access via the USB port, to support this our device has a g_ether Linux gadget driver that creates a virtual ethernet port for both our device and the clients host. A DHCP server assigns the client an IP address saving them having to configure this them selves, while the device has a fix IP address. I believe this is much the same as how Android does its tethering
This all works fine until a client wants to use 2 or more devices at once. Both devices come up as distinct network interfaces on the clients machine, but both devices have the same IP address meaning you cannot target the host specifically! A smaller problem is that there is a slight possibility that both devices might assign the clients "distinct" interface the same ip address and cause a conflict there too, but I am less concerned about that as the IP address is random since the DHCP server assigns the address based on the MAC address and g_ether randomly generates this, so a retry should fix the issue (not ideal, but will do)
I would like to know if anyone else has faced a similar problem, and if so how they solved it ?

Resources