Computer Networks Explained: Core Concepts and Communication
Learn how computer networks connect devices, move data, use protocols and addresses, provide Internet access, and can be secured and troubleshot.
A computer network is a group of connected devices that can communicate, exchange data, and share resources. A network may connect two computers in a room, devices throughout a school, or many separate networks across the world.
Networking enables communication, file sharing, shared Internet access, printer sharing, centralized applications and storage, and remote access. A standalone computer can process local files and programs, but it cannot directly use network resources or communicate with other devices unless a network connection is provided.
Why Computer Networks Exist
- Communication: People and applications exchange messages, voice, video, and other information.
- File sharing: Users can access files stored on another computer or a shared storage system.
- Shared Internet access: Many private devices can use one connection supplied by an Internet service provider.
- Printer and peripheral sharing: Several computers can use a network printer, scanner, camera, or other device.
- Centralized services: Servers can provide authentication, databases, websites, backups, and applications.
- Remote access: Authorized users can reach systems and resources from another location.
Network Participants and Components
End devices
An end device is a source or destination of network communication. Examples include desktop computers, laptops, servers, smartphones, tablets, network printers, security cameras, smart televisions, sensors, and other Internet of Things devices.
A client is a device or program that requests a service. A server is a device or program that provides a service or resource. One physical computer can act as both a client and a server for different applications.
Network interfaces
A network interface card (NIC) connects a device to a wired network. A wireless adapter performs a similar function for radio communication. Modern computers often include both Ethernet and Wi-Fi interfaces. Each interface has configuration information and usually has a MAC address used for local delivery.
Intermediary devices
| Device | Primary Function | Where It Is Used | Key Distinction |
|---|---|---|---|
| Switch | Forwards traffic between devices on the same LAN | Homes, offices, laboratories | Connects local devices |
| Router | Forwards packets between different networks | Homes, businesses, the Internet | Chooses a path between networks |
| Wireless access point | Provides Wi-Fi access to a wired network | Homes, offices, campuses | Bridges wireless clients to the LAN |
| Modem | Connects a local network to a provider's transmission medium | Cable, DSL, and some other access services | Adapts communication to the provider link |
| Optical network terminal | Terminates a fiber service connection | Fiber Internet installations | Converts the provider's optical service for local equipment |
| Firewall | Allows or blocks traffic according to rules | Devices, routers, servers, and networks | Enforces security policy |
| Repeater | Regenerates or retransmits a signal | Networks needing additional physical reach | Extends a signal rather than choosing routes |
Consumer gateway equipment commonly combines a router, switch, wireless access point, firewall, and sometimes a modem in one box.
Network Types by Size and Scope
| Type | Typical Coverage | Example | Common Technologies |
|---|---|---|---|
| PAN | A person's immediate surroundings | Phone connected to earbuds or a watch | Bluetooth, USB, short-range wireless |
| LAN | A limited site | Home, classroom, laboratory, or office | Ethernet and Wi-Fi |
| WLAN | A LAN using radio instead of, or in addition to, cables | Home or office Wi-Fi | Wi-Fi |
| MAN | A city or large metropolitan area | Connected municipal or provider sites | Fiber and carrier networks |
| WAN | Large geographic areas | Company branches connected across countries | Leased links, VPNs, carrier services |
| Internet | Global interconnected networks | Public websites and cloud services | IP and many related protocols |
A home network and a school or office network are usually LANs. A campus network may join several buildings and LANs. A WAN connects smaller networks over longer distances. The Internet is not one single LAN; it is a global system of interconnected networks operated by many organizations.
Wired and Wireless Connections
Ethernet is a common wired LAN technology. It often uses twisted-pair copper cable, while fiber-optic links carry data as light through glass or plastic fiber. Wi-Fi uses radio communication between wireless adapters and access points.
| Characteristic | Ethernet | Wi-Fi |
|---|---|---|
| Mobility | Requires a cable during use | Allows movement within radio range |
| Reliability | Usually consistent and less affected by radio interference | Can be affected by distance, walls, interference, and congestion |
| Speed | Often offers predictable high throughput; fiber supports long, fast links | Advertised rates depend on signal quality, shared airtime, and equipment |
| Installation | Requires cable runs and suitable ports | Requires access-point placement and radio configuration |
| Security | Physical access to a port is an important consideration | Requires strong authentication and encryption over the radio link |
Wired links are often preferred for servers, desktop computers, and high-volume transfers. Wireless links are convenient for phones, laptops, sensors, and devices that move. Fiber is useful for long distances and high capacity but generally requires specialized installation.
Network Topologies
A topology is the physical or logical arrangement of devices and links.
- Star: Each device connects to a central switch or wireless access point. This is the most common modern LAN arrangement. A failed individual cable usually affects one device, while a failed central device can affect many devices.
- Bus: Devices share one main communication path. It uses less central equipment but can be difficult to troubleshoot and expand, and a fault in the shared path can affect the network.
- Ring: Each device connects to the next device in a circular arrangement. It can provide an orderly path, but a break may disrupt communication unless the design includes redundancy.
- Mesh: Devices have multiple links to other devices. Mesh designs provide alternate paths and strong fault tolerance, but they cost more and are more complex to install.
- Hybrid: Two or more topologies are combined, such as star-connected office LANs joined across a redundant campus backbone.
Topology decisions balance reliability, cost, expansion, performance, and fault isolation. Modern networks often use star arrangements at the edge and redundant or partially meshed designs in their core.
How Network Data Is Represented and Transmitted
Computers represent information digitally as binary values. A bit is one binary 0 or 1. A byte is commonly eight bits. Network hardware converts digital data into physical signals, such as electrical changes in copper, pulses of light in fiber, or radio waves in Wi-Fi.
- Data: The application information being sent, such as a web request or file contents.
- Segment: A transport-layer unit, commonly associated with TCP.
- Packet: A formatted unit of data carried across an IP network.
- Frame: A local-network unit used by the data-link layer.
- Signal: The physical representation that travels across a medium.
Bandwidth is the maximum capacity of a link, usually measured in bits per second. Throughput is the useful data actually transferred per second. Throughput can be lower because of protocol overhead, congestion, interference, slow endpoints, or a limited upstream link.
Latency is the delay between points. Jitter is variation in delay, which can disturb voice and video. Packet loss occurs when packets fail to reach their destination. A link advertised as 1 Gbit/s has a theoretical capacity; it does not guarantee that an application will copy files at 1 Gbit/s.
Addresses and Device Identification
A MAC address is a hardware-associated identifier used for delivery on a local network. Switches use MAC addresses to decide which local port should receive an Ethernet frame. A MAC address is not normally used to route traffic across the entire Internet.
An IP address is a logical address used to identify an interface and route packets between networks. IPv4 uses 32-bit addresses, commonly written in dotted-decimal form, such as 192.168.1.25. IPv6 uses 128-bit addresses and is written in hexadecimal groups, providing a much larger address space.
| Concept | Purpose | Example | Scope |
|---|---|---|---|
| MAC address | Local hardware-level delivery | 00:1A:2B:3C:4D:5E | Usually one local link or LAN |
| Private IP address | Addressing inside a local or private network | 192.168.1.25 | Not directly routable on the public Internet |
| Public IP address | Identifies an Internet-reachable network endpoint | Assigned by an ISP | Public Internet |
| Subnet mask or prefix length | Identifies the network portion of an IP address | /24 or 255.255.255.0 | Determines local versus remote destinations |
| Default gateway | Next-hop router for destinations outside the local network | 192.168.1.1 | Local network's route out |
| DNS server | Translates names into IP addresses | A configured resolver | Name resolution service |
A typical device needs an IP address, a subnet mask or prefix length, a default gateway, and one or more DNS servers. DHCP commonly supplies these settings automatically. Private addresses are often used inside homes and offices, while the router represents the local network with a public address supplied by the ISP.
For more detail, see MAC address concepts, private IP addresses, and subnetting.
How Communication Travels Across Networks
When the destination is on the same local network, the sender creates a local frame addressed to the destination's MAC address. A switch examines the frame and forwards it through the appropriate local port. Wireless communication follows the access point's radio rules before being bridged into the LAN.
When the destination is on another network, the sender compares the destination IP address with its own network and prefix. If the destination is remote, the sender sends the frame to the MAC address of the default gateway. The gateway is usually a router, which removes the local frame, examines the IP packet, selects a next hop, and forwards the packet toward its destination.
- A laptop joins a home Wi-Fi network and receives a private address from DHCP.
- The browser needs the IP address for a domain name, so the device asks a DNS server.
- The laptop determines that the web server is outside its local subnet.
- It sends the packet to the default gateway, often the home router.
- The router may use NAT to replace the private source address with the home's public address.
- The ISP and several routers forward the packet across separate networks.
- The remote web server receives the request and sends response packets back through routers toward the home router.
- The router uses its connection state and NAT information to deliver the response to the laptop.
A file transfer between two devices on the same LAN usually remains within the local switch or access point. A transfer to cloud storage must pass through the gateway, ISP, and multiple routers.
Protocols and Layered Communication
A protocol is an agreed set of rules for communication. Protocols specify formats, addressing, timing, error handling, and what each participant should do when messages arrive.
Layering divides networking into functions. The TCP/IP model is commonly presented with application, transport, Internet, and network-access functions. The OSI model has seven named layers; it separates data-link and physical work and gives more detailed boundaries. These models are teaching and design frameworks, not separate networks.
- Application: Provides services used by programs, such as web, email, file transfer, and name resolution.
- Transport: Provides communication between applications, including ports, reliability, ordering, flow control, or low-overhead delivery.
- Internet or network: Provides logical IP addressing and routing between networks.
- Data link: Delivers frames across one local link using technologies such as Ethernet or Wi-Fi.
- Physical: Sends bits as electrical, optical, or radio signals.
Encapsulation means that data gains control information as it moves down the stack. An application message may receive a transport header, an IP header, and a link-layer header and trailer. At the destination, each layer interprets and removes the information intended for it before passing the remaining data upward.
Common Protocols and Services
- DNS: Translates human-readable domain names into IP addresses. It can also provide other records used by network services.
- DHCP: Automatically supplies an IP address, prefix or mask, gateway, DNS servers, and lease information.
- TCP: Establishes a connection and provides reliable, ordered delivery with retransmission when needed.
- UDP: Has lower overhead and does not guarantee delivery or ordering. Applications can choose it when timeliness or application-managed recovery is more important.
- HTTP: Transfers web resources. HTTPS is HTTP protected by TLS, which helps provide confidentiality, integrity, and server authentication.
- ICMP: Carries control and diagnostic messages, including those used by many reachability tests.
- ARP: Resolves an IPv4 address to a local MAC address. IPv6 uses Neighbor Discovery for related functions.
- FTP and SFTP: Transfer files; SFTP runs through SSH and protects the session.
- Email protocols: SMTP is used for sending and relaying mail, while IMAP and POP are used by clients to retrieve mail in different ways.
- SSH: Provides encrypted remote command-line access and related secure forwarding functions.
TCP and UDP are transport protocols, not alternatives for every situation. The application and its requirements determine which transport is appropriate.
| Feature | TCP | UDP | Typical Use Cases |
|---|---|---|---|
| Reliability | Acknowledgments and retransmission provide reliable delivery | No built-in guarantee of delivery | TCP: web sessions, file transfer; UDP: real-time and query traffic |
| Ordering | Delivers data to the application in order | Datagrams may arrive out of order or not at all | TCP: documents; UDP: time-sensitive streams |
| Overhead | Higher because of connection and reliability mechanisms | Lower and simpler | UDP where low delay matters |
| Behavior | Adjusts transmission to network conditions | Leaves more control to the application | Chosen according to application design |
See also TCP and UDP ports and HTTP.
Internet Access and Home Networks
A typical home connection follows this path: local devices connect by Ethernet or Wi-Fi to a router; the router connects to a modem or optical network terminal; that device connects to the ISP; the ISP connects to the Internet. A separate switch may provide additional wired ports, and a separate access point may provide Wi-Fi.
The modem adapts communication to a cable, DSL, or another provider medium. An optical network terminal performs the equivalent termination role for many fiber services. The router connects different networks, applies firewall rules, provides DHCP, and commonly performs NAT. In consumer equipment, all these functions may be combined.
Network address translation lets many private devices share one public IPv4 address. The router records connections and translates private source addresses and ports for outbound traffic. NAT is useful for address sharing, but it is not a complete substitute for a firewall or other security controls.
Basic Wi-Fi concepts
- SSID: The name presented for a wireless network.
- Authentication: Verifies that a user or device is allowed to join.
- Encryption: Protects wireless traffic from casual interception; use current strong standards supported by the equipment.
- Channel: A portion of radio spectrum used for communication. Overlapping or congested channels can reduce performance.
- Signal range: The usable area depends on transmit power, antenna design, obstacles, distance, and interference.
Network Security Basics
Networks need security because unauthorized users may attempt to access devices, intercept information, alter traffic, or disrupt services.
- Use strong, unique Wi-Fi and administrator passwords.
- Use strong Wi-Fi encryption and replace outdated security modes.
- Install operating-system, router, access-point, and application updates.
- Use firewalls to allow necessary traffic and block unwanted traffic.
- Provide a guest network for untrusted visitors and less-trusted devices when appropriate.
- Prefer HTTPS for websites and do not ignore browser certificate warnings.
- Take extra care on untrusted public networks; use protected applications and avoid sending sensitive information through insecure services.
Authentication answers “Who are you?” Authorization answers “What are you allowed to do?” Encryption transforms data so that an unauthorized observer cannot readily understand it without the required key. These are different controls and may be used together.
A Logical Network-Diagnosis Process
- Check power and physical links: Confirm that equipment is powered, cables are seated, link lights are present, and the correct switch port is used.
- Check Wi-Fi association: Confirm that the device joined the intended SSID and completed authentication.
- Check IP configuration: Inspect the address, prefix or mask, gateway, DNS servers, and adapter state.
- Check the local gateway: Ping the default gateway. Failure suggests a local link, Wi-Fi, addressing, or router problem.
- Check an Internet IP address: If the gateway responds but an appropriate external IP does not, investigate the router, upstream link, or ISP.
- Check DNS: If IP connectivity works but names do not, query DNS and inspect the configured resolver.
- Compare devices: If every device fails, suspect the router, access service, or ISP. If one device fails, focus on that device, its cable, adapter, or configuration.
Useful commands
Run these commands in the operating system's terminal or command prompt. Results vary by platform and network policy.
ipconfig /allOn Windows, displays adapter details, IP addresses, subnet masks, default gateways, and DNS servers.
ip addrOn macOS or Linux, displays interfaces and assigned IP addresses. On systems that still provide it, ifconfig can show similar interface information.
ping 192.168.1.1Tests whether the local gateway responds. A lack of response may also result from firewall rules that block ICMP, so interpret the result with other evidence.
ping example.comTests basic reachability while requiring DNS resolution first.
nslookup example.comQueries DNS and helps determine whether a name resolves to an address.
tracert example.comOn Windows, displays observed hops toward a destination.
traceroute example.comOn macOS or Linux, displays observed hops toward a destination. Some routers do not respond to diagnostic probes, so missing hops do not always indicate failure.
Example configuration
A small private LAN might use the following settings:
Device address: 192.168.1.25
Prefix or mask: /24 or 255.255.255.0
Default gateway: 192.168.1.1
DNS server: 192.168.1.1An address beginning with 169.254 is commonly self-assigned after unsuccessful DHCP communication. Check the cable or Wi-Fi association, reconnect or renew the DHCP lease, and verify that the router's DHCP service is operating.
| Symptom | Likely Cause | Checks | Possible Remedy |
|---|---|---|---|
| Connected to Wi-Fi but no websites load | Router or ISP outage, bad IP settings, DNS failure, captive portal | Check IP and gateway; ping gateway; test external IP; query DNS; compare another device | Reconnect, correct settings, complete the portal, repair DNS, or contact the provider |
| Address begins with 169.254 | DHCP unavailable or link problem | Check cable, signal, adapter, lease, and router DHCP | Reconnect, renew the lease, repair the link, or restore DHCP |
| Internet works by IP but not by name | Incorrect or unavailable DNS service | Run nslookup; inspect DNS configuration | Correct DNS or use an approved alternate resolver |
| Only one wired computer fails | Damaged cable, disabled adapter, switch port, or addressing error | Check port lights; try a known-good cable and port; compare configuration | Replace cable, enable adapter, change port, or correct settings |
| Wi-Fi is slow or drops | Weak signal, interference, congestion, outdated equipment | Test near the access point; compare devices; inspect placement, band, and updates | Move equipment, reduce interference, select a suitable band, or update equipment |
Exam-Relevant Summary
- A network connects devices so they can exchange data and share resources.
- A switch forwards traffic within a LAN; a router forwards packets between networks.
- LAN describes a limited area, while WAN connects networks across larger distances. The Internet is a global system of interconnected networks.
- MAC addresses support local delivery; IP addresses support logical addressing and routing.
- The subnet mask or prefix identifies the local network, and the default gateway handles remote destinations.
- DNS resolves names, DHCP supplies configuration, TCP provides reliable ordered delivery, and UDP provides low-overhead datagrams.
- Bandwidth is capacity; throughput is actual useful transfer; latency is delay; jitter is delay variation; packet loss is missing data.
- Encapsulation adds layer-specific headers as data moves down the stack; receiving layers interpret those headers in reverse order.
- NAT commonly allows private devices to share a public IPv4 address, but NAT alone is not a complete security design.
- When diagnosing a fault, proceed from physical connectivity to local addressing, gateway reachability, external connectivity, and DNS.
For related study, explore what a router does, IP routing, and static IP configuration in Ubuntu.