Sockets are the building blocks of networking. Servers listen and clients dial using sockets to bind together and share information. The Internet Protocol (IP) layer specifies the address of a machine, but the Transmission Control Protocol (TCP) or the User Datagram Protocol (UDP) specify which port on the machine should be used.
The main difference between the two is the connection state. TCP keeps the connection alive and verifies that messages are received. UDP just sends a message off without receiving an acknowledgement from the remote host.