1/32
Networking & Algorithms
Algorithm
Any set of instructions which results in a predictable end from a known beginning
Must be well ordered, unambiguous, finite
Sequence
Linear progression where one task is performed sequentially after another
Selection
A question is asked and the processing path depends on the answer (true or false)
Single selection - if, then
Double selection - if, else
Multi selection - if, elif, else
Repetition
A control strucutre that repeats the execution of a block of instructions
For, while, and repeat until loops
Module
Self contained file or collection of files that groups related code into a single reusable unit
Benefits of using this include code reusability, prevention of naming conflicts, and easier collaboration
Function
Self-contained reusable block of code designed to perform a specific task
Input - parameters can change how a function works
Process - sequence of instructions that manipulates the data
Output - final product handed back to the main program
Variable
Named storage location in a computer’s memory that holds data that can be changed during program execution
Name - used to call upon the data
Value - the actual data
Data type - string (text), integer (whole number), float (decimal), boolean (true/false)
Constant
A value that cannot be changed after it is assigned
Networking
The linking of two or more computing devices for the purpose of sharing data
Network classificaton
Geographical area: Local Area Networks, Wide Area Networks, Personal Area Networks
Design: Peer to Peer, client/server
Layout
Protocols: TCP/IP, HTTP
Unshielded Twisted Pair (UTP)
Wired media
Pair of copper wires twisted together and wrapped with plastic coating
Twisting reduces electrical noise
Low cost, but limited bandwidth
Shielded Twisted Pair (STP)
Wired media
Shielding reduces electromagnetic interference
Coaxial Cable
Wired media
Two conductors, one forming an electromagnetic shield around the other, separated by insulation
Fibre Optic
Wired media
Thin glass fibres (core) surrounded by glass cladding
Core refracts light along the path, cladding stops light from escaping
Radio Transmission
Wireless media
Lower frequencies can pass through walls & travel further, higher frequencies bounce back & can be absorbed by obstacles
Microwave
Wireless media
Travel in straight lines, sender and receiver must be aligned
Have higher frequences
Satellite
Wireless media
Signals transmitted from the ground are received by satellite, then routed back to Earth
Cellular
Wireless media
Radio network that is distributed over land through cells, where each cell has a base cell tower
Provide coverage over larger geographical areas
Router
Forwards data packets along networks
Connected to at least two networks
Assigns IP addresses (Dynamic Host Configuration Protocol)
Switch
Filters and forwards data packets between LAN segments
Keeps record of MAC addresses of connected devices, knows where to send frames
Primarily operates in data link layer of OSI model
Firewall
Controls what traffic is allowed to pass between internal and external side of network
Modem
Modulator/Demodulator
Used for transmitting and receiving data over communication media - connects home network to ISP
Converts digital signals into analogue signals
Bridge
Hardware device used to create a connection between two separate network segments or to divide one network into two
Forwards data based on MAC address
Repeater
Amplifies network signals, allowing them to travel a greater distance
Receives incoming signals, regenerates them to their original strength, and retransmits them
Wireless Access Point
Allows wireless devices to access a LAN
Protocol
Rules a network uses to transfer data
TCP/IP
Transmission Control Protocol / Internet Protocol
TCP/IP Subprotocols
Application - protocols for data exchange, interacts with end users, application & presentation layer of OSI model
Transport - manages communication between source and destination, session & transport layer of OSI model
Internet - handles addressing and routing of data packets, network layer of OSI model
Network Interface - deals with physical transmission of data frames over network media, data link & physical later of OSI model
IPv4 vs IPv6
IPv4 - made up of 32 bits, dotted decimal system
IPv6 - made up of 128 bites, hexadecimal system with colons
Three Types of Error
Logic error - when program runs but does not produce what is expected - test logic error by comparing code result with proper data
Syntax error - program does not run at all because of spelling mistake - detected when program is compiled
Runtime error - when program runs in infinite loop causing program to crash
Bandwidth & Throughput
Bandwidth - the capacity of a medium to carry data
Throughput - the amount of data sent or received over a connection within a period of time
Encapsulation
The process of placing one message format (the letter) inside another message format (the envelope)
De-encapsulation occurs when the process is reversed by the recipient and the letter is removed from the envelope
Network layout
internet → modem → firewall → router → switch → devices