Study resource
The Transmission Control Protocol/Internet Protocol (TCP/IP) revision notes
Study The Transmission Control Protocol/Internet Protocol (TCP/IP) with curriculum-aligned Revision Notes resources, practice links, and exam-focused support.
At a glance
revision notes
Resource type
Topic
The Transmission Control Protocol/Internet Protocol (TCP/IP)
Revision notes
TCP/IP, Application Protocols and Web Communication
The four TCP/IP layers
The TCP/IP stack divides network communication into four layers:
- Application layer: Provides protocols used directly by applications, such as HTTP, HTTPS, FTP, POP3, SMTP and SSH. These protocols define how application-level messages and commands are exchanged.
- Transport layer: Provides communication between applications. TCP connections use sockets, which identify an endpoint for communication using an IP address and a port. A client can make a TCP connection to a remote port and send application-level commands through it.
- Network layer: Handles IP addressing and the movement of packets between networks. An IP address contains a network identifier part and a host identifier part.
- Link layer: Handles communication over the local network. MAC addresses are associated with network interfaces and are used at this layer.
Ports and sockets
A well-known port is associated with a standard service, so a client knows which server port to contact for that service. A client port is used by the client application for its side of the communication. The two ends of a TCP connection can therefore be distinguished using their IP addresses and ports. A socket represents an endpoint of communication in the TCP/IP stack.
Application protocols
- FTP transfers files between an FTP client and an FTP server. Access may be anonymous or non-anonymous. Anonymous access does not require an individual authenticated account, whereas non-anonymous access uses the user's account details.
- HTTP transfers web requests and responses. HTTPS provides the secure form of HTTP.
- SMTP is used for sending email. POP3 is used for retrieving email.
- SSH allows secure remote login and remote management. An SSH client can make a TCP connection to a remote port, send commands using an application-level protocol, log in securely and execute commands on the remote computer.
An email server is involved in sending and retrieving email. A web server serves web pages in text form. A web browser requests the page and its resources, then renders them appropriately.
IP addressing and network configuration
An IP address is divided into a network identifier and a host identifier. A subnet mask identifies which part is the network identifier, allowing a network to be divided into subnets. IPv4 and IPv6 are the two current IP standards; IPv6 was introduced because of the need for a newer address standard. A routable public IP address can be used for communication across networks, while a non-routable private IP address is used within a private network.
DHCP provides the system for configuring devices with network settings. NAT translates between private and public addressing, allowing private-network devices to communicate using a public address. Port forwarding directs incoming communication arriving at a public address and port to an appropriate device or service on the private network.
Client-server and web applications
In the client-server model, the client sends a request message and the server replies with a response message. WebSockets establish a persistent, full-duplex socket connection between a browser and a server over TCP. Both parties can send data at any time, which is useful when communication must continue rather than consist only of separate request-response exchanges.
CRUD means Create, Retrieve, Update and Delete. REST maps these operations to HTTP methods and database functions:
| CRUD operation | HTTP method | Database function | |---|---|---| | Create | POST | INSERT | | Retrieve | GET | SELECT | | Update | PUT | UPDATE | | Delete | DELETE | DELETE |
A REST API runs on the server. JavaScript in the browser calls the API through HTTP. JSON or XML can transmit data between the server and web application. Compared with XML, JSON is easier for a human to read, more compact, easier to create and easier for computers to parse, so it can be quicker to parse.
Thin and thick clients
A thin client relies more heavily on a server for processing or services. A thick client performs more processing on the client computer. The comparison should consider where processing takes place and how much work is performed by the client and server.
Common errors
Do not confuse an IP address with a MAC address: IP addressing belongs to the network layer, while MAC addresses are used at the link layer. Do not treat HTTP and HTTPS as identical: HTTPS is the secure form of HTTP. Do not swap SMTP and POP3: SMTP sends email and POP3 retrieves it. Do not describe a WebSocket as a single request followed by a response; its TCP connection is persistent and full-duplex. Finally, do not confuse REST methods: GET retrieves, POST creates, PUT updates and DELETE deletes.
Related topics
