Network Services and Implementation

Hey everyone! Welcome to your study notes for "Network Services and Implementation". Ever wondered how you can instantly watch a video on your phone, share files with a friend for a project, or even just connect to the Wi-Fi at home? This chapter pulls back the curtain on how it all works!

We'll explore how computers "talk" to each other (the client-server model) and then get practical by learning how to set up a simple network and share things like files, printers, and web applications. It might sound technical, but we'll break it down with simple examples. Let's get started!

Part 1: How Computers Talk - Client-Server Communication

At the heart of the internet and most networks is a simple idea: one computer asks for something, and another computer gives it. This is the client-server model.

1.1 The Client and the Server: A Restaurant Analogy

Imagine you're at a restaurant. You are the customer, and you want to order food. The waiter and the kitchen are there to serve you.

The Client: This is YOU! In the computer world, the client is your device (your computer, phone, tablet) running a program that requests a service or information. For example, when you type a website address into your browser, your browser program is acting as a client.

The Server: This is the waiter and the kitchen. A server is a computer running dedicated software that holds information or provides services that clients want. It continuously listens for incoming requests, processes them, and responds by sending data back. The website you want to visit lives on a server.

So, the roles are simple:
Client = Asks for things (makes requests)
Server = Provides things (sends responses)

1.2 Sockets, Ports, and the Request-Response Cycle

When a client communicates with a server, two network processes (programs) connect using an endpoint called a socket, which is a combination of an IP address and a port number (e.g., 192.168.1.10:80).

TCP Port Numbers: Finding the Right Department

Imagine a server is a giant office building. The server's IP address is like the building's street address. But how do you find the right department inside? That's where port numbers come in! A port number is a 16-bit number attached to a connection request to direct it to the correct service running on the server.

• Web browsing (HTTP): Port 80
• Secure web browsing (HTTPS): Port 443
• Sending email (SMTP): Port 25
• Receiving email (POP3): Port 110 / (IMAP): Port 143
• File Transfer Protocol (FTP): Port 20 (Data) / Port 21 (Control)
• Secure File Transfer Protocol (SFTP / SSH): Port 22

Did you know? There are \(2^{16} = 65\text{,}536\) possible TCP port numbers, numbered from \(0\) to \(65\text{,}535\). Ports \(0\) to \(1023\) are known as "well-known ports" reserved for standard system services.

HTTP Requests: GET vs. POST

Web clients and web servers communicate using HTTP requests and responses:

GET Request: Used to retrieve data from the server. Data parameters are appended directly in the URL query string (e.g., search?query=hkdse). It is visible in browser history and bookmarkable, but unsuitable for sensitive data.

POST Request: Used to send or submit data to the server for processing (e.g., submitting passwords, user registration, or file uploads). Data is transmitted inside the HTTP message body, making it more secure and capable of carrying larger payloads.

Memory Aid: Think GET = "Go and get me something!" and POST = "Take this information I'm posting inside an envelope!".

1.3 The Super-Servers: Meet the Team!

A network relies on different types of servers, each performing a specialized role:

DHCP Server (Dynamic Host Configuration Protocol): The Address Giver. Automatically assigns dynamic IP addresses, subnet masks, default gateways, and DNS server addresses to client devices when they connect to the network.

Domain Controller: The Security Guard. Centralizes user account authentication, password management, and access control policies across a domain network (e.g., allowing a student to log in to any school desktop with the same credentials).

File Server: The Central Vault. Stores files centrally so authorized network users can share, store, and back up documents via network file sharing protocols (such as SMB/CIFS or NFS).

FTP / SFTP Server: The File Transporter. Dedicated to uploading and downloading files across networks. While standard FTP transfers credentials and files in plaintext, SFTP encrypts commands and data via SSH for secure remote file transfers.

Print Server: The Queue Master. Connects printers to the network, manages incoming print jobs in a spool/queue, and eliminates the need for every client computer to be physically wired to a printer.

Mail Server: The Post Office. Handles email delivery using SMTP (Simple Mail Transfer Protocol) for sending mail between servers, and POP3 (Post Office Protocol) or IMAP (Internet Message Access Protocol) for clients downloading or syncing mail.

Proxy Server: The Middleman. Intercepts client web requests to provide web caching (speeding up access to popular pages), URL filtering (blocking restricted sites), and hiding internal client IP addresses for security.

Web Server & Database Server: The Dynamic Duo. A Web Server (e.g., Apache, Nginx, IIS) hosts web files (HTML, CSS, JavaScript, PHP) and delivers them to browsers. A Database Server (e.g., MySQL, PostgreSQL, MariaDB) stores and retrieves structured records for dynamic web applications.

Gateway: The Translator / Exit Door. Connects two distinct networks with different protocols and subnets, such as routing traffic between a local home network (LAN) and the wider Internet (WAN).


Part 2: Building Your Own Network - Basic Implementation

Now that we know the theory, let's look at how to implement a network and share resources securely.

2.1 Getting Connected: Ethernet vs. Wireless

Ethernet (Wired): Connects computers using physical cables (e.g., Cat 5e/Cat 6 UTP cables) into a switch or router. Offers high bandwidth, low latency, and resistance to radio interference.

Wireless (Wi-Fi): Connects devices over radio frequencies through a Wireless Access Point (WAP) or wireless router, offering mobility for laptops and mobile devices.

Ad hoc Network: A decentralized, peer-to-peer wireless connection created directly between two or more devices without requiring an intermediate router or access point (useful for quick local file exchanges).

2.2 Resource Sharing & File Sharing Protocols

Networks allow users to share essential hardware and data resources:

Shared Folders (OS-level / SMB): Built-in operating system folder sharing lets network users browse and edit files in real time over the LAN as if they were local files.

FTP / SFTP Services: Ideal for transferring large batches of files or updating web files on remote hosting servers over the Internet.

Network Printers: Multiple users send print jobs over the LAN to a shared printer managed by a print server, optimizing hardware usage.

Internet Sharing: A router acts as a default gateway and NAT (Network Address Translation) device to share a single public IP broadband connection among multiple private LAN devices.

2.3 Who Can Do What? Permissions and Access Control

To protect shared folders and files from unauthorized access or accidental deletion, network administrators configure permissions based on the Principle of Least Privilege (giving users only the minimum access necessary to perform their work).

Standard Permission Types:
Read: Allows viewing folder contents, opening files, and viewing attributes without modifying them.
Write: Allows creating new files, modifying existing file contents, and overwriting data.
Execute: Allows running executable programs or script files.
Full Control / Modify: Combines read, write, execute, delete, and the ability to change access permissions.

User Groups & Permission Inheritance:
Instead of assigning rights to each student individually, administrators create User Groups (e.g., Administrators, Teachers, Students, Guests) and assign permissions to the whole group. Files placed inside a shared folder typically receive inherited permissions from the parent folder.

2.4 Implementing Simple Network Services (Web & Database)

For practical school projects or local testing, students can set up local web and database services:

Local Web Server: Running server software (such as Apache, Nginx, or Node.js) on a local machine to test web pages and server-side scripts locally via http://localhost or the local IP address before public deployment.

Local Database Server: Setting up a database service (such as MySQL or MariaDB) on the same host or on another machine within the LAN, enabling web applications to execute SQL queries to store and manage dynamic data.

Key Takeaway for Part 2: Networks enable the sharing of files, printers, and internet access across wired (Ethernet) and wireless media. By applying appropriate file permissions (Read, Write, Execute), user groups, and secure protocols (like SFTP and HTTPS), network resources remain accessible, organized, and secure.