¡GoConqr estrena diseño! Cuéntanos qué te parece.

Apuntes

1.3 - Exchanging Data

Michael Mee OCR Computer Science H446 A level Inglés 4 páginas

Contenido del apunte (4)

Página 1

1.3.1 - Compression, Encryption and Hashing

Lossy Compression:

Removes non-essential information.

The degree at which the file has been compressed comes at the cost of quality.

Suitable for images, sound files, voice transmission.

Results in a much smaller file size.

Lossless Compression:

Records patterns in the data and uses those patterns to reassemble a file.

No data is lost using lossless.

Suitable for compressing text files, as we need all the data present.

Run Length Encoding (RLE):

Records a single instance of a data value (such as the colour green) and instead of recording all instances of that data that occur one after the other, the number of times it repeats is recorded.

Dictionary Coding:

Searches through text and records every group of characters that repeat (a space is written as '_').

Each group has an assigned binary value, and a corresponding number.

The dictionary must still be stored alongside the text.

Example of an entry:

Number: 3, Entry: _chocolate, Binary: 010

So, for every instance in which chocolate appears, that instance can be replaced by the number 3.

Encryption:

The transformation of data from one form to another to prevent an unauthorised party from being able to understand it.

The original data is called the plaintext.

The encrypted data is called the ciphertext.

The information needed to unlock the message is called a key.

Symmetric (Private Key) Encryption:

Uses the same key to encrypt and decrpyt the data.

The key must be transferred to the same destination as the ciphertext.

The key can be intercepted very easily alongside the ciphertext, causing severe security problems.

Asymmetric (Public Key) Encryption:

Uses two separate, but related, keys for encrypting and decrypting.

The public key is made public to allow others to encrypt data to send to you.

The private key is known only by you, and is the only key that can be used to decrypt a message.

Messages can be digitally signed to authenticate the sender.

Hashing:

A hashing function provides a mapping between an input and smaller output.

It works only one-way, you cannot get back to the original.

Suitable for storing encrypted PIN numbers and passwords so that they cannot be read.

To verify the data, the software applies the hash function to the user input and comparies it with the one stored.

Cryptographic Hash Functions:

A hash total is a value calculated from unencrypted message data. (known as the checksum).

The process is irreversible and impossible to crack, other than using brute force.

Página 2

1.3.2 - Databases

Database Concepts:

An entity is a category of an object about which data is to be recorded.

An attribute is a value associated with an entity, such as Name, Surname, Address.

A flat file database is a database that consists of a single file, and thus a single entity.

A primary key is a unique identifier, which relates to any given record in an entity.

A secondary key acts as a secondary index, so that searches can be completed quickly.

Relational Databases:

A separate table is created for each entity in the system.

Wherever a relationship exists between entities, a foreign key links them.

Foreign Key:

A primary key from another table which is placed into a table to link them together.

Entity Relationship Modelling:

There are three degrees of relationship:

One-to-one.

One-to-many.

Many-to-many.

An entity relationship diagram can be constructed to show these relationships between entities, where a 'many' connection is shown as 2 diagonal lines coming from a central line (much like a fork).

Many-to-Many Relationships:

It is not possible to link tables that are in a many-to-many relationship.

To solve this, an additional table can be added that separates the relationship into 2 one-to-many relationships.

Composite Key:

A primary key that consists of more than one attribute.

Referential Integrity:

Ensures that if a particular component of a relational database is being used in a table, it is not deleted.

Indexing:

An index of primary keys is automatically maintained by the database software, giving the position of each record.

This allows any particular primary key to found quickly.

Secondary indexes can be defined to be used as search criteria too, to speed up searches.

Normalisation:

The process used to come up with the best possible design for a relational database.

It has several rules:

No unnecessary duplication of data.

No data inconsistency.

The structure of each table is flexible to allow as many or as few items as required.

The structure should allow for complex queries.

First Normal Form (1NF):

Must contain no repeating attributes, or group of attributes.

Second Normal Form (2NF):

Must contain no partial dependencies.

Partial dependency occurs when one or more attributes only depend on part of the primary key, so can only occur if there is a composite key.

Third Normal Form (3NF):

