TCP sets up a connection and guarantees ordered, reliable delivery; UDP just fires packets with no setup or guarantees. The second option reverses them, and neither protocol is defined by encryption or by being limited to local versus internet use.
Official docs