Notes, summaries, assignments, exams, and exercises for Computer science for Baccalaureate

Network Security & Configuration: Routing, VLANs, DHCP, and Attack Mitigation

Computer science2.38 KB

Router-on-a-Stick Inter-VLAN Routing

The router's port connecting to the LAN has multiple sub-interfaces, each the default gateway for a specific VLAN. For example, VLAN 10 traffic destined for VLAN 20 is first forwarded to VLAN 10's default gateway (the router sub-interface). The router then routes this traffic to VLAN 20's gateway (its corresponding sub-interface) and finally to the user in VLAN 20.

Why STP Is Needed for Redundant Ethernet LANs

  • Preventing Broadcast Storms: In redundant networks, frames can loop endlessly, exponentially increasing traffic. STP prevents this by disabling redundant paths, ensuring one active path between devices.
  • Ensuring MAC Address Table Consistency: Loops cause switches to receive the same frame on different
...
Continue reading "Network Security & Configuration: Routing, VLANs, DHCP, and Attack Mitigation" »

Refer to the exhibit. When a static IP address is being configured on the host, what address should be used for the default gateway

Computer science4.69 KB

HOSTàROUTER: 1

ENABLE

CONFIGURE TERMINAL

INTERFACE GIGABITETHERNET 0/0

IP ADDRESS 192.168.1.126 255.255.255.224

NO SHUTDOWN

EXIT

INTERFACE GIGABITEETHERNET 0/1

IP ADDRESS 192.168.1.158 255.255.255.240

NO SHUTDOWN

HOSTàSWITCH 2

ENABLE

CONFIFURE TERMINAL

INTERFACE VLAN 1

IP ADDRESS 192.168.1.157 255.255.255.240

NO SHUTDOWN

HOST/ROUTER 3

EXIT (LLEGAR AL CONFIGURE TERMINAL)

HOSTNAME MIDDLE

ENABLE SECRET CISCO

LINE CONSOLE 0

PASSWORD CLASS

LOGIN

EXIT

SECURITY PASSWORD MIN-LENGTH 10

SERVICE PASSWORD ENCRYPTION

IP DOMAIN-NAME CISCO

CRYPTON KEY GENERATE RSA

1024

EXIT

USERNAME CICLOS

LINE VTY 0 4

LOGIN LOCAL

TRANSPORT INPUT SSH

EXIT

INTERFACE GIBABITEETHERNET 0/0

IPV6 ADDRESS 2001:DB8:ACAD:A::1/64

IPV6 ADDRESS FE80::1 LIN

EXIT

GIBABITETHERNET 0/1

IPV6 ADDRESS 2001:DB8:ACAD:B::1/64

IPV6

...
Continue reading "Refer to the exhibit. When a static IP address is being configured on the host, what address should be used for the default gateway" »

Introduction to Computer Networks

Computer science2.57 KB

Servers

A server stores data to be used by other computers on a network. A server could be a specialized machine, or it can be a normal PC running server software. The server stores data and responds to requests for data or files, such as web pages.

Types of Server

There are many different types of servers. Some popular examples follow.

Web Servers

Web servers host websites and generally handle requests for static information such as HTML pages or images. They are used to manage the website on the server and often include FTP software, which can easily host and share large files. The Apache web server is a popular type of open-source web server software.

Application Servers

Many websites are classed as web applications, which contain programming and...

Continue reading "Introduction to Computer Networks" »

Classic Algorithm Solutions: Step-by-Step Examples

Computer science5.78 KB

1) DIJKSTRA (SSSP) — STEP TABLE (PAST-PAPER INSTANCE A)

Given edges: a→b(2), a→c(7), a→e(10), b→d(2), c→d(1), c→g(2), d→f(2), e→g(1), f→g(2). Source = a.
Rule: Pick unsettled vertex with minimum dist; relax outgoing edges.

Vertices:   a   b   c   d   e   f   g

Init:
Dist      = 0   2   7   ∞  10   ∞   ∞
S = ∅

Step 1: Pick a (min=0), S={a}
Relax from a: already set b=2, c=7, e=10
Dist      = 0   2   7   ∞  10   ∞   ∞

Step 2: Pick b (min=2), S={a,b}
Relax b→d: dist(d) = dist(b)+2 = 2+2 = 4
Dist      = 0   2   7   4  10   ∞   ∞

Step 3: Pick d (min=4), S={a,b,d}
Relax d→f: dist(f) = 4+2 = 6
Dist      = 0   2   7   4  10   6   ∞

Step 4: Pick f (min=6), S={a,b,d,f}
Relax f→g: dist(g) = 6+2 = 8
Dist
...
Continue reading "Classic Algorithm Solutions: Step-by-Step Examples" »

Mastering Relational Algebra for Database Queries

Computer science4.53 KB

Relational Algebra Fundamentals

  • Relational Algebra is a mathematical query language used in databases.
  • The result of any operation is always another relation (table).