Must be in 2NF and must depend on nothing but the primary key.

Advantages of Normalisation:

No data redundancy.

Data integrity is maintained, making it easier to modify and maintain the database.

Faster sorting and searching.

Records can't be deleted accidentally.

Structured Query Language (SQL) Concepts:

A declarative language used for querying and updating tables in a relational database.

SELECT, FROM, WHERE:

SELECT - the fields to be extracted from.

FROM - the table or tables the data will come from.

WHERE - the search criteria (i.e. WHERE Name = "John")

ORDER BY - the fields that the results are to be sorted on. (ASC or DESC)

When extracting data from multiple tables, it is important to remember to link the tables together using the primary key:

SELECT Table1.Field1, Table2.Field1

FROM Table1, Table2

WHERE (Table1.PrimaryKey1 = Table2.PrimaryKey1) AND Table1.Field1 = Table2.Field1

JOIN Statements:

JOIN Table2

ON Table1.Field1 = Table2. Field1

WHERE Table1.Field3 = "Cheese"

Creating Tables (example):

CREATE TABLE Employee

(

EmpID INTEGER, NOT NULL, PRIMARY KEY

EmpName VARCHAR(20), NOT NULL

HireDate DATE

Salary CURRENCY

)

You must define the primary key, and the data type of each attribute.

"NOT NULL" means that the attribute can't be empty.

Data Types:

CHAR(n) - character string of fixed length n.

VARCHAR(n) - character string of variable length, max n.

BOOLEAN - true/false.

INTEGER - whole number, integer.

FLOAT - decimal value.

DATE - stores day, month, year values.

TIME - stores seconds, minutes, hours.

CURRENCY - formats numbers into regional currency values.

Altering a Table's Structure:

The ALTER TABLE statement is used to add, delete or modify columns in a table.

Adding a column:

ALTER TABLE Table1

ADD Field2 VARCHAR(10)

Deleting a column:

ALTER TABLE Table1

DROP COLUMN Field2

Changing the data type of a column:

ALTER TABLE Table1

MODIFY COLUMN Field3 VARCHAR(30), NOT NULL

Inserting, Updating and Deleting Data:

The INSERT INTO statement is used to insert a new record in a table.

Example:

INSERT INTO Table1(column1, column2...)

VALUES (value1, value2...)

The UPDATE statement is used to update a record in a table.

Example:

UPDATE Table1

SET column1 = value1, column2 = value2....

WHERE columnX = value

The DELETE statement is used to delete a record from a table.

Example:

DELETE FROM Table1

WHERE columX = value

Capturing, Selecting and Exchanging Data:

Capturing Data:

Manual Methods:

Transcribing data from a form.

Market researchers.

Automated Methods:

Scanning cheques at the bank.

Lottery tickets.

Exams.

Questionnaires.

Barcode Scanners.

Selecting Data:

Data may be selected due to specific criteria before being added to a database.

SQL can be used to select data from different tables which match the required criteria.

Selected data can be used to create reports, letters, records...

Exchanging Data:

Electronic Data Interchange (EDI):

Transfers data between one computer and another.

Standardised message formatting allows documents to be exchanged electronically.

Transaction software.

Transaction Processing:

A transaction is defined as a single logical operation on data.

ACID:

Atomicity - requires that a transaction must be processed in its entirety or not at all.

Consistency - ensures that no transaction can violate any of the defined validation rules for maintaing referential integrity.

Isolation - ensures that concurrent execution of transactions leads to the same results as if transactions were processed on after the other.

Durability - ensures that once a transaction has been committed it will remain in all events.

Record Locking:

A technique of preventing simultaneous access to objects in a database in order to prevent updates being lost or inconsistencies in the data arising.

Anyone else attempting to retrieve the same record is denied access until the transaction is completed in cancelled.

Problems:

Deadlock may occur, a situation in which neither user can proceed.

Solving Deadlock:

Serialisation - ensures that transactions do not overlap in time and therefore cannot interfere with each other, a transaction can't be started until the previous one has finished.

Timestamp Ordering:

Each transaction is given a timestamp.

The transaction with the earlier timestamp is applied first.

