Data Sheet

UCTRONICS Ultimate Starter Leaning Kit for Raspberry Pi #K0064
110 www.uctronics.com
8.20 Project 20: Controlling an LED through LAN
8.20.1 Overview
In this lesson, we will introduce TCP and socket, and then programming to control an LED
through the local area network(LAN).
8.20.2 Requirement
Raspberry Pi ×1
LED ×1
220Ω Resistor ×1
Breadboard×1
Several Jumper wires
8.20.3 Principle
1. What
s TCP ?
The Transmission Control Protocol (TCP) is a core protocol of the Internet Protocol Suite. It
originated in the initial network implementation in which it complemented the Internet
Protocol (IP). Therefore, the entire suite is commonly referred to as TCP/IP. TCP provides
reliable, ordered, and error-checked delivery of a stream of octets between applications
running on hosts communicating over an IP network. TCP is the protocol that major Internet
applications such as the World Wide Web, email, remote administration and file transfer rely
on. Applications that do not require reliable data stream service may use the User Datagram
Protocol (UDP), which provides a connectionless datagram service that emphasizes reduced
latency over reliability.
2. What
s Socket ?
A network socket is an endpoint of an inter-process communication across a computer
network. Today, most communication between computers is based on the Internet Protocol;
therefore most network sockets are Internet sockets.
A socket API is an application programming interface (API), usually provided by the
operating system, that allows application programs to control and use network sockets.
Internet socket APIs are usually based on the Berkeley sockets standard.