Networks Flashcards
Charles Gillan
What is the oldest global communication network?
The postal system.
What was a key step in the 90s in relation to the phone system?
Enabling packed based communication.
What is a network + its methods of data transfer?
When computing nodes can exchange data with each other. Copper, fibre optic or wireless.
What is a digital electronic computer?
Device designed to process numbers very quickly. Built out of fixed num of transistors made of silicone which can be on/off so use binary. Have fixed num of binary digits in rep of num corresponding to transistors used.
Describe decimal numbers.
They have base 10. To discern them from binary, we place a d in front of them e.g. d10230.
Describe binary numbers.
They have base 2. To discern them from other numbers, we place a b in front of them e.g. b10100. Can represent 127 in 8 bits (1 byte) as can’t use leftmost bit (twos complement, use this to show neg num)
Describe hexadecimal numbers.
Hex for short. They have base 16. Made by grouping 4 consecutive binary digits. Uses digit 0 - 9 + A-F. 32 bit memory words often initialised to Hex num (0xDEADBEEF). 2 hex digits = 1 byte. To discern them from other numbers, we place 0x in front of them e.g. 0x343f54
What is the issue with fixed bits?
We can’t use the leftmost bit and must ensure we have enough bits to rep the numbers we are working with. However, no point having 64 bits if we only need 8 as this wastes time, money + power. Failing to understand fixed size rep can lead to runtime errors (overflow + underflow) which gives totally wrong answers.
Why must we know the corresponding bitwidth for our compiler + architecture?
Numerical overflow, embedded systems + networking protocols.
How do we convert a negative number to binary?
We first convert it as a positive number into binary, then flip all of the bits and add 1. Flipping the bits is also known as complementing the bits.
How do we convert a negative binary number into decimal?
Flip all of the bits and add 1. The convert as a positive number into decimal.
What is overflow?
When we try to represent a number that is larger than what we can represent with out set num of bits, we encounter this and end up with a totally incorrect number. A bug that caused overflow was found in the Secure Shell number + allowed a hacker to send a large message and insert its code into the running code due to arithmetic overflow.
Describe octal numbers.
Oct for short. Has base 8 + uses digits 0 - 7. Made from numerals by grouping 3 consecutive binary digits starting from right. Used in linux file permissions + Canadian power plants who use PDP-11 computers. 1 octal digit = 3 binary bits. Represented by subscript 8 after number. Pilots use them on transponder to link to flight num.
What is interesting about Unix?
Each file has extra 3 bits that allow for special functionality. Setuid bits, setgid bit + sticky bit.
What is the setuid bit?
Allows executable to run as another user typically root. (security risk)
What is the setgid bit?
Allows executable to change group privacies (security risk)
What is the sticky bit?
Almost obsolete, has had specialist uses.
How do we represent a network + do maths on it?
We must use an adjacency matrix which can be implemented into code. We will also use minimal spanning trees as ethernet switches in networks need to know these but they’re also nodes on a network. At outset, they don’t know about each other or adjacency matrix, can’t use Prims or Kruskals algorithm.
What is spanning tree protocol?
Set of rules for packet exchange between switches to allow them to discover each other + evaluate minimal spanning tree for network. Spanning tree makes network more efficient.
Why are floating point numbers called floating point numbers?
This is due to the way these numbers have varying magnitudes (diff nums of digits) so decimal point can move, especially during arithmetic operations.
When are floating point numbers often used?
Scientific + engineering modelling software suits, machine learning + artificial codes.
How do we add numbers in binary?
Find the twos complement rep of number + add like normal in columns.
How do we subtract numbers in binary?
Subtracting means adding the negative number so find twos complement of number we are subtracting + add first num to this num.
What is the IEEE754 standard for?
Each manufacturer had own CPU chip design + all agreed to use twos complement to rep integers but used diff format for floating point nums which meant complex modelling suites gave diff answers after few decimal places so they were unreliable and not portable. IEEE754 defines how floating point should be repped in CPUs. Established in 1985. Updated in 1987, 2008 + 2019. Have to pay to view.
IEEE754: What are rounding rules?
Properties to be satisfied when rounding numbers during arithmetic conversions to/from decimal.
IEEE754: What are operations?
Arithmetic using the arithmetic formats.
IEEE754: What is exception handling?
Indications of exceptional conditions such as division by 0 + arithmetic overflow.
What is scientific notation?
Defines standard way of writing down decimal numbers (m * 10^n) where m is real num + n is integer. M must be greater or equal to 1 + less than 10.
How are the bits laid out in IEEE754?
32 bit representation. Sign bit, biased exponent + normalised mantissa.
What is the sign bit in IEEE754?
1 bit size. 1 = negative, 0 = positive.
What is the biased exponent in IEEE754?
Power of 2 of normalised binary floating point num which we add 127 to (bias). 8 bits.
What is the normalised mantissa in IEEE754?
Decimal part of normalised binary floating point num. (23 bits)
How do we work out IEEE754 binary floating point representation standard from decimal?
Convert num to binary (not twos comp) + establish in standard form. Add sign bit, bias exponent + convert to binary (not twos comp) then put it all together. We don’t store the 1 to the left of the point as it’s assumed by the hardware so we save the silicon + power that would be used to store it.
What is the danger of floating point representation?
Not very precise. May not get exact num within 32 bits so each num being approximate before operations + then may end up with roundoff errors + risk of overflow + underflow. Numerical analysis is critical. Safety critical codes do not use floating point representation.
What is true of all languages?
They have basic types (char, float, int, double) + arrays of these too (e.g. int[32]). The compiler allocates RAM for each of these. Many allow programmer to package basic data types together to user defined structures which are better for data management.
What is a struct?
Packaged together basic data typesm like a row of a relational database table. e.g. struct employee {int iTaxRate; double dSalary; char [32] cName;}; The compiler allocates these back to back in memory.
How do we work with data structures + access elements of them?
We work with them as a whole unit, as a set bytes, when copying + moving them around in memory. We can access an individual element of a structure e.g. employee2.dSalary. We can also send a structure byte by byte (wired/wirelessly) from 1 comp to another. There is a clear order to this. Data structures are fundamental to writing network software.