week 14 virtual machines and networking

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/65

flashcard set

Earn XP

Description and Tags

flashcards based on os slides from week 14

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

66 Terms

1
New cards

operating system

a layer of software between many applications and diverse hardware

2
New cards

what does the operating system do

  • hardware abstraction so an application doesn’t have to know the details about the hardwarre

  • arbitrates access to resources among multiple applications + sharing of resources

  • provides protections

3
New cards

what kind of protection does an OS provide

  • isolation protects app’s from each other

  • isolation also protects OS from applications

  • isolation limits resource consumption by any one app

4
New cards

OS prevents applications from writing into

privileged memory

5
New cards

OS prevents applications from invoking

privileged functions

6
New cards

privileged instruction examples

  • memory address mapping

  • flush or invalidate data cache

  • invalidate TLB (translation lookaside buffer) entries

  • load and read system registers

  • change processor modes from K to U

  • change the voltage and frequency of processors

  • halt/reset processor

  • perform I/O operations

7
New cards

unit of work for an OS

  • application

  • task

  • job

  • process

8
New cards

what does a TASK consist of

  • code — placed into memory

  • data — stored in memory

  • OS data for task — task descriptors

9
New cards

mode bit

hardware that identifies whether the system is in user mode or supervisor/kernel mode

  • requires extra support from the CPU hardware for this OS feature

10
New cards

supervisor or kernel mode (mode bit = 0)

  • can execute all machine instructions, including privileged instructions

  • can reference all memory locations

  • kernel executes in this mode

11
New cards

user mode (mode bit = 1)

  • can only execute a subset of non-privileged instructions

  • can only reference a subset of memory locations

  • all applications run in user mode

12
New cards

virtual machine

  • a simulated computer running within a real computer

  • virtual computer runs an OS that can be different than the host operating

13
New cards

in a virtual machine, all the requests to access real hardware are routed to the appropriate _________, then virtual os or applications don’t know they are _________

host hardware, virtual

14
New cards

a process is given the illusion that it has its

  • own memory, via virtual memory

  • own CPU, via time slicing

15
New cards

virtual extends this idea to give a process the illusion that it also has its own

hardware

  • moreover, extend the concept from a process to an entire os being given the illusion that it has its own memory, CPU, and I/O devices

16
New cards

virtual machine benefits

  • can run multiple os’s simultaneously on the same host

  • fault isolation if an os fails — doesn’t crash another VM. this is also useful for debugging a new os

  • easier to deploy applications — can deploy an app within a VM instance that is customized for the app, rather than directly deploying the app itself and worrying about compatibility with the target os — useful for cloud server deployments

17
New cards

a type 1 hypervisor provides a _____________ for guest OSs and resides just above the ___________

virtualization layer, hardware

18
New cards

virtual machine goal

create a virtual machine that executes at close to native speeds on a CPU, so emulation and interpreting instruction by instruction are not good options — too much software overhead

19
New cards

virtual machine solution

have the guest os execute normally, directly on the CPU, except that it is not in kernel mode

  • therefore, any special privileged instructions invoked by the guest os will be trapped to the hypervisor, which is kernel mode

20
New cards

when the guest os trapped to the hypervisor, the hypervisor

then emulates only these privileged instructions and when done passes control back to the guest OS, also known as a “VM entry”

21
New cards

with the hypervisor trapping, most ordinary (non-privileged) instructions operate at _________, and only privileged instructions incur the overhead of a trap, also known as a ________, to the hypervisor/VMM

full speed, “VM exit”

22
New cards

trap-and-emulate

Executable code from the guest can execute directly on the host CPU by the hypervisor. The hypervisor configures the CPU in such a way that all potentially unsafe instructions will cause a “trap”. A trap is an exceptional condition that transfers control back to the hypervisor

23
New cards

it is very easy to provision and deploy VM instances on the ______

cloud

24
New cards

amazon’s elastic compute cloud (EC2) uses ____________

Xen virtualization

  • different types of VMs or instances that can be deployed

    • standard, high-memory, high-cpu

  • users can create and reboot their own VMs

  • to store data peristently, need to supplement EC2 with an additional cloud service

    • amazon’s simple storage service (S3)

25
New cards

process VMs, e.g. Java VMs

differ from system VMs in that the goal is NOT to try to run multiple OSs on the same host, but to provide portable code execution of a single application across different hosts

26
New cards

java applications are compiled into __________ that can be run on any ________

Java byte code, Java VM

  • java VM acts as an interpreter of byte code, translating each byte code instruction into a local action on the host OS

27
New cards

______________ compilation can be used to speed up execution of java code

just in time

  • java byte code is compiled at run time into native machine code that is executed directly on the hardware, rather than being interpreted instruction by instruction

