Networks Flashcards

Charles Gillan

1
Q

What is the oldest global communication network?

A

The postal system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What was a key step in the 90s in relation to the phone system?

A

Enabling packed based communication.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a network + its methods of data transfer?

A

When computing nodes can exchange data with each other. Copper, fibre optic or wireless.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a digital electronic computer?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Describe decimal numbers.

A

They have base 10. To discern them from binary, we place a d in front of them e.g. d10230.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Describe binary numbers.

A

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Describe hexadecimal numbers.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the issue with fixed bits?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Why must we know the corresponding bitwidth for our compiler + architecture?

A

Numerical overflow, embedded systems + networking protocols.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do we convert a negative number to binary?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do we convert a negative binary number into decimal?

A

Flip all of the bits and add 1. The convert as a positive number into decimal.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is overflow?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Describe octal numbers.

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is interesting about Unix?

A

Each file has extra 3 bits that allow for special functionality. Setuid bits, setgid bit + sticky bit.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the setuid bit?

A

Allows executable to run as another user typically root. (security risk)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the setgid bit?

A

Allows executable to change group privacies (security risk)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is the sticky bit?

A

Almost obsolete, has had specialist uses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

How do we represent a network + do maths on it?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is spanning tree protocol?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Why are floating point numbers called floating point numbers?

A

This is due to the way these numbers have varying magnitudes (diff nums of digits) so decimal point can move, especially during arithmetic operations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

When are floating point numbers often used?

A

Scientific + engineering modelling software suits, machine learning + artificial codes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

How do we add numbers in binary?

A

Find the twos complement rep of number + add like normal in columns.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

How do we subtract numbers in binary?

A

Subtracting means adding the negative number so find twos complement of number we are subtracting + add first num to this num.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is the IEEE754 standard for?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

IEEE754: What are rounding rules?

A

Properties to be satisfied when rounding numbers during arithmetic conversions to/from decimal.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

IEEE754: What are operations?

A

Arithmetic using the arithmetic formats.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

IEEE754: What is exception handling?

A

Indications of exceptional conditions such as division by 0 + arithmetic overflow.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

What is scientific notation?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

How are the bits laid out in IEEE754?

A

32 bit representation. Sign bit, biased exponent + normalised mantissa.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

What is the sign bit in IEEE754?

A

1 bit size. 1 = negative, 0 = positive.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

What is the biased exponent in IEEE754?

A

Power of 2 of normalised binary floating point num which we add 127 to (bias). 8 bits.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

What is the normalised mantissa in IEEE754?

A

Decimal part of normalised binary floating point num. (23 bits)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

How do we work out IEEE754 binary floating point representation standard from decimal?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

What is the danger of floating point representation?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

What is true of all languages?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

What is a struct?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

How do we work with data structures + access elements of them?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

How is the data structure defined?

A

The programmer of the application program creating the data decides how they define the data structure. If the application is going to be used by many people + have many programmers work on it, then we need to write the doc details + agree it between them all.

39
Q

What is the RFC?

A

If data is sent over network, receiving network must’ve been programmed to know format of data structures that it will receive. RFC is the mechanism for this, it means Requests for Comments + the docs are managed by the IETF (Internet Engineering Task Force)

40
Q

What is nesting?

A

Putting data structure inside data structure. Internet Protocol suite nests data structures + we call each nest a layer. We use each layer to handle unique + well defined part of process of transmitting info from sender to sender so as well as formatted structure at each layer, we have to define operations for software to process that layer.

41
Q

What is the OSI model?

A

Open Systems Interconnection, defined by ISO. In 70s, when IP was invented, they used 5 layers. In 80s, realised that needed 7 layers to describe network completely. Layers are application, presentation, session, transport, network, data link + physical. OSI model is set of generic definitions + actions.

42
Q

What is the ISO?

A

International Standards Organisation.

43
Q

What is a protocol suite?

A

If we make specific choices for protocols at each layer + implement software for these. Internet Protocol is one such example, in its original form, there are no protocols at layers 5 + 6. When we say Internet Protocol, we mean the complete suite + the protocol within that suite at layer 3.

44
Q

What are the different versions of the IP suite?

A

IPv4 is in common global use (it IS the internet to most people). IPv6 is improved version but hasn’t replaced IPv4. There are older + niche protocol suites in existence (OSI created own set of protocols in late 80s) Management of phone system still uses OSI protocols. Can discuss protocol suites in terms of OSI model but may not have all of layers.

45
Q

What are the benefits of the OSI model?

A

