Hi Mark,
I am thinking of using the uTasker simulator to help me build an application that will simulate a number of modbus TCPIP slaves, on one ethernet connection. I need to support about 30 modbus slaves. To do this I need to modify the stack to repond to multiple IP addresses, this could easily be done on a block basis so utasker would respond to any IP in the range 192.168.1.1 to 192.168.1.32 for instance.
How difficult would this be to do? I'm envisioning this just being a simulator project it would never run on real hardware.
I could just run 30 instances of an application all configured to run with different IP addresses but this seems a bit heavy.
I found this post
http://www.utasker.com/forum/index.php?topic=261.0 which gives me some clues, I think I need to do the following things
1. Handle ARP requests from external devices for any IP in the range, I presume it would be ok to respond with the same MAC address
2. If a UDP or TCP request came through for an IP request in the range then respond to it, accordingly. I.e. respond to a Ping or Http request etc. In most cases I don't care that the uTasker simulator will not know to which IP destination address the request was directed, just that it replies to the request from the same IP address. Thinking about it I may have to duplicate the structures for each IP address as different IP addresses may be in different states
3. In the case of ModbusTCP I will want the higher level application to Know which IP address the request was sent to as I will want to respond with different information. The Modbus stack can already handle multiple TCPIP connections on different ports, its just a case of extending this mechanism to support multiple IP addresses.
Is it worth me trying to do this or is uTasker quite tightly tied into working with single IP addresses?
Cheers
Martin