Question: I want to set the Gateway IP-address and the Netmask of the Device Server but these Settings are disabled (grayed) in the DS Manager. I noticed that they are only enabled in the Master Routing Mode. Why can't I set the Gateway IP and Netmask in Slave (Server) mode?
Answer: The Gateway and Netmask Settings are disabled (grayed) because in the Slave Routing Mode they are irrelevant. These Settings are only needed when the Device Server must establish an outgoing connection to the remote host, which is only possible in the Master Routing Mode. In Slave (Server) Mode the Device Server only accepts incoming connections so these Settings are not needed. For more details, read on.
First, let us discuss what happens in Master (Client) Mode when the Device Server needs to establish an outgoing connection to the remote host:
The Device Server knows the destination IP-address and needs to discover the “path” to this address. By comparing the destination IP with the Netmask the EM100 finds out that the destination IP is on a different subnet.
Since the destination IP is on a different subnet the Device Server needs to find the default gateway. The Gateway IP Setting defines the IP-address of this gateway, but the Device Server still needs to find out the MAC address of the gateway. To do this the Device Server sends an ARP (Address Resolution Protocol) request packet.
The Gateway sends back an ARP reply. The Device Server now knows its target MAC address.
The Device Server is now able to send the data packet to the destination IP. In this packet the destination IP field contains the IP-address of the remote host the EM100 is trying to communicate with. The destination MAC field contains the MAC address of the gateway.
As you can see from the above explanation the Netmask and Gateway IP-address Settings are both used by the Device Server when it prepares to send its first data packet to the remote host.
Now let's see what happens when the Device Server is in the Slave (Server) Routing Mode. In this mode the Device Server never establishes an outgoing connection but only accepts incoming connections (Fig. 1):
Fig 1. When accepting an incoming connection the DS100 simply replies to the sender and doesn't have to use the Netmask and Gateway IP Settings.
First packet from the remote host reaches the gateway. The gateway knows which IP-address on the local network segment to forward this packet to.
The gateway now needs to find out the MAC address of the destination so it sends out an ARP request
Device Server replies with its MAC. The gateway now knows its target MAC address
The gateway now routes the data packet to the Device Server (packet 1 on Fig.1). Destination IP-address and Source IP-address fields remain unchanged (The former specifies the Device Server, and the latter specifies the remote host). In the destination MAC the gateway sets the MAC address of the Device Server that was discovered using ARP. In the Source MAC field the gateway sets its own MAC address.
When replying to this data packet (packet 2 on Fig.1) the Device Server doesn't need to discover the MAC address of gateway because this data is already contained in the received packet (gateway has filled out its source MAC in the packet it sent to the Device Server, remember?).
Nowhere in the above scenario has the Device Server needed to use the Netmask and the Gateway IP Settings. When receiving an incoming connection the Device Server simply replies to the sender. In fact, the Device Server doesn't know or care if the sender is the remote host itself or some kind of intermediary (firewall, router, etc.), it simply replies back and that is it!