By separating network comms into logical smaller pieces, OSI model simplifies how network protocols are designed. OSI model was designed to ensure diff types of equipment (switches, routers, NICs) would all be compatible even if built by diff manufacturers which also opens market to competition. Adding new protocols + other network services is easier in layered architecture than in monolithic.

46
Q

What are the drawbacks of the OSI model?

A

The choice for layered model for network is engineering design choice, nature doesn’t require this. In networking, nature only limits physical layer (electrical - cable, waves - WiFi). There is a latency (time delay) in processing through all of layers. In ultra high performance markets (stock market) where every microsecond is potential profit lost, can be issue. Research efforts today include cross-layer optimisation.

47
Q

What is the key word about the OSI?

A

An abstraction, it is generic.

48
Q

How is layer 1 of the OSI implemented?

A

Physical layer. Implemented through hardware (NIC or WiFi chip)

49
Q

How are layers 2 - 4 of the OSI implemented?

A

Operating System. Ethernet, IP, TCP, UDP in OS.

50
Q

How are layers 5 + 6 of the OSI implemented?

A

If they exist, implemented in each application.

51
Q

How is layer 7 of the OSI implemented?

A

Each application using network is at layer 7.

52
Q

What is SOCKET?

A

Created in Berkeley in 1974. It’s a programming concept created for C language but now available in many languages. Used by application programmers to interact with layer 4 (transport)

53
Q

How do data packets get sent to the right program?

A

1 NIC/WiFi chip per computer, each with own IP address but have multiple programs executing at once. The role of transport layer is to ensure they get there. Network layer only uses IP address, not ‘apartment number’.

54
Q

How do we draw the IP struct + why?

A

Although the IP struct is a linear structure, we draw the front fields in a rectangular format for ease of display for IPv4. The IPv4 source + destination addresses are 32 bits, the protocol field tells us which protocol is carried within this packet – usually TCP or UDP.

55
Q

When was the Internet Protocol defined?

A

1981, RFC 791.

56
Q

What is the definition of the purpose of IP?

A

The internet modules use the addresses carried in internet header to transmit internet datagrams towards destination. Selection of path for transmission called routing. Internet modules use fields in internet header to fragment + reassemble internet datagrams when necessary for transmission through ‘small packet’ networks.

57
Q

What is layer 3 and what size is protocol? Where are the values defined + give some examples.

A

Delivery mechanism on internet. 8 bit field (256 values max) Defined in RFC on IANA website. e.g. IP within IP is 0x04, TCP is 0x06 + UDP is 0x11

58
Q

How are IPv4 addresses presented?

A

Computers see as 32 bits, we break up into 4 x 8 bits, convert to decimal and place dot between each byte e.g. 143.117.69.72 Every NIC/WiFi card on internet must have unique address (RFC1918)

59
Q

What is IANA?

A

Internet Assigned Numbers Authority. In charge of internet address allocation, delegated to RIRs who allocate blocks of addresses to ISPs who sell addresses to customers.

60
Q

What are RIRs?

A

Regional Internet Authorities. Allocate blocks of addresses to ISPs.

61
Q

What are ISPs?

A

Internet Service Providers, sell addresses to customers.

62
Q

What are the limits of class A? (IPv4)

A

0.0.0.0 to 127.255.255.255

binary start 0000

63
Q

What are the limits of class B? (IPv4)

A

128.0.0.0 to 191.255.255.255

binary start 0010

64
Q

What are the limits of class C? (IPv4)

A

192.0.0.0 to 223.255.255.255 (binary start 0110)

65
Q

What are the limits of class D? (IPv4)

A

224.0.0.0 to 239.255.255.255 (binary start 1110)

66
Q

What are the limits of class E? (IPv4)

A

240.0.0.0 to 247.255.255.255

binary start 1111

67
Q

What is unicasting?

A

1 comp talks to 1 other comp e.g. web browser to server. Enabled with TCP or UDP at layer 4.

68
Q

What is multicasting?

A

1 comp sends same message to several comps e.g. stock exchange to brokers. UDP multicast.

69
Q

What is broadcasting?

A

1 comp sends message to all comps on own network.

70
Q

What are the reserved IPv4 addresses and what do they mean?

A

Can’t be routed on public internet. (RFC1918) Can build private network + connect to public internet using NAT/PAT

71
Q

What is NAT/PAT?

A

Network/Port Address Translation

72
Q

What is the special loopback address + what is it for?

A

172.0.0.1. IP packets sent from Transmit (Tx) to Receive (Rx) within same comp. Tests software but not physical. Useful in testing client/server without using network.

73
Q

What are IPv6 addresses?

A

Much longer + use hex.

74
Q