Relational Algebra Operations Explained

Unary Relational Operations

SELECT (σ) – Filters Rows

  • Retrieves specific rows from a table based on a condition.
  • Syntax: σ (condition) (Relation)
  • Example: σ (Dept_ID = 4) (EMPLOYEE)

PROJECT (π) – Filters Columns

  • Retrieves specific columns from a table.
  • Syntax: π (column1, column2) (Relation)
  • Example: π (Name, Salary) (EMPLOYEE)

RENAME (ρ) – Changes Table or Column Name

  • Syntax: ρ (NewTable (NewColumn1, NewColumn2), OldTable)
  • Example: ρ (Staff (Emp_ID, FullName), EMPLOYEE)

Set Theory Operations

UNION (∪) – Combines Two Tables

  • Combines tuples
...
Continue reading "Mastering Relational Algebra for Database Queries" »

Software Testing Fundamentals and Techniques

Computer science3.93 KB

1. Basics of Software Testing

  • Definition of Software Testing: The process of verifying and validating that a software application or product meets specified requirements.
  • Key Objectives: Ensure quality, detect errors, and assess functionality.

2. Differences Between:

  • Errors: Mistakes made by developers during coding or design.
  • Faults (Defects): Errors in the code that can cause failures when executed.
  • Failures: The manifestation of a fault during program execution.
  • Bugs: Common term for faults/defects found in the software.

3. Debugging

  • Definition: The process of identifying, analyzing, and fixing bugs in software.
  • Key Difference: Debugging fixes the bugs detected during testing.

4 & 5. Static Techniques and Testing Methods

Static Techniques:

  • Benefits:
...
Continue reading "Software Testing Fundamentals and Techniques" »

Python Exception Handling and File Modes Explained

Computer science2.6 KB

What is an Exception?

Answer: An exception in Python is an error that occurs during program execution, disrupting the normal flow of instructions. Instead of crashing, the program can "catch" the exception and handle it gracefully using try and except blocks. Common exceptions include ZeroDivisionError, IndexError, and FileNotFoundError. You can also define custom exceptions. The finally block can be used for cleanup actions, ensuring certain code runs regardless of whether an exception was raised.

Different Modes of Opening a File

Answer: Different Modes of Opening a File

1. Read Mode ('r')

  • Purpose: Opens a file for reading.
  • Behavior:
    • The file pointer is placed at the beginning of the file.
    • If the file does not exist, a FileNotFoundError is raised.
...
Continue reading "Python Exception Handling and File Modes Explained" »

Understanding the 80386 Processor State After Reset

Computer science4.15 KB

80386 Processor State After Reset

After a reset, the 80386 processor is initialized to a specific state to ensure proper operation. Here's an explanation of the processor state after reset:

1. Operating Mode

The processor is initially in Real Mode after a reset. Real Mode is a backward-compatible mode with earlier x86 processors like the 8086/8088. In Real Mode, the processor operates with a 20-bit address bus, allowing it to address up to 1 MB of memory.

2. Segment Registers

The segment registers CS, DS, SS, and ES are set to 0x0000, pointing to the bottom of the physical memory. In Real Mode, these segment registers are 16 bits wide.

3. Instruction Pointer (IP)

The instruction pointer (IP) is set to 0xFFFF, indicating the initial address from which...

Continue reading "Understanding the 80386 Processor State After Reset" »

Aircraft systems

Computer science10.6 KB

New jobs are admitted into the system
-- long-term or high-level scheduling

Once in the system, processes go through a number of state changes
-- short-term or low-level or CPU scheduling

A process is a "running program" or "program in execution"

Processes have a variety of states:


   RUNNING           READY                 WAITING (on I/O)
    STATE            STATE                  STATE

   +-----+                               +-----------------------+
   |     |     +--------------------+    |                 P2 P8 |
   | CPU | <== |="" p3="" |="" p6="" |="" p5="" |="" ...="">==><== i/o="" subsystem="" p13="" |="" |="" p11="" |="" +--------------------+="" |="" |="" +-----+="" +-----------------------+="" (a="" cpu=""
...
Continue reading "Aircraft systems" »

Public vs. Private Blockchains: Understanding the Key Differences

Computer science2.03 KB

1. What is a Public Blockchain?

Public blockchains are open networks that allow anyone to participate. This permissionless nature means anyone can join the network and read, write, or participate in the blockchain.

Public blockchains are decentralized, meaning no single entity controls the network. Data on a public blockchain is secure because it is virtually impossible to modify or alter data once validated on the blockchain.

Features of Public Blockchains:

  • High Security: Secured by mining and the 51% rule.
  • Open Environment: Open for anyone to join.
  • Anonymous Nature: Participants can remain anonymous, enhancing privacy.
  • No Regulations: No strict regulations on platform usage.
  • Full Transparency: The ledger is publicly viewable, ensuring transparency.
...
Continue reading "Public vs. Private Blockchains: Understanding the Key Differences" »