Title: COMS 414 Prelim 2 Review Session
1COMS 414 - Prelim 2 Review Session
Yejin Choi ychoi_at_cs.cornell.edu Daniel
Williams djwill_at_cs.cornell.edu
2lt 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.
3lt DNS gt
- By maintaining distributed host table
- Scalability !!!
- How changes to domain name IP address mapping
will be updated? - Caching
- TTL
4lt 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
5DNS 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
6lt CDN gt
- CDN Content Distribution Networks
- Replication of web servers
- CDN V.S. Centralized server
- Less latency, better performance
- More robust service availability
7Content Distribution Network
Hosting Center
Hosting Center
Backbone ISP
Backbone ISP
Backbone ISP
IX
IX
Site
ISP
ISP
ISP
S
S
S
Sites
S
S
S
S
S
S
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.
9What if lots of clients try to access the same CS?
Hosting Center
Hosting Center
OS
Backbone ISP
Backbone ISP
Backbone ISP
CS
CS
CS
IX
IX
Site
ISP
CS
ISP
ISP
CS
S
S
S
Sites
S
S
S
S
S
S
C
C
C
C
C
C
10DNS CDN together
- DNS load balancer
- Picks a server that is least overloaded and
closer to the client. - DNS answer with a small TTL
- 30 seconds one minute for fine-grained load
decisions - quickly offload a busy or even crashed content
server
11lt 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
12lt TCP gt
- Reliable / In-order message delivery.
- Connection-oriented.
- Stream based
- - thus no restriction on transmission size
- Flow control
- Congestion control
13TCP 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)
14TCP-SYN Attack
- Classic DOS (Denial of Service) attack.
- Attack by creating myriads of half-established
connections.
15TCP 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.
16TCP 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.
17TCP Congestion Control
- Interpret dropped packets as congestion
- Maintain congestion window size
- Additive Increase/Multiplicative Decrease
TCP sawtooth pattern
KB
Time (seconds)
18Wireless 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?
19VPN Virtual Private Network
- remote client can communicate with the company
network securely over the public network as if it
resided on the internal LAN
20NAT 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
21Network 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
22IP Multicast
- Reduces overhead for sender
- Reduces bandwidth consumption in network
- Useful in small subnet
- I.e.) virtual meeting broadcast within a
corporate network - Multicast over internet?
- Mbone. (buried in the history)
23lt 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)
24Virtual 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)
25Multi-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
26Page 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
27Paging and swapping
Before fault
After fault
Memory
Memory
Page Table
Page Table
Virtual Addresses
Physical Addresses
Virtual Addresses
Physical Addresses
CPU
CPU
Disk
Disk
28lt 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
29FIFO and Belady's Anomaly
- ? For some page replacement algorithms, the page
fault rate may increase as the number of
allocated frames increases.
30OPT (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 !
31LRU
- 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
32Second-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.
33LFU
- 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
34Virtual 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
35Virtual Memory Systems view
- virtual address space created by page mapping
- Address space need not be contiguous
- Allocated dynamically
- Enforce protection during address translation
- Multi-processing performance
- Switching to other processes when servicing disk
I/O for page fault
36Levels 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
37Virtual 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
38Virtual Memory Cache TLB
? Speed up Address translation
39lt 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/2003fa/
- http//www.cs.cornell.edu/Courses/cs414/2002fa/