Advanced Member level 2
UDP and TCP are both used on top of IP which rests on Ethernet. How does one know which is needed? They both ultimately send and recieve data in packets.
The best thing about UDP jokes is that I don’t care if you get them or not.
will I use TCP or UDP? It seems that since TCP makes sure that data does get to the other side, it is most suitable for such a task.
so if I design an embedded device (made using microchip PIC) which shall sit in a LAN and I want to be able to communicate with it to find what value it measures from switches and temperature sensors and then send it to my PC, will I use TCP or UDP? It seems that since TCP makes sure that data does get to the other side, it is most suitable for such a task.
You can use either!
However I advice you to use UDP since you will be sending small packages and you do not need to deal with establishing a connection. UDP produces far less traffic on the network since it does not need to check if the package is actually arrived at its destination.