Author Topic: M522XX IP Conflict Handling  (Read 8300 times)

Offline ctkian

  • Newbie
  • *
  • Posts: 20
    • View Profile
M522XX IP Conflict Handling
« on: October 22, 2013, 03:07:45 AM »
Hi,

I would like to know how uTasker react when IP conflict occur? Please advise me which part of the code is handling the IP conflict.

Best regards,
Cheng

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: M522XX IP Conflict Handling
« Reply #1 on: October 22, 2013, 02:45:38 PM »
Hi

An IP conflict can exist when your device has the same IP address as another device on the network or when there are 2 or more IP addresses on the network that are the same (but not your device).

Which of the two types are you interested in being able to detect?

Regards

Mark

Note that using DHCP should exclude any possibility of IP conflicts (own device)

Offline ctkian

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: M522XX IP Conflict Handling
« Reply #2 on: October 23, 2013, 03:00:40 AM »
Hi All,

My case would be the former one: An IP conflict can exist when my device has the same IP address as another device on the network(can be a PC with same IP or another unit of my device).

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: M522XX IP Conflict Handling
« Reply #3 on: October 23, 2013, 12:09:18 PM »
Hi

An IP address conflict of this type only becomes apparent in two cases:
1 - There is a reception from this IP address using (probably a broadcast). Each IP reception can be compared with the own address and flags a conflict if found.
2 - The device actively requests whether there is another device in the network with the same IP address.

These are not done normally but the second is probably the best method in case you need to be sure, or want to generally check for a conflict each time your device starts (or the network connection goes up).

To do this, the same technique could be used as in DHCP - see fnCheckIPAddress(). This sends out ARP resolution request to the same IP address as the device has (this causes ARP to send it a multiple amount of times if there is no response). If this fails it means that there is no other device on the network with the same IP address - no conflict. If it however results in a response it means that there is - conflict case. In the conflict case you can stop the local devices operation with a warning so that the situation can be corrected.

Regards

Mark

Offline ctkian

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: M522XX IP Conflict Handling
« Reply #4 on: October 24, 2013, 03:44:17 AM »
Hi Mark,

Thanks for the answer.