Computer Networks Tutorial: LAN to Internet
Networking | Network Devices | LAN | WAN | Internet | Network Protocols | How the Web Works
Contents
1. What Is a Computer Network?
A computer network is a collection of two or more computing devices connected through communication links so that they can exchange data and share resources and services.
For example, when several computers in a school laboratory are connected to a switch, they can communicate with other devices on the network and may share a printer, files, or an Internet connection.
A Simple Computer Network
The communication link may use Ethernet, fibre optics, or wireless technology.
Basic Terms
- Node
- A device or connection point on a network, such as a computer, printer, or router interface.
- Host
- A network-connected device that communicates using network protocols, such as a laptop or server.
- Data
- Information exchanged between devices, such as text, images, files, audio, and video.
- Communication medium
- The path through which data travels, such as a copper cable, fibre-optic cable, or radio signal.
2. Advantages of Computer Networks
Computer networks make communication, information sharing, and resource management easier.
- Resource sharing: Several computers can use a shared printer or storage system.
- File sharing: Users can share documents through a server or authorised network folder.
- Communication: Users can send email, chat, and participate in video conferences.
- Internet sharing: Multiple devices can access the Internet through a suitable network gateway.
- Centralised management: Administrators can manage accounts, permissions, and network resources.
- Backup: Important information can be backed up to central storage or another location.
- Collaboration: Users can work together on shared documents and projects.
- Remote access: Authorised users can access organisational resources from other locations.
- Cost efficiency: Sharing suitable resources can reduce the need to purchase separate equipment for every user.
Example: A school can connect 30 computers to one network and provide access to a shared printer, educational server, and Internet connection.
3. Important Network Devices
A computer network uses different devices to connect equipment, forward data, provide services, and protect communications.
3.1 Switch
A network switch connects multiple devices within a local area network. In a typical Ethernet LAN, it forwards Ethernet frames using learned MAC address information.
Example: Four computers and a file server connect to five separate ports on a switch.
3.2 NIC — Network Interface Card
A NIC is the hardware interface that enables a device to communicate with a network. It may support a wired Ethernet connection or a wireless connection.
Modern laptops and desktop computers often have network interfaces integrated into their mainboards.
Example: A desktop computer uses its Ethernet NIC to connect to a switch through an Ethernet cable.
3.3 Copper Ethernet Cables
Copper Ethernet cables carry electrical signals between compatible network interfaces. Cat5e and Cat6 twisted-pair cables are common examples. RJ45-style connectors are widely used with these cables.
Example: A Cat5e cable connects a computer's Ethernet port to a switch port.
3.4 Fibre-Optic Cables
Fibre-optic cables carry data using light through optical fibres. They are useful for high-capacity links and longer distances, including links between buildings and network distribution points.
Example: A school uses a fibre-optic link between its main building and a second computer laboratory.
3.5 Router
A router forwards IP packets between different IP networks. It uses routing information to determine where packets should be sent next.
Example: A home router forwards traffic between the home LAN and the ISP network.
3.6 Wireless Access Point
A wireless access point (AP) allows Wi-Fi devices to connect to a network. It bridges wireless devices to the relevant network infrastructure.
Example: Students connect their laptops to the school's Wi-Fi access point.
3.7 Servers
A server is a computer or software system that provides services or resources to clients over a network.
- File server
- Stores and provides authorised access to shared files.
- Mail server
- Handles email delivery, sending, or retrieval functions.
- Web server
- Provides web pages and other resources to web clients.
- Database server
- Stores, manages, and processes database requests.
- Print server
- Coordinates access to shared printers and print jobs.
- FTP server
- Provides file-transfer services using FTP. Traditional FTP is not encrypted.
- DNS server
- Answers Domain Name System queries, such as requests to resolve domain names.
- Backup server
- Stores backup copies of important data for recovery.
4. LAN — Local Area Network
A Local Area Network (LAN) connects devices within a relatively limited geographical area, such as a home, classroom, office, school, or computer laboratory.
Ethernet and Wi-Fi are commonly used to connect devices in a LAN. A LAN can provide local communication even when it has no Internet connection.
4.1 How to Construct a LAN
Step 1: Prepare the computers.
Each computer needs a suitable network interface, such as an Ethernet NIC, to connect to a wired LAN.
Step 2: Prepare the Ethernet cables.
Use suitable Ethernet cables with compatible connectors. Cat5e is a common choice for a new basic Ethernet installation.
Step 3: Connect the computers to a switch.
Insert one end of an Ethernet cable into a computer's Ethernet port and the other end into a switch port. Repeat this process for each computer, using a separate switch port and cable.
Step 4: Connect the servers and other devices.
Connect the file server, printer, and other network devices to available switch ports. The devices must also have suitable network configuration and services.
LAN Construction Diagram
Each device connects to an appropriate switch port. The diagram is a simplified logical representation of a physical star topology.
Step 5: Configure the network.
Assign suitable IP addresses, subnet masks or prefixes, and other required settings. DHCP can automatically provide network configuration when a DHCP service is available.
Step 6: Test communication.
Check the physical link indicators, confirm the IP configuration, and test communication between devices. A network administrator may use the ping command where ICMP traffic is permitted.
4.2 How Does a Switch Work?
A switch learns source MAC addresses from received Ethernet frames and builds a MAC address table. It uses that table to forward frames towards the appropriate destination port.
Broadcast traffic and frames with unknown destination addresses may be forwarded to multiple ports within the relevant VLAN.
Example: When PC 1 sends a frame to a known destination on PC 2's port, the switch can forward the frame to that port instead of sending it to every port.
4.3 Client-Server and Peer-to-Peer Networks
- Client-server network
- A client requests a service from a server. For example, a computer requests a document from a file server.
- Peer-to-peer network
- Devices can share resources directly with one another without relying on a dedicated central server for every sharing task.
5. Connecting Two LANs Using Fibre-Optic Cable
Organisations may operate separate LANs in different buildings or sections of a campus. These LANs can be interconnected using suitable network equipment and communication links.
Two LANs Connected by Fibre
LAN A
LAN B
The double arrow represents a suitable fibre-optic uplink between compatible network interfaces.
How the connection is made:
- Connect the devices in LAN A to Switch A.
- Connect the devices in LAN B to Switch B.
- Use compatible optical interfaces and transceivers where required.
- Connect the switches using a suitable fibre-optic cable.
- Configure the link and test connectivity.
Fibre-optic links can provide high bandwidth, support long distances, and resist electromagnetic interference.
6. Connecting a LAN to the Internet
The Internet is a global system of interconnected networks that communicate using the Internet protocol suite. An ISP (Internet Service Provider) provides a service that connects a customer to the provider's network and, typically, to the Internet.
6.1 Basic Internet Connection
LAN to Internet
In this arrangement, computers connect to the switch. The switch connects to a router or gateway, which forwards IP packets towards the ISP. The ISP provides connectivity to other networks.
6.2 Internet Connection with a Separate Firewall
Business Network Example
and Servers
Simplified arrangement. Actual installations may combine firewall, routing, switching, and wireless functions in the same equipment.
- Switch
- Connects devices within the LAN and forwards Ethernet frames.
- Firewall
- Applies security rules to network traffic.
- Router
- Forwards IP packets between networks.
- ISP equipment
- Provides the required physical or logical connection to the provider's network.
- Internet
- Enables communication with external networks, servers, and services.
Depending on the service, the connection may use fibre, cable, telephone-line technology, or a mobile network. A home gateway may combine a router, firewall, switch, and Wi-Fi access point.
6.3 DHCP, DNS and NAT
- DHCP — Dynamic Host Configuration Protocol
- Automatically provides clients with network configuration, such as an IP address and other settings.
- DNS — Domain Name System
- Resolves domain names into DNS records, often including IP addresses needed to reach a service.
- NAT — Network Address Translation
- Translates IP addresses and, in common home-router configurations, may also translate transport-layer port numbers. It is often used to allow multiple private IPv4 devices to share a public IPv4 address.
7. Why Is a Firewall Needed?
A firewall is a security system that monitors and controls network traffic according to a set of rules. It helps prevent unauthorised connections and restricts traffic that should not be allowed.
Important functions include:
- Blocking traffic that violates security rules.
- Allowing required connections to approved services.
- Controlling inbound and outbound traffic.
- Separating networks with different levels of trust.
- Recording relevant traffic events for monitoring and investigation.
- Restricting access to selected devices, services, ports, or applications, depending on firewall capabilities.
Example: A school firewall can allow students to access approved educational websites while restricting unwanted incoming connections to internal computers.
- Hardware firewall
- A physical device or appliance that provides network security functions.
- Software firewall
- A program running on a computer or server that controls network connections.
- Cloud firewall service
- A service that applies security controls to supported cloud or network traffic.
8. Network Protocols
A network protocol is a set of agreed rules that defines how devices or applications exchange information. Different protocols perform different tasks, and several protocols often work together during a single communication.
| Protocol | Purpose | Example |
|---|---|---|
| Ethernet (IEEE 802.3) | Wired LAN communication. | A computer sends an Ethernet frame through a switch. |
| Wi-Fi (IEEE 802.11) | Wireless local area networking. | A laptop connects to a wireless access point. |
| IP | Logical addressing and packet delivery between networks. | A packet travels towards a web server. |
| TCP | Reliable, ordered byte-stream communication. | Commonly used by HTTP/1.1 and HTTP/2. |
| UDP | Datagram communication without TCP's built-in delivery guarantees. | Used by DNS queries and by applications such as QUIC. |
| HTTP | Transfers web resources. | A browser requests a web page. |
| HTTPS | HTTP protected using TLS. | A browser securely connects to a website. |
| DNS | Queries and resolves domain-name records. | Finding address information for a website. |
| DHCP | Automatically provides IP configuration. | A laptop receives its network settings. |
| SMTP | Sends and relays email. | An email system transfers a message. |
| IMAP / POP3 | Accesses or retrieves email. | A user reads email using a mail application. |
| FTP | Transfers files; traditional FTP is unencrypted. | A client uploads a file to an FTP server. |
| SFTP | Secure file transfer over SSH. | A user transfers files securely. |
| SSH | Secure remote access and command execution. | An administrator manages a remote server. |
| ICMP | Network diagnostics and error reporting. | Ping uses ICMP Echo messages where permitted. |
How Do These Protocols Work Together?
Suppose a student opens an HTTPS website. DNS may help the computer find the server's IP address. IP carries packets between networks. HTTPS protects the web communication using TLS. HTTP defines the web request and response, while the transport mechanism depends on the HTTP version.
HTTP/1.1 and HTTP/2 commonly use TCP. HTTP/3 uses QUIC over UDP. Therefore, not every web connection uses exactly the same transport protocol.
9. How Does the Web Work?
The World Wide Web (WWW) is a system of linked resources accessed over the Internet. Websites are commonly accessed using a web browser.
- Web browser
- Software used to access and display web resources, such as Chrome, Firefox, or Edge.
- Web server
- A system that responds to requests for web pages, images, scripts, and other resources.
- URL
- A Uniform Resource Locator identifies the location of a resource, for example https://example.com/.
- Domain name
- A human-readable name used to locate Internet services, such as example.com.
Steps Involved in Opening a Website
How a Website Opens
- The user enters a website address in the browser.
- The browser obtains the necessary destination information, often using DNS.
- The computer sends packets through the LAN and its gateway.
- Routers forward the packets towards the destination service.
- The web server processes the request and returns the appropriate response.
- The browser receives the resources and displays the web page.
Real communication may involve caching, existing connections, multiple routers, content delivery networks, and other optimisations. The return traffic may follow a different route from the outgoing traffic.
10. Internet Services
Internet services are applications and resources available through the Internet. The Internet is the underlying network infrastructure; the Web is one service that operates over it.
- World Wide Web
- Accessing websites, online articles, educational resources, and web applications.
- Sending and receiving electronic messages and attachments.
- File transfer and cloud storage
- Uploading, storing, sharing, and downloading authorised files.
- Instant messaging
- Exchanging messages and files in real time or near real time.
- Video conferencing
- Participating in online classes, meetings, and video calls.
- Media streaming
- Watching videos and listening to audio over a network.
- Online education
- Attending classes, accessing notes, and submitting assignments online.
- E-commerce
- Buying and selling goods or services through online platforms.
- Online banking
- Accessing banking services through authorised websites or applications.
- Online gaming
- Playing games with other users or online game servers.
- Remote access
- Securely accessing a remote computer or network when authorised.
- Internet of Things (IoT)
- Connecting devices such as sensors, smart appliances, and monitoring equipment.
Security tip: When using online banking or other sensitive services, use trusted applications or websites, check the destination carefully, enable multi-factor authentication where available, and never share passwords or one-time codes.
11. IP Address, MAC Address and Gateway
11.1 IP Address
An IP address is a logical address used to identify a network interface for communication using IP.
Example of a private IPv4 address: 192.168.1.10.
11.2 MAC Address
A MAC address is a link-layer address used for communication on technologies such as Ethernet and Wi-Fi. Ethernet switches commonly use source and destination MAC addresses to forward frames within a Layer 2 network.
Illustrative example: 00:1A:2B:3C:4D:5E.
11.3 Subnet Mask
A subnet mask or IP prefix identifies the network portion of an IPv4 address and helps determine whether a destination belongs to the local subnet.
Example: 192.168.1.10/24 identifies an address using a 24-bit network prefix.
11.4 Default Gateway
A default gateway is the router or Layer 3 interface to which a device sends traffic when the destination is outside the device's directly connected IP network and no more specific route applies.
Example: A computer in a home LAN sends traffic for an external website to its configured router.
| Term | Main purpose |
|---|---|
| MAC address | Link-layer delivery on a local network link. |
| IP address | Logical addressing for communication across IP networks. |
| Subnet mask / prefix | Identifies the IP network portion of an address. |
| Default gateway | Provides the next hop for traffic requiring an external route. |
12. Network Topologies
A network topology describes how network devices are arranged or interconnected. A physical topology describes the physical connections, while a logical topology describes how data flows through the network.
- Star topology
- Devices connect to a central switch or other central device. This is common in modern wired Ethernet LANs.
- Bus topology
- Devices share a common communication backbone. Traditional bus networks require suitable termination and are less common in modern LAN installations.
- Ring topology
- Devices are connected in a ring arrangement. Some technologies use ring structures for communication or resilience.
- Mesh topology
- Devices or network nodes have multiple interconnections, which can provide alternative paths when a link fails.
13. Difference Between LAN and WAN
A WAN (Wide Area Network) connects networks across large geographical areas. It can connect branch offices, campuses, data centres, and other networks using long-distance links or service-provider infrastructure.
| Feature | LAN | WAN |
|---|---|---|
| Full form | Local Area Network | Wide Area Network |
| Coverage | Relatively limited area | Large geographical area |
| Example | School computer laboratory | Company offices in different cities |
| Connectivity | Often uses Ethernet and Wi-Fi | May use provider networks, leased links, fibre, or VPNs |
| Management | Often managed by one household or organisation | May involve several organisations and service providers |
| Cost | Often lower for a small local installation | Long-distance connectivity can cost more |
| Performance | Often offers high local speeds and low latency | Depends on link technology, distance, capacity, and congestion |
| Complexity | Often simpler to configure and maintain | Can require more complex routing and management |
Important: Not every LAN is faster than every WAN. Actual speed and latency depend on the technology, distance, equipment, configuration, and network conditions.
The Internet is a global network of interconnected networks. It is commonly described as WAN-scale infrastructure, but the Internet and a private WAN are not exactly the same thing.
14. Advantages and Disadvantages of WAN
Advantages of WAN
- Connects offices in different cities or countries.
- Supports communication and collaboration over long distances.
- Allows authorised users to access shared organisational resources.
- Supports centralised applications and information systems.
- Can enable remote working and access to cloud services.
- Supports off-site backups and disaster recovery when properly designed.
Disadvantages of WAN
- Installation and ongoing connectivity costs may be high.
- Configuration and maintenance can be complex.
- Long-distance communication may have higher latency.
- Congestion or provider problems may reduce performance.
- A failed link may interrupt remote access unless redundancy is provided.
- Connecting more sites can increase security and troubleshooting requirements.
Example: A company with offices in Colombo, Kandy, and Jaffna can use a WAN to connect its branch networks and provide authorised staff with access to shared applications.
15. Basic Network Security
Network security involves protecting network devices, data, services, and users from unauthorised access, misuse, and disruption.
- Strong passwords: Use unique, hard-to-guess passwords.
- Multi-factor authentication: Add another verification factor where supported.
- Software updates: Install security updates for operating systems, applications, and network equipment.
- Firewalls: Apply suitable rules to control traffic.
- Encryption: Protect sensitive communications using appropriate secure protocols.
- Access permissions: Give users only the access they need.
- Backups: Keep regular backups and test recovery procedures.
- Endpoint protection: Use suitable security controls on computers and servers.
- Safe browsing: Avoid suspicious links, unexpected attachments, and untrusted downloads.
- Monitoring: Review relevant logs and investigate unusual network activity.
16. Network Performance: Bandwidth, Throughput and Latency
- Bandwidth
- The capacity of a communication link, commonly measured in bits per second (bps).
- Throughput
- The actual rate at which data is successfully transferred.
- Latency
- The time taken for data to travel between endpoints or for a response to return, depending on the measurement.
- Packet loss
- The failure of some transmitted packets to reach their destination.
For example, a link may have a high advertised bandwidth but deliver lower actual throughput because of congestion, interference, protocol overhead, or equipment limitations. High latency can make interactive applications feel slow even when the link has sufficient bandwidth.
Wired and Wireless Networks
- Wired Ethernet: Often offers predictable performance and a stable connection.
- Wi-Fi: Provides mobility and convenient access, but its performance can be affected by distance, obstacles, interference, and congestion.
17. Final Summary
Let us review the key concepts covered in this tutorial.
- A computer network connects devices to exchange data and share resources.
- A LAN connects devices within a relatively limited area.
- A NIC provides a device's network interface.
- A switch connects devices within a LAN and forwards Ethernet frames.
- Copper Ethernet cables and fibre-optic links provide wired communication.
- A router forwards IP packets between networks.
- An ISP provides connectivity to external networks and the Internet.
- A firewall controls network traffic according to security rules.
- Network protocols define how devices and applications communicate.
- The Web is an Internet service accessed through web browsers and servers.
- IP addresses and MAC addresses serve different purposes.
- A WAN connects networks across large geographical areas.
- Network security, backups, and maintenance are essential.
18. Revision Questions
Test your understanding with these questions.
- What is a computer network?
- State four advantages of computer networking.
- What is the purpose of a Network Interface Card?
- How are several computers connected in a typical wired LAN?
- Explain the difference between a switch and a router.
- What is the purpose of a fibre-optic link between two LANs?
- Why is a firewall used in a computer network?
- What is the difference between an IP address and a MAC address?
- State the functions of DNS and DHCP.
- What is the difference between HTTP and HTTPS?
- Explain how a browser obtains and displays a web page.
- Name five Internet services.
- State three differences between LAN and WAN.
- Give three advantages and three disadvantages of WAN.
- Explain bandwidth, throughput, and latency.
- State four methods of improving network security.

No comments:
Post a Comment