To ensure transactions are not lost, every object in the database has a read timestamp and a write timestamp which is updated whenever an object is read or written.

Redundancy:

The process of maintaining many different storage facilities to store transactions so that, in the event of systems going down, there are backups to prevent the loss of transactions.

Página 3

1.3.3 - Networks

Characteristics of the Internet:

The Internet is a series of inter-connected networks.

Physical Structure of the Internet:

Each continent uses backbone cables connected to lines fed across the sea beds.

Internet Service Providers (ISPs) connect directly to the backbone and distribute connection to providers, who then provide access to homes and businesses.

Uniform Resource Locators (URLs):

The full address of an Internet resource.

It specifies the location, the resource name and file type.

Example:

http://www.testsite.com/folder/newfolder/computing.png

Internet Registrars:

Holds records of all existing website names.

Holds the details of the domains that are currently available for purchase.

Act as resellers for domain names and allow people to purchase them.

Internet Registries:

5 global organisations governed by the Internet Corporation for Assigned Names and Numbers (ICANN).

They hold records of all the domain names currently issued to individuals and companies.

Details include:

Name.

Type of individual.

Mailing address.

Date of registry.

They also allocate IP addresses and keep track of which address a domain name is associated with, as a part of DNS.

Internet Protocol (IP) Addresses:

A unique address that is assigned to a device on a network.

Example:

130.142.37.108

Indicates where a packet of data is to be sent or sent from.

Domain Names:

A domain name identifies the area that an Internet resource resides in.

The names are structured into a hierarchy of smaller domains:

Example:

www.google.co.uk (each Level Domain is separated using a full stop).

Domain Name System (DNS):

The DNS catalogues all domain names and their corresponding IP addresses in a series of global directories.

When a webpage is requested by a user, the IP address associated with the URL used is requested from the local DNS.

If the local DNS does not have the correct IP address, the search will be extended to larger DNS databases.

Once the IP address is located, a data request is sent by the user to that location to find the page data.

Fully Qualified Domain Name (FQDN):

A domain name that include the host server name, such as 'www', 'mail' or 'ftp'.

Example:

www.websitename.com

Wide Area Networks (WANs):

A network that relies on third-party carriers.

Spread over large geographical areas.

Lesser speed and lower data transfer rates.

Signal may be impacted by obstruction.

Local Area Networks (LANs):

A number of computing devices connected together on a single site or building.

Users on this network can communicate with each other and share data/hardware devices such as printers.

Can transmit data very fast, but only over a small distance.

Network Topologies:

Physical Bus Topology:

All computers are connected to a single cable.

Advantages:

Inexpensive to install, requiring less cable and does not require any additional hardware.

Disadvantages:

If the main cable fails, the whole network is down.

Performance reduces significantly with heavy traffic.

Low security, as all computers can see the data transmissions.

Physical Star Topology:

There is a central node which acts as a router to transmit messages.

A switch keeps a record of the unique MAC address of each device on the network, and identifies the computer on the network it should send data to.

Advantages:

If one cable fails, only one station is affected.

Consistent performance despite heavy usage.

Higher transmission speeds.

No collisions of data.

System is more secure as messages can't be intercepted by other stations.

Easy to add new stations without disrupting the network.

Disadvantages:

Costly to install due to the length of cable required.

If the central node goes down, data can no longer be transitted to any of the nodes.

Mesh Network:

Each node is wirelessly connected to every other node in a network.

Only one node requires a connection to the Internet, and all others can share this connection.

Advantages:

No cabling costs.

Increasing the number of nodes increases the speed and stability of the network.

New nodes can automatically be incorporated.

Faster packet communication as there are no switches involved.

Physical Topologies:

The actual layout of a network.

Import for selecting wiring schemes and designing the wiring for a network.

Logical Topologies:

The path in which the data travels in.

Describes how components communicate across the physical topology.

Wi-Fi:

A local area wireless technology that enables connection to the Internet using a wirels network access point (WAP).

Wireless Access Point:

In order to connect to a wireless network, a network adapter is required.

The combination of a computer and interface controller is called a station.

Circuit Switching:

Creates a direct link between two devices for the duration of the communication.