Reserved IPv4 addresses: Class A

A

10.0.0.0 to 10.255.255.255

75
Q

Reserved IPv4 addresses: Class B

A

172.16.0.0 to 172.31.255.255

76
Q

Reserved IPv4 addresses: Class C

A

192.168.0.0 to 192.168.255.255

77
Q

Why were IP addresses put into classes?

A

To assist routing, we now don’t use them, we use CIDR + VLSM.

78
Q

How do we convert from binary to hexadecimal?

A

Separate into 2 sets of 4 bits and convert into hex digits e.g. 0010 0111 = 27.

79
Q

How can we implement electronic circuits for operation?

A

Implement circuits for operation defined by Boolean algebra + build more complex operations from these.

80
Q

How can we represent electronic circuits + what are the issues?

A

Using boolean variables + logic operations in Java (&&, ||, !) but langs don’t give us bit type. If we have 8 bits and need 3, we must ignore the other 5.

81
Q

What do we do when given 2 binary words of equal length?

A

Apply operations bit by bit.

82
Q

How could we initialise a register to 0 in assembler code?

A

Load literal value 0 from memory or it may be faster on some architectures to execute R XOR R e.g. R = b10101010. R = b10101010. R XOR R = b00000000

83
Q

What is register pressure?

A

Can cause all registers to be used so if we needed to swap 2 registers, we couldn’t use an intermediate or memory.

84
Q

How might we swap 2 registers without using an intermediate or memory?

A

Apply in order following ops. R1 = b1001, R2 = b1011. R1 = R1 XOR R2. R2 = R1 XOR R2. R1 = R1 XOR R2.

85
Q

How can we extract left + right nibbles to stand alone?

A

Can split 8 bit byte into 2 4 bit nibbles. Use static char const RIGHT_MASK = b0000(1111). Same idea with left mask.

86
Q

How can we defined mask + shift?

A

Can define them to extract any num of bits from any position in any length of bit sequence. Used in embedded systems + implementing data comms stacks.

87
Q

What is true of IPv4 in terms of routing + addressing?

A

Each NIC on internet has unique 32 bit address which splits into network address (left) + host part (right). When routing packets over internet, routers only need worry about network address. In early internet, boundaries were fixed at 8,16,24 bits (classes A,B,C)

88
Q

What is the modern approach to routing?

A

Classless Inter Domain Routing (CIDR) in which we need to define where to split 32 bits, known as defining network mask.

89
Q

How can you find the network address from an IP address?

A

Convert dotted decimal form of IP address into 32 bit binary, convert netmask (/23) into 32 bit binary, apply AND function, convert binary back to dotted decimal + observe how many bits used for host address.

90
Q

How can we save time when finding network address from IP address?

A

We know that /23 will leave first 2 bytes intact (16 bit network), split 3rd byte (7 bits network, 1 bit host) + set 4th byte to 0 so address is 132.117.?.0. e.g. 69d = b01000101. mask = b11111110. network part = b01000100, 68d.

91
Q

What is a MAC address?

A

Hardware address of NIC/WiFi chip on read only memory, fixed at manufacture time. Used at layer 2 to comm on local network. Part of layer 2 packet (source/dest) Managed by IEEE. 48 bits (6 bytes) 3 bytes OUI (organisationally unique identifier) + 3 bytes set by manufacturer. Network hardware must have one. Anyone can buy OUI + see list.

92
Q

How do static addresses + IP addresses work?

A

IP address of device managed by software, changes. When connect to ethernet, comp can be configured with predefined (static) address or request IP address from DHCP (dynamic host configureation protocol) server, which is useful when devices connect and leave often, dynamic. Systems admin responsible for WAP controls IP addresses allocated.

93
Q

How do DHCP servers work?

A

Comp sends UDP packet onto network + address of DHCP unknown so source = 0.0.0.0 + dest is 255.255.255.255. DHCP server configured with block of addresses. Op indep of list of IP addresses + works on fixed line addresses too. Could be public range if owned by access provider. Sets time limit on how long you have address (leasing) Open to exploitation by hackers as address unknown so could send spoof replies. Once sent to DHCP, must find MAC address of known IP address.

94
Q

What is ARP?

A

Address Resolution Protocol. If device wants to send data packet on LAN to known IP address, needs MAC address to build layer 2 packet. Ask LAN who has IP address + to tell what MAC address is. ARP packet format created, encapsulated in IP packet, encapsulated in ethernet packet + sent on LAN. ARP could be used for other protocols. Open to exploitation as false ARP server could force client to send to rogue server, ARP poisoning. MITM (man in the middle)