Download presentation
Presentation is loading. Please wait.
Published byJoanna Cox Modified over 9 years ago
1
CS162 Section Lecture 9
2
KeyValue Server Project 3 KVClient (Library) Client Side Program KVClient (Library) Client Side Program KVClient (Library) Client Side Program Socket Server NeworkHandler KVInterface KVCache (LRU Cache) KVInterface KVStore KVMessage Available Threads Job Queue Thread Pool What port will you listen on? Asynchronous! Write Through Cache!
3
“A distributed system is one in which the failure of a computer you didn't even know existed can render your own computer unusable” -- Leslie Lamport
4
What is Bandwidth? What is Latency?
5
RTT of 100ms Packet size of 1 KB Initial handshake of 2 RTTs Bandwidth is 1.5 Mbps 1 1 2 2 How long does it take to transfer a 1000 KB file. Packet Transfer is continuous
6
RTT of 100ms Packet size of 1 KB Initial handshake of 2 RTTs Bandwidth is 1.5 Mbps 1 1 2 2 How long does it take to transfer a 1000 KB file. Packet Transfer is one at a time
7
1 1 2 2 Transfer data at speed of light (3 x 10 8 m/s) What is the RTT of the link? 385,000 km
8
How is a packet generated inside the Operating System? 1 1 2 2 Router Packet
9
User Space Data Kernel Space Data Device Space
10
Time to process an interrupt, T int = 1.5 ms CPU cycle time, T CPU = 10 ns Packet size, N pkt = 1000B (ignore headers) Time to copy or DMA one byte, T copy = 1 μs Latency of a link, T link = 3 ms Bandwidth of links, B = 8Mbps How many buffer copies are there to transmit a single packet? 1 1 2 2 Router
11
Time to process an interrupt, T int = 1.5 ms CPU cycle time, T CPU = 10 ns Packet size, N pkt = 1000B (ignore headers) Time to copy or DMA one byte, T copy = 1 μs Latency of a link, T link = 3 ms Bandwidth of links, B = 8Mbps How many interrupts are generated to transmit a single packet? 1 1 2 2 Router
12
Time to process an interrupt, T int = 1.5 ms CPU cycle time, T CPU = 10 ns Packet size, N pkt = 1000B (ignore headers) Time to copy or DMA one byte, T copy = 1 μs Latency of a link, T link = 3 ms Bandwidth of links, B = 8Mbps What is the time to reliably send a single packet from Node 1 to Node 2? 1 1 2 2 Router
13
Time to process an interrupt, T int = 1.5 ms CPU cycle time, T CPU = 10 ns Packet size, N pkt = 1000B (ignore headers) Time to copy or DMA one byte, T copy = 1 μs Latency of a link, T link = 3 ms Bandwidth of links, B = 8Mbps What is the maximum rate possible between Node 1 to Node 2? 1 1 2 2 Router
14
10101010011010111 Physical Layer 10101010011010111 Datalink Layer Trans. Hdr. Net. Hdr. Frame Hdr. Datalink Layer Trans. Hdr. Net. Hdr. Frame Hdr. Data Network Layer Trans. Hdr. Net. Hdr. Network Layer Trans. Hdr. Net. Hdr. Data Transport Layer Trans. Hdr. Transport Layer Trans. Hdr. Data Application Layer Data
15
TCP Connection Setup – 3 way handshake Byte Stream Oriented (NOTE!) Reliable data transfer Flow control Congestion control Connection tear down (4 way)
16
TCP Connection Setup Client (initiator) Server SYN, SeqNum = x Active Open Passive Open connect()listen()
17
TCP Connection Setup Client (initiator) Server SYN, SeqNum = x SYN and ACK, SeqNum = y and Ack = x + 1 ACK, Ack = y + 1 Active Open Passive Open connect()listen() accept() allocate buffer space
18
TCP Connection Teardown 4-ways tear down connection FIN FIN ACK FIN FIN ACK Host 1Host 2 timeout Avoid reincarnation Can retransmit FIN ACK if it is lost closed close closed data
19
Key Value Stores Very large scale storage systems Two operations – put(key, value) – value = get(key) Challenges – Fault Tolerance replication – Scalability serve get()’s in parallel; replicate/cache hot tuples – Consistency quorum consensus to improve put() performance
20
Key Value Stores Also called a Distributed Hash Table (DHT) Main idea: partition set of key-values across many machines key, value …
21
Chord Lookup Each node maintains pointer to its successor Route packet (Key, Value) to the node responsible for ID using successor pointers E.g., node=4 lookups for node responsible for Key=37 4 20 32 35 8 15 44 58 lookup(37) node=44 is responsible for Key=37
22
Chord Highly scalable distributed lookup protocol Each node needs to know about O(log(M)), where M is the total number of nodes Guarantees that a tuple is found in O(log(M)) steps Highly resilient: works with high probability even if half of nodes fail
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.