Prog 1235 Final Exam Prep PDF
Document Details

Uploaded by MerryHelium
Conestoga College
Tags
Summary
This document contains a set of questions and answers related to Windows OS, PowerShell 7, TCP/IP network protocols and other networking concepts. It appears to be a final exam preparation guide for a computing or networking course, covering topics such as PowerShell scripting, TCP/IP layers, and windows operating systems.
Full Transcript
Final Exam Preparation Windows OS 1. What does TPM stand for? Why is it in Windows 11? TPM stands for Trusted Platform Module. It is a secure cryptoprocessor used in Windows 11 to verify that the boot process starts from trusted hardware and software, and it also...
Final Exam Preparation Windows OS 1. What does TPM stand for? Why is it in Windows 11? TPM stands for Trusted Platform Module. It is a secure cryptoprocessor used in Windows 11 to verify that the boot process starts from trusted hardware and software, and it also stores disk encryption keys. 2. List two system level issues discussed in class. Third-party device drivers causing instability in kernel mode. Malware threats such as rootkits or bootkits that compromise the kernel. 3. How would you fix those issues? For problematic drivers: ensure they are digitally signed, update or remove outdated/unstable drivers, and enable Secure Boot. For kernel-level malware threats: use TPM, Secure Boot, and a robust security setup (e.g., Windows Defender, Sysmon monitoring) to detect or block malicious code. 4. What is the purpose of Process Explorer? Process Explorer is described as an advanced version of Task Manager. It displays detailed information about running processes (including threads, DLLs, and handles) and shows parent-child relationships in a tree view. 5. What is the purpose of Process Monitor? Process Monitor logs details about file system, registry, network, process, thread, and image load activity in real time. It is useful for troubleshooting by capturing and filtering large numbers of system events. 6. What does the Sysmon tool do? Sysmon operates at the kernel level to monitor and log system activities, such as process creation, network connections, and file modifications, helping detect and analyze malware or suspicious behavior. 7. How can you access the System Configuration in Windows? Type “Run” in the Start Menu, then enter msconfig (or “System Configuration”) in the Run dialog. 8. What does access to System Configuration allow you to do? It allows you to configure OS startup processes, services, and programs, troubleshoot boot options, and optimize overall system performance. 9. List two emerging Windows OS technologies. How would you use them? Windows To Go: Create a portable Windows environment on a USB drive for mobility and secure remote usage. Virtual Desktop Infrastructure (VDI): Host virtual Windows desktops in a data center so that users can remotely access a standardized Windows environment. PowerShell 7 Basic Concepts 1. What is PowerShell 7? CHATGPT: PowerShell 7 is a cross-platform command-line shell and scripting language built on.NET, designed for configuration management and automation tasks. It supersedes Windows PowerShell 5.1 and runs on Windows, macOS, and Linux. 2. How do you open PowerShell 7 on Windows? CHATGPT: Search for “PowerShell 7” in the Start Menu. Use Windows Terminal and select the PowerShell 7 profile. 1 Install it from the Microsoft Store or official GitHub repository Or using Visual studio code 3. What is the command to check the version of PowerShell you are using? CHATGPT: You can inspect $PSVersionTable or run: $PSVersionTable OR Get-Host | Select-Object Version 4. Explain the difference between PowerShell and Command Prompt. CHATGPT: Command Prompt is a legacy, text-based shell primarily for running traditional DOS/Windows commands. PowerShell is object-based, built on.NET, and provides more powerful scripting capabilities, with cmdlets that output structured objects instead of plain text. 5. What is a cmdlet in PowerShell? CHATGPT: A cmdlet is a lightweight, specialized command in PowerShell (in the form of Verb-Noun, e.g., Get Process) that performs a single function. Cmdlets are compiled.NET classes designed for efficiency and consistency. BOOK: Cmdlets – commands in PowerShell are called cmdlet. They are built on common runtime rather than separate executables as they are in many other shell environments. This provides better experience in parameter parsing and pipeline behavior 6. What are some attributes of CmdletBinding()? CHATGPT: Common attributes include: SupportsShouldProcess (enables -WhatIf and -Confirm) DefaultParameterSetName ConfirmImpact HelpUri These attributes allow you to build advanced functions that behave like compiled cmdlets. Scripting and Commands 1. How do you create a new script file in PowerShell? CHATGPT: Use a text editor like VS Code or Notepad, then save with a.ps1 extension. Or from PowerShell: New-Item -ItemType File "MyScript.ps1" 2. What is the command to list all files in a directory? CHATGPT: Get-ChildItem OR Aliases like dir or ls also work. 3. How do you execute a script in PowerShell? CHATGPT: Provide the path to the script with a.\ prefix:.\MyScript.ps1 4. What is the purpose of the Get-Help cmdlet? CHATGPT: Get-Help provides documentation and usage details on cmdlets, scripts, and PowerShell functions. Example: Get-Help Get-Process -Full BOOK: Use the get-help cmdlet to get information about the New-Item cmdlet 5. How do you comment a line in a PowerShell script? Use # for Single-line comment OR for Multi-Line Comments 6. You have a variable ‘var’. How do you read back the value in this variable using PowerShell command prompt? $var Variables and Data Types 2 1. What are the different data types supported in PowerShell? CHATGPT: Common types include: String ([string]), Integer ([int]), Boolean ([bool]), DateTime ([datetime]), Array ([object[]]), HashTable ([hashtable]) 2. How do you declare a variable in PowerShell? CHATGPT: Use the $ notation followed by the variable name LIKE $myVariable = "Hello" 3. How do you concatenate strings in PowerShell? CHATGPT: Using double quotes: "$string1 $string2" Using the + operator or [string]::Concat() method: $string3 = $string1 + $string2 4. What is the command to convert a string to an integer? CHATGPT: Casting like [int]"42" or [int]$stringVar 5. Explain the use of arrays in PowerShell. CHATGPT: Arrays are used to store an ordered list of items (e.g., numbers, strings, objects). You can declare them by comma separation: $myArray = 1,2,3,4 Control Structures 1. How do you write an if statement in PowerShell? if ($condition) {# code} elseif ($condition2) { # code} else {# code} 2. What is the syntax for a switch statement? switch ($variable) { "Value1" { # code } "Value2" { # code } default { # code } } 3. How do you create a loop using for in PowerShell? for ($i = 0; $i -lt 10; $i++) { # code } 4. Explain the use of foreach in PowerShell. foreach ($item in $collection) { # code } 5. How do you break out of a loop in PowerShell? Use the break keyword. Functions and Modules 1. How do you define a function in PowerShell? function MyFunction { param($param1) # function code } 3 2. What are some of the attributes of CmdletBinding()? SupportsShouldProcess: enables -WhatIf / -Confirm support. DefaultParameterSetName: sets a default parameter set. ConfirmImpact: sets the importance level for confirmations. 3. Explain the use of the Export-ModuleMember cmdlet. The `Export-ModuleMember` cmdlet in PowerShell is used within a module to specify which functions, variables, or cmdlets are accessible to users of the module, thereby controlling the module's public interface. Here’s a simple example: param ( [string] $Name "Hello, $Name!" Export-ModuleMember -Function * -Alias * : This command exports all the functions and aliases defined in the script module. 4. How do you list all available modules in PowerShell? Get-Module -ListAvailable 5. What is the purpose of the Get-Command cmdlet? Get-Command lists all the commands PowerShell knows about (cmdlets, functions, aliases, scripts). You can filter with -Name, -Module, etc. Error Handling 1. How do you handle errors in PowerShell? By default, PowerShell writes errors to the console. You can handle them programmatically with try, catch, and finally blocks, or control behavior with -ErrorAction. 2. What is the try and catch block used for? try: encloses code that might generate exceptions. catch: captures and handles those exceptions. 3. Explain the use of the finally block. finally always runs, whether an error occurred or not. It is used for clean-up tasks, resource closing, or logging. 4. How do you throw an exception in PowerShell? throw "Something went wrong." 5. What is the ErrorAction parameter? Advanced Topics -ErrorAction instructs what PowerShell should do when a command encounters an error. Valid values include SilentlyContinue, Stop, Continue, Inquire, etc. 6. What is PowerShell Remoting? PowerShell Remoting allows you to run commands and scripts on remote machines using the WS-Management protocol (WinRM). It’s useful for administrating multiple servers or clients from one console.\ 7. How do you enable PowerShell Remoting? Enable-PSRemoting -Force : This configures WinRM listeners and firewall exceptions. 8. Explain the use of the Invoke-Command cmdlet. Invoke-Command runs PowerShell commands or scripts on remote computers. You specify the remote computer name(s) and a script block to execute: Invoke-Command -ComputerName Server1 -ScriptBlock { Get-Process } 9. How do you create a scheduled task using PowerShell? Use Register-ScheduledTask (or in older scripting approaches, schtasks.exe). Example: 4 $action = New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "-File C:\Scripts\ Backup.ps1" $trigger = New-ScheduledTaskTrigger -Daily -At 3am Register-ScheduledTask -Action $action -Trigger $trigger -TaskName "DailyBackup" 10. What is the purpose of the Start-Job cmdlet? Start-Job runs a command or script asynchronously in the background (a “job”), so you can continue other tasks while it runs. Retrieve results with Receive-Job. Working with Files and Directories 1. How do you read the contents of a file in PowerShell? Get-Content.\file.txt 2. What is the command to write data to a file? Set-Content (overwrites) Add-Content (appends) Out-File (can format or redirect output) Example: "Hello World" | Set-Content.\file.txt 3. How do you copy files using PowerShell? Copy-Item.\source.txt -Destination C:\backup\ 4. Explain the use of the Move-Item cmdlet. Move-Item moves or renames items (files, directories). It removes from the source and places them in the specified destination. LIKE: Move-Item -Path C:\test.txt -Destination E:\Temp\tst.txt 5. How do you delete a file in PowerShell? Remove-Item.\file.txt Networking and Security 1. How do you retrieve network information using PowerShell? ipconfig /all (cmd-style) Get-NetIPAddress or Get-NetIPConfiguration for native PowerShell cmdlets. 2. What is the command to test network connectivity? Test-Connection (Similar to ping, but returns objects.) 3. Explain the use of the Get-Credential cmdlet. Get-Credential prompts the user for credentials (username and password), returning a PSCredential object that can be passed securely to commands needing authentication. 4. How do you encrypt a string in PowerShell? Typically, you convert it to a SecureString: $secure = ConvertTo-SecureString "MySecret" -AsPlainText -Force Or use methods from the.NET System.Security.Cryptography classes for more advanced encryption. 5. What is the purpose of the Set-ExecutionPolicy cmdlet? Set-ExecutionPolicy controls the level of restriction for running PowerShell scripts (e.g. Restricted, RemoteSigned, Unrestricted). This helps protect against accidental or malicious script execution. Miscellaneous 1. How do you install a PowerShell module from the PowerShell Gallery? 5 Install-Module -Name ModuleName (Requires an internet connection and the PSGallery repository.) 2. What is the command to update PowerShell to the latest version? On Windows, you can typically use the Microsoft Store or the winget package manager. You can also download installers from the official GitHub for PowerShell. For modules: Update-Module 3. Explain the use of the Measure-Object cmdlet. Measure-Object calculates statistical data for numeric properties (like Count, Sum, Average, Maximum, Minimum), or measures the length of strings. 4. How do you format output in PowerShell? Use the Format cmdlets: Format-Table Format-List Format-Wide Example: Get-Process | Format-Table Name, CPU 5. What is the Out-GridView cmdlet used for? Out-GridView displays data in an interactive GUI window where you can sort/filter results in real time. TCP/IP Network Protocols Basic Concepts 1. What does TCP/IP stand for? Transmission Control Protocol / Internet Protocol. 2. Explain the difference between TCP and IP. IP (Internet Protocol) handles addressing and routing of packets (finding the path). TCP (Transmission Control Protocol) provides reliable, connection-oriented data delivery (ensuring packets are received, retransmitting if needed). 3. What is the purpose of the IP address? An IP address uniquely identifies a network interface (host) on a TCP/IP network so data can be routed to the correct destination. 4. How does TCP ensure reliable data transmission? TCP uses acknowledgments, sequence numbers, flow control, and retransmissions of lost data to guarantee all data is delivered in order. 5. What is the role of the subnet mask? A subnet mask determines which portion of the IP address is the network part and which portion is the host part, helping define the size of the network. IP Addressing 1. What are the different classes of IP addresses? Class A: Govermenet, very big company Class B: mid company Class C: Home Class D:Mulitcasting and stream Class E: For research 2. Explain the difference between IPv4 and IPv6. IPv4 uses 32-bit addresses (e.g., 192.168.1.1). 6 IPv6 uses 128-bit addresses and has a vastly larger address space plus built-in features like IPSec. 3. What is a private IP address? An IP address range used inside private networks (non-routable on the public Internet) 4. How do you calculate the network address from an IP address and subnet mask? Perform a bitwise AND between the IP address and the subnet mask. The result is the network address. 5. What is the purpose of a default gateway? A default gateway is the router or device that routes traffic from the local network to other networks or the internet when no specific route is defined. TCP Protocol 1. What is a TCP three-way handshake? Steps of the TCP 3-Way Handshake SYN (Synchronize): The client sends a segment with the SYN flag set to the server, indicating a request to establish a connection. This segment includes the client's initial sequence number (ISN). SYN-ACK (Synchronize-Acknowledge): The server responds with a segment that has both SYN and ACK flags set. This segment acknowledges the client's SYN and includes the server's ISN. ACK (Acknowledge): The client sends an ACK segment back to the server, acknowledging the server's SYN. At this point, the connection is established, and data transmission can begin 2. Explain the concept of TCP window size. The window size indicates how much data the sender can transmit before requiring an acknowledgment. It helps control the flow of data and prevents overwhelming slower receivers. 3. What is the purpose of the TCP sequence number? Sequence numbers track the order of data segments, ensuring data can be reassembled correctly and identifying lost or duplicated segments. 4. How does TCP handle flow control? TCP uses the sliding window mechanism and adjusts the window size based on network conditions. If packets are lost, the window shrinks; if transmissions are successful, the window can grow. 5. What is the difference between TCP and UDP? TCP is connection-oriented, reliable, and ensures ordered delivery. UDP is connectionless, faster, and does not guarantee delivery or order. 6. Which TCP/IP layer is responsible for the following action? Application: HTTP, FTP, DNS, POP3 TRANSPORT: TCP, UDP NETWORK: IP, ICMP, ARP DATA LINK: Ethernet PHYSICAL: Ethernet ACTION RESPONSIBLE LAYER 7 Resolved MAC address from IP address Network Layer (where ARP operates) Provides MAC address for the network Interface Data Link Layer (Ethernet / MAC addressing) Allow user to send, receive and store emails Application Layer (POP3, SMTP, etc.) Provides reliability needed to handle the data Transport Layer (TCP handles reliable communication delivery) Defines and follows media access rules Data Link Layer (Ethernet’s CSMA/CD rules, for example) Defines and verifies IP address Network Layer (IP addressing and routing) UDP Protocol 1. What is UDP and how does it differ from TCP? User Datagram Protocol is a connectionless protocol that sends data (datagrams) without establishing a session or guaranteeing reliability/order. It is simpler and faster than TCP. 2. In what scenarios is UDP preferred over TCP? Real-time services such as VoIP, video streaming, gaming, DNS requests—where low latency is more critical than guaranteed delivery. 3. Explain the concept of UDP datagrams. A UDP datagram is a self-contained message unit. Each packet is sent individually with no guaranteed order or reliability. 4. What is the purpose of the UDP checksum? The UDP checksum provides a basic integrity check to detect data corruption in transit. 5. How does UDP handle data transmission errors? It generally does not handle them. There’s no automatic retransmission or reordering in UDP. The application layer must handle errors if needed. ICMP Protocol 1. What is ICMP and what is its primary function? Internet Control Message Protocol is used for diagnostics and error reporting in IP networks. It reports issues like unreachable destinations and helps with utilities such as ping and traceroute. 2. Explain the use of the ping command. ping sends ICMP echo requests to a target host, measuring response time and packet loss to test basic network connectivity. 3. What is an ICMP echo request and echo reply? An echo request is the packet ping sends; an echo reply is the response from the target host if it’s reachable. 4. How does ICMP handle error reporting? Routers or hosts send ICMP error messages (e.g., Destination Unreachable, Time Exceeded) back to the sender to indicate a delivery problem. 5. What is the purpose of the traceroute command? traceroute (or tracert on Windows) identifies the path (sequence of routers/hops) packets take to reach a destination and measures transit delays. DHCP Protocol 8 1. What is DHCP and how does it work? Dynamic Host Configuration Protocol automatically assigns IP addresses, subnet masks, gateways, and DNS server addresses to hosts. Clients broadcast a request, the DHCP server offers an address, and the client formally requests it, then the server acknowledges. 2. Explain the DHCP lease process. The lease process is typically DORA: 1. Discovery (client → broadcast) 2. Offer (server → client) 3. Request (client → server) 4. Acknowledgment (server → client) How DHCP Lease Works 1. Initial Lease: When a device first connects, it requests a new lease from the DHCP server. 2. Normal Operation: The device uses the assigned IP address. 3. Renewal: Halfway through the lease period, the device attempts to renew the lease to keep the same IP address. 4. Rebinding: If renewal fails (e.g., the DHCP server is offline), the device tries to extend the lease with any active DHCP server. 3. What is the purpose of a DHCP server? To centrally manage and distribute IP configuration to clients, ensuring addresses don’t conflict and simplifying administration. 4. How does a DHCP client obtain an IP address? Through the DORA exchange (broadcasting DHCPDISCOVER, waiting for a DHCPOFFER, sending DHCPREQUEST, and finally receiving DHCPACK). 5. What is the difference between a static and dynamic IP address? A static IP is manually configured and does not change without administrative action; a dynamic IP is automatically assigned by DHCP and can change over time. DNS Protocol 1. What is DNS and why is it important? Domain Name System resolves domain names (e.g., www.example.com) to IP addresses. It’s essential for navigating the internet by human-friendly names instead of numeric addresses. 2. Explain the process of DNS resolution. A client queries a DNS resolver, which either returns a cached record or queries authoritative DNS servers. Once an IP is found, it is sent back to the client. 3. What is the purpose of a DNS server? It answers DNS queries (mapping domain names to IP addresses) either from its own database or by recursively querying other DNS servers. 4. How does DNS handle domain name to IP address mapping? DNS servers store resource records (A records for IPv4, AAAA for IPv6), performing lookups to resolve names to IPs. 5. What is a DNS zone file? A text file or database on a DNS server that contains the resource records for one or more domains (e.g., A, AAAA, CNAME, MX records). ARP Protocol 1. What is ARP and what is its function? 9 Address Resolution Protocol maps an IP address to a MAC address on a local network segment. 2. Explain the process of ARP resolution. A host broadcasts “Who has IP X.X.X.X?” on the local network. The host with that IP replies with its MAC address. 3. What is an ARP cache? A local table that stores recently resolved IP-to-MAC mappings, speeding up future requests. 4. How does ARP handle IP to MAC address mapping? ARP broadcasts requests; responses are unicast. Hosts save the mapping in their ARP cache for a specified timeout period. 5. What is the purpose of an ARP request and reply? ARP Request: “Which MAC address is associated with IP X?” (broadcast) ARP Reply: “IP X is at MAC XX:XX:XX:XX…” (unicast back to requester). Network Layers 1. What are the four layers of the TCP/IP model? Application (process-to-process communication) Transport (TCP/UDP) Internet (IP addressing, routing) Network Access (Data Link + Physical) 2. Explain the function of the application layer. It provides services and APIs for high-level protocols like HTTP, SMTP, FTP. Applications use these protocols for end-user communication. 3. What is the role of the transport layer? The transport layer (TCP/UDP) provides end-to-end connectivity, flow control, segmentation, and error handling for data between applications. 4. How does the network layer handle data transmission? The network layer (IP) handles logical addressing and routing packets across multiple networks/hops. 5. What is the purpose of the data link layer? It ensures reliable node-to-node (or hop-to-hop) delivery on the local network segment, handling MAC addressing and framing. Miscellaneous 1. What is the purpose of a firewall in a TCP/IP network? A firewall monitors and filters incoming/outgoing traffic based on security rules, blocking unauthorized access while permitting legitimate communications. 2. Explain the concept of NAT (Network Address Translation). NAT maps private IP addresses to a single public IP (or a pool of public IPs). It conserves public IP addresses and hides internal network details from the outside. 3. How does a VPN (Virtual Private Network) work? A VPN creates an encrypted “tunnel” over the internet between remote hosts or networks, ensuring secure data exchange as if connected on a private LAN. 4. What is the purpose of a proxy server? A proxy sits between a client and the internet, forwarding requests on the client’s behalf. It can cache content, filter traffic, log usage, and enhance anonymity. 10 5. How do you troubleshoot network connectivity issues using TCP/IP protocols? Common steps: ping (ICMP) to check basic reachability. traceroute (or tracert) to identify routing paths and bottlenecks. ipconfig / ifconfig / Get-NetIPAddress to verify local addressing. netstat to check open ports/connections. nslookup / dig to check DNS resolution. Check firewall and NAT configurations if connectivity fails. WEEK12 1. What is the primary purpose of the TCP/IP protocol suite? The primary purpose of the TCP/IP protocol suite is to provide a set of standardized protocols for reliable communication and data transfer over networks, including the internet. It enables devices to connect, exchange data, and ensure compatibility between different platforms. 2. Which protocol is used for secure web browsing? HTTPS (Hyper Text Transfer Protocol Secure) – Uses SSL/TLS for encrypted communication over TCP port 443. 3. What are the three parts of an HTTP response? Status Code: Indicates the result of the request (e.g., 200 OK, 404 Not Found). Header: Contains metadata about the response (e.g., Content-Type, Content-Length). Body: Contains the actual data or content requested (e.g., HTML, JSON). 4. What port and protocol does the RDP use? Protocol: RDP (Remote Desktop Protocol) Port: TCP port 3389 5. What does DNS stand for? DNS (Domain Name System) – Translates human-readable domain names into IP addresses. 6. True / False: MAC addresses are also referred to as Logical Address. False. MAC addresses are Physical Addresses (Burned into network interfaces). Logical Addresses refer to IP addresses. 7. Which protocol is used to send emails? SMTP (Simple Mail Transfer Protocol) 8. List three comparisons between HTTP and HTTPS. HTTP HTTPS Uses TCP port 80 Uses TCP port 443 Data is unencrypted Data is encrypted with SSL/TLS Vulnerable to attacks Provides data integrity and security 9. What is the function of the DHCP protocol? DHCP (Dynamic Host Configuration Protocol) is used to automatically assign IP addresses and network configurations to devices when they join a network. It operates over UDP ports 67 (Server) and 68 (Client). 10. What is the drawback of TCP/IP in a large network? How can it be resolved? A drawback of using TCP/IP in a large network is keeping track of assigned addresses and to which machine they are assigned DHCP is used to automatically assign IP addresses as needed When a computer is turned on, it requests an address from a server that is configured as a DHCP server The server will assign an address for a specific amount of time (called a lease) DHCP uses the UDP Transport layer because DHCP messages are short in length 11. Which protocol is used for remote login to a computer? RDP (Remote Desktop Protocol) and port 3389 12. What does the acronym IP stand for? IP (Internet Protocol) 11 13. An IP address is divided into two parts. What are they? Network Part: Identifies the network. Host Part: Identifies the specific device within the network. 14. Which protocol is used for transferring files between computers? FTP (File Transfer Protocol) and port 21 15. What is the main function of the ICMP protocol? To provide error reporting and network diagnostics (e.g., Ping, Traceroute). 16. What is the main benefit of DNS and what Transport layer protocol it uses? Main Benefit: Resolves domain names to IP addresses, making internet navigation easier. Transport Layer Protocol: UDP (Usually), but uses TCP for large queries or zone transfers. 17. Which protocol is used for network management and monitoring? SNMP (Simple Network Management Protocol) – Uses UDP ports 161 (General) and 162 (Traps). 18. What does the acronym ARP stand for? ARP (Address Resolution Protocol) – Resolves IP addresses to MAC addresses 19. Name two types of records maintained at DNS. A Record (Address Record): Maps domain names to IP addresses. MX Record (Mail Exchange Record): Specifies mail servers for a domain. CNAME Record (Canonical Name Record): Provides aliases for domain names. 20. Which protocol is used to retrieve emails from a server? POP3 (Post Office Protocol 3) or IMAP (Internet Message Access Protocol) WEEK11 1. What are Network Protocols for? Network protocols are rules and standards that enable devices to communicate and exchange data effectively over a network. They define how data is formatted, transmitted, received, and processed, ensuring compatibility across different devices and platforms. 2. Scenario: You are given the IP address 192.168.1.10 with a subnet mask of 255.255.255.0 a. Determine the network address. Answer: 192.168.1.0 (The host bits are all zeros). b. Determine the broadcast address. Answer: 192.168.1.255 (The host bits are all ones). c. Calculate the range of valid host addresses. Valid range: 192.168.1.1 to 192.168.1.254. Explanation: The first address is the network address (192.168.1.0), and the last is the broadcast address (192.168.1.255). 3. Reproduce the TCP/IP Protocol Suite Mapping. Layer Protocols & Functions Application HTTP, HTTPS, FTP, DNS, DHCP, RDP, SMB, SNMP, SMTP, POP3, IMAP Transport TCP (Reliable), UDP (Unreliable) Network IP, ICMP, ARP Data Link Ethernet (MAC & LLC Sublayers) Physical Ethernet cables, Wireless signals, Optical fiber, etc. 4. What protocol can be used to share files, printers, and other peripherals? SMB (Server Message Block) – Used for network file and printer sharing. 5. What happens in the Application layer? The Application layer provides network services directly to user applications. It is responsible for generating messages, managing network requests, and providing interfaces for applications to access network resources. 6. Name some Application layer protocols. 12 HTTP/HTTPS (Web Browsing) FTP (File Transfer Protocol) DNS (Domain Name System) SMTP, POP3, IMAP (Email Protocols) DHCP (Dynamic Host Configuration Protocol) RDP (Remote Desktop Protocol) SNMP (Network Management Protocol) 7. Which TCP/IP layer is responsible for these actions: a. Resolving the MAC address from the IP address Answer: Network Layer (Using ARP - Address Resolution Protocol). b. Providing the reliability needed to handle the data communication Answer: Transport Layer (Using TCP - Transmission Control Protocol). c. Defining and following the media access rules Answer: Data Link Layer (Using MAC sublayer and protocols like Ethernet). 8. What IP address class is used for research purposes? Class E (240.0.0.0 – 255.255.255.254) – Reserved for research and experimental purposes. 9. What IP address class is used for large corporations? Class A (1.0.0.0 – 126.0.0.0) – Provides a large number of hosts per network. 10. What are the two parts of an IP address? Network Part: Identifies the network. Host Part: Identifies the specific device within the network. 11. What is the role of the NIC? The Network Interface Card (NIC) is a hardware component that allows a computer to connect to a network. It provides a physical interface for network access and has a unique MAC address for communication. 12. What address class is used for audio/video streaming? Class D (224.0.0.0 – 239.255.255.255) – Used for multicasting, which is commonly applied in streaming and broadcasting. 13. What are some differences between a P2P network and a Server-based network? P2P Network Server-based Network No central server. Central server controls resources. All devices are equal. Devices (clients) access resources from the server. Limited security and control Better security and management. Harder to manage in large networks. Easier to manage and scale. 14. How is error-free data transfer assured? Error-free data transfer is assured by TCP (Transmission Control Protocol) through: Checksum: Error detection mechanism. Acknowledgments (ACKs): Confirmation of received packets. Retransmissions: Resending lost packets. Sequencing: Ensuring packets arrive in the correct order. 15. What is ‘flow control’? Flow control is a mechanism used by TCP to regulate data transmission speed between sender and receiver. Prevents the receiver from being overwhelmed by too much data at once. Uses Sliding Window Protocol to dynamically adjust the flow of data. WEEK10 Basics of PowerShell 1. What are five advantages of using PowerShell as a shell and scripting language? Object-Oriented Output: Unlike traditional shells that work with text, PowerShell outputs structured objects, making data manipulation easier. Integration with.NET: PowerShell seamlessly integrates with the.NET framework, allowing access to extensive libraries for scripting. 13 Automation & Task Scheduling: PowerShell automates repetitive tasks, making it a powerful tool for system administrators. Cross-Platform Compatibility: PowerShell 7 works on Windows, Linux, and macOS, making it a universal tool. Pipeline Support: Commands can be chained using pipelines (|), allowing efficient data processing. 2. What is the purpose of the Get-Help cmdlet in PowerShell? The Get-Help cmdlet provides documentation and syntax details for PowerShell commands. It helps users learn about cmdlets and their parameters. Get-Help Get-Process -Full Output: Displays detailed documentation about Get-Process. 3. How do you execute a PowerShell script? You execute a script by running:.\script.ps1 Note: If the execution policy restricts scripts, use: Set-ExecutionPolicy RemoteSigned -Scope CurrentUser 4. What are two advantages of using PowerShell as a shell and scripting language? Object-based Processing: Works with objects instead of raw text, making it more powerful than traditional shells. Extensive Command Library: Thousands of built-in cmdlets help with system management, networking, and automation. Variables, Parameters, and Operators 5. How do you declare a variable in PowerShell? Provide an example. Syntax: $variableName = value $greeting = "Hello, World!" 6. What is the purpose of the -eq operator in PowerShell? The -eq operator checks for equality between two values. 5 -eq 5 # Returns True 7. Explain the difference between -ne and -not operators. -ne (Not Equal) → Compares two values. Returns True if they are not equal. -not (Logical NOT) → Reverses a Boolean condition. 5 -ne 4 # True (5 is not equal to 4) -not ($true) # False (negates the True value) 8. How do you pass parameters to a PowerShell script? Provide an example. Define Parameters in Script (script.ps1): param ($Name) Write-Host "Hello, $Name" Execute Script with Parameter:.\script.ps1 -Name "Alice" Output: Hello, Alice Objects and Arrays 9. What is an object in PowerShell and how is it different from a simple variable? An object in PowerShell is a structured data type containing properties and methods, unlike a simple variable that holds a single value. $process = Get-Process | Select-Object -First 1 $process.Name # Retrieves the Name property 10. How do you create an array in PowerShell? Provide an example. $numbers = @(1, 2, 3, 4, 5) 11. What cmdlet would you use to get the properties and methods of an object? The Get-Member cmdlet. Get-Process | Get-Member 14 Output: A list of properties and methods of Process objects. 12. How do you access a specific element in an array? Provide an example. Arrays are zero-indexed in PowerShell. $numbers = @(10, 20, 30) $numbers # Output: 20 PowerShell Scripting Basics 13. What is a function in PowerShell and how do you define one? A function is a reusable block of code. Example: function Greet-User { param ($name) Write-Host "Hello, $name!" } Calling the function: Greet-User -name "Alice" 14. Complete the function to display numbers 5, 4, 3, 2, 1 on separate lines: Function NewCounter { [CmdletBinding()] param () for ($i = 5; $i -ge 1; $i--) { Write-Host $i } } NewCounter 15. How do you handle errors in PowerShell scripts? Provide an example using try and catch. try { Get-Content "nonexistent.txt" } catch { Write-Host "Error: $_" } 16. What is the purpose of the Begin, Process, and End blocks in a PowerShell function? Begin → Runs once before processing input (initialization). Process → Runs for each input object. End → Runs once after all input is processed. Working with Cmdlets and Modules 17. What is a cmdlet in PowerShell? Provide an example. A cmdlet is a built-in PowerShell command designed for specific tasks. Example: Get-Service 18. How do you import a module in PowerShell? Provide an example. Use Import-Module. Example: Import-Module ActiveDirectory 19. What is the purpose of the Get-Command cmdlet? Get-Command lists all available commands in PowerShell. Example: Get-Command *process* Output: 15 Lists commands like Get-Process, Stop-Process. 20. How do you find and install a module from the PowerShell Gallery? Find a module: Find-Module -Name Pester Install a module: Install-Module -Name Pester 16