28
New cards

note Java VMs virtualize and abstract _______, not actual ________, unlike system VMs

machine, hardware

  • i.e. the target machine that Java byte code being compiled for is a software specifiction

29
New cards

applications today leverage the internet to __________________ data

send and receive data

30
New cards

internet service examples

  • web browser requests pages from a web server

  • P2P systems

  • streaming video

  • social networks

  • mobile apps

31
New cards

every networked application communicates to a remote process via a ___________

socket API

  • send(message)

  • recieve(message)

32
New cards

socket library talks via ___________ to OS kernel’s _____________

system call API, network stack

  • send(message)

  • receive(message)

33
New cards

the network stack’s architecture is organized into

multiple layers of protocols

  • each protocol performs a specific set of duties

34
New cards

web (HTTP), Email (SMTP, IMAP) reside in

application layer 5

35
New cards

TCP, UDP reside in

transport layer 4

36
New cards

IP (v4 and v6) reside in

network layer 3

37
New cards

ethernet, wifi, bluetooth reside in

data link/MAC layer 2

38
New cards

CDMA, OFDM reside in

physical layer 1

39
New cards

to send a packet of data to a remote destination

each layer first passes a packet of data down the stack to the next lowest layer

40
New cards

to receive a packet of data

  • each layer retrieves a packet of data from the layer below

  • and after processing the packet sends the packet to the layer above

41
New cards

to send, an application calls _____________

socket API’s send()

  • gives a pointer to the user space buffer containing the data to send

42
New cards

if file to be sent is large, the application

segments the file into smaller packets

43
New cards
<p>application layer prepend a ________ header to the user data, forming a __________</p>

application layer prepend a ________ header to the user data, forming a __________

layer 5, packet

  • prepend the header AH1 to data1 forming packet 1

  • header info is useful at the remote receiver to decode the packet

44
New cards

when sending a packet

  • in general, at each layer N, a pack header NHx is prepended to data x and then set to a lower layer N-1

45
New cards

when sending a packet, packet grows as it __________ the network layered stack

descends

46
New cards

when receiving a packet

  • at each layer N, strip off the layer N header

47
New cards

when receiving a packet, packet shrinks as it _________ the stack

moves up

48
New cards

how to recover from a lost packet

retransmit lost packets

  • TCP, the transmission control protocol

49
New cards

transport layer’s job is _________________, if desired

end-to-end error recovery

50
New cards

how does the sender know if a packet was received correctly

receiver sends an Acknowledgement (ACK) packet back to sender

51
New cards

when does a sender know when to retransmit?

sets a timer

  • if it times out before ACK received, then retransmit

52
New cards

TCP ensures ____________

in-order delivery

53
New cards

many apps require TCP’s reliable and in-order packet delivery service

  • web, email, etc - can’t render a web page or read email if there are holes in the web page or email

  • changing order of web/email text also makes it unreadable

54
New cards

apps that use TCP can view the network connection as a __________________

pipe abstraction

  • any data sent into the pipe appears at the other end, hence it is reliable, i.e. pipes don’t lose data

  • a pipe preserves the order of the data sent into it at the output of the pipe — no reordering is possible

55
New cards

reliability comes at the cost of ________ due to retransmissions

delay

56
New cards

not all apps need/want TCP’s

reliability

  • interactive real-time apps like skype audio/video conferencing can’t wait for TCP’s retransmissions

  • must get packet delivered in real time, e.g. within 30 ms

57
New cards

real-time voice-over-IP (VOIP) apps like Skype and Facetime can tolerate

packet loss

  • may lose audio temporarily, but it’s OK

  • such apps are built on top of unreliable UDP (user datagram protocal) at layer 4, not TCP

58
New cards

the internet consists of many _______ that connect together to form a ___________

routers, network graph

59
New cards

the internet protocal (IP) network layer must route the

ip packet to the correct destination

60
New cards

network layer tries to find the ______________, e.g. using _________________

“shortest path”, dijkstra’s algorithm

  • the metric for shortest path may be minimum number of hops, shortest physical distance, lowest delay, minimum cost, etc

61
New cards

each router implements the

network layer

62
New cards

ip routing may _________

lose packets

  • any router or link may fail at any time. also congested router buffers may overflow

  • ok as long as TCP can retransmit them

63
New cards

each link between any two routers (endpoints) must be able to

transmit packets

  • data link layer is responsible for transmitting packets between any 2 neighboring nodes in the network

64
New cards

data link layer must define

the beginning and end of packets (packet framing)

  • packets may be lost, so this layer may also retransmit locally

65
New cards

along each link, the ___________ determines how 1’s and 0’s, i.e. digital bits, are transmitted

physical layer

66
New cards