VJC Chapter 26 Fundamentals of Computer Networks (Part 2)
Uploaded by cheesemuffin · 10 December 2025
Preview
Text from the first pagesVJC/H2Computing/9569 Chapter 26 Fundamentals of Computer Networks (Part 2) Content 1 Introduction 2 Computer Network Architecture: Client and Server Processes 2.1 Client-server Architecture 2.2 Peer-to-peer (P2P) Architecture 2.3 Hybrid Architecture 3 The Interface Between the Process and the Computer Network 3.1 Socket Communication 3.2 IP addresses and Ports 3.3 TCP Socket API 4 Socket Programming 4.1 Python’s Socket Module 4.2 Unicode and Encodings 4.3 Sockets 4.4 How to Create a Basic Client and Server 4.5 How to Design a Protocol 4.6 How to Create Iterative Servers 4.7 Writing a Chat Program 4.8 Writing a Turn-Based Game Annex - Dynamic Host Configuration Protocol Syllabus Learning Outcomes 4.1 Fundamentals of Computer Networks Understand computer network technology 4.1.5 Explain client-server architecture. 4.1.6 Implement an iterative server with socket programming. Given the server code, students should be able to implement the client code for a given scenario, and vice-versa, e.g. for a tic-tac-toe game. 1
VJC/H2Computing/9569 1 Introduction When we use the internet, we often use a web browser such as Internet Explorer, Firefox, or Chrome. The web browser is an example of an application, meaning a program used by the end user. It is also referred to as a client because it starts the exchange of information. It requests web pages from a web server, which is a different program running on another device. A server serves the information requested by the client. This is the client-server model, and most programs that access the internet follow it. Applications such as email, file transfer, media streaming, and online games all communicate via the internet with their respective servers. In peer-to-peer networking, each device can act as a client requesting files from another device, as a server sharing files with another device, or as both simultaneously. Messages sent between the application (i.e. the client) and the server use a specific protocol designed for the application. The application layer provides these protocols. 2 Computer Network Architecture: Client and Server Processes A network application consists of pairs of processes that send messages to each other over a network. For each pair of communicating processes, we typically label one of the two processes as the client and the other process as the server. In a Web application, a browser is a client process, and a Web server is a server process. A browser process initialises contact with a Web server process. Hence, the browser process is the client, and the Web server process is the server. In a Peer-to-peer (P2P) file-sharing system, a file is transferred from a process in one peer to a process in another peer. The peer that is downloading the file is labelled as the client, and the peer that is uploading the file is labelled as the server. A process can be both a client and a server. For example, a process in a P2P file-sharing system can both upload and download files. When Peer A asks Peer B to send a specific file, Peer A is the client and Peer B is the server in the context of this specific communication session. Sometimes, we also use the terminology “client side and server side of an application.” In the context of a communication session between a pair of processes, the process that initiates the communication is labelled as the client. The process that waits to be contacted to begin the session is the server. 2
VJC/H2Computing/9569 2.1 Client-server Architecture Source: Kurose, J., & Ross, K. (2016). Computer Networking: A Top-Down Approach (7th ed.). Pearson. In a client-server architecture, there is an always-on host, called the server, which services requests from many other hosts, called clients. A classic example is the Web application for which an always-on Web server services requests from browsers running on client hosts. When a Web server receives a request for an object from a client host, it responds by sending the requested object to the client host. The clients, i.e. the web browsers in this case, do not directly communicate with each other. Another characteristic of the client-server architecture is that the server has a fixed, well-known address called an IP address. Because the server has a fixed, well-known address, and because the server is always on, a client can always contact the server by sending a packet to the server’s IP address. Some of the better-known applications with a client-server architecture include the Web, FTP, Telnet and e-mail. Often in a client-server application, a single-server host is incapable of keeping up with all the requests from clients. For this reason, a data centre, housing a large number of hosts, is often used to create a powerful virtual server. The most popular Internet services such as search engines (e.g. Google, Bing, Baidu), Internet commerce (e.g. Amazon, eBay, Alibaba), Web-based email (e.g. Gmail and Yahoo Mail), social networking (e.g. Facebook, Instagram, Twitter, and WeChat) employ one or more data centres. Google, for example, has 30 to 50 data centres distributed around the world, which collectively handle search, YouTube, Gmail, and other services. A data centre can have hundreds of thousands of servers, which must be powered and maintained. Additionally, the service providers must pay recurring interconnection and bandwidth costs for sending data from their data centres. 3
VJC/H2Computing/9569 The advantages and disadvantages of a client-server network can be summarised as follows: 2.2 Peer-to-peer (P2P) Architecture Source: Kurose, J., & Ross, K. (2016). Computer Networking: A Top-Down Approach (7th ed.). Pearson. 4
VJC/H2Computing/9569 In a P2P architecture, there is minimal or no reliance on dedicated servers in data centres. Instead, the application exploits direct communication between pairs of intermittently connected hosts, called peers. The peers are not owned by the service provider, but are desktops and laptops controlled by users, residing in homes, universities, and offices. Because the peers communicate without passing through a dedicated server, the architecture is called peer-to-peer. Many of today’s most popular and traffic-intensive applications are based on P2P architectures. These applications include file sharing (e.g. BitTorrent), peer-assisted download accelerati
Content continues in the PDF. Download PDF
Related notes
- NYJC 2026 Prelim P2Exam Papers · 2026
- NYJC 2026 Prelim P1Exam Papers · 2026
- DHS 2026 Y6 H2 Computing Prelim Paper 2_finalExam Papers · 2026
- ACJC 2026 JC2 Computing Prelim Paper 2 (Practical)Exam Papers · 2026
- 2026_NJC Prelim_Computing_P2.pdfExam Papers · 2026
- 2026_JPJC_Computing_Prelim_P2_finalExam Papers · 2026
- 2026_JPJC_Computing_Prelim_P1_markschemeExam Papers · 2026
- 2026_JPJC_Computing_Prelim_P1_finalExam Papers · 2026
- 2026 ACJC Prelim Computing Paper 2Exam Papers · 2026
- 2024 ACJC Computing PromoExam Papers · 2024
- 2023 ACJC Promo QPExam Papers · 2023
- 2022 ACJC Computing Promo Paper 2Exam Papers · 2022
- See all H2 Computing notes

