Purpose of This Lesson
- This lesson provides foundational knowledge of IP (Internet Protocol) and
networking concepts, which are essential for understanding Domain 2 (Networking) of
the A+ exam.
- If you are unfamiliar with networking basics, especially IP, this lesson serves as
a primer for more advanced topics covered later.
Overview of Modern Networks
- Modern networks are designed to transfer information between devices using various methods,
including Ethernet, wireless, and DSL.
- From an IP perspective, the physical transport method (e.g., Ethernet, Wi-Fi) is
less important than the content of the packets being transmitted.
- Networks can be visualized as a series of highways or roads, where
IP acts as the truck carrying data across the network.
Encapsulation and Decapsulation
- Encapsulation is the process of nesting data within multiple layers of protocols
for transmission.
- Decapsulation is the reverse process, where data is unpacked layer by layer upon
arrival.
- Example of data transmission to a web server:
- A client device (e.g., laptop) sends data to a web server
over an Ethernet network.
- The data is wrapped in an Ethernet frame, which includes a
header (start of data) and a trailer (end of data).
- Inside the Ethernet frame is an IP payload with its own IP
header.
- Within the IP payload is a TCP payload (or UDP payload)
with a TCP header.
- For web traffic, the TCP payload contains HTTP (Hypertext Transfer
Protocol) data.
Internet Protocol (IP)
- IP (Internet Protocol) is the primary protocol for data transmission across
networks.
- It acts as the transport mechanism (the "truck") that carries data between devices.
- Within IP packets, two key transport protocols are commonly used:
- TCP (Transmission Control Protocol)
- UDP (User Datagram Protocol)
TCP (Transmission Control Protocol)
- TCP is a connection-oriented protocol, meaning it establishes a formal connection
before data transfer and formally closes it afterward.
- Analogy: TCP works like a phone call, where both parties greet each other before talking and say
goodbye before hanging up.
- Key features of TCP:
- Reliable delivery: Uses acknowledgments to confirm data receipt. If data is
lost or corrupted, the receiver requests a retransmission.
- Flow control: The receiver can request the sender to speed up or slow down
data transmission based on its capacity.
- Error recovery: Detects and corrects errors during transmission.
- TCP is often referred to as an OSI Layer 4 protocol (though the OSI model is not a
focus for the A+ exam).
- Examples of TCP-based applications:
- HTTPS (Hypertext Transfer Protocol Secure) for secure web browsing.
- SSH (Secure Shell) for secure terminal communication.
UDP (User Datagram Protocol)
- UDP is a connectionless protocol, meaning it does not establish a formal connection
before sending data.
- Key features of UDP:
- Unreliable delivery: No acknowledgments are sent, so there is no guarantee
that data will arrive intact or at all.
- No error recovery: Lost or corrupted data is not retransmitted.
- No flow control: The sender transmits data at its own pace without feedback
from the receiver.
- Low overhead: Faster and more efficient than TCP due to the lack of
connection setup and acknowledgment processes.
- Use cases for UDP:
- Real-time applications, such as VoIP (Voice over IP) and
video streaming, where minor data loss is preferable to delays caused by retransmissions.
- DHCP (Dynamic Host Configuration Protocol): Used for automatic IP address
assignment.
- TFTP (Trivial File Transfer Protocol): Used for simple, small file
transfers.
- Applications using UDP may implement their own error recovery or retransmission mechanisms if
needed.
Multiplexing
- Multiplexing allows multiple types of data to be transmitted simultaneously across
a network using TCP or UDP.
- Each type of traffic is assigned a unique port number to ensure it reaches the
correct application on the receiving device.
IP Addresses and Port Numbers
- IP Addresses: Unique identifiers assigned to each device on a network (similar to a
street address for a house).
- Port Numbers: Used to direct data to the correct service or application on a device
(similar to rooms in a house).
- Port numbers range from 0 to 65,535 and are divided into two categories:
- Non-ephemeral (permanent) ports: Typically range from 0 to
1023 and are assigned to well-known services (e.g., HTTP on port
80, HTTPS on port 443).
- Ephemeral (temporary) ports: Typically range from 1024 to
65,535 and are used by client devices for temporary communication sessions.
- Port numbers are not a security mechanism but serve as a reference for directing traffic to the
correct application.
- Example of communication between a client and server:
- The client (IP:
10.0.0.1) sends data to a server (IP: 10.0.0.2)
using:
- HTTP on TCP port 80.
- VoIP on UDP port 5004.
- Email on TCP port 143.
- The client uses a random ephemeral port for each communication session,
while the server uses a well-known port for its services.
Key Takeaways
- IP is the primary protocol for data transmission across networks.
- TCP provides reliable, connection-oriented communication with error recovery and
flow control.
- UDP provides fast, connectionless communication with low overhead, ideal for
real-time applications.
- Port numbers direct data to the correct application on a device, with non-ephemeral
ports used for services and ephemeral ports used for client communication.