I learn TCP/IP protocol thoroughly but i'm not sure of some aspects. I'd like to build a temperature measurement instrument (digital thermometer) capable of sending measurements results over the internet using TCP/IP protocol. The thermometer will be a simple electronic circuit with a microcontroller that will handle all TCP/IP protocol and will be connected to the router. The temperature measurements will be read from the server by my computer also connected to the router (there will be software written in VC++, Delphi or C Builder for instance) . However, i have some questions about it as i'm not sure if i get everything right.
1. I really don't want to use any of the protocols such as FTP, Telnet, HTTP etc. I want to send only raw data (it will be only several bytes that represent the value of the measured temperature. The computer will send a command byte "Show me temperature" and the thermometer will send an acknowledge together with the temperature values). Can i put these data bytes in the DATA field of TCP packet and receive them in my computer ? (let's assume that my computer and the thermometer are on the same home network)
2. The default gateway. By definition, it is an IP address to which data is sent when a receiving computer is not on the same network. There may be a case when the thermometer is on another network (or somewhere in the internet). ( lets's assume there are no problems with firewalls blocking data transfer and the routers are configured for port forwarding, etc.)
For example, my computer has an IP 192.168.1.100 and the thermometer has IP 192.168.4.100.
If the thermometer wants to send data to the 192.168.1.100 (my computer IP) does it have to put IP address 192.168.1.100 in the destination IP field in IP packet or does it have to put the default gateway IP there ?