● Buffer - Used to store data temporarily ○ Keep track of the Caller vs. Callee Frame ○ C doesn’t keep track of array bounds, so we have to ○ Buffer Overflow occurs when you write past the bounds of a buffer ○ By overflowing, you can overwrite other data (kind of hacking) via ■ Stack Smashing ■ Code Injection ○ Avoid Buffer Overflow via: ■ System Level Protections (Non executable code segments, randomized stack offsets) ■ Avoid overflow vulnerabilities (Limit String lengths, don’t use C) ■ Use Stack Canaries (Place value just beyond buffer, check for existence) ● Binary Units/Prefixes ○ X * 2abcbytes = 2log2(x) + abc (how to calculate prefixes) ● Caches ○ Processor Memory Bottleneck means that Performance is suffering ○ Solve with caches - a “pantry to limit trips to the grocery store” ■ Based on temporal and spatial locality, can be hit or miss ■ Take advantage of locality and memory hierarchy to write efficient programs ○ Average Memory Access Time = Hit Time + Miss Rate * Miss Penalty ○ Memory Hierarchies show which processes are costly vs. not costly ○ Organization ■ Block Size (number of bytes per set), Cache size (total number of bytes in cache), Associativity (Number of sets per cache) ○ Addresses ■ Tag (check for match), Index (where in cache to look), offset (which byte of block) ● Misses ○ Conflict Miss - First access ○ Compulsory Miss - Multiple data objects map to the same place ○ Capacity Miss - When working set > cache block ● Writes ○ Write Hit ■ Write Through - Immediately to next level ■ Write Back - Defer until next line is evicted ○ Write Miss ■ Write Allocate - Load into cache, then execute ■ No-Write Allocate - write immediately to next level ● Control Flow ○ CPU runs things concurrently but it looks simultaneous ○ fork() - parallel process, clones process at that moment in time ■ wait() used to force one process to wait for the other ● Virtual Memory ○ Ability to use limited RAM across multiple processes ○ Protection for each process without interference
NET 202 WEEK 5 (1)http://www.scribd.com/upload-document?archive_doc=49742789&escape=false&metadata=%7B%22page%22%3A%22read%22%2C%22action%22%3A%22download_promo%22%2C%22context%22%3A%22archive_view_restricted%22%2C%22platform%22%3A%22web%22%2C%22logged_in%22%3Afalse%7D