Study Notes: Networking (3.14 Networking and Cyber Security)
Hello future Computer Scientists! This chapter is all about how computers communicate, from the smallest home network to the massive global structure we call the Internet. Understanding networking is crucial because, in the modern world, almost every system is connected. Don't worry if some of these terms seem technical—we'll break them down using simple analogies!
3.14.1 Communications Fundamentals
3.14.1.1 Communication Methods: Parallel vs Serial
When data moves between components or systems, it uses one of two main methods:
1. Parallel Transmission
Imagine a multi-lane highway. In parallel transmission, multiple bits (usually 8 or more) are sent simultaneously across separate wires or channels.
- Speed: Very fast over short distances.
- Problem: Over longer distances, signals arrive at slightly different times, which is called skew. This makes the data unreliable.
2. Serial Transmission
Imagine a single-lane road. Bits are sent one after the other over a single wire or channel.
- Advantages of Serial over Parallel:
- Reliability: No data skew, making it reliable over long distances.
- Cost: Requires fewer wires, making the cables cheaper and thinner.
- (Example: USB (Universal Serial Bus) is serial, even though it's much faster than older parallel ports!)
Synchronous vs Asynchronous Data Transmission
This refers to how the timing (or 'clock') of the data is managed.
1. Synchronous Transmission:
- The sender and receiver share a common timing signal (a clock).
- Data is sent continuously in large, synchronized blocks.
- Advantage: Very efficient for large transfers, as no timing bits are added to every byte.
2. Asynchronous Transmission:
- No shared clock. Data is sent one character (or byte) at a time.
- To tell the receiver when the data starts and ends, special bits are added:
- Start Bit: Brings the receiver's clock into phase with the sender's clock, signalling that a character is coming.
- Stop Bit(s): Allows the receiver time to process the received data and prepares it to recognise the next start bit.
Quick Review: Transmission Methods
Short distance, high speed: Parallel (but watch out for skew!)
Long distance, reliable: Serial (less skew)
Large data blocks (shared clock): Synchronous
One character at a time (Start/Stop bits): Asynchronous
3.14.1.2 Communication Basics: The Vocabulary
Here are the essential terms you must know when discussing communication quality:
- Protocol: A set of rules defining how data is transmitted and received. (Think of protocols as the grammar for computer conversation.)
- Latency: The time delay between when data is sent and when it is received. High latency means slow responsiveness (bad for gaming!).
- Bit Rate: The number of bits transmitted per second. Measured in bits per second (bps). This is the true measure of speed.
- Baud Rate: The number of signal changes (or symbols) occurring per second. Measured in Hertz (Hz) or symbols per second.
- Bandwidth: The maximum theoretical data transfer rate of a communication medium.
The Difference between Baud Rate and Bit Rate
The baud rate is the speed of the signal change, but sometimes, sophisticated technologies encode more than one bit into a single signal change (using complex voltage levels).
Therefore:
Bit Rate can be higher than Baud Rate if more than one bit is encoded in each signal change.
Relationship between Bit Rate and Bandwidth
The Bit Rate is directly proportionate to the Bandwidth. If a cable has a high maximum bandwidth, it can achieve a higher bit rate (transfer more data per second).
3.14.2 Networking
3.14.2.1 Types of Networking between Hosts
How do computers in a network interact? They usually follow one of two models:
1. Peer-to-Peer (P2P) Networking
- Status: All computers (hosts) have equal status (they are "peers").
- Uses: Small businesses or homes where security isn't critical. Used extensively for file sharing.
- Analogy: A group study session where everyone shares notes directly with everyone else.
2. Client-Server Networking
- Status: There are dedicated servers that provide resources and clients that request them.
- Uses: Large organizations, school networks, and the Internet. Provides better security and centralized management.
- Examples of Servers: File server (stores files), Email server (handles email), Web server (stores websites).
3.14.2.2 Thin-Client versus Thick-Client Computing
This defines where the bulk of the processing power lies.
1. Thin-Client Computing
- The client device (e.g., a simple terminal or Chromebook) does very little processing.
- The main work (running applications, storing data) is done centrally on the powerful server.
- Requirements: Requires robust networking infrastructure and highly powerful servers.
- Advantages: Lower client hardware cost, easier maintenance, high data security (data stays on the server).
2. Thick-Client Computing
- The client device (e.g., a typical desktop PC) does the majority of the processing itself.
- The server is mostly used for storing files or backups.
- Requirements: Requires powerful client hardware (expensive PCs) but networking requirements can be less demanding.
- Advantages: Can operate locally if the network fails, faster performance for intensive tasks (like CAD or video editing).
3.14.2.3 Wired Networking: Cables and Collision Detection
Choosing the right cable is critical for network performance.
Copper (Ethernet) vs Fibre-Optic Cables
| Copper Cable (e.g., Cat 5e/6) | Fibre-Optic Cable | |
|---|---|---|
| Technology | Uses electrical signals through metal wires. | Uses light signals through glass or plastic strands. |
| Cost | Cheap to install, widely used. | Expensive to install and maintain. |
| Speed & Capacity | Good, but limited over long distances (suffers from signal degradation). | Extremely high speed and capacity (can carry data much further). |
| Interference | Susceptible to electromagnetic interference. | Immune to electromagnetic interference. |
Collision Handling: CSMA/CD
CSMA/CD stands for Carrier Sense Multiple Access with Collision Detection. This protocol is used primarily in wired Ethernet networks to manage shared transmission media.
- Carrier Sense (CS): A device checks if the channel is currently busy (if another device is transmitting).
- Multiple Access (MA): Multiple devices can access the channel and try to transmit.
- Transmit: If the channel is clear, the device transmits its data.
- Collision Detection (CD): The device listens to the channel while transmitting. If it detects a garbled signal (a collision), it stops transmitting immediately.
- Backoff: All devices involved in the collision wait for a random length of time before attempting retransmission.
Did you know? Collision Detection is not possible in wireless networks because a wireless device cannot listen and transmit simultaneously.
3.14.2.4 Wireless Networking (Wi-Fi)
Wi-Fi is a wireless Local Area Network (WLAN) based on international standards (IEEE 802.11). Its purpose is simply to enable devices to connect to a network wirelessly.
Key Wireless Components:
- Wireless Network Adapter: Hardware in your device (laptop, phone) that allows it to communicate wirelessly.
- Wireless Access Point (WAP): The central device that connects wireless devices to the network (often combined with a router and switch in home devices).
- Service Set Identifier (SSID): The friendly name of the Wi-Fi network (the name you see when you scan for Wi-Fi).
Wireless Security:
Wireless networks are secured using methods to prevent unauthorized access and eavesdropping:
- Strong Encryption (WPA2/WPA3): Encrypts transmitted data, making it unreadable if intercepted.
- SSID Broadcast Disabled: Hiding the network name so casual users cannot see it when scanning (though this is a weak security measure).
- MAC Address Allow List (MAC Filtering): Only devices with specific, approved MAC addresses (unique hardware identifiers) are allowed to connect.
Collision Handling: CSMA/CA
Since collisions cannot be detected reliably in wireless networks, the protocol uses Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA).
- Sense: The device checks if the channel is free.
- Intent to Send (RTS/CTS): If the channel is free, the device sends a short Request to Send (RTS) packet to the Access Point (AP). The AP responds with a Clear to Send (CTS) packet, telling all other devices to wait.
- Transmit: The device transmits its data.
- Acknowledge: The receiver sends an acknowledgement (ACK). If no ACK is received, the data is assumed lost and the device tries again after a random wait time.
3.14.2.5 Comparing Wired and Wireless Networking
| Wired Networking | Wireless Networking | |
|---|---|---|
| Advantages | Faster speed, higher bandwidth, more secure, consistent connection quality. | Mobility, easier to install (no physical cables required), less expensive to scale up initially. |
| Disadvantages | Less flexible (requires drilling/cables), higher installation cost for infrastructure. | Slower speeds, lower security (data is broadcast), subject to interference and signal degradation over distance. |
Key Takeaway: Networking Types
Networks manage traffic using collision protocols (CSMA/CD for wired, CSMA/CA for wireless) and choose infrastructure based on needs (P2P for simplicity, Client-Server for control/security).
3.14.3 The Internet
The Fundamentals of Internet Structure
The Internet is a massive, interconnected network of networks. Data transfer relies on two key ideas: packet switching and routers.
Packet Switching
Instead of sending one continuous stream of data, information is broken down into small, manageable chunks called packets. Each packet travels independently across the network and may take a different route. They are reassembled at the destination.
Role of Routers
A router is a device that directs network traffic. It reads the destination address on a packet and uses routing tables to determine the most efficient path for that packet to take across the Internet. (Think of a router as a postal sorting office, deciding which road a letter needs to take next.)
Main Components of a Packet
A packet contains essential information for its journey:
- Source Address: Where the packet came from (IP address).
- Destination Address: Where the packet is going (IP address).
- Payload: The actual piece of data being transmitted.
- Packet Sequence Number: Used to reassemble the packets in the correct order at the destination.
- Time to Live (TTL): A counter that limits how many hops (routers) the packet can pass through. Prevents packets from circulating indefinitely if they get lost.
- Error Detection/Correction Information: Checks (like a checksum) to ensure the data wasn't corrupted during transmission.
Routing across the Internet
Routing is achieved when each router reads the destination IP address of an incoming packet. It consults its internal routing table, which lists known network paths, and forwards the packet toward the next router on the path to its final destination. This process repeats until the packet reaches the destination network.
Addressing on the Internet
- Uniform Resource Locator (URL): The human-readable web address used to locate a resource on the internet (e.g., https://www.oxfordaqa.com/).
- IP Address (Internet Protocol Address): A unique numerical label assigned to every device connected to a network. This is the machine-readable destination address found in a packet.
- Domain Name: The primary name of a website (e.g., oxfordaqa.com).
- Fully Qualified Domain Name (FQDN): The complete domain name for a specific computer or host on the Internet (e.g., www.oxfordaqa.com).
The Domain Name System (DNS)
The purpose of DNS is to translate human-readable domain names (like google.com) into machine-readable IP Addresses (like 172.217.16.14).
- Analogy: DNS is the internet's phone book. You look up the name to get the number.
- Domain Name Servers: These are dedicated servers that hold these translation databases. When you type a URL, your device sends a request to a Domain Name Server (DNS Server) to find the corresponding IP address.
Internet Registries
Internet registries (like ICANN and regional registries) manage the allocation of domain names and IP addresses globally. They are needed to ensure that every domain name and IP address is unique, preventing conflicts and maintaining the structured organization of the internet.
3.14.4 The Transmission Control Protocol/Internet Protocol (TCP/IP) Protocol
3.14.4.1 The TCP/IP Model (The Four Layers)
The TCP/IP model is a suite of protocols that governs nearly all communication on the Internet. It uses a layered structure.
Why use layers?
Networking protocols use layers to divide the complex task of sending data into smaller, independent sub-tasks.
- This allows specific protocols to focus on just one job.
- If one layer changes (e.g., new cable technology), the other layers remain unaffected, promoting modularity.
The Four Layers of the TCP/IP Stack (A-T-I-L):
- Application Layer: (Top Layer) This is where network applications (like browsers, email clients) operate. It handles the specific services the user interacts with (e.g., FTP, HTTP).
- Transport Layer: Responsible for establishing connections and ensuring reliable transmission of data between processes. This is where TCP (Transmission Control Protocol) operates, breaking data into segments and ensuring they arrive correctly.
- Internet Layer: Handles addressing and routing across the network. This is where IP (Internet Protocol) operates, directing packets using IP addresses.
- Link Layer (Network Access Layer): (Bottom Layer) Deals with the physical transmission of data over the specific network hardware (e.g., Ethernet cable, Wi-Fi).
Sockets and MAC Addresses
- Sockets: A socket is a combination of an IP address and a port number (e.g., 192.168.1.1:80). It provides an endpoint for communication at the Transport Layer, ensuring data not only gets to the correct computer but also to the correct application running on that computer.
- MAC (Media Access Control) Address: A unique physical address permanently burned into every network adapter. It operates at the Link Layer, used for local communication within the same physical network segment (e.g., getting a packet from your laptop to your router).
3.14.4.2 Standard Application Layer Protocols
These protocols define the rules for specific services used by applications:
- HTTP (Hypertext Transfer Protocol): Used by web browsers to request and receive web pages (text form) from a web server.
- HTTPS (HTTP Secure): The secure version of HTTP, ensuring encrypted communication (uses SSL/TLS).
- FTP (File Transfer Protocol): Used for transferring files between a client and a server. It can use anonymous or authenticated access. (Be aware that FTP is being replaced by secure alternatives like SFTP.)
- SSH (Secure Shell): Used for secure remote management, allowing users to log in to a remote computer and execute commands securely.
- SMTP (Simple Mail Transfer Protocol): Used by clients to send emails to an email server, and used by email servers to transfer mail between each other.
- POP3 (Post Office Protocol v3): Used by clients to retrieve emails from an email server (often deletes the email from the server after download).
- IMAP (Internet Message Access Protocol): Used by clients to retrieve emails from an email server (emails are usually kept on the server, allowing multiple devices to synchronize).
Role of Web Browser and Server:
A web server stores and serves web pages, typically in text form (HTML, CSS, etc.). A web browser is responsible for retrieving these web pages and their resources, interpreting the code, and rendering them visually on the user's screen.
3.14.4.3 IP Addresses
Every IP address is divided into two parts:
- Network Identifier Part: Identifies the specific network the device belongs to.
- Host Identifier Part: Identifies the specific device within that network.
Subnetting and Subnet Masks
Networks can be divided into smaller segments called subnets to improve organization and efficiency. A subnet mask (a 32-bit number) is used to determine which part of the IP address is the Network ID and which is the Host ID.
(Trick: If a bit in the subnet mask is 1, the corresponding bit in the IP address is part of the Network ID. If it is 0, it is part of the Host ID.)
IPv4 vs IPv6
- IPv4: Uses 32 bits, offering about 4.3 billion unique addresses.
- IPv6: Uses 128 bits.
- Why IPv6 was introduced: Because the rapid expansion of the Internet caused us to run out of available IPv4 addresses (address exhaustion). IPv6 offers virtually unlimited addresses.
Routable vs Non-routable IP Addresses
- Routable (Public) IP Addresses: Addresses that are unique globally and can be directed across the internet by routers.
- Non-routable (Private) IP Addresses: Addresses reserved for use within private networks (like your home or school LAN). Routers are configured to block these addresses from crossing the public internet, meaning they are only visible locally.
3.14.4.4 Dynamic Host Configuration Protocol (DHCP)
Purpose: DHCP is a system that automatically assigns unique IP addresses and other network configuration parameters (like the subnet mask and default gateway) to devices when they connect to the network.
How DHCP Works (Simplified):
- A new device broadcasts a request (DHCP Discover).
- The DHCP server offers an available IP address (DHCP Offer).
- The device accepts the offer (DHCP Request).
- The DHCP server sends a final confirmation (DHCP Acknowledgement).
Advantages over Manual Configuration:
DHCP prevents human error (like accidentally assigning two devices the same IP address) and makes network management much easier, especially in large networks where devices frequently join and leave.
Key Takeaway: TCP/IP and Addressing
The Internet relies on layered protocols (TCP/IP) for efficiency, numerical addresses (IP) for routing, and DNS to translate names into numbers. DHCP simplifies the essential job of assigning these addresses.
3.14.5 Cyber Security
Cyber security is about protecting systems and data from unauthorized access, use, disclosure, disruption, modification, or destruction.
Firewalls
A firewall is a security system that monitors and controls incoming and outgoing network traffic based on predetermined security rules.
- Packet Filtering: The simplest type, inspecting the headers of packets (like source/destination IP and port) and blocking traffic that doesn't match the rules.
- Proxy Server: Acts as an intermediary (a middleman) between the internal network and the outside world. It makes requests on behalf of the internal client, hiding the client's true IP address.
- Stateful Inspection: A sophisticated firewall that tracks the 'state' of active network connections. It only allows incoming traffic if it corresponds to an established outgoing connection request, making it harder for malicious external connections to initiate contact.
Symmetric and Asymmetric Encryption
Encryption is the process of converting plaintext into unreadable ciphertext using an algorithm and a key.
1. Symmetric Encryption
Uses the same key to encrypt and decrypt the data.
(Example: Caesar and Vernam ciphers are symmetric.)
2. Asymmetric (Public Key) Encryption
Uses two different mathematically related keys: a Public Key (shared widely) for encryption, and a Private Key (kept secret) for decryption.
The Key Exchange Problem
In symmetric encryption, the sender and receiver must find a secure way to share the secret key without it being intercepted. This is the key exchange problem. Asymmetric encryption solves this because the encryption key (Public Key) can be shared openly, and only the mathematically related private key can decrypt the data.
Digital Certificates and Digital Signatures
These are essential for establishing trust online, especially when using HTTPS.
- Digital Certificate: An electronic document used to prove ownership of a public key. They are obtained from a Certificate Authority (CA) and verify that a website is who it claims to be.
- Digital Signature: A method used to verify the authenticity and integrity (that it hasn't been tampered with) of a message or document. It is created by encrypting a hash of the document using the sender's Private Key.
Malicious Software (Malware)
Malware attempts to exploit vulnerabilities—weaknesses in systems, software, or security procedures.
- Virus: Malicious code that attaches itself to a legitimate program and requires a host program to spread. Exploits vulnerabilities like outdated software.
- Trojan (Horse): Malicious software disguised as legitimate software. It tricks the user into installing it. Exploits human vulnerabilities (social engineering).
- Worm: Standalone malicious software that replicates itself rapidly and autonomously across a network without needing a host program or user intervention. Exploits network protocol or operating system vulnerabilities.
Quick Review: Cyber Security
Firewalls: Monitor traffic.
Symmetric: One key (key exchange problem).
Asymmetric: Two keys (solves key exchange problem).
Certificates: Verify identity.
Signatures: Verify integrity/authenticity.