Author Topic: Re-Post "DHCP, DNS and MQTT issues"  (Read 198 times)

mcThings

  • We Connect Things To The Internet... That Can't Be Plugged In.
  • Administrator
  • Jr. Member
  • *****
  • Posts: 68
    • View Profile
    • www.mcthings.com
Re-Post "DHCP, DNS and MQTT issues"
« on: June 01, 2016, 06:02:21 pm »
kersing2din Support3
DHCP, DNS and MQTT issues
0
1. The gateway does not honour the DNS address specified in the DHCP response it receives. If no DNS server is set in the Gateway Config the DNS request will be sent to the router, not the DHCP server specified in the DHCP response.
2. Two issues with MQTT. First the server has to be a resolvable name, using an IP address does not work, the value in the configuration will always be sent to a nameserver. The second issue, when using mosquitto mqtt server the gateway hangs after it exchanged a few packets. The green led on the gateway stops blinking. The only way to revert to a working gateway is to make sure it can not reach mosquitto on boot.Like


mc-abe
mc-abeAdmin2d
1. You are correct. The current implementation on the gateway uses the Default Gateway provided by the DHCP as a DNS server. The expectation is that the Default Gateway will forward DNS requests to the correct DNS server. Are you using this in a specific scenario that doesn't work for you right now? If you provide some more details, I can see what we can do to accommodate your use case. Note that at the moment use of the DNS server provided in the gateway configuration is not implemented. This will be added soon.
2. Can you provide a bit more information around the messages that are exchanged? Do you have a capture of the message exchange or how did you discover that messages are exchanged? I will try to setup a test case here against the mosquitto server to see how the gateway behaves.Like

tomasu
tomasu1d
Many networks have name servers on different machines than the DHCP/Gateway machine.Like

kersing
kersing1d
1. Our network has DNS on a Linux server and the gateway of the internal IP segment is a router that does not handle DNS. Having the default gateway handle DNS is typical for cable/adsl modem(/router) not for a setup with ‘real’ network equipment. That is why the DNS information is provided in the DHCP information. (DHCP server does not run on the router either)
2. I don't have a capture with data, just tcpdump output to verify communication exists between the gateway (@172.16.2.214) and mosquitto (@172.16.1.1).
22:31:25.380004 IP (tos 0x0, ttl 128, id 8, offset 0, flags [DF], proto TCP (6), length 44)
    172.16.2.214.ibm-mqisdp > 172.16.1.1.ibm-mqisdp: Flags , cksum 0x908d (correct), seq 1906975553, win 2048, options [mss 1460], length 0
22:31:25.380031 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 40)
    172.16.1.1.ibm-mqisdp > 172.16.2.214.ibm-mqisdp: Flags [.], cksum 0x7d26 (correct), ack 1907820447, win 14600, length 0
22:31:25.380133 IP (tos 0x0, ttl 128, id 9, offset 0, flags [DF], proto TCP (6), length 40)
    172.16.2.214.ibm-m qisdp > 172.16.1.1.ibm-mqisdp: Flags [R.], cksum 0xb62a (correct), seq 1, ack 0, win 0, length 0
22:31:25.582322 IP (tos 0x0, ttl 128, id 10, offset 0, flags [DF], proto TCP (6), length 44)
    172.16.2.214.ibm-mqisdp > 172.16.1.1.ibm-mqisdp: Flags , cksum 0x908d (correct), seq 1906975553, win 2048, options [mss 1460], length 0
22:31:25.582382 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 44)
    172.16.1.1.ibm-mqisdp > 172.16.2.214.ibm-mqisdp: Flags [S.], cksum 0x6851 (correct), seq 2252697821, ack 1906975554, win 14600, options [mss 1460], length 0
22:31:25.582559 IP (tos 0x0, ttl 128, id 11, offset 0, flags [DF], proto TCP (6), length 40)
    172.16.2.214.ibm-mqisdp > 172.16.1.1.ibm-mqisdp: Flags [.], cksum 0xb116 (correct), ack 1, win 2048, length 0
22:31:25.585076 IP (tos 0x0, ttl 128, id 12, offset 0, flags [DF], proto TCP (6), length 94)
    172.16.2.214.ibm-mqisdp > 172.16.1.1.ibm-mqisdp: Flags [P.], cksum 0x2137 (correct), seq 1:55, ack 1, win 2048, length 54
22:31:25.585111 IP (tos 0x0, ttl 64, id 8223, offset 0, flags [DF], proto TCP (6), length 40)
    172.16.1.1.ibm-mqisdp > 172.16.2.214.ibm-mqisdp: Flags [.], cksum 0x7fd8 (correct), ack 55, win 14600, length 0
22:31:25.585178 IP (tos 0x0, ttl 64, id 8224, offset 0, flags [DF], proto TCP (6), length 44)
    172.16.1.1.ibm-mqisdp > 172.16.2.214.ibm-mqisdp: Flags [P.], cksum 0x5c16 (incorrect -> 0x5fc5), seq 1:5, ack 55, win 14600, length 4
22:31:25.585187 IP (tos 0x0, ttl 64, id 8225, offset 0, flags [DF], proto TCP (6), length 40)
    172.16.1.1.ibm-mqisdp > 172.16.2.214.ibm-mqisdp: Flags [F.], cksum 0x7fd3 (correct), seq 5, ack 55, win 14600, length 0
22:31:25.585288 IP (tos 0x0, ttl 128, id 13, offset 0, flags [DF], proto TCP (6), length 40)
    172.16.2.214.ibm-mqisdp > 172.16.1.1.ibm-mqisdp: Flags [.], cksum 0xb0df (correct), ack 6, win 2044, length 0
After this last packet the green LED on the gateway stops blinking.
« Last Edit: June 02, 2016, 12:16:06 pm by mc-Things »

Social Buttons


kersing

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Re-Post "DHCP, DNS and MQTT issues"
« Reply #1 on: June 08, 2016, 03:59:50 pm »
Tested with 0.6-355, setting mqtt parameters results in a crashed gateway within 5 seconds. (Green led stops blinking). Valid or invalid mqtt user and password makes no difference. Tested with couldmqtt.com as well. (Using wired connection for gateway)
« Last Edit: June 08, 2016, 04:07:20 pm by kersing »

kristofferis

  • Sr. Member
  • ****
  • Posts: 286
  • Location: Sweden
    • View Profile
Re: Re-Post "DHCP, DNS and MQTT issues"
« Reply #2 on: June 08, 2016, 04:21:14 pm »
If you run your local mosquitto in -v mode (or configure logs to see connections) does you see that the mcGateway actually creates a connection to your broker?
Because what you explain sounds like the same issue that I have when the mcGateway loses it connection to a broker or when it cant establish a connection.