jan mocks dk Flashcards
network layer
encapsulates IP packets into frames
maps IP to MAC
specifies requirements of hardware to be used
delivers packets to network
defining pointer data type
TYPE Tmonth = ^STRING
random file
records stored in any available position
location found using a hashing algorithm on the key field
TCP/IP +
+ break processes down into manageable self contained modules
+ easier to develop + make software/ hardware compatible
application layer
- what user sees
- contains programs that exchange data
- send files to transport
HTTP
- user types URL
- HTTP requests from application to transport
- transport creates packet which is sent to destination ports
- DNS server looks up IP
- sends transport acknowledgement
- communication established between web server and browser
circuit switchinge eg
PSTN
packet switching eg
VoIP
massively parallel computers
- large number of processors connected
- simultaneously performing a set of coordinated computations
- network infrastructure
- communicate by sending messages
features of SISD and SIMD vs MISD and MIMD
- if SI - sequential processing - can use pipelining
- if MI - each processor is independent
- all except SISD - can be used as parallel computers
Describe how the layers of the TCP/IP protocol stack interact with each other
- Each layer can only accept input from the next higher layer or the next lower layer
- There is an interface between the adjacent layers which is the only interaction between layers
- Data is added to the headers as the frames/packets pass through the layers
- User interaction takes place at the highest/Application layer of the stack through protocols associated with that layer
of the stack - Direct access to hardware takes place at the lowest/Link layer of the stack.
set
- user-defined composite data type
- … which includes a list of unordered elements
- Set theory operations, such as intersection and union, can be applied to these elements
- A set data type includes the type of data/data type it uses as part of its definition
- All the elements are of the same data type.
PSUEDOCODE of set
TYPE SymbolSet = SET OF CHAR
DEFINE Operators (‘+’, ‘–’, ‘*’, ‘/’, ‘^’) : SymbolSet
segmentation
- space is broken into varying sized blocks called segments
- Each segment has a name and size.
- During execution segments from logical / virtual memory are loaded into physical memory.
- The address is specified by the user
- Segments are numbered
- … and this number is used as an index in the segment map table.
- A segment map table maps logical / virtual addresses to physical addresses
disk thrashing
- when virtual memory is being used.
- As the main memory fills up, more and more pages need to be swapped in and out of virtual memory.
- This swapping leads to a very high rate of hard disk access / excessive disk head movements.
- takes a long time
- Eventually, more time is spent swapping pages than processing data thrash point, which can cause the program to
freeze or not run.
record
- A user-defined composite data type
- It uses other data types in its definition to form a single new data type
- The data types referenced may be primitive data types from a programming language or they may be other userdefined data types.
- Includes a fixed number of items.
Outline how the kernel of an OS acts as an interrupt handler.
- the kernel receives a signal when an interrupt is generated
- the kernel checks the priority and reviews the status/priority of the current interrupts
- system enters kernel mode if the type of interrupt is of higher priority than the current process
- saves the state of the interrupted process on the kernel stack
- the kernel restores the process state e.g. contents of registers once the interrupt is serviced
object vs class
- An object is an instance of a class
- No memory is allocated when a class is defined, but objects are allocated memory space whenever they are created
- A class cannot be manipulated as it is not available in the memory, but objects can be manipulated
- A class is defined but an object is declared
- A class can use inheritance. An object cannot.
Explain the role of a digital certificate in creating a digital signature.
- The digital certificate provides the public key
- … that can be used to validate the private key associated with the organisation/website/digital signature
need for protocols
- Protocols provide a standard set of rules that enables successful data transfer between devices.
- Allows communication between devices on different platforms.
- Makes communications independent of software and hardware.
recursion
- process using a function that is defined in terms of itslef and calls itself
- defined usintg a base case - terminates and not recursive
- and general xase - recursively defined solution
benefit of a user interface
- hids complexity of hardware
eg using a GUI click and icon rather than write code
running > ready state
- fixed time slice is up
and there is a process with higher priority in queue - or interrupt arrives
causes of exception
user errors
programming errors
hardware failure
runtime error
stack vs queue
FIFO vs FILO
both vary in size
queue has 2 accessible ends - stack has one
virtual memory
secondary staorage is used as main memory
temporarily
data swapped between RAM and VM when needed
CPU appears to access more that avaialable RAM memory
O logn
time taken goes up linearly as number of items rises exponentially
worst case scenario
big O notation describes time complexity of an algorithm
2 stacks used for a queue
- second stack reverses order or first
- stack one is queue - stack 2 is empty
- to add an element pop all elements from stack one and push to stack 2
- push on new element
- pop from stack 2 and push back to stack 1
why private
To ensure that attributes can only be accessed by the class’s own methods
To enforce encapsulation // ensure they are hidden
why normalise
- To store the maximum range of numbers in the minimum number of bytes / bits
- Normalisation minimises the number of leading zeros/ones represented
- Maximising the number of significant bits
- … enables very large / small numbers to be stored with accuracy.
- Avoids the possibility of numbers having multiple representations.
reasons for including exception handling routines
To trap (some) runtime errors
To prevent a program halting unexpectedly
To produce meaningful error messages for these errors
eg divide by zero // end of file // file not found
SSL and TLS
- The SSL and TLS protocols provide communications security over the internet / network
- … they provide encryption
- They enable two parties to identify and authenticate each other
- … and communicate with confidentiality and integrity.
imperitive programming lang
- Imperative languages use variables * … which are changed using (assignment) statements
- … they rely on a method of repetition / iteration.
- The statements provide a sequence of commands for the computer to perform * … in the order written / given
- … each line of code changes something in the program run.
declarative lang
- Instructs a program on what needs to be done instead of how to do it
- … using facts and rules
- … using queries to satisfy goals.
- Can be logical or functional
- Logical - states a program as a set of logical relations
- Functional – constructed by applying functions to arguments / uses a mathematical style
recursion using stack
- A stack is a LIFO data structure
- Each recursive call is pushed onto the stack
- …. and is then popped as the function ends
- Enables backtracking/unwinding … to maintain the required order
Explain how a compiler makes use of a stack when translating recursive programming code.
MP1 The compiler must produce object code to One mark per mark point (Max 3) MP2 …push return addresses / values of local variables onto a stack MP3 …with each recursive call // … to set up winding MP4 …pop return addresses / values of local variables off the stack … MP5 …after the base case is reached // … to implement unwinding.