Various switchesset up a path between the caller and the recipient.

Used when communications are in real time, such as in telecommunications.

Advantages:

Packets arrive in the order they are sent, so reorganising the message is much simpler.

Disadvantages:

When used in computers, the two devices must operate at the same transfer rate.

Electrical interference may occur due to the switches, which may cause corrupt or lost data.

Data Packets:

Packet Switching:

Sending packets of data across a network on which other similar communications are happening simultaneously.

Packets:

Data which has been broken down into more manageable chunks, between 500 and 1500 bytes.

Each packet contains a header and a payload:

The payload contains the body of the data to be sent, which is reassembled in the correct order when the data is received.

The header contains the sending and receiving IP addresses, as well as the protocol being used and the number of packets sent as a sequence.

The header also contains the hop limit - the point at which the data packet expires.

A checksum may be used to detect transmission errors by creating and attaching a hash value:

If the checksum differs from the expected value, the packet is refused and a new copy is requested.

Network Hardware:

Router:

Used to connect at least two networks.

Reads the recipient's IP address in each packet and forwards it on to the recipient via the fastest and least congested route to the next router.

The above step repeats until the packet has reached its destination.

Gateways:

Used when the protocols in the header differ when hopping through routers.

All of the header data is stripped, where new data is added in the format of the new network before the gateway sends the packet on.

Media Access Control (MAC) Addresses:

Every device capable of being part of a network must have a Network Interface Card (NIC).

Each NIC has a unique MAC address which is assigned into the card by the manufacturer, uniquely indentifying the device.

Protocols and Standards:

A protocol is a set of rules defining common methods of data communication.

standard is set, so that that all devices can communicate with each other.

Examples:

HTTP (HyperText Transfer Protocol) is the standard for browsers to render web pages.

TCP/IP (Transmission Control Protocol/ Internet Protocol) enables communication with any other computer regardless of its location.

The TCP/IP Stack:

Contains four layers:

Application Layer:

Uses protocols relating to the application being used to transmit data over a network.

Selects an appropriate protocol for the communication, such as HTPP, POP3 or FTP.

Transport Layer:

Uses the Transmission Control Protocol to establish an end-to-end connection with the recipient.

Data is split into packets, labelled with the total number of packets and the port number through which the packet should route.

If any packets do not reach their destination, a request is made for retransmission.

Internet Layer:

Adds the source and destination IP addresses.

Routers operate on the internet layer, to send packets onto their destinations.

Link Layer:

The physical connection between the network nodes and adds the MAC addresses, which identify the NIC of the source and destination computers.

The destination MAC address is that of the device that the packet is being sent to.

At the receiving end, the process is reversed:

The MAC address is stripped by the link layer, passing the packets onto the Internet layer.

The IP addresses are removed by the Internet layer which passes them to the transport layer.

The port numbers are removed and the packets are reassembled.

The resulting data is passed on to the application layer which presents the data for the user.

Protocol Layering:

Separating network designs into layers, and assigning protocols to perform each layer's task.

Firewalls:

A security checkpoint designed to prevent unauthorised access between two networks.

Consists of two NICs with one connected to the internal network, the other connected to the external network.

Each data packet attempting to pass between the two NICs is analysed against packet filters, then accepted or rejected.

A firewall may also act as a proxy server.

Packet Filtering:

Controls network access according to network administrator rules and policies.

Examines the source and destination IP addresses, and allows permitted addresses.

Can also block packets based on the protocols being used and the port numbers they are trying to access.

Proxy Servers:

Intercepts all packets entering and leaving a network, hiding the true network address of the source from the recipient.

Enables privacy and anonymous web surfing.

Maintains a cache of websites commonly visited and returns the data to the user immediately, without the need to reconnect to the Internet.

If a website is not in the cache, the proxy makes a request on behalf of the user using its own IP address.

Network Threats:

Viruses:

Rely on host files to be opened in order to spread.

Self-replicates by spreading copies of itself.

Once the virus is resident in memory, any other uninfected file that runs becomes infected when it is copied into memory.

Worms:

Sub-class of a virus.

Will usually enter the computer through a vulnerability or when a file is opened.

