- Published on
KembaraXtra-Computer Suite - Networking as Computing
Core Idea:
Core Idea:
- Networking isn't separate from computing; it's a part of it. The internet is a vast, distributed computing system.
- Hardware & Software: The internet and networks rely on both.
- Hardware: Cables, routers, switches, network interface cards (NICs).
- Software: Protocols, operating systems, device drivers, application libraries.
- Data Representation: Data transmitted over networks is ultimately represented as bits (0s and 1s). These bits are physically encoded (e.g., as voltages).
- Networking Interface as I/O: A network interface card (NIC) (like Wi-Fi or Ethernet) is treated by a computer as an input/output (I/O) device.
- Device Drivers: The OS uses device drivers to communicate with NICs.
- Software Libraries: The OS provides libraries that simplify network communication for applications.
- Abstraction: The OS hides the low-level details of networking, allowing applications to send and receive data more easily.
- Routers and switches are specialized computers.
- They perform specific tasks like routing network traffic.
- Extension of Local Computing: Networking extends computing beyond a single device.
- Data Transfer & Processing: It enables data to be transferred and processed across different machines and locations.
- Published on
KembaraXtra-Computer Science- Filesystems
1. Storage Devices & Partitions
1. Storage Devices & Partitions
- Secondary Storage: Devices like HDDs and SSDs used for persistent data storage (data remains even when the power is off).
- Partitions: Storage devices are divided into regions called partitions.
- Filesystems: Operating systems use filesystems to organize data on storage devices into files and directories. A partition must be formatted with a particular filesystem before it can be used by the operating system.
- Formatting: Preparing a partition with a specific filesystem.
- Filesystem Examples:
- Linux: ext2, ext3, ext4 (ext family)
- Windows: FAT (File Allocation Table), NTFS (NT File System)
- Volumes: Some OSes use "volumes" as a logical abstraction built on one or more partitions. Filesystems reside on volumes in this case.
- File: A container for data. The structure of the data is defined by the program that created the file.
- Directory (Folder): A container for files and other directories.
- Unix-like Systems (e.g., Linux):
- Unified Hierarchy: A single, tree-like structure of directories.
- Root Directory: The top-level directory, represented by /. All other directories are descendants of the root.
- Example: /usr/lib (lib is a subdirectory of usr, which is a subdirectory of root)
- Mounting: Attaching an additional storage device to a location in the directory structure (e.g., a USB drive mounted to /mnt/usb1).
- Microsoft Windows:
- Drive Letters: Each volume is assigned a drive letter (A-Z).
- Separate Hierarchies: Each drive has its own root and directory structure.
- Directory Paths: Use backslashes (\) in directory paths and a colon (:) after a drive letter.
- Example: C:\windows\system32
- Historical Context: Drive letters A and B were initially reserved for floppy disks. C is typically the drive for the Windows installation.
- Published on
KembaraXtra-Case Law- Services and Daemons
Core Concept: Background Processes
Core Concept: Background Processes
- Definition: Services (Windows) and daemons (Unix-like systems) are processes that run automatically in the background, without direct user interaction.
- Purpose: Provide system-level capabilities that:
- Are not tied to a specific user.
- Do not require kernel-mode privileges.
- Need to be available on demand.
- Examples:
- Configuring network settings
- Running scheduled tasks
- Responsibility: Operating systems have components to manage services/daemons. This includes:
- Starting services/daemons at boot.
- Starting services/daemons in response to events.
- Restarting services/daemons after failures.
- Function: Manages Windows services.
- Executable: services.exe
- Startup: Started early in the boot process and runs continuously.
- Function: Manages daemons (and acts as the init process).
- Status: Standard daemon manager for many modern Linux distributions.
- Startup: Started very early in the boot process and runs continuously.
- Daemon Origin: Inspired by Maxwell's demon, a background "helper" in a physics experiment.
- Pronunciation: "DAY-mon" (common in computing) or "demon" are both acceptable when referring to background processes.
- Service vs. Daemon: Historically, "service" was Windows-specific, but is now also used on Linux, often for daemons managed by systemd.
- Published on
KembaraXtra-Case Law- Security in Operating Systems
I. What is Security in the Context of Operating Systems?
I. What is Security in the Context of Operating Systems?
- Definition: Security means that software and users should only access appropriate parts of the system. Access is restricted to minimize damage from mistakes or malicious software.
- Why is it Important?
- Single-User Systems: Even on personal devices, users can make mistakes (e.g., running untrustworthy code). The OS limits damage from accidental execution of malicious software.
- Multi-User Systems: Users should not be able to access or modify other users' data without permission.
- User Mode Bubble:
- Isolates applications, preventing them from interfering with other applications or the kernel.
- Filesystem Security:
- Controls access to files and data, allowing only authorized users and processes to access specific files.
- Virtual Memory Security:
- Memory regions can be marked as read-only or executable.
- Helps prevent memory misuse (e.g., executing data as code).
- Login System:
- Allows the OS to manage security based on user identity.
- Enforces access control based on user permissions.
- Baseline Expectations: The above techniques are basic security measures in modern OS.
- Vulnerabilities: Security flaws are frequently discovered, allowing malicious actors to bypass defenses.
- Importance of Updates: Keeping internet-connected OS updated is essential to address vulnerabilities and maintain security.
- Published on
KembaraXtra -Computer Science -World Wide Web
Core Attributes
Distributed
HTTP (HyperText Transfer Protocol)
ii.Server hello: Server selects the encryption methods. The server provides its public key.
iii.The client encrypts a string of bytes with the server's public key, and sends it to the server.
iv.Server decrypts using its private key. Both compute a shared secret key for symmetric encryption.
v.All further data is encrypted using the shared secret key.
The Searchable Web
Core Attributes
Distributed
- Definition: No central authority controls web content.
- Implications:
- Anyone can host a web server and publish content.
- Organizations/countries can block access.
- Governments can shut down illegal content.
- Key Point: The web is open and not centrally controlled.
- Definition: Every web resource has a unique address (URL).
- URL Components:
- Scheme: Protocol (e.g., HTTP, HTTPS).
- Authority:
- Hostname (e.g., travel.example.com).
- Optional: Username, Port Number.
- Path: Location of resource on server (like a file system path).
- Query: Modifies the resource returned (format varies by site).
- Relative URLs:
- Omit scheme, hostname, or full path.
- Interpreted relative to the current context.
- Practical URL Reading Example:
- Uses HTTP protocol.
- Server: travel.example.com.
- Path: /destinations/carolinas.
- Query: location=beach (shows beach locations).
- Definition: Web resources reference each other via hyperlinks.
- Hyperlinks: One-way references, no permission needed.
- Hypertext: Documents connected by hyperlinks.
HTTP (HyperText Transfer Protocol)
- Purpose: Transferring web resources (reading, creating, updating, deleting).
- Foundation: Based on TCP/IP for reliable data transfer and addressing.
- Model: Request and response.
- Client sends an HTTP request.
- Server replies with an HTTP response.
- GET: Retrieve a resource (no modification).
- PUT: Create/modify a resource at a specific URL.
- POST: Create a new resource as a child of an existing URL.
- DELETE: Remove a resource.
- Usage:
- GET is most common (used for browsing and loading resources).
- Servers often restrict PUT, POST, DELETE.
- Format: 3-digit number.
- Classes:
- 100s: Informational.
- 200s: Success.
- 300s: Redirection.
- 400s: Client error.
- 500s: Server error.
- Examples:
- 200 OK: Success.
- 301 Moved Permanently: Redirect to a new URL.
- 401 Unauthorized: Authentication required.
- 403 Forbidden: Access denied.
- 404 Not Found: Resource not found.
- 500 Internal Server Error: Server-side error.
- Request:
- First line: Method URL HTTP/Version (e.g., GET /documents/hello.txt HTTP/1.1).
- Headers: Additional information.
- Optional message body.
- Response:
- First line: HTTP/Version Status Code Response Phrase (e.g., HTTP/1.1 200 OK).
- Headers.
- Optional message body.
- Purpose: Encrypt data transmitted over the internet.
- Encryption: Encoding data to be unreadable without decryption.
- Cryptographic Key: Secret sequence of bytes used for encryption/decryption.
- Encryption Types:
- Symmetric: Single shared key for both encryption and decryption.
- Asymmetric:
- Public key: Encrypts data.
- Private key: Decrypts data (kept secret).
- Security:
- Prevents interception and modification of data.
- Encrypts the entire HTTP request (URL, headers, body).
- TLS (Transport Layer Security): Protocol used to encrypt HTTP requests (formerly SSL).
- HTTPS Handshake:
ii.Server hello: Server selects the encryption methods. The server provides its public key.
iii.The client encrypts a string of bytes with the server's public key, and sends it to the server.
iv.Server decrypts using its private key. Both compute a shared secret key for symmetric encryption.
v.All further data is encrypted using the shared secret key.
The Searchable Web
- Entry Point: Often accessed through search engines.
- Search Engines: Non-standard, proprietary systems (e.g. Google). """
- Published on
- Published on
- Published on
- Published on
KembaraXtra-Computer Science-Foundational Internet Capabilities
1. Dynamic Host Configuration Protocol (DHCP)
ii.If the server has the record in its cache, it returns the IP address.
iii.If not, the server queries other DNS servers, starting at the root, to find the record.
iv.The server caches the record for future queries.
4. Networking in Context of Computing
1. Dynamic Host Configuration Protocol (DHCP)
- Purpose: Automatically assigns IP addresses and related network information to devices when they connect to a network.
- Why it's important: Simplifies network configuration for end-users by eliminating the need for manual IP address assignment.
- How it works:
- Discovery: A device broadcasts a message to discover available DHCP servers.
- Offer: The DHCP server offers an IP address from its available pool.
- Request: The device requests the offered IP address.
- Acknowledgment: The DHCP server acknowledges the request, assigning the IP address to the device.
- Lease: IP addresses are leased to devices for a limited time. The device must renew the lease to continue using the IP address.
- DHCP Server: A device on the network configured to provide DHCP services, including managing a pool of available IP addresses.
- Problem: Limited number of public IP addresses available, but many networks have multiple devices.
- Solution: Using private IP addresses for internal network communication and NAT to share a single public IP address.
- Private IP Addresses:
- IP address ranges reserved for internal networks (e.g., homes, offices).
- Ranges: 10.x.x.x, 172.16.x.x to 172.31.x.x, 192.168.x.x.
- Non-routable on the public internet.
- Can be used simultaneously on multiple private networks without conflict.
- Network Address Translation (NAT):
- Allows devices on a private network to share a single public IP address.
- The NAT router modifies the source IP address of outgoing packets to its public IP address.
- When responses return, the router translates the destination IP address back to the correct private IP address.
- Security benefit: Hides devices on the private network from direct exposure to the public internet.
- Proxy Server:
- An alternative to NAT, typically used in corporate networks.
- Operates at the application layer.
- Provides additional features: User authentication, traffic logging, and content filtering.
- Purpose: Translates human-friendly domain names (e.g., www.example.com) into IP addresses.
- Why it's important: Makes the internet easier to use by allowing users to remember names instead of IP addresses.
- Fully Qualified Domain Name (FQDN): The complete DNS name of a computer (e.g., travel.example.com).
- Consists of a hostname (travel) and a domain suffix (example.com).
- Domain: A grouping of network resources managed by an organization (e.g., example.com).
- Resolving a Hostname: The process of querying a DNS server to find the IP address associated with a hostname.
- Mapping:
- One-to-many: A single name can map to multiple IP addresses (used for load balancing and geographic distribution).
- Many-to-one: Multiple names can map to the same IP address (used for web hosting).
- DNS Records: Entries in the DNS database.
- A Record: Maps a hostname to an IP address.
- CNAME Record: Maps one hostname to another hostname (alias).
- MX Record: Used for email services.
- DNS Hierarchy:
- A distributed system with shared responsibility for managing DNS records.
- Root Domain: Top of the hierarchy, contains records for top-level domains (TLDs).
- Top-Level Domains (TLDs): (e.g., .com, .org, .edu).
- Second-Level Domains: Registered under TLDs (e.g., example.com).
- DNS Resolution Process:
ii.If the server has the record in its cache, it returns the IP address.
iii.If not, the server queries other DNS servers, starting at the root, to find the record.
iv.The server caches the record for future queries.
4. Networking in Context of Computing
- The internet is a network of hardware and software enabling communication between devices.
- Data transmission over the internet is based on binary data (0s and 1s).
- Network interfaces (e.g., Wi-Fi, Ethernet) are I/O devices.
- Operating systems use device drivers and software libraries to facilitate network communication for applications.
- Networking devices (routers, switches) are specialized computers.
- Networking extends computing beyond single devices.
- Published on
KembaraXtra-Computer Science - A Trip Through the Internet
Overview
This guide summarizes the journey of data across the internet using the TCP/IP model, illustrating how different devices interact at each layer.
Scenario
Overview
This guide summarizes the journey of data across the internet using the TCP/IP model, illustrating how different devices interact at each layer.
Scenario
- A client device (connected to Wi-Fi) wants to access a web page hosted on a server (connected via wired connection).
- The client knows the server's IP address.
- Application Layer (Client):
- The web browser creates an HTTP request.
- The browser hands off the HTTP request to the OS's TCP/IP stack.
- Transport Layer (Client):
- The TCP layer encapsulates the HTTP payload into a TCP segment.
- It sets the destination port to 80 (standard for HTTP) in the segment header.
- If the data is too large, TCP divides it into multiple segments.
- Internet Layer (Client):
- The IP layer wraps the TCP segment in an IP packet.
- The packet header includes the destination IP address of the server.
- If necessary, IP divides the packet into smaller fragments.
- Link Layer (Client):
- The IP packet is encapsulated in a frame.
- The frame header includes the MAC address of the local router.
- The client's Wi-Fi hardware transmits the frame wirelessly.
- Wireless Access Point:
- Receives the frame.
- Sends the frame to the router (operates at the link layer).
- Router(s):
- Examines the IP packet to determine the destination IP address.
- Encapsulates the packet in a new frame with the MAC address of the next router.
- Sends the new frame on its way.
- This routing process continues through multiple routers.
- Final Router (Server's Subnet):
- Encapsulates the packet in a frame suitable for the server's local network.
- The frame header includes the MAC address of the server.
- Switch (Server's Subnet):
- Looks at the MAC address in the frame.
- Forwards the frame out the appropriate physical port to the server.
- Doesn't need to look at higher layers.
- Server:
- Receives the frame.
- The network interface driver passes the TCP/IP packet up to the TCP/IP stack.
- The TCP/IP stack hands off the HTTP data to the process listening on TCP port 80.
- The web server software (listening on port 80) handles the request.
- Reverse Process (Server to Client):
- The server replies to the client, and the entire process happens again in reverse order.
- Encapsulation: Each layer adds its own header to the data from the layer above.
- Decapsulation: Each layer removes its header to reveal the data for that layer.
- Routers: Operate at the internet layer (primarily) to forward packets between networks based on IP addresses.
- Switches: Operate at the link layer to forward frames within a local network based on MAC addresses.
- Ports: Used by the transport layer (TCP/UDP) to identify specific applications or services on a host.
- Devices interact at different layers of the TCP/IP stack.
- The routing process involves multiple routers, each forwarding the packet closer to its destination.
- The switch forwards data based on MAC addresses within the local network.