Exchanging data Flashcards
Why is compression important for sharing files?
Compression is the process of reducing the amount of storage required by a file.
The bigger the file = the more time it takes to get transferred
So compressing files increases the number of files that you can transfer in a given time
Downloading the full version of a file is faster than downloading the compressed file over the internet
TRUE OR FALSE
FALSE
Downloading the compressed file over the Internet is faster than downloading the full version of a file
Give categories of compression
Lossy and Lossless
Lossy compression
Reduces file size while REMOVING SOME INFORMATION
So compressed image is more pixelated/sound is less clearer
Compressed file cant be turned back into original
Lossless compression
Reduces file size WITHOUT REMOVING INFORMATION
So compressed file can be turned back to the original without loss of quality
How would you compress audio files? Which compression category would you use?
Using LOSSY
Removing very high or very low frequences which are less noticeable to the ear
However, there is no way to go back to the original as there is no record of these high or low frequences and how high and low they were
Run Length Encoding is a type of….
Lossless compression
Run Length Encoding
LOSSLESS COMPRESSION
Repeated values are rempved and replaced with one occurence of the data followed by the number of times its repeated
When would Run Length Encoding not be suitable?
When there is not much redundant data so it wouldnt offer a large reduction in file size
What is Dictionary encoding?
LOSSLESS COMPRESSION
Frequently occuring pieces of data are replaced with an index
Compressed data is stored alongside a dictionary which matches the frequently occuring data to an index
Dictionary encoding is an example of….
Lossless compression
Give a disadvantage of Dictionary encoding
The compressed data has to be stored alongside the dictionary which will increase the file size of the compressed data.
Without the dictionary the original data cant be restored.
What is meant by encryption?
The process of scrambling data do that it can only be understood by the sender and intended recipient
What is symmetric encryption?
Both the sender and receiver share the same private key
So SAME KEY IS USED FOR ENCRYPTING AND DECRYPTING DATA
This private key is distributed in a process called key exchange
In Symmetric encryption both the sender and receiver share the same private key
This private key is distributed in a process called…
Key exchange
What is Asymmetric encryption?
2 keys are used
The 2 public keys can be published anywhere but the 2 private keys are to be kept secret
Message is encrypted with senders private key and recipients public key and decrypted using receivers private key and senders public key
Explain the process of hashing (simple)
An input called a key is turned into a fixed size value called a hash using a hashing function (algorithm)
The output of a hash function can be reversed to form the key
TRUE OR FALSE
FALSE
The output of a hash function CAN’T be reversed to form the key
The output of a hash function CAN’T be reversed to form the key
What would this fact make hashing useful for?
Storing passwords:
1.Instead of storing the password directly, the system generates a hash of the password using a hashing algorithm
2.The system stores the hash in the database, not the password itself.
3.When a user enters their password, the system hashes the input and compares it to the stored hash. If they match, the password is correct.
A hacker would only get accessed to the hashes which can’t be reversed to gain passwords (keys)
What would be the time complexity for looking up data in an array?
O(1) Constant
What is meant by a collision in hash tables?
Give methods to deal with these?
When 2 pieces of data produce the same hash
-Making a new/bigger hash table
-Storing items with same hash in a list under same hash value
-Use a second hash function to generate a new hash
A good hash function should…..
-Have a low chance of collisions
-Produces a fixed length output regardless of input size
What is a hash table?
A data structure which holds key-value pairs
A relational database is a database that….
database that recognises the differences between entities by creating different tables for each entity
What is an attribute in databases?
A characteristic of an entity
What is meant by a primary key?
A unique identifier for each record in the table
(shown by underlining)
What is meant by a foreign key?
An attribute which links two tables together
-It will be the primary key in a table and then the foreign in another
(denoted using asterisk *)
What is meant by a secondary key?
A key which allows a database to be searched quicker
eg. patientID is primary key but a patient may not know this. So a secondary key could be their surname
-So you can search and order by surname to find specific patients
Give examples of entity relationship modelling
ONE TO ONE
ONE TO MANY
MANY TO MANY
ONE TO ONE
MANY TO ONE
MANY TO MANY
Are examples of entity relationship modelling?
FALSE
ONE TO ONE
ONE TO MANY (NOT MANY TO ONE)
MANY TO MANY
MANY TO ONE DOESNT EXIST
What does database normalisation try to accomplish?
-No redundancy (unnecessary duplicates)
-Complex queries can be carried out
-Records can be added and removed without issues
-Consistent data throughout linked tables
What happens in first normal form?
No attribute contains more than a single value
(No repeated attributes)
(all fields should be atomic)
What happens in second normal form?
No partial dependencies meaning that no attributes can depend on part of a composite key
What happens in third normal form?
Nonkey dependencies which means the attribute only depends on the value of the primary key and nothing else
What is meant by indexing in databases?
A method used to store the position of each record ordered by a certain attribute (called secondary key).(eg.surname instead of patientID)
Even though the primary key is automatically indexed it is almost never used as its hard to remember
-So we use secondary keys instead
How would you capture the data when people pay cheques?
Pay cheque = ordering bank to get money from your account and give it to the person that is on the cheque.
Person writes details down.
Bank scans cheque and prints it in magnetic ink which allows the use of MICR Magnetic Ink Character Recognition so details can be recognised by a computer
How would you capture data from multiple choice questions?
Using Optical Mark Recognition (OMR)
Exchanging data
The process of transferring collected data.
Can use Electronic Data Interchange (EDI) which doesnt require human interaction and enables data transfer from one computer to another
eg. automated exchange of invoices between businesses,
automatically exchange purchase orders between buyers and suppliers. Instead of a person manually creating an order and sending it by email
Structured query language (SQL) is an example of a…
Declarative language used to manipulate databases
SQL SELECT statement structure
SELECT attribute
FROM table
WHERE conditions
ORDER BY
ASC = ascending
DESC= descending
If you say:
ORDER BY DatePublished
it wil automatically order in ascending
Also can do:
ORDER BY DatePublished ASC
so ORDER BY DatePublished ASC = ORDER BY DatePublished
JOIN in databases
Returns records from multiple tables based on a common field between them
What is the difference between VARCHAR and CHAR in databases?
VARCHAR(n) is a string of variable length with upper limit n (max length is n)
CHAR(n) is a string of fixed length n
ALTER in databases
Used to add, delete or modify the columns/ ATTRIBUTES in a table
E.g
ADDING ATTRIBUTE:
ALTER TABLE Students
ADD Birthday DATE
DELETING ATTRIBUTE:
ALTER TABLE STUDENT
DROP COLUMN Birthday
MODIFYING DATA TYPE
ALTER TABLE STUDENT
MODIFY COLUMN Birthday INTEGER
Using ALTER write an SQL query deleting the Birthday attribute from the students table
ALTER TABLE STUDENT
DROP COLUMN Birthday
Using ALTER write an SQL query modifying the Birthday attribute from the students table so that its data type is integer
ALTER TABLE STUDENT
MODIFY COLUMN Birthday INTEGER
Using ALTER write an SQL query adding the Birthday attribute to the students table
ADDING ATTRIBUTE:
ALTER TABLE Students
ADD Birthday DATE
INSERT SQL query format
INSERT INTO Students (birthday, surname)
VALUES (11/02/2004, “Smith”)
Updating a record in a database table format
E.G In the students table change the birthday from 11/02/2004 to 11/04/2004 for the student with surname Smith
UPDATE Students
SET Birthday= 11/04/2004
WHERE Surname = “Smith”
What is meant by referential integrity?
A process which ensures consistency.
Ensures that info is not removed if it is required elsewhere in a linked table
-This means that when 2 databases are linked one cant be deleted as the other needs its contents
(e.g pet and owner) without an owner the animal isnt a pet the pet needs its owner
What is meant by transaction?
A single operation being executed on data
-Sometimes a collection of operations can also be called a transaction
WHAT IS THIS?
A process which ensures consistency.
Ensures that info is not removed if it is required elsewhere in a linked table
-This means that when 2 databases are linked one cant be deleted as the other needs its contents
(e.g pet and owner) without an owner the animal isnt a pet the pet needs its owner
Referential integrity
Explain the term deadlock
A situation in which two or more transactions are waiting for one another to give up locks.
eg user1 (transaction) finishes with record1 and user2(transaction) finishes with record2 but now user1 wants record2 and user2 wants record1
Explain ACID in transactions
ACID = ATOMICITY, CONSISTENCY, ISOLATION, DURABILITY
Atomicity= A transaction must be processed in its entirety or not at all (fully or then no)
Consistency= A transaction must maintain the referential integrity rules between linked tables (one table cant be deleted as the other table requires its contents)
Isolation= Simultaneous transactions should lead to the same result as if they were carried out one after the other
At the same time=one after the other
Durability=When a transaction has been executed it will remain just in case (e.g in the event of a power cut)
TRANSACTIONS
Explain what the A in ACID stands for
ATOMICITY
A transaction must be processed in its entirety or not at all (fully or then no)
TRANSACTIONS
Explain what the C in ACID stands for
CONSISTENCY
A transaction must maintain the referential integrity rules between linked tables (one table cant be deleted as the other table requires its contents)
TRANSACTIONS
Explain what the I in ACID stands for
ISOLATION
Simultaneous transactions should lead to the same result as if they were carried out one after the other
At the same time=one after the other
TRANSACTIONS
Explain what the D in ACID stands for
DURABILITY
When a transaction has been executed it will remain just in case (e.g in the event of a power cut)
Explain record locking in databases
Prevents simultaneous access to records in order to prevent inconsistencies and loss of updates
Once a person is editing a record, this ‘locks’ the record so that no one else can access the same record until the person is finished
DRAWBACKS = Deadlocks
Give an advantage and disadvantage of using record locking
ADVANTAGE=
-Doesnt allow more than one person to modify a record at a time =>
-No loss of updates
-Prevents inconsitencies
DISADVANTAGE
-Deadlocks
Explain what is meant by a deadlock by giving an example
If user 1 accesses record1 and user2 accesses record2
Then user1 wants to access record2 and user2 wants to access record1
Now they are both waiting for eachother but no progress is made
Give an advantage of data redundancy
In situations such as big companies who cant afford to lose important data, it means that if one copy of the data is lost there is still another copy which remains unaffected and be recovered
(as redundancy= having one or more copies of data in physically different locations)
What is meant by data redundancy?
Having one or more copies of data in physically different locations
Give types of networks
Local Area Network (LAN)
Wide Area Network (WAN)
What is meant by a network?
When two or more computers are connected together with the ability to transmit data between eachother
When would you use a WAN?
Its a network which is spread over a large geographical area so therefore large corporations with offices in multiple locations for example
-This way they can communicate with eachother between different sites
WANs also require extra telecommunication hardware.
Infrastuctures used in WANs are owned by 3rdparties
When would you use a LAN?
Its a network which is spread over a small geographical area or a single site so perhaps a school
What is the difference between a LAN and a WAN?
LAN= Small geographical area/single site
WAN= Large geographical area/multiple sites
What is meant by the term protocol?
A set of rules defining how two computers communicate with eachother
Protocols are standard so that all devices have a agreed method of communicating with eachother, regardless of manufacturer
Protocols are standard. What is meant by this?
Protocols are standard so that all devices have a agreed method of communicating with eachother, regardless of manufacturer
What is FTP?
FILE TRANSFER PROTOCOL
A protocol used for the transmission of files over networks
What is IMAP and POP3?
IMAP= Internet message access protocol
POP3= Post office protocol
Mailing protocols used for email access
What is TCP/IP?
TRANSMISSION CONTROL PROTOCOL / INTERNET PROTOCOL
Networking protocol used for routing packets through a network
Networking protocol used for routing packets through a network
TCP/IP
(TRANSMISSION CONTROL PROTOCOL / INTERNET PROTOCOL)
What is HTTP? HTTPS?
HYPERTEXT TRANSFER PROTOCOL/(SECURE)
HTTP= used for web page rendering
HTTPS= encrypted version of HTTP (more secure)
What is meant by webpage rendering?
The process of turning HTML, CSS, and JavaScript code into an interactive page that website visitors expect to see when clicking on a link.
The internet is…
a network of networks which allows computers on opposite sides of the globe to communicate with eachother
What happens in the application layer?
When a device (or application) sends data, it will determine which protocol to use based on the type of communication required by the application.
What happens in the transport layer?
-Uses TCP (Tranmission control protocol) to establish an end-to-end connection bewteen the source and recipient computer
-Splits data into packets, adds sequence number and port number being used for communication
-If any packets gets lost==> transport layer requests retransmission of these
What happens in the network layer?
-Adds source and destination IP addresses
-Combo between IP address and port number is a socket address
-Routers operate in this layer and they use the IP addresses tells you which device the data should be sent to within the network.
The port number identifies the specific service or application on the device that should receive the data.
The router uses the… to forward packets
IP address
to the specific device on the network
In which TCP/IP layer do routers operate?
Network layer
What does a socket tell you?
IP+Port num=Socket
IP addresses tells you which device the data should be sent to within the network.
The port number identifies the specific service or application on the device that should receive the data.
What happens in the link layer?
-Creates a physical connection between the network nodes
-Adds a MAC address which identifies the NICs of the source and destination computers so that the packets can be sent properly
For devices on the same network, the destination MAC address is….
SAME NETWORK so:
Destination MAC address =MAC address of recipient computer
Otherwise it will be the MAC address of the router because its already in the correct/same network otherwise the packets would need to be routed by the router
Once the destination has been reached, what happens in the TCP/IP stack?
- MAC address is removed by link layer
- IP address is removed by network layer
- Port number is removed and packets are reassembled by transport layer
- Application layer presents the data to recipient in the form it was requested in
Give an example of a WAN
The Internet
Give a disadvantage of WANs
Usually require extra telecommunication hardware
-Have to manage
-Expensive
What is a firewall? (simple)
A firewall is a network security system that monitors and controls incoming and outgoing network traffic based on predetermined security rules.
It acts as a barrier between a trusted internal network (e.g., your home or company network) and untrusted external networks (such as the internet)
Can be software or hardware
Explain how a software firewall works
Prevents unauthorised access to a network.
Consists of 2 NICs which sit between the user and the internet
Firewall passes packets between these and compares the packets against a predefined set of rules set by the firewall software ensuring that only legitimate traffic is allowed through.
When access is denied by a firewall either the packet is dropped or the packet is rejected. Explain the difference
Rejected packet sends an alert to the sender to notify them whereas a dropped packet won’t
Explain what is meant by packet filtering?
Packet filtering/static filtering
Used by firewalls where they inspect each packet that is trying to enter or leave the network. It checks various aspects of each packet, such as:
It examines source and destination IPs, protocols and ports being requested
Why is encryption important when transmitting data over the Internet?
Its a way of keeping data secure as it makes data unreadable if intercepted
Proxy servers
Acts as an intermediary, collecting and sending data on behalf of users
-Privacy of user is protected because packets are forwarded using the proxys ip address instead of the sender’s router’s ip address
How many bits in a MAC address?
48 Bits
(12 digit hex)
What is a NIC?
NETWORK INTERFACE CARD
It is a card usually built into a device required for a device to connect to a network.
It assigns a device a unique MAC address
What is a switch?
A device used to direct the flow of data
(Most commonly used in star topology)
What is a WAP?
WIRELESS ACCESS POINT
A device which allows wireless devices to connect to wired networks
What is a router?
A device which is used to connect 2 or more networks together
What is a Gateway? How do they work?
A device used to connect 2 or more networks together but when the networks have different protocols from eachother.
They work by:
Removing packet header and modifyes it using the new protocol then adds it back on so networks can communicate with eachother
Give some points on the idea of Client Server networks
Clients = terminals
-They can request to use server
Server:
-Powerful, central computer
-Greater processing power than terminals
-Holds all important info and resources
Give advantages of Client Server networks
-More secure as data is stored in one place (because of centralised structure of network)
-Central backups are carried out so no need for individual backups
-Data and resources can be shared between all clients
Give disadvantages of Client Server Networks
-Expensive to set up
-If server fails the performance fails as clients depend on server
-Trained staff required to maintain server
Give advantages of using Peer to Peer networks
-Cheaper than client server networks
-Users can share resources
-Easy to maintain (no specialist staff needed, so cheaper)
-Not dependent on central server, so if one computer fails the rest wont (only performance as that computer may have some resources that the other may not have)
Give disadvantages of using Peer to Peer networks
-Impossible to trace origin of files (thats why they are commonly used in piracy)
-Poorer security
-May be diff to locate resources
-Backups must be done on each separate computer (time consuming)
Give some points on the idea of Peer to Peer networking
Computers are connected to eachother so they can share files
Each devices is both the client and server as it can both request and provide resources
Used in piracy as its almost impossible to trace the origin of files
More decentralised
Why would Peer to Peer networks be useful in piracy?
Because its almost impossible to trace the origin of files
What is meant when an field is atomic in a database?
An atomic value is a piece of data that cannot be broken down further in the context of the database.
e.g Name = Bob Smith (not atomic)
FirstName = Bob, Surname = Smith (atomic)
What is a composite key?
A type of primary key that consists of two or more fields combined to uniquely identify a record in a table.
It is used when no single field can uniquely identify a record.
What is the difference between the port number and IP address?
Both combined = socket
IP addresses tells you which device the data should be sent to within the network.
The port number identifies the specific service or application on the device that should receive the data.
How is the Domain name system used in web page accessing
Overall: deals with translating human-readable domain names into IP addresses, allowing users to access websites and services on the internet.
1.When you type a domain name (e.g., www.example.com) into your web browser, the browser needs to know the IP address of the web server that hosts the website.
2.Browser sends a DNS query to a DNS server, which will either directly respond with the IP address if it knows the mapping, or it will forward the query to other DNS servers until it finds the answer.
Domain name system order
The DNS system is organized in a hierarchical structure:
Root DNS servers: The top level of DNS servers, responsible for directing queries to the appropriate top-level domain (TLD) servers (e.g., .com, .org, .uk).
Top-Level Domain (TLD) servers: These servers are responsible for handling queries for domain names with specific TLDs, like .com, .edu, .gov, etc.
Authoritative DNS servers: These are the final DNS servers that hold the actual IP address records for specific domain names.
-A DNS query might be passed along multiple servers before reaching the authoritative server that holds the IP address for the requested domain.
Root Domain servers
Root DNS servers: The top level of DNS servers, responsible for directing queries to the appropriate top-level domain (TLD) servers (e.g., .com, .org, .uk).
Top-Level Domain (TLD) servers
Top-Level Domain (TLD) servers: These servers are responsible for handling queries for domain names with specific TLDs, like .com, .edu, .gov, etc.
Give examples of Top Level Domain servers
.com
.edu
.gov
Authoritative DNS servers
Authoritative DNS servers: These are the final DNS servers that hold the actual IP address records for specific domain names.
-A DNS query might be passed along multiple servers before reaching the authoritative server that holds the IP address for the requested domain.
Used by firewalls where they inspect each packet that is trying to enter or leave the network. It checks various aspects of each packet, such as:
It examines source and destination IPs, protocols and ports being requested
What is this?
Packet filtering
Stateful inspection works in the … layer
Transport
Packet filtering works in the … layer
Network
What is stateful inspection?
More advanced than packet switching
Checks the payload (contents of packets) rather than just the header
What is meant by a packet’s payload?
Raw data to be transmitted
Packets are…
segments of data
What is meant by a packet’s trailer?
Refers to the data added at the end of a packet during transmission. It often includes information used to ensure the integrity of the data being transmitted
1.Checksum or cyclic redundancy check
-Code is generated based on the received data in the packet used to detect whether any errors have occured during transmission
When the packet is received, the receiving device recalculates the checksum or CRC based on the received data and compares it to the value in the trailer. If they match, the data is assumed to be intact; otherwise, an error is detected.
Packet switching and circuit switching are techniques which…
networks use to exchange data
What is packet switching?
Data is transferred accross a network in packets
-Packets are sent along the most efficient route
Give advantages of using packet switching
-Has methods which checks if data has been lost (checksums, cyclic redundancy check)
X Time consumming to construct and deconstruct packets (cause of headers …etc)
-Multiple routes can be used between devices (one path breaks another can be used)
X But you must wait for all packets to arrive before data can be received
-Allows global communication as packets can be transferred over very large networks
Give advantages of using circuit switching
-Data arrives in logical order ==> so quicker to reconstruct
-Allows 2 users to hold a call without delay in speech
Give disadvantages of using circuit switching
-Bandwidth is wasted during periods when no data is sent
-Devices must send and receive data at same rate
-Using switches means electrical interference may be product ==> data corruption or destruction
-The sections of network which have a direct link to eachother cant be used by other until transmission is finished
What is circuit switching?
A direct path is established between the sender and the receiver before any data is transmitted. This path remains fixed throughout the communication.
Once the circuit is established, data is sent in a continuous stream without interruption.
After the communication ends, the circuit is released, and the resources are freed for other users.
-However both devices must transfer and receive data at same rate
Give advantages of proxy servers
-Masks IP addresses and location.
-Scans for malicious content and blocks harmful websites.
-Speeds Up Browsing: Through caching of frequently visited websites.
-Restricts or monitors internet usage.
-Allows access to blocked content by changing the perceived location.
How many digits in hex in a MAC address?
12 digit hexadecimal number
Can you give the difference between packet switching and circuit switching in terms of connection type
Connectionless:
PS: Data is divided into small packets, which are sent independently over the network.
CS: A direct communication path (circuit) is established for the entire session.
Can you give the difference between packet switching and circuit switching in terms of data transfer
PS: Packets are routed individually and may take different paths to the destination.
CS:All data follows the same predetermined path (circuit).
Can you give the difference between packet switching and circuit switching in terms of network resources
PS: Network resources are shared among users, allowing multiple connections simultaneously.
CS: Resources are reserved for the duration of the communication, even if idle.
Can you give the difference between packet switching and circuit switching in terms of cost
PS: More cost-effective, as it optimizes the use of network resourceS (as it allows multiple connections at the same time)
CS: More expensive due to dedicated resource usage.
Example usage of circuit switching
Traditional telephone networks.
Example usage of packet switching
Internet communication (e.g., emails, web browsing, streaming).
Give 3 advantages of using layers in the TCP/IP stack
- Selcontained : Allows different layers to be worked on
independently - Selcontained : Allows layers to be replaced/upgraded without
affecting others - Allows for layers from different providers to be used interchangeably
Why do computers store data using binary?
Computers use binary logic for on/off or 1/0
* Computer systems are based on
switches/transistors
* Binary is high tolerance
Give 2 advantages of using two’s complement over sign and magnitude
-Can be easily used in binary arithmetic (as all the bits represent the actual number)
or
- Increased range of numbers available (because there is more bits)