The worm can replicate itself and send copies to other users on the computer.

Responsible for using up bandwidth, system memory or resources causing computers to slow down.

Trojans:

Used as a backdoor to its creator, to obtain personal information or to use your computer power to send spam to others.

Trojans can't self-replicate.

Página 4

1.3.4 - Web Technologies

All the HTML content and CSS content was randomly deleted, so this will start from JavaScipt.

JavaScript:

A script language that is used to add interactivity to a webpage.

JavaScript is interpreted rather than compiled.

JavaScript is translated into object code for the computer it is running on, which is then translated by the interpreter when the page is loaded.

Input:

JavaScript can be used to input data on the client's computer.

Advantages of processing data before it is posted to a server:

Local computers can validate erroneous data before submission.

A busy server is relieved from having to process everything itself.

Output:

JavaScript can reference and interact with HTML elements.

A validation script can change the colour of an element if a user has entered invalid data.

Functions and Variables:

Functions are defined with curly brackets - {} - and called using the function name.

Variables must be declared as variables.

Example:

var chocolate = 0

Arrays:

Example:

var captcha = ["captcha1.jpg", "captcha2.jpg"];

There are some basic JavaScript techniques you need to know:

Changing the contents of a HTML element:

chosenElement = document.getElementById("example");

chosenElement.innerHTML = "Hello world";

Writing directly to a document:

document.write("Hello world");

Creating an alert box:

alert("Hello world");

Search Engine Indexing:

Search engines rely on a database of webpages to find the page you're looking for.

To create this index, a program called a web crawler constantly goes out to all pages on the index and then all the sites linked to those sites and so until all resources on the Internet are found.

Key Words and Meta Tags:

Key words are within search criteria, so that the pages can be found easier and more suited to what the client wants.

Meta tags are a list of keywords or phrases specified by the website owner that are built into each web page.

PageRank Algorithm:

Ranks each page based on their reliance and relevance.

Determined by how many visits to Page X result from other web pages containing links to the page, and the total number of outbound links from the site.

Equation:

PR(A) = (1-d) + d(PR(T1)/C(T1) + ... + PR(Tn/C(Tn))

PR(A) is the PageRank of A.

C(Tn) is the total count of outbound links from web page n, including the inbound link to page A.

PR(Tn)/C(Tn) is the share of the vote that page A gets from pages T1 to Tn.

d is the damping factor, which is the probability that after clicking through around 6 links, the average user will either stop or enter a new web address.

The damping factor is also there to reduce the impact of PR(Tn)/C(Tn).

Client Server:

One or more computers are connected to a powerful server.

Each client may hold some of its own files and software, and can access resources held by the server.

There may be several servers, each handling different requests.

Advantages:

Security is better, as all files are stored in a central location and access is managed by the server.

Backups are done centrally so there is no need for individual backups.

Data and resources can be shared.

Disadvantages:

It is expensive to install and manage.

Professional staff are neede to maintain the servers and run the network.

Peer-to-Peer:

There is no central server.

Individual computers are connected with each other to share files.

Advantages of using peer-to-peer in a small LAN:

Cheap to set up.

Enables users to share resources.

Not difficult to maintain.

Problems of peer-to-peer:

It has been widely used for online piracy, causing massive destruction to jobs in industries such as movies, music and gaming.

Client-Side Processing:

Data is processed on the client computer, rather than on the server.

This may happen as the computer has specific software that can process the information, or to lighten the load on the server.

Improves security as it can avoid unnecessary data transfer.

JavaScript is a client-side language, and is commonly used for processing data on the client side to validate data entry before it is sent to the server.

Server-Side Processing:

Data is processed on the server side.

They can process data much faster than a client computer.

Validation may be carried out server side where an invalid entry will be compared with data already stored in the server.

JavaScript can be circumvented, so server-side validation is important for the integrity of server data.

Often used for database queries and provides further validation.

Información

Descripción
A level OCR Computer Science H446 Apunte sobre 1.3 - Exchanging Data, creado por Michael Mee el 30/05/2018.
Creado por
Michael Mee · may 2018
Actualizado
30 may 2018
Visitas
4
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?