Title: TC 670 Review Session
1TC 670Review Session
2All Topics
- Processes and threads, scheduling policies
- Inter-process communication, concurrency
- Memory management
- Secondary storage management
- File Systems
- Device management
- Multimedia operating systems
- Multimedia network protocols
- Computer security
- Network security
- Wireless sensor networks
3File Systems
- The concept of a file system is simple
- Storage abstraction the implementation of the
abstraction for secondary storage - abstraction files
- Organizational structure logical organization of
files into directories - the directory hierarchy
- Access interface a set of operations that can be
used by users to manipulate the info - You can retrieve what you store
- Access control sharing/protection of data
between users, processes, and machines - access control, consistency,
4File Access Methods
- Some file systems provide different access
methods that specify ways the application will
access data - sequential access
- read bytes one at a time, in order
- direct access
- random access given a block/byte
- record access
- file is array of fixed- or variable-sized records
- indexed access
- FS contains an index to a particular field of
each record in a file - apps can find a file based on value in that
record (similar to DB) - Why do we care about distinguishing sequential
from direct access? - what might the FS do differently in these cases?
5Device Management
keyboard
graphics
printer
CPU
mouse
tape
Memory
modem
network
6I/O Software System
User Level Software
Device Independent Software
Device Drivers
Interrupt Handlers
Hardware
7Multimedia Operating Systems
- Real-time requirements!
- A real-time process is a process which delivers
the results of the processing in given time-span. - The system must enforce externally-defined time
constraints. - Speed and efficiency are not the main
characteristics of a real-time system. - The playback of a video sequence is only
acceptable when it is presented neither too
quickly nor too slowly. - Timing and logical dependencies among different
related tasks, processed at the same time, also
must be considered. - Audio data sometimes must be synchronized with
video data.
8Multimedia Process Scheduling
- Rate Monotonic Scheduling
- Earliest Deadline First Scheduling
9Multimedia Storage Management
- Disk scheduling
- File placement
10Admission Controls
Video files
11Multimedia network Protocols
- RTP/RTCP
- RTSP
- RSVP
- Can you describe a typical streaming process
using these protocols?
12Computer System Security
- Basics of Cryptography
- Digital signature
- Authentication
13Computer System Security
- Attacks from inside the system
- Trojan Horses
- Trap Doors
- Login Spoofing
- Buffer Overflow
- Attacks from outside the system
- Virus
14Computer System Security
- Protection mechanisms
- Protection Domains
- Access control lists
15Network Security
- Routing Attacks
- DDoS and Traceback
- Intrusion Detection Systems
- Firewalls
- IP Security
- Web Security
- Examples
- What are the tradeoffs between different
architectures of firewalls? - What are the tradeoffs between different modes
(transport/tunnel) of IP security?
16Wireless Sensor Networks
- Physical constraints and unique requirements
- Scheduling (interrupt, tasks, etc).
- Message passing
- Topology
- Routing algorithms
- Security in WSN.
17Sensor Node Hardware
Transceiver
Embedded Processor
Memory
Sensors
Battery
18TinyOS Solutions
- Support concurrency event-driven architecture
- Modularity application scheduler graph of
components - Compiled into one executable
- Efficiency Get done quickly and sleep
- Event function calls
- Less context switch FIFO/non-preemptable
scheduling - No kernel/application boundary
19TinyOS Two-level Scheduling
- Tasks do computation
- Un-preemtable FIFO scheduling
- Bounded number of pending tasks
- Events handle interrupts
- Interrupts trigger lowest-level events
- Events can signal events, call commands, or post
tasks - Two priorities
- Event/command
- Tasks
20Active Message
- Every message contains the name of an event
handler - Sender
- Declaring buffer space in a frame
- Naming a handler
- Requesting transmission exit
- Done completion signal
- Receiver
- The event handler is fired automatically in a
target node - No blocked or waiting threads on sender or
receiver - Behaves like any other events
- Single buffering
21Adaptive Topology Problem Description
- Simple Formulation (Geometric Disk Covering)
- Given a distribution of N nodes in a plane.
- Place a minimum number of disks of radius r
(centered on the nodes) to cover them. - Disk represents the radio connectivity (simple
circle model). - The problem is NP-hard.
22Routing
- Problem Given a topology, how to route data?
- Different from Internet (wired) routing.
23Midterm
24Problem 1 Processes
0xFFFFFFFF
stack (dynamic allocated mem)
3 points
i
SP
address space
heap (dynamic allocated mem)
static data (data segment)
4 points
hello
code (text segment)
ilt100
3 points
PC
0x00000000
- main()
-
- int i
- for(i 0 i lt 100 i) printf(hello)
-
25Problem 2 CPU Scheduling
- First part easy (5 points)
- Second part 2 possibilities
- New job is put in the ready queue first
- New job immediately runs
26Problem 3 Synchronization
- Solution
- Spin-locks is a low-level locking mechanism to
synchronize processes. In spin-locks, the caller
busy-waits or spins for a lock to be released
(2 points). Spin-locks is not appropriate for
uniprocessor systems, mainly because it is
implemented in a less efficient way. One process
will run at any time. However in a multiprocessor
system, efficiency is less critical since often
there are idle processors. On the other hand, the
simplicity of spin-locks is very desirable (3
points). - Â
- Monitor is software module that encapsulates
thread data structure and procedures in an
exclusive fashion. Monitor protects the data from
unstructured access (2 points). With Hoare
monitor, the waiter runs immediately and its
condition is guarantee. Hence, it is efficient
since the waiter does not have to re-check the
condition. However, the signaler must do extra
work to restore monitor invariant before
signaling. With Mesa monitor, the signaler
continues. Therefore it is possible that when the
waiter runs again, the condition is changed again
(so it needs to re-check the condition). Mesa
monitor is easy for the signaler since it does
not have to restore invariant. The signaler may
simply run until out of the monitor session (3
points).
27Problem 4 Deadlocks
- Solution
- Four conditions of deadlocks are (1) Mutual
exclusion, (2) hold-and-wait, (3) no preemption,
and (4) circular wait (5 points). In this
example, condition (1) holds as two vehicles
cannot take the same slot. Condition (2) holds as
every vehicle holds a slot and is waiting for the
slot ahead to be released. Condition (3) holds as
no vehicle can be removed. Condition (4) hold as
there is a circular wait (5 points). Note you may
also argue that the circle can be broken and
there is no deadlock. - There are many examples of deadlocks in
telecommunication applications. One example is
teleconferencing you should pick a reasonable
one (5 points).
28Problem 5 Memory hierachy
- Solution On average access to main memory takes
110ns 0.1ns (3 points). On average access to
disk takes 10.25ms 0.1ns (3 points). The
expected time to get a word is 0.30.10.1
0.5us (2 points). On average the CPU can access
1sec/0.5us 2M words (2 points).
29Problem 6 Memory Addressing
- Please see the homework 2 (problem 1) for a
simple draw of the addressing mechanisms (5
points). The virtual address space has 32 bits,
but really only 30 bits are useful. See the
follows - Â
- For the virtual address 0x83A4C234, binary 1000
0011 1010 0100 1100 0010 0011 0100, its segment
is 2, its page is 0x3A4C, its offset is 0x234.
Let us assume in the page table of segment 2,
page 0x3A4C contains 0xDDDD. Then the physical
address is 0xDDDD234 (5 points). - Â
- For the virtual address 0x94A4D234, binary 1001
0100 1010 0100 1101 0010 0011 0100, it is invalid
since two useless bits are set (5 points).
Therefore it causes overflow. Note if you ignore
this you may still get an answer.
30Problem 7 Replacement Algorithms
- Part one easy 5 points
- Part two new algorithms, table (5 points)
- The new algorithm is better. This example shows
the new algorithm tries to keep the hot items
(items 1 and 2) in the cache, and it pays off
eventually. It does so by remembering the number
of accessed to the items (using a count for each
item). This algorithm is a more complicated than
the LRU algorithm. You may also argue that the
new algorithm may not work well for other access
patterns. (5 points)
31Problem 8 File Access
- Solution First the root directory / is open,
and checked for its sub-directory ssh. Then
ssh is open, and checked for the file
ssh_config. Finally, ssh_config is open (5
points). There are at least 2 disk read
operations, one to read / and one to read ssh
(2 points). It is possible that the system needs
more disk reads, for example if either the
directory / or ssh is very large and needs
several disk pages (3 points).
32Problem 9 File Organization
File pointer
- (1) There are 4 record pages and an index page.
The index page contains many pairs of (phone,
page). Each pair shows that the records with
phone in a specific range are stored in that
page. (5 points) - (2) To search a record with key 617-353-8924, we
first compare this with those in the index
page. Then we know which record page potentially
contains the record. Then we can read that record
page to find the record. (4 points). Two disk I/O
are required to get the record, one for the index
and one for the record page. (1 point) - (3) If there are 256000 records in the file,
then a single index page will not work, instead
we need more index pages (probably need up to
dozens). One simple solution is to link these
index pages together (5 points). But then if we
have two many index pages, possibly we need to go
through all of them to find a record! A better
solution is to create a higher-level index page
for the index pages. (It is ok if you do not
answer in this way).
Index
64 records
64 records
64 records
64 records
33Problem 10 Disk Scheduling
- The Elevator algorithm is better in term of
efficiency (it finishes all jobs in 23 units of
time while FCFS needs 29 units. FCFS is better in
terms of fairness in that it finishes the jobs in
order, while with Elevator, some earlier jobs may
wait for a longer time. (5 points)
34Format of Final
- Open book, 3 hours
- Everything is allowed
- 20 multiple-choice questions
- Choose one or two
- 2 points each
- Problem solving
- Solve 5 of 6 problems
- Total 60 points
35Topic Coverage
Multiple choices
Problem solving
- Processes and threads, scheduling policies
- Inter-process communication, concurrency
- Memory management
- Secondary storage management
- File Systems
- Device management
- Multimedia operating systems
- Multimedia network protocols
- Computer security
- Network security
- Wireless sensor networks
36Good luck!
37(No Transcript)