Subnet Mask

If I set the static IP address of my 5700 device for use on my LAN e.g. 10.10.6.100. Why would we need to set a subnet mask (like 255.255.255.0)
I thought these masks were used to interface to a WAN to tell it that we have (in this case) nodes on our LAN with addresses in the 10.10.6.XXX block.

The subnet mask tells your IP layer which machines are local, that is, directly reachable on the LAN. Your example is correct: a netmask of 255.255.255.0 will indicate any device with a 10.10.6.x address is directly on the LAN.

You must set a subnet mask; even though your LAN is very simple, the IP layer can do a whole lot more and it needs the subnet mask to determine how to route things. There is no “this is a simply little LAN so I don’t need any of this fancy stuff” setting in IP. Why? Just assume your application needs to talk to something not on the LAN or at least not in the same address space. You’ll need to add a default gateway which has a netmask of 0.0.0.0. Any address than doesn’t have a more specific route will default to it. That’s the beauty of IP :slight_smile:

1 Like

Thanks
If my portable, desktop and Rabbit are connected (LAN) though a D-Link router and then on the internet (WAN) via my ISP - what would I use for the default gateway and DNS - The address of my Router (192.168.0.1)?

You’re welcome!

Well, the easiest thing is to use DHCP and then the router should set up all that for you.

However, you would use the router as the default gateway with a netmask of 0.0.0.0. Earlier you mentioned using 10.10.6.x as your class C address range; everything on the LAN should probably be the same unless you have a group of systems that will be on the same LAN but aren’t going to communicate with the other set without another gateway.

Your router might act as a DNS, so try using that first and it’ll query whatever servers it’s configured to use. If that doesn’t work then use the DNS provided by your ISP.

If you use static IP adresses, then the rabbit would not need a DNS adress. Just remember to exclude this adress you assign to the rabbit from your DHCP server.
If the router is your gateway to the internet/ISP, then you would set its adress as your default gateway : 192.168.0.1

Thank you
Unfortunately I have to stop using the Rabbit - can you believe it!
All I want to do is collect 40 or so Hex digits from a weather sensor and send them to my web site. Easy! - Not! If I plug something like; www.MyServer.com/Target.ASP?DATA=1E34A7B67D into my browser’s address bar I can pick up the data with a simple asp page. BUT! The Rabbit somehow ONLY uses the IP address of the web site which, like a lot of such sites is “shared”. Hence sending similar from the Rabbit results in an error page. Somehow the browsers uses the IP address and also sends the domain name which the site (1and1.com) filters into the correct directory for my stuff. The Rabbit doesn’t.
Second thought was FTP it! But TWO problems 1/ My data is in a variable - not a file and b/ Attempts to FTP a simple text file resulted in a file full of garbled characters ending up in my web site. (Tech support were going to look into this but never got back)
I have discoursed this Tech Support for months who only seem able to help with code line errors and “Modify this example” etc - so giving up and going to Microchip who have a bigger support base.

I’ll be seeing you there then. Unfortunately I am not using the Rabbit for a web page server, so I cannot help you further.

I don’t kow what the Microchip web servers do, so I can’t comment there. What you’re looking for is a virtual domain web server which is more than an small, embedded web server will do. Yes, the Rabbit web server code is pretty limited, but works well for small applications. My application is pretty simplistic and the Rabbit works extremely well for it without adding tons of code I’ll never need. If you need a lot of functionality then you might need a Unix machine with a full web server.

Take a look at the “Samples/tcpip/http/http client.c” sample. It can connect to a webpage via HTTP/1.1 using the hostname and retrieve the contents of a page.