0. Network Architecture
Network architecture refers to the design and structure of a network, which defines how devices (nodes) communicate with each other, the types of roles they play, and the technologies they use. The primary purpose of network architecture is to establish clear communication pathways, efficiently manage resources, and ensure scalability and security in data transmission.
0.1 Network Topologies
A fundamental aspect of network architecture is the topology, which defines the layout and connection structure of nodes in a network. Common topologies include:
- Bus Topology: All devices are connected to a single communication line (bus). Data sent by one node is received by all other nodes, though only the intended recipient processes it.
- Star Topology: All devices are connected to a central hub. The hub manages communication between the nodes and is a single point of failure.
- Ring Topology: Each node is connected to exactly two other nodes, forming a circular pathway. Data travels in a loop, and each node checks if the data is intended for it.
- Mesh Topology: Each node connects to multiple other nodes, allowing for multiple communication paths, increasing redundancy and reliability.
0.2 Protocols
Protocols are the rules and standards that define how data is transmitted across a network. Protocols enable different devices and systems to communicate effectively. Important protocols include:
- Transmission Control Protocol (TCP): Ensures reliable, ordered, and error-checked delivery of data between applications over the network.
- Internet Protocol (IP): Provides addressing and routing of packets between devices across networks, typically used alongside TCP.
- Hypertext Transfer Protocol (HTTP): Used for transmitting web pages over the internet.
- Simple Mail Transfer Protocol (SMTP): Protocol for sending email between mail servers.
- File Transfer Protocol (FTP): Protocol used for transferring files between client and server on a network.
0.3 Network Layers (OSI Model)
The OSI (Open Systems Interconnection) model breaks down network communication into seven layers, each handling a specific part of the transmission process. These layers include:
- Physical Layer: Deals with the physical connection between devices and the transmission of raw data over the medium (e.g., cables, fiber optics).
- Data Link Layer: Ensures error-free transmission between adjacent network nodes and manages access to the physical medium.
- Network Layer: Handles logical addressing (IP addresses) and routing of packets across the network.
- Transport Layer: Manages end-to-end data transmission, flow control, and error recovery. TCP operates at this layer.
- Session Layer: Establishes, manages, and terminates communication sessions between applications.
- Presentation Layer: Translates data formats between application and network formats, ensuring correct interpretation of data (e.g., encryption, compression).
- Application Layer: Provides network services directly to applications, like email (SMTP), web browsing (HTTP), and file transfer (FTP).
0.4 Wired vs. Wireless Networks
Network architecture can also be distinguished by the transmission medium used:
- Wired Networks: Use physical cables (e.g., Ethernet) to connect devices. Wired connections are often faster and more stable, with lower interference.
- Wireless Networks: Use radio waves (e.g., Wi-Fi) to connect devices without cables. Wireless networks provide flexibility and mobility but are generally more prone to interference and security risks.
0.5 Network Devices
Various hardware devices are integral to network architecture, facilitating communication, data routing, and security:
- Router: Directs data packets between networks by analyzing destination IP addresses and determining the optimal path.
- Switch: Connects multiple devices within the same network, forwarding data only to the intended device based on MAC addresses.
- Hub: Broadcasts data to all devices connected to it, regardless of the intended recipient.
- Firewall: Monitors and controls incoming and outgoing network traffic based on predefined security rules.
- Access Point (AP): Extends wireless coverage in a network by allowing wireless devices to connect to the wired infrastructure.
0.6 Network Security
Security is a critical concern in network architecture to ensure the confidentiality, integrity, and availability of data. Key security practices include:
- Encryption: Data is encoded during transmission so only authorized recipients can decrypt and understand it.
- Firewalls: Control traffic between networks and enforce security policies, preventing unauthorized access.
- Virtual Private Network (VPN): Establishes a secure, encrypted tunnel over a public network, allowing users to access a private network securely.
- Intrusion Detection/Prevention Systems (IDS/IPS): Monitor network traffic for malicious activity or policy violations.
- Access Control: Ensures only authorized users can access network resources, using methods like passwords, biometrics, and two-factor authentication.
1. Network Architecture: Client-Server Architecture
Network architecture refers to the framework for data communication between computers. One of the most common models in network architecture is the client-server architecture. It is widely used in modern systems for organizing network communication efficiently.
1.1 Client-Server Architecture
In the client-server model, two types of machines interact:
- Client: A client is a device (typically a computer or application) that requests services or resources from a server. Clients initiate communication.
- Server: A server is a device (or software) that provides resources, data, or services to the clients. Servers listen for incoming requests and respond accordingly.
The client-server architecture is typically employed in systems requiring centralized data processing and management, such as web servers, databases, and file sharing systems.
1.2 Key Characteristics
- Centralized Control: The server manages the resources and services, ensuring a single point of control.
- Scalability: Servers can handle multiple clients simultaneously, making it easier to scale by adding more server resources.
- Client Independence: Clients are independent from one another and from the server. They can perform tasks independently and only connect to the server when needed.
- Security: Servers provide a central point to implement security measures like authentication and access control.
- Resource Sharing: The server hosts resources that multiple clients can access, leading to efficient sharing of services like databases, websites, or applications.
1.3 Communication Flow
The communication in client-server architecture follows a request-response pattern:
- Request: The client sends a request to the server for a specific service (e.g., retrieving a webpage or accessing a database).
- Processing: The server processes the client’s request by performing operations like computation, data retrieval, or executing specific actions.
- Response: The server sends back a response containing the requested data or a status message (e.g., success or failure).
1.4 Advantages
- Centralized Management: The server offers centralized management, which simplifies tasks like software updates, backups, and security policy enforcement.
- Ease of Maintenance: Since the server manages resources, administrators can perform updates or fixes without impacting client machines directly.
- Resource Efficiency: Servers allow for efficient use of resources by serving multiple clients without needing separate instances for each.
1.5 Challenges
- Single Point of Failure: If the server goes down, all clients depending on it may lose access to services.
- Server Overload: High demand can overwhelm the server if it’s not designed to handle multiple simultaneous requests.
- Cost: Setting up and maintaining a robust server infrastructure can be expensive compared to peer-to-peer networks.
1.6 Common Applications
- Web Servers: A central server stores and serves web pages to client browsers.
- Email Servers: Manage email storage and provide clients (like Outlook or Gmail) access to send and retrieve emails.
- Database Servers: Store large datasets and allow multiple clients to query and retrieve data.
1.7 Types of Client-Server Architectures
1.7.1 Two-Tier Architecture
In a two-tier architecture, the client directly communicates with the server. This model is simpler but can become inefficient as the number of clients increases. Example: Database client applications.
1.7.2 Three-Tier Architecture
In this architecture, an intermediate layer (often called a middleware) exists between the client and the server. This layer performs tasks like load balancing, authentication, and caching. Example: Web applications where the client communicates with a web server, which in turn queries a database server.
1.7.3 N-Tier Architecture
In N-tier architectures, multiple layers exist between clients and servers, often used in complex enterprise systems to separate functionalities like user interface, business logic, and data storage. Example: Enterprise-level ERP systems.
2. Peer-to-Peer (P2P) Architecture
The Peer-to-Peer (P2P) architecture is a decentralized model where each device (peer) in the network functions both as a client and a server. Unlike the client-server model, there is no central server managing resources. Instead, all peers can request and provide resources to each other directly.
2.1 Key Characteristics of P2P Architecture
- Decentralization: No central server is required. Every peer in the network shares resources equally.
- Distributed Resource Sharing: Resources like files, bandwidth, or processing power are distributed among all peers in the network.
- Scalability: P2P networks are highly scalable since adding more peers increases both resource availability and capacity.
- Resilience: The network is more resilient because if one or more peers fail, others can still share resources, avoiding a single point of failure.
2.2 Communication Flow in P2P Networks
In a P2P architecture, peers communicate directly with each other, without a central server acting as an intermediary:
- Resource Discovery: Peers locate and connect to other peers in the network through decentralized protocols like Distributed Hash Tables (DHTs) or broadcast messages.
- Direct Data Transfer: Once a connection is established, data (e.g., files, streams) is transferred directly between peers.
- Request and Response: Every peer can both request and provide resources. For example, in file-sharing networks, a peer may download parts of a file from multiple peers and, at the same time, upload parts to others.
2.3 Advantages of P2P Architecture
- Cost Efficiency: Since there is no need for central servers, the cost of infrastructure is significantly reduced.
- Redundancy and Fault Tolerance: The decentralized nature provides high fault tolerance. If one peer fails, others can take its place.
- Load Distribution: Load is distributed across all peers rather than being concentrated on a central server, reducing bottlenecks.
- Scalability: As more peers join, the network grows in both size and resource availability without adding centralized hardware.
2.4 Challenges of P2P Architecture
- Security: The lack of central control makes it harder to enforce security policies, leading to issues such as unauthorized access, data manipulation, and the spread of malware.
- Data Integrity: Since peers can provide resources, ensuring data integrity (i.e., no corrupted or malicious data) can be difficult without a trusted central authority.
- Unpredictable Performance: Performance depends on the availability and reliability of peers, which can fluctuate over time.
- Network Management: Managing and monitoring a decentralized network is more complex than with centralized client-server networks.
2.5 Types of P2P Networks
2.5.1 Pure P2P Networks
In pure P2P networks, every peer is equal, and there is no central server or authority involved. Peers independently find each other and exchange resources. Examples include early versions of file-sharing networks like Gnutella.
2.5.2 Hybrid P2P Networks
In hybrid P2P networks, some form of central authority exists to facilitate peer discovery or manage specific tasks, but peers still exchange data directly. Examples include modern BitTorrent clients where a central tracker helps peers find each other.
2.5.3 Structured P2P Networks
Structured P2P networks use algorithms (e.g., Distributed Hash Tables or DHT) to organize how peers connect and locate resources. This structure increases efficiency for resource discovery. Example: BitTorrent with DHT for decentralized peer lookup.
2.5.4 Unstructured P2P Networks
Unstructured P2P networks allow peers to connect randomly without a predefined algorithm. While this is simpler to implement, it can lead to inefficiencies in resource discovery, especially in large networks. Example: Gnutella.
2.6 Common Applications of P2P Networks
- File Sharing: P2P is widely used for decentralized file-sharing platforms like BitTorrent, where files are distributed across multiple peers.
- Blockchain: Cryptocurrencies like Bitcoin use a P2P network to maintain decentralized, distributed ledgers without central control.
- VoIP Services: Some VoIP applications like Skype originally used a P2P model to manage voice traffic between users.
- Distributed Computing: Projects like SETI@Home leverage P2P networks to utilize unused processing power from millions of computers around the world.