Fundamentals of Computing - 1.pdf
Document Details
Tags
Full Transcript
Data Storage 1 Bits and Bits patterns Bit: Binary Digit (0 or 1) Inside today’s computers information is encoded as patterns of 0s and 1s. Boolean Operations An operation that manipulates one or more true/false values Specific operations AND is TRUE when both inputs are true. (1+1 =1)...
Data Storage 1 Bits and Bits patterns Bit: Binary Digit (0 or 1) Inside today’s computers information is encoded as patterns of 0s and 1s. Boolean Operations An operation that manipulates one or more true/false values Specific operations AND is TRUE when both inputs are true. (1+1 =1) OR is TRUE when at least one input is true. (1+0=1) XOR (exclusive or) is TRUE when only one input is true. (0+1=1) NOT just flips the input the opposite. Gates are devices that perform basic Boolean operations. They are small electronic circuits that serve as the essential building blocks for computers. Flip-flops A circuit built from gates that can store one bit. One input line is used to set its stored value to 1 One input line is used to set its stored value to 0 While both input lines are 0, the most recently stored value is preserved VLSI (Very Large Scale Integration) packs millions of electronic components onto a small chip, enabling tiny devices and complete computer systems on one chip. Hexadecimal Notation Or base 16, is a shorthand for long bit patterns, making them easier to read. It groups bits into sets of four and uses a single symbol (0-9, A-F) for each group. For example, the binary number 10100011 is represented as A3 in hexadecimal. Main Memory Cells Computers have extensive circuits, like flip-flops, to store data in what's known as main memory. Cell: A main memory unit, typically 8 bits (one byte). Most Significant Bit (MSB): The leftmost (high-order) bit in a memory cell. Least Significant Bit (LSB): The rightmost (low-order) bit in a memory cell. Main memory address An address uniquely identifies each memory cell in a computer's main memory, assigned as consecutive numbers starting from zero. This numbering organizes the memory cells for easy access. Memory terminology Random Access Memory (RAM) - RAM allows access to memory cells in any order. Modern RAM uses advanced technology for efficiency: Dynamic memory or DRAM - stores data as tiny electrical charges that need frequent refreshing, making it volatile. Synchronous DRAM (SDRAM)- enhances DRAM for faster data retrieval. Mass storage On-line vs. Off-line Mass Storage Systems Types: Magnetic: Hard drives, tapes Optical: CDs, DVDs Solid-State: Flash drives, SD cards, SSDs Advantages Over Main Memory: More stable (less volatile) Larger capacity Lower cost Removable Disadvantage: Slower access due to mechanical moving parts, unlike faster electronic main memory. Solid State Storage Flash Memory How It Works: Flash memory traps electrons in tiny silicon dioxide chambers. Drawbacks: Repeated erasing can gradually damage the media. Common Uses: ○ Digital cameras ○ Smartphones Flash Drives: Portable units with capacities up to several hundred GB, usually connecting via USB. Secure Digital (SD) Cards: Offer several GBs of storage. Solid State Disks (SSD): Use flash memory for faster data access and storage. Flies - A unit of data stored in a mass storage system. Physical Record vs. Logical Record: Physical Record: The actual data as stored on the storage medium. Logical Record: Represents data in a way that's meaningful for processing, often consisting of smaller segments called fields (e.g., name, address). Key Field: A unique identifier for a logical record, known as the key. Buffer: A temporary memory area used to store data during transfer processes. Representing data Each character is represented by a unique bit pattern. ASCII: The original system used 7 bits for 128 characters, covering most English text. DOS extended this to 8 bits for 256 characters. ISO: Developed several 8-bit extensions to ASCII to support major language groups. Unicode: Uses 16 bits to represent a wide range of symbols for languages worldwide. Representing Numeric values Binary Notation: Represents numbers in base two using bits. Limitations: ○ Overflow: When a number is too large to be represented. ○ Truncation: When a value cannot be accurately represented. Representing images Pixel: Short for "picture element." Bitmap Techniques: ○ Images as encoded pixels (RGB: 3 bytes). ○ Luminance: Brightness (R + G + B). ○ Chrominance: Color differences (blue and red). ○ Limitation: Enlargement leads to "pixelation." Vector Techniques: ○ Images as geometric shapes. ○ Advantage: Scalable without quality loss (e.g., TrueType, PostScript). Representing sounds Sampling Techniques - Higher sampling rates yield better audio quality; MIDI captures essential music data efficiently. 1. Audio Sampling: Telephone: 8,000 samples/second. Music: 44,100 samples/second for high fidelity. 2. MIDI: Records musical data (e.g., instrument & duration). Example: Clarinet playing D for 2 seconds: ○ Audio Sampling: >2 million bits. ○ MIDI: Only 3 bytes (24 bits). Data storage 2 The binary system The traditional decimal system is based on powers of ten. The Binary system is based on powers of two. Decoding the binary representation 100101 Algorithm to find the binary representation of a positive integer. Step 1: divide the value by two and record the remainder. Step 2: as long as the quotient obtained is not zero, continue to divide the newest quotient by two and record the remainder. Step 3: Now that a quotient of zero has been obtained, the binary representation of the original value consists of the remainders listed from right to left in the order they were recorded. Binary addition Decoding the binary representation 101.101 Storing Integers Two’s complement notation: Integer values are commonly represented using a 32-bit pattern in modern equipment. Excess notation is another method for representation. Both methods can experience overflow errors if a value exceeds their minimum or maximum limits. Two’s complement notation systems 1. String of 0s of the appropriate length 2. Count upward unit a pattern of o followed by all 1s is reached 3. Count backwards in binary from all 1s until a pattern of 1s followed by all 0s is reached or start from the bottom and count upward. Left bit is the sign bit: 0 - 0 - nonnegative(positive) 1 - negative To code -6 in two's complement using four bits: 1. Find the binary of +6: The binary representation of 6 is 0110. 2. Invert the digits: Change all 0s to 1s and 1s to 0s: 1001. 3. Add 1 to the inverted number: ○ 1001 + 0001 = 1010. So, -6 in four-bit two's complement is 1010. Addition problems converted to two’s complement notation (4 bits) An excess eight conversion table An excess notation system using bit patterns of length three Excess-4 Notation is a way to represent numbers using binary, where you add 4 to the actual value to encode it. 1. Offset by 4: To find the binary representation, add 4 to the number you're trying to encode. For example, the number 0 would be represented as 4 in binary, which is 0100. 2. Negative Numbers: The largest negative number in excess-4 helps determine the range of values you can represent. In a 4-bit system, it typically ranges from -4 to +3. Storing Fractions Floating-point Notation is a way to store fractions or real numbers in computers using a specific format that includes: (components) 1. Sign Bit: Indicates whether the number is positive (0) or negative (1). 2. Exponent Field: Represents how many places to shift the decimal point, allowing for a wide range of values. 3. Mantissa Field : Contains the significant digits of the number, usually starting with a 1 in normalized form. Key Concepts: Normalized Form: The mantissa is adjusted to begin with the leftmost 1, ensuring efficient storage and accurate representation of the number. Truncation Errors (Round-off Errors): Occur when the mantissa field isn't big enough to hold all the digits of the number. This can lead to a loss of precision because some information is cut off. In simple terms, floating-point notation helps computers represent fractions, but it can sometimes lead to small errors due to limitations in how many digits can be stored. Truncation Data Data Compression Lossy vs. Lossless: Lossy: Some data is lost during compression (e.g., JPEG images). Lossless: All original data can be restored (e.g., PNG images). Types of Lossless Compression: 1. Run-Length Encoding (RLE): ○ Replaces sequences of identical data with a code for the element and the count. Example: "AAAABBB" → "4A3B". 2. Frequency-Dependent Encoding: ○ Uses shorter codes for more frequent items (e.g., Huffman coding). Example: More common letters get fewer bits. 3. Relative Encoding (Differential Encoding): ○ Records differences between consecutive data units instead of entire values. Example: In videos, only the changes between frames are saved. 4. Dictionary Encoding: ○ Uses a dynamic dictionary to compress data. Example: LZW (used in GIFs) builds a dictionary as it encodes. Compressing Images GIF (Graphic Interchange Format) Good for cartoons JPEG (Joint Photographic Experts Group) Good for photographs TIFF (Tagged Image File Format) Good for image archiving Compressing Audio and Video 1. MPEG (Motion Picture Experts Group): ○ A set of standards for video and audio compression. ○ Used in high-definition TV broadcasts and video conferencing. 2. MP3 (MPEG Layer 3): ○ Common audio format that reduces file size while maintaining quality. ○ Utilizes human hearing characteristics: Temporal Masking: After a loud sound, softer sounds aren’t heard for a brief time. Frequency Masking: Louder sounds at one frequency can hide softer nearby sounds. Communication Errors Error-correcting techniques help keep data safe and accurate, especially in hard drives and CDs. Here are some simple examples: 1. Parity Bits: Adds a single extra bit to show if the number of 1s is even or odd. It helps spot errors. 2. Checkbytes: Extra codes that check if the data is correct. If it doesn't match, there's an error. 3. Error-Correcting Codes (ECC): Smart methods that can find and fix errors automatically. Parity Bits Communication errors Parity bits help detect communication errors by ensuring that all data patterns have an odd number of 1s. If a pattern with an even number of 1s is found, it indicates an error. To achieve this, a parity bit is added to the data, making the total count of 1s odd. Checkbytes are used to detect errors in long bit patterns, like those on a magnetic disk. Each checkbyte consists of parity bits, where each bit corresponds to a specific set of bits in the pattern. If errors occur in one area, they are likely to be detected because they're covered by multiple parity bits. This idea leads to more advanced error detection methods, such as checksums and cyclic redundancy checks (CRC). Error-correcting codes detect and correct errors in data transmission. The Hamming distance measures how many bits differ between two patterns. For example, if one pattern differs from another by only one bit, it can be corrected. To ensure effective correction, at least three bits must change for one pattern to resemble another legal pattern, allowing the code to identify and fix errors reliably. Decoding the pattern 010100 using the code in Figure 1.30 Imagine receiving a bit pattern that doesn't match the code: 010100. We compare it to the code's patterns and find the closest match is D. This example allows us to detect 2 errors and correct 1. The larger the Hamming distance, the more errors we can detect and correct. For example, a distance of 5 would detect 4 errors and correct 2. Data Manipulation 1 Computers manipulate data and communicate with peripheral devices such as printers and keyboards. Computers are programmed by means of encoded instructions, called machine language instructions. Computer Architecture The Central Processing Unit (CPU) or processor has three main parts: 1. Arithmetic/Logic Unit: This part does calculations and logical operations (like adding and subtracting numbers). 2. Control Unit: This part directs and manages how all the parts of the computer work together. 3. Registers: These are small storage areas that hold data the CPU is currently working on, the instruction it's executing, and the address of the next instruction to execute. There are general-purpose registers for everyday tasks and special-purpose registers for specific functions. Additionally, the CPU uses a Bus to connect to the main memory, and it is mounted on the Motherboard, which is the main circuit board of the computer. CPU and main memory connected via a bus Stored Program Concept A program can be encoded as bit patterns and stored in main memory. From there, the CPU can then extract the instructions and execute them. In turn, the program to be executed can be altered easily. Terminology Machine instruction: An instruction is a command written in a specific pattern of bits that the CPU can understand. Machine language is the complete list of all the instructions that a computer can recognize and execute. Machine Language Philosophies 1. RISC (Reduced Instruction Set Computing): ○ Few, simple instructions. ○ Designed for speed and efficiency. ○ Examples: ARM, PowerPC. 2. CISC (Complex Instruction Set Computing): ○ Many powerful instructions. ○ Complex tasks can be done with fewer lines of code. ○ Example: Intel processors. Machine Instruction Types Data Transfer: copy data from one location to another Arithmetic/Logic: use existing bit patterns to compute a new bit patterns Control: direct the execution of the program Adding values stored in memory 2 Step 1: get one of the values to be added from memory and place it in the register. Step 2: get another value to be added from memory and place it in another register. Step 3: activate the additional circuitry with the registers used in step 1 and 2 as inputs and another register designated to hold the result. [2+3] Step 4: store the results in memory. Step 5: Stop. Dividing values stored in memory Step 1: LOAD a register with a value from memory. Step 2: LOAD another register with another value from memory. Step 3: If the second value is zero, JUMP to step 6. [0?] Step 4: Divide the contents of the fist register by the second register and leave the results in a third register. [8/4=2] Step 5: STORE the contents of the third register in memory. Step 6: STOP. The architecture of the machine described in Appendix C Parts of a Machine Instruction 1. Op-code: Tells the computer which operation to perform. 2. Operand: Provides more details about the operation. 3. Variation: The operand's meaning changes depending on the op-code. Example: Add 2 numbers Op-code: "ADD" Operand: "2 + 3" Computer: "Oh, you want to ADD 2 numbers? Great! The first operand is 2 and the second operand is 3. Let me do that for you..." A simple machine language Decoding the instruction 35A7 An encoded version of the instructions in Figure 2.2 Data Manipulation 2 Program Execution Basics Two important registers: ○ Program Counter: Points to the next instruction to run. ○ Instruction Register: Holds the instruction that is currently being processed. Machine Cycle Steps: 1. Fetch: Get the next instruction from memory. 2. Decode: Understand what the instruction means. 3. Execute: Carry out the instruction. A Simple Machine Language Decoding the instruction B258 Program from Fig 2.7 stored in main memory ready for execution Performing the fetch step of the machine cycle 8 Fetch Step of the Machine Cycle 1. Get Instruction: The instruction at address A0 is pulled from memory and stored in the instruction register. 2. Update Program Counter: The program counter is changed to A2 so it points to the next instruction. 3. Process Instruction: The instruction is decoded (understood) and executed. This cycle continues until a HALT instruction is reached. Arithmetic/Logic Operations Logic: AND, OR, XOR Masking Arithmetic/Logic Operations (con’t) Rotate and Shift: Circular shift (Figure 2.12 Rotating the bit pattern 65 (hexadecimal) one bit to the right) Arithmetic/Logic Operations: Rotate and Shift Circular Shift: This moves the bits around in a circle (like rotating). For example, rotating the bit pattern of 65 (in hexadecimal) one bit to the right. Logical Shift: Shifting bits left multiplies by 2, while shifting right divides by 2. Be careful to keep the sign bit (which indicates positive or negative). Arithmetic Shift: This type of shift keeps the sign bit the same. Arithmetic/Logic Operations (continued) Addition: Combining two numbers. Subtraction: Taking one number away from another (can be seen as adding a negative number). Multiplication: Adding a number to itself repeatedly (like 3 × 4 means adding 3 four times). Division: Taking a number away repeatedly (like 12 ÷ 4 means subtracting 4 from 12 three times). How you do these operations depends on how the numbers are stored in the computer: Two’s complement: Simple to add by stacking numbers on columns (like regular addition). Floating-point: Convert the number from its special format, do the math, and then convert it back. Appendix B: Circuits for Two’s Complement Manipulation A: A circuit that flips (negates) a two's complement number. B: A circuit that adds a single column of bits. C: A circuit that adds two two's complement numbers together. Communicating with Other Devices Controller: A device that manages communication between the computer and other devices. Each type of device has its own specific controller, but there are also general-purpose controllers like USB and FireWire. Port: The connection point where a device links to a computer. Memory-mapped I/O: A method where the CPU treats peripheral devices like they are part of memory, allowing direct communication. Controllers attached to a machine’s bus A conceptual representation of memory-mapped I/O Memory-mapped I/O means using part of the computer's memory to connect with input/output devices instead of regular RAM. This way, you can communicate with these devices just like you would read or write to memory. The I/O device just needs to follow the same communication rules as the memory. Communicating with Other Devices (continued) Direct Memory Access (DMA): Allows a controller to access main memory while the CPU is busy, speeding up performance but complicating communication on the bus. Von Neumann Bottleneck: The bus speed isn't fast enough, slowing down the computer's performance. Handshaking: A method to ensure that data is transferred properly between components. Communicating with Other Devices (continued) Serial Communication: Bits are sent one at a time over a single path. Examples include USB, FireWire, and modems. Parallel Communication: Multiple bits are sent at once through several paths. An example is a computer's internal bus. Data Communication Rates Measurement Units: ○ Bps: Bits per second ○ Kbps: 1,000 bits per second ○ Mbps: 1,000,000 bits per second ○ Gbps: 1,000,000,000 bits per second Multiplexing: Combines multiple data streams into one communication path, allowing it to act like several paths. Bandwidth: The maximum speed at which data can be transferred in a specific setting. Other Architectures: 1. Traditional Machine: SISD - One instruction and one piece of data at a time. 2. Ways to boost performance: ○ Pipelining: Overlap tasks so one instruction is being processed while another is being prepared. ○ Parallel Processing: Use multiple processors at the same time. ○ SIMD: One program operates on multiple data items. ○ MIMD: Different programs work on different data at the same time. Operating Systems 1 Functions of Operating Systems An operating system is software that: Manages the computer's operations Stores and retrieves files Schedules programs to run Coordinates how programs run together Evolution of Shared Computing 1940s-50s: Batch processing (jobs run one after another without user interaction) 1960s-70s: Interactive processing (users can interact during job execution) 1970s onward: Time-sharing/multitasking (multiple tasks run at the same time on multiprocessor machines) Batch Processing (1940s-50s) Computers were large and took up entire rooms. There were no screens; users relied on switches and punched cards. Jobs were collected in batches by an operator and executed without any user input during the process. Interactive processing in the 60s-70s Allowed users to work in real-time, using remote terminals like typewriters or printers. It was effective for one user at a time, but only being able to handle one task at a time made it difficult for multiple users to access the system simultaneously. Time Sharing/Multitasking (1970s and later): Allows multiple users to use the same computer at the same time. One way to do this is through multiprogramming. In multitasking, a single user can run multiple tasks at the same time on their computer. Multiprocessor machines Allow multiple tasks to run at the same time by sharing their processing power. Some processors share time unevenly (asymmetric), while others might share tasks equally (symmetric). Challenges include: 1. Load Balancing: Distributing tasks evenly across processors for better use. 2. Scaling: Dividing tasks into smaller parts that match the number of processors available. Types of Software: Application Software: Helps users perform specific tasks. System Software: Supports application software and includes the operating system and utility programs. Software classification Operating System Components User Interface: How users interact with the computer. ○ Text-based (Shell): Uses text commands. ○ Graphical User Interface (GUI): Uses icons and images. Window Manager: Manages screen space by creating "windows" for different applications and keeps track of which app is in each window. Operating System Components: Kernel: Handles core functions. File Manager: Manages files.(Program Files) Device Manager: Controls hardware devices. (Keyboard, Printer) Memory Manager: Manages RAM. Processor Manager: Oversees CPU usage. Scheduler: Organizes tasks for execution. Dispatcher: Transfers tasks to the CPU. File Manager helps manage the computer's storage. A Directory (or Folder) is a user-made collection of files and subdirectories. A Directory Path is a list of directories linked together. Device drivers are software that help the computer talk to hardware devices, like printers or keyboards, so they can work properly. The Memory Manager allocates space in main memory and can make it seem like there’s more memory than there really is (virtual memory). It does this by moving data blocks (pages) between main memory and storage as needed. Bootstrapping, or "booting," is how a computer moves its operating system from storage into memory when it turns on. Boot Loader: A small program stored in ROM (special memory) that runs when you power up the computer. It loads the operating system into memory and starts it up. The booting process ○ ○ Operating Systems 2 Coordinating Machine Activities: The operating system manages the execution of application software, utility software, and its own components. Concept of a Process: Process: The execution of a program. Process State: The current status of this execution, including: ○ The current point in the program (program counter). ○ The values in the CPU registers and relevant memory areas. This represents a snapshot of the system at a specific moment. Process Administration Involves coordinating process execution, which is managed by the Scheduler and the Dispatcher in the operating system's kernel. Scheduler The scheduler manages the process table in memory, adding new processes and removing those that are complete. A process is "ready" when it can continue running, and "waiting" when it is paused until an external event happens. Dispatcher The dispatcher manages the execution of scheduled processes by allocating short time slices to each one. It switches the CPU's focus between processes, allowing each to run for a time slice. When the time slice ends, an interrupt signals the dispatcher, which then uses an interrupt handler to determine how to respond. Process Switching Managing Competition Among Processes An important role of an operating system is distributing the machine's resources among competing processes. This is done using several methods, including: Semaphores Critical Regions Mutual Exclusion Semaphore A “control flag” that controls access to a common resource by multiple processes Critical Region A group of instructions that should be executed by only one process at a time Mutual exclusion Requirement for proper implementation of a critical region Deadlock occurs when processes block each other because they are waiting for resources held by one another. This can happen when: 1. Processes compete for non-sharable resources. 2. Resources are requested in parts, leading processes to ask for more. 3. Allocated resources cannot be forcibly taken back. When a process needs to create new processes but the system's process table is full, it can further contribute to the deadlock situation. Security Issues and Solutions External Attacks: Problems: ○ Insecure passwords, Sniffing software Countermeasures: ○ Use auditing software Internal Attacks: Problem: ○ Unruly processes Countermeasures: ○ Control process activities with privileged levels and instructions. Networking and the Internet 1 Scope: PAN (Personal Area Network): Small, personal devices (e.g., Bluetooth). LAN (Local Area Network): Covers a small area like a home or office. MAN (Metropolitan Area Network): Spans a city or large campus. WAN (Wide Area Network): Covers large areas, even globally (e.g., the Internet). Ownership: Closed (Proprietary): Owned by a single entity (e.g., Novell). Open (Public Domain): Accessible to the public (e.g., Internet, TCP/IP). Topology (Configuration): Bus: All devices share a single communication line (e.g., Ethernet). Star: Devices connect to a central point (e.g., wireless networks with a central Access Point). Network topologies Protocols are rules that help networks work reliably, and they are essential for developing networking technologies. CSMA/CD (Carrier Sense Multiple Access with Collision Detection): This method allows devices to check if the network is busy before sending data. If a device detects a collision while transmitting, it stops and tries again later. It is commonly used in Ethernet networks. CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance): This method also checks if the network is clear before sending data, but devices try to avoid collisions by waiting until the channel is idle. It is commonly used in WiFi networks. The hidden terminal problem occurs when two devices cannot sense each other’s signals and may end up colliding when they try to send data at the same time. Communication over a bus network In a bus network: 1. Send Signal: A device sends data onto the shared bus. 2. Travel: The signal travels along the bus. 3. Receive: Devices check if the signal is for them. 4. Process: The intended device processes the data. It’s a simple and cost-effective way to connect devices The hidden terminal problem The hidden terminal problem happens when two devices can’t see each other but try to send data to a third device at the same time, causing a collision. This issue can lead to data loss and reduced network efficiency. Connecting Networks Repeater: Makes a network bigger. Bridge: Links two similar networks. Switch: Connects multiple similar networks. Router: Links different networks to create an internet. Building a large bus network from smaller ones To build a large bus network from smaller ones: 1. Link Networks: Use repeaters, bridges, and switches. 2. Connect Segments: Use routers for different parts. 3. Boost Signal: Use repeaters to keep the signal strong. 4. Manage Traffic: Monitor and control data flow. Routers connecting 2 WiFi nets and an Ethernet network to form an internet To connect two WiFi networks and an Ethernet network: 1. Main Router: Connect to the internet. 2. WiFi Routers: Link to the main router. 3. Ethernet Network: Connect to the main router. This setup allows all networks to share the same internet connection. Inter-process Communication Client-Server: One server, many clients: One server handles requests from multiple clients. Server always on: The server must run continuously. Client starts: The client initiates the communication. Peer-to-Peer (P2P): Equal communication: Two processes communicate as equals. Short-lived peers: Peer processes can be temporary. Distributed Systems: Systems where parts run on different computers. Types: 1. Cluster Computing: ○ Homogeneous: Similar computers working closely together. ○ Example: A group of servers in one location. 2. Grid Computing: ○ Geographically Distributed: Different computers spread out over various locations. ○ Example: Computers in different cities working together. 3. Cloud Computing: ○ Services via the Cloud: Resources and services provided over the internet. ○ Examples: Amazon’s Elastic Compute Cloud: Provides scalable computing power. Google Drive: Offers online storage and file sharing. The Internet Original goal was to develop a means of connecting networks that would not be disrupted by local disasters. Today it has shifted from an academic research project to a commercial undertaking that links a worldwide combination of PANs, LANs, MANs, and WANs involving millions of computers PANs (Personal Area Networks): Connect devices like phones and laptops over short distances, usually within a room. LANs (Local Area Networks): Connect computers in a small area, like a home or office. MANs (Metropolitan Area Networks): Cover a larger area, like a city, connecting multiple LANs. WANs (Wide Area Networks): Connect networks over vast distances, like between cities or countries. Internet Architecture The Internet is structured through a hierarchy of Internet Service Providers (ISPs) that offer connectivity: 1. Types of ISPs: ○ Tier-1 ISPs: Backbone providers with high-speed, international networks. They connect directly with each other. ○ Tier-2 ISPs: Regional providers that connect to Tier-1 ISPs and serve larger areas, including cities. ○ Tier-3 ISPs: Local ISPs that connect directly to end users, often serving homes and businesses. 2. Connection Types: ○ Hot Spots (Wireless): Locations offering public Wi-Fi access (e.g., cafes). ○ Dial-up: An older, slower way to connect using a phone line. ○ Cable/Satellite: High-speed connections using cable TV lines or satellites. ○ DSL: Fast Internet via phone lines, without interrupting calls. ○ Fiber Optics: Very fast connections using light through glass fibers. ○ Wireless: Mobile connections (e.g., 4G/5G) for Internet on-the-go. Internet Composition Internet Addressing Simplified: 1. IP Address: A unique number for devices online. ○ IPv4: Has 32 bits (e.g., 192.168.1.1). ○ IPv6: Has 128 bits (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334). 2. Mnemonic Address: Easier names for websites. ○ Domain Name: Like ub.edu.bz. ○ Subdomain: Like doit.ub.edu.bz. ○ Top-Level Domain (TLD): The last part, like.bz. 3. Domain Name System (DNS): Converts names to IP addresses. 4. Name Servers: Directories that help with this conversion. 5. DNS Lookup: The process of using DNS to find an IP address from a name. Internet Corporation for Assigned Names & Numbers (ICANN) ICANN gives out IP addresses to Internet Service Providers (ISPs), which then distribute them in their areas. ICANN also manages how domain names are registered. To register a domain name, you must go through a registrar approved by ICANN. Early/ Traditional Internet Applications: 1. Network News Transfer Protocol (NNTP): Used for sharing news. 2. File Transfer Protocol (FTP): Allows file transfers between computers. 3. Telnet and SSH : Let you connect to another computer remotely. 4. Hypertext Transfer Protocol (HTTP): Used for loading websites. 5. Email: Sends and receives messages. A mail server collects incoming emails and sends out new ones. SMTP sends new emails and transfers them between servers. It delivers incoming emails to users through POP3 or IMAP. Recent Uses of Internet Technology: 1. Voice Over IP (VoIP): Making phone calls over the internet. 2. Internet Multimedia Streaming: Watching videos or listening to music online. 3. N-unicast: Sending data to one person at a time. 4. Multicast: Sending data to multiple people at the same time. 5. On-demand Streaming: Watching or listening to content whenever you want. 6. Content Delivery Networks (CDNs): Services that deliver content quickly by storing it in various locations. Networking and the Internet 2 World Wide Web The World Wide Web uses hyperlinks to connect documents. Browsers show these documents to users, while web servers provide access. Each document has a URL and is shared using the HTTP protocol. A typical URL Uniform Resource Locator (URL) is a unique address used to locate and retrieve documents on the WWW. Protocol required to access the document. In this case it is hypertext transfer protocol(http). Mnemonic name of host holding the document. Directory path indicating the location of the document within the host files system Document name. Hypertext Document Format Encoded as text file Contains tags to communicate with browser Appearance to start a level one heading to start a new paragraph Links to other documents and content Insert images A simple Web page 1. HTML Element: is the root element of the page. 2. Head Element: contains meta-information like the character set and the title of the page. 3. Title Element: sets the title of the web page, which appears in the browser tab. 4. : is used to close the head section of the document. 5. Body Element: contains the content of the web page. 6. Header: represents the main heading or title of the page. 7. Paragraph: is a tag in HTML that is used to define a paragraph. 8. : This tag closes the body section of the HTML document. 9. : This tag closes the entire HTML document. A Enhanced simple web page 10. HTML Element: is the root element of the page. 11. Head Element: contains meta-information like the character set and the title of the page. 12. Title Element: sets the title of the web page, which appears in the browser tab. 13. : is used to close the head section of the document. 14. Body Element: contains the content of the web page. 15. Header: represents the main heading or title of the page. 16. Paragraph: is a tag in HTML that is used to define a paragraph. 17. : used to create hyperlinks, which allow users to click and navigate to other web pages or resources. 18. : The content between the opening and closing tags is what users will click on. 19. : closes the paragraph section 20. : This tag closes the body section of the HTML document. 21. : This tag closes the entire HTML document. Extensible Markup Language (XML) XML is a way to create custom markup languages, similar to HTML but more flexible. A descendant of SGML (Standard Generalized Markup Language) Opens door to a World Wide Semantic Web Client Side Versus Server Side Client-side activities - Runs on the user’s device (browser). Examples: Java applets, JavaScript, Macromedia Flash. Server-side activities - Runs on the server. Examples: Common Gateway Interface (CGI), Servlets, PHP. Client-side is for user interactions, while server-side handles data processing and storage. Internet Software Layers Application: Constructs message with address Transport: Chops message into segments Network: Converts segments into packets and routes them through the Internet Link: Handles actual transmission of packets Following a message through the internet 1. Origin: ○ Application: Prepares the message and adds the destination address. ○ Transport: Splits the message into packets. ○ Network: Assigns an intermediate address to each packet. ○ Link: Sends packets to their intermediate addresses. 2. Intermediate Stops: At each stop, the network layer gives the packet a new address and sends it back to the link layer to continue its journey. ○ Network: Assigns new intermediate addresses to packets. ○ Link: Transmits packets across networks. 3. Final Destination: ○ Link: Receives packets. ○ Network: Confirms packets have reached the final destination. ○ Transport: Reassembles packets into the original message. ○ Application: Receives the complete message. TCP/IP Protocol Suite Is a set of standards used for internet communication. It has four layers: 1. Transport Layer: Includes TCP and UDP. 2. Network Layer: Includes IP (IPv4 and IPv6). These protocols help manage data transmission across networks. Internet software layers Transmission Control Protocol/ Internet Protocol (TCP/ IP) Open Systems Interconnect (OSI) 1. Represents Data: Shows data to the user, handles encoding and dialog. 2. Supports Communication: Connects different devices and networks. 3. Determines Path: Finds the best route through the network. 4. Controls Hardware: Manages network devices and media. Choosing between TCP and UDP TCP (Transmission Control Protocol): Reliability Reliable: Ensures all data packets arrive in order. Connection-Oriented: Establishes a connection before data transfer. Use Cases: Web browsing, email, file transfers. UDP (User Datagram Protocol): Speed Faster: No connection setup, less overhead. Unreliable: No guarantee of packet delivery or order. Use Cases: Streaming, online gaming, VoIP. Security Attacks: Malware: Viruses, worms, Trojan horses, spyware, phishing. Denial of Service (DoS/DDoS): Overloading a system to make it unavailable. Spam: Unwanted messages. Protection: Firewalls: Block unauthorized access. Spam Filters: Block unwanted messages. Proxy Servers: Hide your IP address. Antivirus Software: Detect and remove malware. Encryption: FTPS, HTTPS, SSL: Secure data transfer protocols. Public-Key Encryption: Uses two keys: ○ Public Key: Encrypts messages. ○ Private Key: Decrypts messages. Certificates and Digital Signatures: Certificate Authorities: Issue digital certificates to verify identities.