Download presentation
Presentation is loading. Please wait.
Published byCynthia Goodman Modified over 9 years ago
1
Computer Networks CSE 434 Fall 2009 Sandeep K. S. Gupta Arizona State University http://impact.asu.edu/cse434fa09.html http://impact.asu.edu Research Experience for Undergraduates (REU)
2
Announcements and Agenda HW 3 – due Oct 12 th. Quiz 4 HW3 discussion Summary last class. File distribution Bit-Torrent P2P cont. Distributed Index (database) maintenance using DHT Skype – using P2P for user location and NAT traversal App Layer Recap
3
File Distribution: Server-Client vs P2P Question : How much time to distribute file from one server to N peers? usus u2u2 d1d1 d2d2 u1u1 uNuN dNdN Server Network (with abundant bandwidth) File, size F u s : server upload bandwidth u i : peer i upload bandwidth d i : peer i download bandwidth
4
File distribution time: server-client usus u2u2 d1d1 d2d2 u1u1 uNuN dNdN Server Network (with abundant bandwidth) F server sequentially sends N copies: NF/u s time client i takes F/d i time to download increases linearly in N (for large N) = d cs = max { NF/u s, F/min(d i ) } i Time to distribute F to N clients using client/server approach
5
2: Application Layer 5 File distribution time: P2P usus u2u2 d1d1 d2d2 u1u1 uNuN dNdN Server Network (with abundant bandwidth) F server must send one copy: F/u s time client i takes F/d i time to download NF bits must be downloaded (aggregate) fastest possible upload rate: u s + u i d P2P = max { F/u s, F/min(d i ), NF/(u s + u i ) } i
6
2: Application Layer 6 Server-client vs. P2P: example Client upload rate = u, F/u = 1 hour, u s = 10u, d min ≥ u s
7
2: Application Layer 7 File distribution: BitTorrent tracker: tracks peers participating in torrent torrent: group of peers exchanging chunks of a file obtain list of peers trading chunks peer r P2P file distribution
8
2: Application Layer 8 BitTorrent (1) file divided into 256KB chunks. peer joining torrent: has no chunks, but will accumulate them over time registers with tracker to get list of peers, connects to subset of peers (“neighbors”) while downloading, peer uploads chunks to other peers. peers may come and go once peer has entire file, it may (selfishly) leave or (altruistically) remain
9
2: Application Layer 9 BitTorrent (2) Pulling Chunks at any given time, different peers have different subsets of file chunks periodically, a peer (Alice) asks each neighbor for list of chunks that they have. Alice sends requests for her missing chunks rarest first Sending Chunks: tit-for-tat r Alice sends chunks to four unchoked neighbors currently sending her chunks at the highest rate re-evaluate top 4 every 10 secs r every 30 secs: randomly select another peer, starts sending chunks newly chosen peer may join top 4 “optimistically unchoke”
10
BitTorrent: Tit-for-tat (1) Alice “optimistically unchokes” Bob (2) Alice becomes one of Bob’s top-four providers; Bob reciprocates (3) Bob becomes one of Alice’s top-four providers With higher upload rate, can find better trading partners & get file faster!
11
Distributed Hash Table (DHT) Index (simple database) is crucial for many P2P applications – it is useful in locating an item (e.g. a file (song) ). DHT = distributed (structured) P2P database Database has (key, value) pairs; key: ss number; value: human name key: content type; value: IP address Peers query DB with key DB returns values that match the key Peers can also insert (key, value) peers
12
Example: Bit-Torrent Tracker Uses (Kandemlia) DHT Key is torrent identifier Value is IP addresses of all the peers currently participating in the torrent A newly arriving BT peer: queries the tracker with torrent ID to find a peer responsible for the identifier It then queries the peer to get a list of other peers in the torrent.
13
Important Issues Decentralization Scalability Fault-Tolerance
14
DHT Identifiers Assign integer identifier to each peer in range [0,2 n -1]. Each identifier can be represented by n bits. Require each key to be an integer in same range. To get integer keys, hash original key. Hash Function: many-to-one function for which two different inputs can have the same output, but the likelihood of this is extremely small eg, key = h(“Led Zeppelin IV”) This is why they call it a distributed “hash” table
15
How to assign keys to peers? Central issue: Assigning (key, value) pairs to peers. Rule: assign key to the peer that has the closest ID. Convention in lecture: closest is the immediate successor of the key. Ex: n=4; peers: 1,3,4,5,8,10,12,14; key = 13, then successor peer = 14 key = 15, then successor peer = 1
16
1 3 4 5 8 10 12 15 Circular DHT (1) Each peer only aware of immediate successor and predecessor. “Overlay network” over “underlay network”
17
Circle DHT - Routing Query(2) 0001 0011 0100 0101 1000 1010 1100 1111 Who’s resp for key 1110 ? I am O(N) messages on avg to resolve query, when there are N peers 1110 Define closest as closest successor
18
Circular DHT with Shortcuts Each peer keeps track of IP addresses of predecessor, successor, short cuts. Reduced from 6 to 2 messages. Possible to design shortcuts so O(log N) neighbors, O(log N) messages in query 1 3 4 5 8 10 12 15 Who’s resp for key 1110?
19
Peer Churn Peer 5 abruptly leaves Peer 4 detects; makes 8 its immediate successor; asks 8 who its immediate successor is; makes 8’s immediate successor its second successor. What if peer 13 wants to join? 1 3 4 5 8 10 12 15 To handle peer churn, require each peer to know the IP address of its two successors. Each peer periodically pings its two successors to see if they are still alive.
20
2: Application Layer 20 P2P Case study: Skype inherently P2P: pairs of users communicate. proprietary application-layer protocol (inferred via reverse engineering) hierarchical overlay with SNs Index maps usernames to IP addresses; distributed over SNs Skype clients (SC) Supernode (SN) Skype login server
21
2: Application Layer 21 Peers as relays Problem when both Alice and Bob are behind “NATs”. NAT prevents an outside peer from initiating a call to insider peer Solution: Using Alice’s and Bob’s SNs, Relay is chosen Each peer initiates session with relay. Peers can now communicate through NATs via relay
22
Summary Application Layer At the edge of the network, Programmable, Open Application Layer Protocols Structure: Client-Server, P2P Core Intenet Fuctionality at App Layer: DNS Examples: HTTP, FTP, SMTP Issues: Addressing, Service needed along different dimensions: reliability, throughput, security, communication abstraction (different types of group communication) Support from Transport Layers Protocol Design Issues: Separate or Combined Data and Control Channel Stateful versus Stateless Push versus Pull Getting across NAT Performance, Scalability, Fault-tolerance
23
Chapter 4 Network Layer A note on the use of these ppt slides: We’re making these slides freely available to all (faculty, students, readers). They’re in PowerPoint form so you can add, modify, and delete slides (including this one) and slide content to suit your needs. They obviously represent a lot of work on our part. In return for use, we only ask the following: If you use these slides (e.g., in a class) in substantially unaltered form, that you mention their source (after all, we’d like people to use our book!) If you post any slides in substantially unaltered form on a www site, that you note that they are adapted from (or perhaps identical to) our slides, and note our copyright of this material. Thanks and enjoy! JFK/KWR All material copyright 1996-2009 J.F Kurose and K.W. Ross, All Rights Reserved Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.
24
Chapter 4: Network Layer Chapter goals: understand principles behind network layer services: network layer service models forwarding versus routing how a router works routing (path selection) dealing with scale advanced topics: IPv6, mobility instantiation, implementation in the Internet
25
Chapter 4: Network Layer 4. 1 Introduction 4.2 Virtual circuit and datagram networks 4.3 What’s inside a router 4.4 IP: Internet Protocol Datagram format IPv4 addressing ICMP IPv6 4.5 Routing algorithms Link state Distance Vector Hierarchical routing 4.6 Routing in the Internet RIP OSPF BGP 4.7 Broadcast and multicast routing
26
Network layer transport segment from sending to receiving host on sending side encapsulates segments into datagrams on rcving side, delivers segments to transport layer network layer protocols in every host, router router examines header fields in all IP datagrams passing through it application transport network data link physical application transport network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical
27
Two Key Network-Layer Functions forwarding: move packets from router’s input to appropriate router output routing: determine route taken by packets from source to dest. routing algorithms analogy: routing: process of planning trip from source to dest forwarding: process of getting through single interchange
28
1 2 3 0111 value in arriving packet’s header routing algorithm local forwarding table header value output link 0100 0101 0111 1001 32213221 Interplay between routing and forwarding
29
Connection setup 3 rd important function in some network architectures: ATM, frame relay, X.25 before datagrams flow, two end hosts and intervening routers establish virtual connection routers get involved network vs transport layer connection service: network: between two hosts (may also involve intervening routers in case of VCs) transport: between two processes
30
What’s Next? HW 3 due Monday Next Class: Midterm Review
31
Network service model Q: What service model for “channel” transporting datagrams from sender to receiver? Example services for individual datagrams: guaranteed delivery guaranteed delivery with less than 40 msec delay Example services for a flow of datagrams: in-order datagram delivery guaranteed minimum bandwidth to flow restrictions on changes in inter- packet spacing
32
Network layer service models: Network Architecture Internet ATM Service Model best effort CBR VBR ABR UBR Bandwidth none constant rate guaranteed rate guaranteed minimum none Loss no yes no Order no yes Timing no yes no Congestion feedback no (inferred via loss) no congestion no congestion yes no Guarantees ?
33
Chapter 4: Network Layer 4. 1 Introduction 4.2 Virtual circuit and datagram networks 4.3 What’s inside a router 4.4 IP: Internet Protocol Datagram format IPv4 addressing ICMP IPv6 4.5 Routing algorithms Link state Distance Vector Hierarchical routing 4.6 Routing in the Internet RIP OSPF BGP 4.7 Broadcast and multicast routing
34
Network layer connection and connection-less service datagram network provides network-layer connectionless service VC network provides network-layer connection service analogous to the transport-layer services, but: service: host-to-host no choice: network provides one or the other implementation: in network core
35
Virtual circuits call setup, teardown for each call before data can flow each packet carries VC identifier (not destination host address) every router on source-dest path maintains “state” for each passing connection link, router resources (bandwidth, buffers) may be allocated to VC (dedicated resources = predictable service) “source-to-dest path behaves much like telephone circuit” performance-wise network actions along source-to-dest path
36
VC implementation a VC consists of: 1. path from source to destination 2. VC numbers, one number for each link along path 3. entries in forwarding tables in routers along path packet belonging to VC carries VC number (rather than dest address) VC number can be changed on each link. New VC number comes from forwarding table
37
Forwarding table 12 22 32 1 2 3 VC number interface number Incoming interface Incoming VC # Outgoing interface Outgoing VC # 1 12 3 22 2 63 1 18 3 7 2 17 1 97 3 87 … … Forwarding table in northwest router: Routers maintain connection state information!
38
Virtual circuits: signaling protocols used to setup, maintain teardown VC used in ATM, frame-relay, X.25 not used in today’s Internet application transport network data link physical application transport network data link physical 1. Initiate call 2. incoming call 3. Accept call 4. Call connected 5. Data flow begins 6. Receive data
39
Datagram networks no call setup at network layer routers: no state about end-to-end connections no network-level concept of “connection” packets forwarded using destination host address packets between same source-dest pair may take different paths application transport network data link physical application transport network data link physical 1. Send data 2. Receive data
40
Forwarding table Destination Address Range Link Interface 11001000 00010111 00010000 00000000 through 0 11001000 00010111 00010111 11111111 11001000 00010111 00011000 00000000 through 1 11001000 00010111 00011000 11111111 11001000 00010111 00011001 00000000 through 2 11001000 00010111 00011111 11111111 otherwise 3 4 billion possible entries
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.