Computer Networks Mid-Term Review
Chapter 1: Computer Networks and the Internet
1.1 Basic Concepts
- End Systems: Devices at the network’s edge, such as computers, smartphones, and IoT devices, that initiate or terminate data communication.
- Hosts: Any device with an IP address capable of sending or receiving data over a network, including servers, personal computers, and mobile devices.
- Network Edge: Comprises end systems and the access networks that connect them to the broader network, including routers, modems, and access points.
- Network Core: The central part of a network, consisting of high-speed routers and switches that facilitate data transmission across various network segments.
1.2 Network Devices and Cables
- Routers: Devices that forward data packets between different networks based on their IP addresses, determining optimal paths for data transmission.
- Switches: Operate at the data link layer to manage and forward frames within a local network, using MAC addresses to direct data to its destination.
- Hubs: Simple devices that broadcast incoming data to all connected devices in a LAN, operating at the physical layer without filtering traffic.
Types of Cables:
- Twisted-Pair Cables (UTP, STP): Consist of pairs of copper wires twisted together to reduce electromagnetic interference; commonly used in Ethernet networks.
- Coaxial Cables: Feature a central conductor surrounded by insulation and shielding; used in older networks and cable television systems.
- Fiber Optic Cables: Transmit data as light pulses through glass or plastic fibers, offering high-speed and long-distance communication with immunity to electromagnetic interference.
1.3 LAN vs. WAN
Local Area Network (LAN):
- Scope: Covers a small geographical area, such as a home, office, or building.
- Transmission Medium: Utilizes Ethernet (wired) or Wi-Fi (wireless) technologies.
- Characteristics: Offers high data transfer rates with low latency; typically owned and managed by a single organization.
Wide Area Network (WAN):
- Scope: Spans large geographical areas, such as cities, countries, or continents.
- Transmission Medium: Employs leased communication lines, satellite links, or public networks like the Internet.
- Characteristics: Connects multiple LANs; generally slower data transfer rates compared to LANs; often managed by multiple organizations or service providers.
1.4 Network Models
OSI Model (7 Layers)
- Physical Layer: Handles the transmission of raw bit streams over physical media, including cables and radio frequencies.
- Data Link Layer: Manages node-to-node data transfer, error detection, and correction; organizes data into frames and handles MAC addressing.
- Network Layer: Responsible for logical addressing (IP addresses) and routing packets between networks.
- Transport Layer: Ensures reliable data transfer, error recovery, and flow control between end systems; protocols include TCP and UDP.
- Session Layer: Establishes, manages, and terminates sessions between applications.
- Presentation Layer: Translates data between the application layer and the network, handling data encryption, compression, and translation.
- Application Layer: Provides network services directly to user applications, such as HTTP for web browsing and FTP for file transfers.
TCP/IP Model (4 Layers)
- Link (Network Interface) Layer: Combines the OSI model’s Physical and Data Link layers; handles hardware addressing and local network protocols.
- Internet Layer: Corresponds to the OSI’s Network layer; manages logical addressing and routing using the IP protocol.
- Transport Layer: Similar to the OSI Transport layer; ensures end-to-end communication and data integrity using protocols like TCP and UDP.
- Application Layer: Encompasses the OSI’s Session, Presentation, and Application layers; includes protocols such as HTTP, SMTP, and DNS.
1.5 Data Encapsulation
- Definition: The process of wrapping data with protocol-specific headers (and sometimes trailers) as it moves down the layers of the OSI or TCP/IP model before transmission over the network.
Encapsulation Process:
- Application Layer: Data generated by applications (e.g., HTTP requests).
- Transport Layer: Encapsulates data into segments (TCP) or datagrams (UDP), adding source and destination port numbers.
- Network Layer: Encapsulates segments into packets, adding source and destination IP addresses.
- Data Link Layer: Encapsulates packets into frames, adding MAC addresses and error-checking information.
- Physical Layer: Converts frames into bits for transmission over the physical medium.
Example: An HTTP request is generated by a web browser (Application Layer), encapsulated into a TCP segment (Transport Layer), then into an IP packet (Network Layer), further into an Ethernet frame (Data Link Layer), and finally transmitted as bits over a physical medium like twisted-pair cable (Physical Layer).
1.6 Protocol Data Units (PDUs)
Each layer of the OSI model has a specific PDU that it processes:
| OSI Layer |
Protocol Data Unit (PDU) |
| Application |
Data |
| Transport |
Segment (TCP) / Datagram (UDP) |
| Network |
Packet |
| Data Link |
Frame |
| Physical |
Bits |
Chapter 2: Application Layer
2.1 Application Layer Functions
The Application Layer is the topmost layer in both the OSI and TCP/IP models. It serves as the interface between end-users and the network, facilitating various network services. Key functions include:
- Network Virtual Terminal: Allows a user to log on to a remote host.
- File Transfer, Access, and Management (FTAM): Enables users to access files in a remote host, retrieve files from a remote computer for use in the local computer, and manage or control files in a remote computer locally.
- Mail Services: Provides the basis for email forwarding and storage.
- Directory Services: Provides distributed database sources and access for global information about various objects and services.
2.2 Common Application Layer Protocols
Several protocols operate at the application layer, each designed for specific functionalities:
- HTTP (Hypertext Transfer Protocol): The foundation of data communication on the World Wide Web. It defines how messages are formatted and transmitted, and how web servers and browsers should respond to various commands.
- FTP (File Transfer Protocol): Used for transferring files between computers on a network. It allows users to upload and download files, manage directories, and perform other file-related operations.
- SMTP (Simple Mail Transfer Protocol): A protocol for sending email messages between servers. Most email systems that send mail over the Internet use SMTP to send messages from one server to another.
- POP3 (Post Office Protocol 3): Used by local email clients to retrieve emails from a remote server over a TCP/IP connection. POP3 downloads emails from the server to the local computer and usually deletes them from the server.
- IMAP (Internet Message Access Protocol): Allows users to access and manipulate their email messages on the server without downloading them to the local computer. This enables management of emails from multiple devices.
- DNS (Domain Name System): Translates human-friendly domain names (like www.example.com) into IP addresses that computers use to identify each other on the network.
- DHCP (Dynamic Host Configuration Protocol): Automatically assigns IP addresses and other network configuration parameters to devices on a network, enabling them to communicate effectively.
2.3 Email Protocols
Email communication relies on specific protocols to handle the sending, receiving, and accessing of messages:
- SMTP (Simple Mail Transfer Protocol): Used for sending emails from a client to a server or between servers. Operates over port 25.
- POP3 (Post Office Protocol 3): Retrieves emails from the server to the local computer, typically removing them from the server after download. Operates over port 110.
- IMAP (Internet Message Access Protocol): Allows users to view and manage emails directly on the mail server, facilitating access from multiple devices. Operates over port 143.
- HTTP/HTTPS (Hypertext Transfer Protocol / Secure): Used by web-based email services (like Gmail, Outlook) to access and manage emails through web browsers.
2.4 Domain Name System (DNS)
The Domain Name System (DNS) is a hierarchical and decentralized naming system that translates domain names into IP addresses. Its structure includes:
- Root DNS Servers: The top-level DNS servers that contain information about top-level domains (TLDs).
- Top-Level Domains (TLDs): The highest level of domain names, such as .com, .org, .net, etc.
- Authoritative Name Servers: Servers that hold DNS records for specific domains and respond to queries about them.
- Local DNS Resolver: A server within an ISP or organization that caches DNS query results to speed up subsequent requests.
2.5 File Distribution Models
There are two primary models for distributing files over a network:
Client-Server Model
- Structure: A central server stores files, and clients request access to these files.
- Characteristics: The server manages resources and security, ensuring controlled access and centralized management.
Peer-to-Peer (P2P) Model
- Structure: Each device (peer) acts as both a client and a server, sharing files directly with other peers without a central server.
- Characteristics: Offers decentralized resource sharing, scalability, and robustness. Commonly used in file-sharing applications like BitTorrent.
Chapter 3: Transport Layer
3.1 Comparison of OSI and TCP/IP Models
The Transport Layer plays a crucial role in both the OSI and TCP/IP models, facilitating end-to-end communication between devices.
OSI Model:
- Structure: Comprises seven layers—Physical, Data Link, Network, Transport, Session, Presentation, and Application.
- Transport Layer (Layer 4): Ensures reliable data transfer, error detection and correction, and flow control.
TCP/IP Model:
- Structure: Consists of four layers—Link, Internet, Transport, and Application.
- Transport Layer: Provides communication services directly to the application processes running on different hosts.
Key Differences:
- Layer Count: OSI has 7 layers; TCP/IP has 4 layers.
- Protocol Independence: OSI is protocol-independent; TCP/IP is designed around standard protocols like TCP and IP.
- Standardization: OSI serves as a theoretical framework; TCP/IP is practical and widely implemented.
3.2 Data Units in the Transport Layer
The Transport Layer uses specific Protocol Data Units (PDUs) to manage data transmission:
- Segment: Used in TCP communications; a segment is a chunk of data with TCP headers, ensuring reliable transmission.
- Datagram: Used in UDP communications; a datagram is a self-contained message sent without establishing a connection, suitable for applications where speed is crucial, and occasional data loss is acceptable.
3.3 Role of the Transport Layer
The Transport Layer is responsible for several critical functions:
- End-to-End Communication: Facilitates direct data transfer between source and destination devices, managing data flow and ensuring complete data exchange.
- Error Recovery: Detects and corrects errors that occur during data transmission, ensuring data integrity.
- Flow Control: Manages the rate of data transmission between devices to prevent overwhelming the receiver, ensuring efficient data flow.
- Multiplexing: Allows multiple applications to transmit data over the network simultaneously by assigning unique port numbers, ensuring data reaches the correct application.
3.4 TCP vs. UDP
Two primary protocols operate at the Transport Layer:
Transmission Control Protocol (TCP):
- Reliability: Ensures data is delivered accurately and in sequence, retransmitting lost packets.
- Connection: Establishes a connection-oriented session between sender and receiver before data transfer.
- Speed: Generally slower due to error-checking and connection establishment processes.
- Use Cases: Suitable for applications where data integrity is crucial, such as web browsing (HTTP), email (SMTP), and file transfers (FTP).
User Datagram Protocol (UDP):
- Reliability: Does not guarantee delivery, order, or error correction; suitable for applications that can tolerate some data loss.
- Connection: Connectionless; sends data without establishing a session, reducing latency.
- Speed: Faster due to the absence of connection setup and error-checking mechanisms.
- Use Cases: Ideal for time-sensitive applications like live streaming, online gaming, and Voice over IP (VoIP), where speed is prioritized over reliability.
3.5 Switching Mechanisms
Data transmission in networks utilizes different switching techniques:
Packet Switching:
- Method: Divides data into packets that are transmitted independently over the network.
- Characteristics: Efficient use of network resources; packets may take different paths and arrive out of order, requiring reassembly.
- Usage: Commonly used in modern networks, including the Internet, due to its flexibility and efficiency.
Circuit Switching:
- Method: Establishes a dedicated communication path between sender and receiver for the duration of the session.
- Characteristics: Provides consistent and ordered data transmission; inefficient for data networks due to resource dedication.
- Usage: Traditionally used in telephone networks where a constant connection is required.
3.6 Port Numbers
Port numbers are essential for directing data to the correct application on a device.
Common Port Numbers:
- HTTP: Port 80; used for web traffic.
- HTTPS: Port 443; used for secure web traffic.
- FTP: Port 21; used for file transfers.
- DNS: Port 53; used for domain name resolution.
- SMTP: Port 25; used for sending emails.
These standardized port numbers ensure that data is directed to the appropriate application services on a device.
3.7 TCP and UDP Segment Structure
Understanding the structure of TCP and UDP segments is vital for analyzing data transmission.
TCP Segment Fields:
- Source Port: Identifies the sending application.
- Destination Port: Identifies the receiving application.
- Sequence Number: Indicates the position of the segment’s data in the overall message, ensuring correct sequencing.
- Acknowledgment Number: Confirms receipt of data and indicates the next expected byte.
- Flags: Control bits (e.g., SYN, ACK, FIN) that manage connection states and control information.
- Checksum: Provides error detection to ensure data integrity.