Title: COMS 414 - Prelim 2 Review Session
1COMS 414 - Prelim 2 Review Session
Biswanath Panda bpanda_at_cs.cornell.edu
2Outline
3lt DNS gt
- DNS Domain Name System
- Why do we need Domain Name?
- Domain names are easier to remember than IP
addresses - IP addresses can be dynamically changing.
- IP addresses may not be unique.
- Why do we need DNS?
- Mapping between domain name and IP addresses.
4lt DNS gt
Biswanath Panda DNS information distrbuted
across all hosts. Each domain level has its own
name server. Caching for faster lookups. TTL
field so that stale entires are removed and
rechecked
- By maintaining distributed host table
- Scalability !!!
- How changes to domain name IP address mapping
will be updated? - Caching
- TTL
5lt DNS gt
- Name resolution commands
- NSLookup ipaddress sitename
- ping -a
- Query scheme is simple
- Query( domain name, RR type )
- Answer( values, additional RRs )
- RR Resource record
6DNS tree structure
NS RR pointers
.
edu.
com.
jp.
us.
cornell.edu.
cmu.edu.
mit.edu.
cs.cornell.edu.
eng.cornell.edu.
foo.cs.cornell.edu A 10.1.1.1 bar.cs.cornell.edu
A 10.1.1.1
7lt CDN gt
- CDN Content Distribution Networks
- Replication of web servers
- CDN V.S. Centralized server
- Less latency, better performance
- More robust service availability
8lt CDN gt
- Cached CDN cache contents on cache miss
- Pushed CDN push contents up-front
- Issues
- Difficulty with dynamic contents
- Cache performance V.S. Content synchronization.
9lt UDP gt
- Unreliable / Out-of-order message delivery.
- Connection-less.
- Datagram based.
- Messages gt MTU will be dropped.
- MTU Maximum Transmission Unit
- Default 1460bytes with Cisco routers
- No flow control
- No congestion control
10lt TCP gt
- Reliable / In-order message delivery.
- Connection-oriented.
- Stream based
- - thus no restriction on transmission size
- Flow control
- Congestion control
11TCP connection establishment
SYN, SeqNumx
- Three-way handshake
- 1. SYN
- 2. ACK SYN
- 3. ACK
- Connection established only after all three
steps. - If not, time-out.
SYNACK, SeqNumy, Ackx1
ACK, Acky1
Client (active)
Server (passive)
12TCP-SYN Attack
- Classic DOS (Denial of Service) attack.
- Attack by creating myriads of half-established
connections.
13TCP Sliding Window
- This is how below TCP properties come to life
- Reliable delivery
- In-order delivery
- Any size message (stream based)
- Flow control
- Sliding window cant slide if messages in the
window didnt get through.
14TCP Sliding Window
- Advertisement of Window size via ACK
- Small sliding window
- Low performance due to delay waiting on ACK.
- Bad with network with large RTT (Round Trip Time)
- Large sliding window
- Send data as a bulk, waiting ACK as a bulk.
- Bad if network congestion, as bulk transfer will
make circumstance worse.
15TCP Congestion Control
- Interpret dropped packets as congestion
- Maintain congestion window size
- Additive Increase/Multiplicative Decrease
TCP sawtooth pattern
KB
Time (seconds)
16Wireless environment
- Issues
- High RTT(Round Trip Time)
- Message loss pattern differs from wired network
- What do dropped packets indicate?
- TCP assumes congestion.
- But it could be just lossy medium.
- How will UDP/TCP behave on wireless?
17VPN Virtual Private Network
- remote client can communicate with the company
network securely over the public network as if it
resided on the internal LAN
18NAT Network Address Translation
- allows an IP-based network to manage its public
(Internet) addresses separately from its private
(intranet) addresses. - popular technology DSL or cable LANs
19Network Failure
- Packet drop or packet delay
- System Crash / halt
- Byzantine failure
- Some systems behaves incorrectly or unexpectedly
- Could be a malicious attacker
- Network Partition
- Also known as Split Brain Syndrome
- Some nodes in a cluster no longer communicate
with each other
20IP Multicast
- Reduces overhead for sender
- Reduces bandwidth consumption in network
- Useful in small subnet
- I.e.) virtual meeting broadcast within a
corporate network
21lt Virtual Memory Overview gt
Memory
Page Table
Virtual Addresses
Physical Addresses
0
1
P-1
Disk
Address Translation Hardware converts virtual
addresses to physical addresses via an OS-managed
lookup table (page table)
22Virtual Memory yet another picture..
Virtual Page Number
Valid
Physical Memory
1
1
0
1
1
1
0
1
0
Disk Storage (swap file or regular file system
file)
1
Memory resident page table (physical page or
disk address)
23Multi-Level Page Tables
- multi-level page tables
- Level 1 table
- 1024 entries, each of which points to a Level 2
page table. - Level 2 table
- 1024 entries, each of which points to a page
...
Level 1 Table
Level 2 Tables
24Page Faults
- PTE Page Table Entry
- Each entry is (pointer to physical address,
flags) - If a process tries to access a page not memory
- ? Page Fault Interrupt
- ? OS exception handler page-fault trap
25Paging and swapping
Before fault
After fault
Memory
Memory
Page Table
Page Table
Virtual Addresses
Physical Addresses
Virtual Addresses
Physical Addresses
CPU
CPU
Disk
Disk
26lt Page replacement schemes gt
- FIFO first in first out
- OPT - (or MIN) optimal page replacement
- LRU least recently used
- LRU Approximation
- Mimicking LRU when no hardware support for LRU
- Reference bits
- Additional reference bits algorithm
- Second chance algorithm
- LFU least frequently used
- MFU most frequently used
27FIFO and Belady's Anomaly
- ? For some page replacement algorithms, the page
fault rate may increase as the number of
allocated frames increases.
28OPT (or MIN)
- Assumes knowledge for future requirement.
- Replace the page that will not be used for the
longest period of time - Doesnt show Beladys anomaly
- But practically too difficult to implement !
29LRU
- Assume pages used recently will be used again
- throw away page not used for longest time
- Popular policy to be taken
- Doesnt show Beladys anomaly
- Implementation options
- Counters
- Stack
30Second-chance
- LRU Approximation
- Reference Bits FIFO
- if set, a page will be granted for second chance.
- If a page used often enough, it will never be
replaced. - Implementation by Circular Queue
- Bad if all bits are set ? degenerates to FIFO.
31LFU
- Assumes pages used actively will be used again.
- What about a page used heavily only in the
beginning? - ? shift count by 1 at regular intervals
32Virtual Memory Programmers view
- Large flat address space
- Can allocate large blocks of contiguous addresses
- Processor owns machine
- Has private address space
- Unaffected by behavior of other processes
33Virtual Memory Systems view
- virtual address space created by page mapping
- Address space need not be contiguous
- Allocated dynamically
- Multi-processing performance
- Switching to other processes when servicing disk
I/O for page fault
34Levels in Memory Hierarchy
virtual memory
cache
Memory
disk
8 B
32 B
4 KB
Register
Cache
Memory
Disk Memory
size speed /Mbyte line size
32 B 1 ns 8 B
32 KB-4MB 2 ns 100/MB 32 B
128 MB 50 ns 1.00/MB 4 KB
20 GB 8 ms 0.006/MB
larger, slower, cheaper
35Virtual Memory Cache
miss
VA
PA
Trans- lation
Cache
Main Memory
CPU
hit
data
- Problem?
- Performs Address Translation before each cache
lookup - Which may involve memory access itself (of the
PTE) - We could cache page table entries
36Virtual Memory Cache TLB
? Speed up Address translation
37lt How to Prepare Prelim gt
- Make sure to review homework problem sets.
- Practice writing synchronization code on your own
!! - Sleep well and have your brain ready to think !
- http//www.cs.cornell.edu/Courses/cs414/2004fa/
- http//www.cs.cornell.edu/Courses/cs414/2003fa/