101
现现现现现现现现现 现现现 现现现现现 Chapter 6 Distributed Networks 现现现现 现现现现现现现 现现现 现现现 825 现 [email protected] 1

第六章 分布式网络 Chapter 6 Distributed Networks

  • Upload
    vail

  • View
    75

  • Download
    6

Embed Size (px)

DESCRIPTION

第六章 分布式网络 Chapter 6 Distributed Networks. 电控学院 电子工程学科部 司鹏搏 综合楼 825 室 [email protected]. Main Contents. 6.1 Mobile Ad Hoc Networks 6.1.1 Distributed Networks 6.1.2 Introduction to MANETs 6.1.3 Design of MANETs 6.1.4 Network Routing Overview 6.1.5 Proactive Protocols - PowerPoint PPT Presentation

Citation preview

Page 1: 第六章 分布式网络 Chapter 6  Distributed Networks

1

现代通信新技术导论

第六章 分布式网络Chapter 6 Distributed Networks

电控学院 电子工程学科部司鹏搏 综合楼 825 室[email protected]

Page 2: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

2

Main Contents• 6.1 Mobile Ad Hoc Networks

– 6.1.1 Distributed Networks– 6.1.2 Introduction to MANETs– 6.1.3 Design of MANETs– 6.1.4 Network Routing Overview– 6.1.5 Proactive Protocols– 6.1.6 Reactive Protocols– 6.1.7 Energy Efficient and Unicast Routing– 6.1.8 Energy Efficiency Multi-/Broadcast Routing– 6.1.9 Geographic Routing

• 6.2 P2P Networks

Page 3: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

3

Main Contents• 6.1 Mobile Ad Hoc Networks• 6.2 P2P Networks

– 6.2.1 Introduction to P2P– 6.2.2 Why P2P?– 6.2.3 Overview of P2P– 6.2.4 Unstructured P2P (Gnutella)– 6.2.5 Structured P2P (with DHTs)– 6.2.6 Performance of P2P Lookup Protocols– 6.2.7 Bi-Dimensional P2P

Page 4: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

4

Main Contents• 6.1 Mobile Ad Hoc Networks

– 6.1.1 Distributed Networks– 6.1.2 Introduction to MANETs– 6.1.3 Design of MANETs– 6.1.4 Network Routing Overview– 6.1.5 Proactive Protocols– 6.1.6 Reactive Protocols– 6.1.7 Energy Efficient and Unicast Routing– 6.1.8 Energy Efficiency Multi-/Broadcast Routing– 6.1.9 Geographic Routing

• 6.2 P2P Networks

Page 5: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

5

6.1.1 Distributed Networks• Distributed-Network-Layer Networks

– Ad Hoc networks (Mobile Ad Hoc networks, MANETs)– Wireless sensor networks (WSNs)– Mesh networks

• Distributed-Application-Layer Networks– Peer-to-peer (P2P) networks

Page 6: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

6

Main Contents• 6.1 Mobile Ad Hoc Networks

– 6.1.1 Distributed Networks– 6.1.2 Introduction to MANETs– 6.1.3 Design of MANETs– 6.1.4 Network Routing Overview– 6.1.5 Proactive Protocols– 6.1.6 Reactive Protocols– 6.1.7 Energy Efficient and Unicast Routing– 6.1.8 Energy Efficiency Multi-/Broadcast Routing– 6.1.9 Geographic Routing

• 6.2 P2P Networks

Page 7: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

7

6.1.2 Mobile Ad Hoc Networks• Characteristics

– Distributed network– Cooperative network– Self-organized network– Self-recovery– No infrastructure needed– Mobile network, different from mesh networks– Dynamic topology, different from mesh networks– Heterogeneous nodes, different from wireless sensor networks– Un-directional data flow, different from wireless sensor networks

• Applications– Extension to the cellular networks, battle fields, dangerous exploring, after-

disaster working, monitoring …

Page 8: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

8

6.1.2 Key Elements of MANETs • Formed dynamically through the cooperation of

independent nodes• Nodes do not have any pre-specified roles• Nodes make decision independently based on the current

network situation• Nodes are expected to behave as

– Information sources/sinks – Routers

• As routers, nodes must assist in discovery and maintenance of network route

Page 9: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

9

Main Contents• 6.1 Mobile Ad Hoc Networks

– 6.1.1 Distributed Networks– 6.1.2 Introduction to MANETs– 6.1.3 Design of MANETs– 6.1.4 Network Routing Overview– 6.1.5 Proactive Protocols– 6.1.6 Reactive Protocols– 6.1.7 Energy Efficient and Unicast Routing– 6.1.8 Energy Efficiency Multi-/Broadcast Routing– 6.1.9 Geographic Routing

• 6.2 P2P Networks

Page 10: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

10

6.1.3 Design of MANETs• Issues to be considered

– Infrastructureless with distributed management– Frequent and unpredictable topology changes– Physical layer limitation– Limited link bandwidth and quality– Variation in node capabilities– Energy Considerations– Network reliability– Network security– Network scalability– Quality of service

Page 11: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

11

6.1.3 Design of MANETs• Physical Layer

– OFDM, DSSS, FHSS, …– IEEE 802.11, Bluetooth, ZigBee, …

• MAC Layer– CSMA/CA, CDMA, …– IEEE 802.11, Bluetooth, ZigBee, …

• Network Layer– The most important issue to be considered– Different from other networks

• Wired distributed networks, e.g., Internet• Wireless distributed networks, e.g., wireless mesh, WSN, …

Page 12: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

12

6.1.3 MANETs Management• Multihop network – each device must carry burden of routing

packets from source to destination• Each Node handles part of the management of the network• Fault detection is extremely difficult because of the distributed

design

Page 13: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

13

Main Contents• 6.1 Mobile Ad Hoc Networks

– 6.1.1 Distributed Networks– 6.1.2 Introduction to MANETs– 6.1.3 Design of MANETs– 6.1.4 Network Routing Overview– 6.1.5 Proactive Protocols– 6.1.6 Reactive Protocols– 6.1.7 Energy Efficient and Unicast Routing– 6.1.8 Energy Efficiency Multi-/Broadcast Routing– 6.1.9 Geographic Routing

• 6.2 P2P Networks

Page 14: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

14

6.1.4 Network Layer Routing Overview• Network with nodes, edges• Goal: Devise scheme for transferring

message from one node to another– Which path?– Who decides – source or intermediate

nodes or destination?• Types

– Unicast routing– Energy efficiency & unicast routing– Multi-/broadcast routing– Geographical routing

msg

Page 15: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

15

6.1.4 Routing Problems• Which Path?

– Generally try to optimize something:• Shortest path (fewest hops)• Shortest time (lowest latency)• Shortest weighted path (utilize available bandwidth)• ……

• Who Determines Route?– Source routing

• Or path routing– Destination routing

• Or hop-by-hop routing

Page 16: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

16

6.1.4 Who Determines Route• Source (“Path”) Routing

– Source specifies entire route: places complete path to destination in message header: A – D – F – G

– Intermediate nodes just forward to specified next hop: D would look at path in header, forward to F

– Like airline travel – get complete set of tickets to final destination before departing…

• Destination (“Hop-by-Hop”) Routing – Source specifies only destination in message header: G – Intermediate nodes look at destination in header, consult internal tables

to determine appropriate next hop– Like postal service – specify only the final destination on an envelope,

and intermediate post offices select where to forward next…

Page 17: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

17

6.1.4 Comparison• Source Routing

– Moderate source storage (entire route for each desired dest.)– No intermediate node storage– Higher routing overhead (entire path in message header,

route discovery messages)• Destination Routing

– No source storage– High intermediate node storage (table w/ routing instructions

for all possible dests.)– Lower routing overhead (just dest in header, only routers

need deal w/ route discovery)

Page 18: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

18

6.1.4 Unicast, ID-centric Routing• Given: a network/a graph

– Each node has a unique identifier (ID)• Goal: Derive a mechanism that allows a packet sent from an

arbitrary node to arrive at some arbitrary destination node– The routing & forwarding problem– Routing: Construct data structures (e.g., tables) that contain information

how a given destination can be reached– Forwarding: Consult these data structures to forward a given packet to its

next hop• Challenges

– Nodes may move around, neighborhood relations change– Optimization metrics may be more complicated than “smallest hop count”

– e.g., energy efficiency

Page 19: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

19

6.1.4 Routing Features• Every node participates in routing: no distinction between “routers” and “end

nodes”• No external network setup: “self-configuring”• Especially useful when network topology is dynamic (frequent network changes

– links break, nodes come and go)• Mobile wireless hosts

– Can only communicate to the subset within range at given time– Want to communicate with any other node

Page 20: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

20

6.1.4 Routing Protocols• Because of challenges, standard routing approaches not really

applicable– Too big an overhead, too slow in reacting to changes– Examples: Dijkstra’s link state algorithm; Bellman-Ford distance

vector algorithm• Simple solution: Flooding

– Does not need any information (routing tables) – simple – Packets are usually delivered to destination – But

• Overhead is prohibitive• Usually not acceptable, either

• Need specific, ad hoc routing protocols

Page 21: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

21

6.1.4 Routing Protocols • Main Question to Ask: When Does the Routing Protocol

operate? • Option 1: Routing Protocol Always Tries to Keep its

Routing Data up-to-Date– Protocol is proactive (active before tables are actually needed)

or table-driven• Option 2: Route is only Determined when Actually Needed

– Protocol operates on demand• Option 3: Combine these Behaviors

– Hybrid protocols

Page 22: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

22

6.1.4 Routing Protocols• Is the Network Regarded as Flat or Hierarchical?

– Compare topology control, traditional routing• Which Data is Used to Identify Nodes?

– An arbitrary identifier?• The position of a node?• Can be used to assist in geographic routing protocols because choice

of next hop neighbor can be computed based on destination address – Identifiers that are not arbitrary, but carry some structure?

• As in traditional routing• Structure akin to position, on a logical level?

Page 23: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

23

6.1.4 Routing Protocols• Standardization Effort Led by IETF MANET Task Group

– http://www.ietf.org/html.charters/manet-charter.html– 9 routing protocols in draft stage, 4 drafts dealing with broadcast /

multicast / flow issues• Other Protocols Being Researched

– Utilize geographic / GPS info, ant-based techniques, etc.• Typical Routing Protocols

– DSR: Dynamic Source Routing• Source routing protocol

– AODV: Ad-hoc On-demand Distance Vector Routing• “Hop-by-hop” protocol

– Both are “on demand” protocols: route information discovered only as needed

Page 24: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

24

Main Contents• 6.1 Mobile Ad Hoc Networks

– 6.1.1 Distributed Networks– 6.1.2 Introduction to MANETs– 6.1.3 Design of MANETs– 6.1.4 Network Routing Overview– 6.1.5 Proactive Protocols– 6.1.6 Reactive Protocols– 6.1.7 Energy Efficient and Unicast Routing– 6.1.8 Energy Efficiency Multi-/Broadcast Routing– 6.1.9 Geographic Routing

• 6.2 P2P Networks

Page 25: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

25

6.1.5 Proactive Protocols• Idea: Start from a standard routing protocol, adapt it• Adapted distance vector: Destination Sequence Distance

Vector (DSDV)– Based on distributed Bellman Ford procedure– Add aging information to route information propagated by

distance vector exchanges; helps to avoid routing loops– Periodically send full route updates– On topology change, send incremental route updates– Unstable route updates are delayed– … + some smaller changes

Page 26: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

26

6.1.5 Proactive Protocols• Combine link-state protocol & topology control• Optimized Link State Routing (OLSR)• Topology control component: Each node selects a minimal

dominating set for its two-hop neighborhood– Called the multipoint relays– Only these nodes are used for packet forwarding– Allows for efficient flooding

• Link-state component: Essentially a standard link-state algorithms on this reduced topology– Observation: Key idea is to reduce flooding overhead (here by

modifying topology)

Page 27: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

27

6.1.5 Proactive Protocols• Fisheye State Routing (FSR) makes basic observation:

When destination is far away, details about path are not relevant – only in vicinity are details required– Look at the graph as if through a fisheye lens– Regions of different accuracy of routing information

• Practically: – Each node maintains topology table of network (as in LS)– Unlike LS: only distribute link state updates locally– More frequent routing updates for nodes with smaller scope

Page 28: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

28

Main Contents• 6.1 Mobile Ad Hoc Networks

– 6.1.1 Distributed Networks– 6.1.2 Introduction to MANETs– 6.1.3 Design of MANETs– 6.1.4 Network Routing Overview– 6.1.5 Proactive Protocols– 6.1.6 Reactive Protocols– 6.1.7 Energy Efficient and Unicast Routing– 6.1.8 Energy Efficiency Multi-/Broadcast Routing– 6.1.9 Geographic Routing

• 6.2 P2P Networks

Page 29: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

29

6.1.5 Reactive Protocols• DSR

– Draft RFC • At http://www.ietf.org/internet-drafts/draft-ietf-manet-dsr-07.txt

– Source Routing• Entire path to destination supplied by source in packet header• Utilizes extension header following standard IP header to carry protocol

information (route to destination, etc.)– Activities

• Route discovery– Undertaken when source needs a route to a destination

• Route maintenance– Used when link breaks, rendering specified path unusable

• Routing (easy!)

Page 30: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

30

6.1.5 Route Discovery• Route Request:

– Source broadcasts Route Request message for specified destination– Intermediate node:

• Adds itself to path in message• Forwards (broadcasts) message toward destination• Cache overheard routes

– “Eavesdrop” on routes contained in headers– Reduces need for route discovery

• May return Route Reply to source if it already has a path stored

• Route Reply– Destination unicasts Route Reply message to source

• Will contain complete path built by intermediate nodes

Page 31: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

31

6.1.5 Example• C Broadcasts Route Request to F

A

SourceC

G H

DestinationF

E

D

BRoute Request

Page 32: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

32

6.1.5 Example• C Broadcasts Route Request to F

A

SourceC

G H

DestinationF

E

D

BRoute Request

Page 33: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

33

6.1.5 Example• H Responds to Route Request

A

SourceC

G H

DestinationF

E

D

B

G,H,F

Page 34: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

34

6.1.5 Example• C Transmits a Packet to F

A

SourceC

G H

DestinationF

E

D

B

FH,F

G,H,F

Page 35: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

35

6.1.5 Route Maintenance• Used when link breakage occurs

– Link breakage may be detected using link-layer ACKs, “passive ACKs”, DSR ACK request

– Route Error message sent to source of message being forwarded when break detected

– Intermediate nodes “eavesdrop”, adjust cached routes – Source deletes route; tries another if one cached, or

issues new Route Request• Piggybacks Route Error on new Route Request to clear

intermediate nodes’ route caches, prevent return of invalid route

Page 36: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

36

6.1.5 Issues• Scalability

– Discovery messages broadcast throughout network• Broadcast / Multicast

– Use Route Request packets with data included• Duplicate rejection mechanisms prevent “storms”

– Multicast treated as broadcast; no multicast-tree operation defined• Scalability issues

– http://www.ietf.org/internet-drafts/draft-ietf-manet-simple-mbcast-01.txt

Page 37: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

37

6.1.5 Reactive Protocols• AODV

– Draft RFC at http://www.ietf.org/internet-drafts/draft-ietf-manet-aodv-10.txt

– “Hop-by-hop” protocol: intermediate nodes use lookup table to determine next hop based on destination

– Utilizes only standard IP header– Activities

• Route discovery– Undertaken whenever a node needs a “next hop” to forward a packet to a

destination

• Route maintenance– Used when link breaks, rendering next hop unusable

• Routing (easy!)

Page 38: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

38

6.1.6 Reactive Protocols• TORA

– Observation: In hilly terrain, routing to a river’s mouth is easy – just go downhill

– Idea: Turn network into hilly terrain• Different “landscape” for each destination• Assign “heights” to nodes such that when going downhill, destination is

reached – in effect: orient edges between neighbors• Necessary: resulting directed graph has to be cycle free

– Reaction to topology changes• When link is removed that was the last “outlet” of a node, reverse

direction of all its other links (increase height!)• Reapply continuously, until each node except destination has at least a

single outlet – will succeed in a connected graph!

Page 39: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

39

6.1.6 Route Discovery• Route Request:

– Source broadcasts Route Request message for specified destination– Intermediate node:

• Forwards (broadcasts) message toward destination• Creates next-hop entry for reverse path to source, to use when sending reply (assumes

bidirectional link…)

• Route Reply– Destination unicasts Route Reply (RREP) message to source

• RREP contains sequence number, hop-count field (initialized to 0)• Will be sent along “reverse” path hops created by intermediate nodes which forwarded RREQ

– Intermediate node:• Create next-hop entry for destination as RREP is received, forward along “reverse path” hop• Increment hop-count field in RREP and forward

– Source:• If multiple replies, uses one with lowest hop count

Page 40: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

40

6.1.6 Route Maintenance• Used when Link Breakage Occurs

– Link breakage detected by link-layer ACK, “passive ACK”, AODV “Hello” messages

• Detecting Node may Attempt “Local Repair”– Send RREQ for destination from intermediate node

• Route Error (RERR) Message Generated– Contains list of unreachable destinations– Sent to “precursors”: neighbors who recently sent packet

which was forwarded over broken link• Propagated recursively

Page 41: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

41

6.1.6 Issues• Scalability

– No inherent “subnetting” provision in routing tables – one entry per destination

• Directionality– Assumes there is at least one bidirectional path

between any two nodes

Page 42: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

42

6.1.6 Alternative Approach• Gossiping/Rumor Routing

– Turn routing problem around: Think of an “agent” wandering through the network, looking for data (events, …)

– Agent initially perform random walk

– Leave “traces” in the network– Later agents can use these

traces to find data– Essentially: works due to high

probability of line intersections

Page 43: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

43

Main Contents• 6.1 Mobile Ad Hoc Networks

– 6.1.1 Distributed Networks– 6.1.2 Introduction to MANETs– 6.1.3 Design of MANETs– 6.1.4 Network Routing Overview– 6.1.5 Proactive Protocols– 6.1.6 Reactive Protocols– 6.1.7 Energy Efficient and Unicast Routing– 6.1.8 Energy Efficiency Multi-/Broadcast Routing– 6.1.9 Geographic Routing

• 6.2 P2P Networks

Page 44: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

44

6.1.7 Energy Efficiency & Unicast Routing• Goals

– Minimize energy/bit• Example: A-B-E-H

– Maximize network lifetime• Time until first node failure,

loss of coverage, partitioning

• Seems trivial – use proper link/path metrics (not hop count) and standard routing

C1

4A

2G

3D

4H

4F

2E

2B

1

1

1

2

2

22

2

3

3

Page 45: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

45

6.1.7 Energy Efficiency & Unicast Routing• Previous path metrics do not perform particularly well• One non-trivial link weight:

– wij weight for link node i to node j

– eij required energy, some constant, i fraction of battery of node i already used up

• Path metric: Sum of link weights– Use path with smallest metric

• Properties: Many messages can be sent, high network lifetime– With admission control, even a competitive ratio logarithmic in

network size can be shown

Page 46: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

46

6.1.7 Multipath Unicast Routing• Instead of only a single

path, it can be useful to compute multiple paths between a given source/destination pair

• Multiple paths can be – Disjoint– Braided

• Used – Simultaneously– Alternatively– Randomly

Source Sink

Disjoint paths

Primary path

Secondary path

Source Sink

Disjoint paths

Primary path

Secondary path

Source Sink

Braided paths

Primary pathSource Sink

Braided paths

Primary path

Page 47: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

47

Main Contents• 6.1 Mobile Ad Hoc Networks

– 6.1.1 Distributed Networks– 6.1.2 Introduction to MANETs– 6.1.3 Design of MANETs– 6.1.4 Network Routing Overview– 6.1.5 Proactive Protocols– 6.1.6 Reactive Protocols– 6.1.7 Energy Efficient and Unicast Routing– 6.1.8 Energy Efficiency Multi-/Broadcast Routing– 6.1.9 Geographic Routing

• 6.2 P2P Networks

Page 48: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

48

6.1.8 Energy Efficiency Multi-/Broadcast Routing

• Distribute a Packet to – all reachable nodes (broadcast) – to a somehow (explicitly) denoted subgroup (multicast)

• Basic Options– Source-based tree: Construct a tree (one for each source) to reach all

addressees • Minimize total cost (= sum of link weights) of the tree• Minimize maximum cost to each destination

– Shared, core-based trees• Use only a single tree for all sources• Every source sends packets to the tree where they are distributed

– Mesh• Trees are only 1-connected ! Use meshes to provide higher redundancy and thus

robustness in mobile environments

Page 49: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

49

6.1.8 Energy Efficiency Multi-/Broadcast Routing

• For each source, minimize total cost

• For each source, minimize maximum cost to each destination

Steiner tree

Source

Destination 1

Destination 2

2

2

1

Source

Destination 1

Destination 2

2

2

1

Shortest path tree

Page 50: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

50

6.1.8 Energy Efficiency Multi-/Broadcast Routing

Broadcast Multicast

MeshShared tree(core-based tree)

Single core

Multiple core

One treeper source

Minimizetotal cost(Steiner tree)

Minimizecost to each node (e.g., Dijkstra)

Page 51: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

51

6.1.8 Wireless Multicast Advantage• Broad-/Multicasting in wireless is unlike broad-/multicasting in a

wired medium– Wired: locally distributing a packet to n neighbors: n times the cost of a

unicast packet – Wireless: sending to n neighbors can incur costs

• As high as sending to a single neighbor – if receive costs are neglected completely

• As high as sending once, receiving n times – if receives are tuned to the right moment

• As high as sending n unicast packets – if the MAC protocol does not support local multicast

• If local multicast is cheaper than repeated unicasts, then wireless multicast advantage is present

Page 52: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

52

6.1.8 Broadcast Incremental Power (BIP)• How to broadcast, using the wireless multicast advantage?

– Goal: use as little transmission power as possible• Idea: Use a minimum-spanning-tree-type construction

(Prim’s algorithm)• But: Once a node transmits at a given power level &

reaches some neighbors, it becomes cheaper to reach additional neighbors

• From BIP to multicast incremental power (MIP): – Start with broadcast tree construction, then prune unnecessary

edges out of the tree

Page 53: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

53

6.1.8 BIP Algorithm

Page 54: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

54

6.1.8 BIP Example

S (3)

A

B

C (1)D

2 3

67

Round 4:

S (5)

A

B

C (1)D

3

710

Round 5:

S

A

B

CD

15 3

73

1

10

Round 1:

S (1)

A

B

CD

4 3

72

1

9

Round 2:

S (3)

A

B

CD

2 3

7

1

7

Round 3:

Page 55: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

55

Main Contents• 6.1 Mobile Ad Hoc Networks

– 6.1.1 Distributed Networks– 6.1.2 Introduction to MANETs– 6.1.3 Design of MANETs– 6.1.4 Network Routing Overview– 6.1.5 Proactive Protocols– 6.1.6 Reactive Protocols– 6.1.7 Energy Efficient and Unicast Routing– 6.1.8 Energy Efficiency Multi-/Broadcast Routing– 6.1.9 Geographic Routing

• 6.2 P2P Networks

Page 56: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

56

6.1.9 Geographic Routing• Routing tables contain information to which next hop a packet

should be forwarded– Explicitly constructed

• Alternative: Implicitly infer this information from physical placement of nodes– Position of current node, current neighbors, destination known – send to a

neighbor in the right direction as next hop– Geographic routing

• Options– Send to any node in a given area – geocasting – Use position information to aid in routing – position-based routing

• Might need a location service to map node ID to node position

Page 57: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

57

6.1.9 Basics of Position-Based Routing• “Most forward within range r” strategy

– Send to that neighbor that realizes the most forward progress towards destination

– NOT: farthest away from sender!• Nearest node with (any) forward progress

– Idea: Minimize transmission power• Directional routing

– Choose next hop that is angularly closest to destination– Choose next hop that is closest to the connecting line to

destination– Problem: Might result in loops!

Page 58: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

58

6.1.9 Problem: Dead Ends• Simple strategies might send a packet into a dead end

Page 59: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

59

Main Contents• 6.1 Mobile Ad Hoc Networks• 6.2 P2P Networks

– 6.2.1 Introduction to P2P– 6.2.2 Why P2P?– 6.2.3 Overview of P2P– 6.2.4 Unstructured P2P (Gnutella)– 6.2.5 Structured P2P (with DHTs)– 6.2.6 Performance of P2P Lookup Protocols– 6.2.7 Bi-Dimensional P2P

Page 60: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

60

6.2.1 Introduction to P2P• Definitions

– Clay Shirky (www.shirky.com): • A class of applications that take advantage of resources – storage, cycles,

content, human presence – available at the edges of the Internet.– Milojicic et al. (HP):

• A class of systems and applications that employ distributed resources to perform a critical function in a decentralized manner.

– Some other guys:• A technology which “enables any network-aware device to provide services to

another network-aware device”

• Instead of Internet information being held in a few central locations, Peer-to-Peer computing makes it theoretically possible to access the files and data residing on every personal computer connected to the Internet

Page 61: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

61

6.2.1 Introduction to P2P• Instead of Internet information being held in a few central locations,

Peer-to-Peer computing makes it theoretically possible to access the files and data residing on every personal computer connected to the Internet

• A peer in P2P network acts as both a client and a server in traditional client/server architecture

P2P Client/Server

Page 62: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

62

Main Contents• 6.1 Mobile Ad Hoc Networks• 6.2 P2P Networks

– 6.2.1 Introduction to P2P– 6.2.2 Why P2P?– 6.2.3 Overview of P2P– 6.2.4 Unstructured P2P (Gnutella)– 6.2.5 Structured P2P (with DHTs)– 6.2.6 Performance of P2P Lookup Protocols– 6.2.7 Bi-Dimensional P2P

Page 63: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

63

6.2.2 Why P2P?• Problem with Server-Client

Model– Scalability

• As the number of users increases, there is a higher demand for computing power, storage space, and bandwidth associated with the server-side

– Reliability• The whole network will depend on

the highly loaded server to function properly

Page 64: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

64

6.2.2 Why P2P?• The Internet has three valuable fundamental

assets– Information– Computing resources – Bandwidth

• All of which are vastly under utilized, partly due to the traditional client-server model

Page 65: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

65

6.2.2 Why P2P?• First, no single search engine or portal can locate and

catalog the ever-increasing amount of information on the Web in a timely way

• Moreover, a huge amount of information is transient and not subject to capture by techniques such as Web crawling– Google claims that it searches about 1.3×108 web pages– Finding useful information in real time is increasingly difficult!

• Many information can not be capture by web crawling – The world produces 2 exabytes(1015) of information every

year, only publishes 300 terabytes(1012)

Page 66: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

66

6.2.2 Why P2P?• Second, although miles of new fiber have been

installed– The new bandwidth gets little use if everyone goes to

Yahoo for content and to eBay– Instead, hot spots just get hotter while cold pipes remain

cold• This is partly why most people still feel the congestion

over the Internet – While a single fiber’s band-width has increased by a factor

of 106 since 1975, doubling every 16 months

Page 67: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

67

6.2.2 Why P2P?• Finally, new processors and storage devices continue

to break records in speed and capacity– supporting more powerful end devices throughout the

network• However

– Computation and storage continue to accumulate around data centers

– They have to increase their workloads at a crippling pace, thus putting immense pressure on space and power consumption

Page 68: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

68

6.2.2 Why P2P?• The P2P Architecture

– Eliminates the single-source bottleneck – Is used to distribute data and control and load-

balance requests across the Net– Eliminates the risk of a single point of failure– Allows direct access and shared space, and this

can enable remote maintenance capability

Page 69: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

69

6.2.2 Why P2P?• Advantages of P2P model

The system is based on the direct communication between peers

There is zero reliance on centralized serviced or resources for operations

The system can survive extreme changes in network composition

They thrive in a network with heterogeneous environment

This model is highly scalable

Page 70: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

70

Main Contents• 6.1 Mobile Ad Hoc Networks• 6.2 P2P Networks

– 6.2.1 Introduction to P2P– 6.2.2 Why P2P?– 6.2.3 Overview of P2P– 6.2.4 Unstructured P2P (Gnutella)– 6.2.5 Structured P2P (with DHTs)– 6.2.6 Performance of P2P Lookup Protocols– 6.2.7 Bi-Dimensional P2P

Page 71: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

71

6.2.3 Properties of P2P• No central control, no central database• No hierarchy

– Every node is both a client and a server– The communication between peers is symmetric

• No global view of the system– Scalability

• Availability for any peer• Peers are autonomous• System globally unreliable

– Robustness and security issues

Page 72: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

72

6.2.3 Examples of P2P Usage• File-Sharing Applications• Distributed Databases• Distributed Computing (Grid Computing)• Collaboration• Distributed Games• Instant Messaging• Ad Hoc Networks• Application-Level Multicast• …

Page 73: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

73

6.2.3 Overview of P2P• Peer:

– A peer is a node on a P2P network that forms the fundamental processing unit of any P2P solution.

– Each peer has a unique Peer ID– Each peer belongs to one or several Peer Group– Each peer can communicate with other peers in

its group and also those in other groups

Page 74: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

74

6.2.3 Overlay Networks

IP

Overlay

Page 75: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

75

6.2.3 Traditional C/S Model

Page 76: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

76

6.2.3 P2P Networks

Large Scale Wireless P2P networksAnd

The lookup protocols

Structured

For large-scale P2P networks

Chord, Pastry,Tapestry, CAN……

Unstructured

For small-scale P2P networks

Gnutella

DistributedWithout an index server

CentralizedWith an index server

DNS, X.500,Napster……

Distributed

Page 77: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

77

6.2.3 Pure P2P

Page 78: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

78

6.2.3 Hybrid P2P

Page 79: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

79

6.2.3 Centralized P2P (Napster)• File-sharing system• Almost distributed system

– The location of a document is centralized– The "transfer" is peer-to-peer

• Problems– Robustness– Scalability (?)

Page 80: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

80

6.2.3 Centralized P2P (Napster)

INTERNET

locationserver

register

Document x?OK: Peer ZIP = a.b.c.d

Document x!

x

Page 81: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

81

Main Contents• 6.1 Mobile Ad Hoc Networks• 6.2 P2P Networks

– 6.2.1 Introduction to P2P– 6.2.2 Why P2P?– 6.2.3 Overview of P2P– 6.2.4 Unstructured P2P (Gnutella)– 6.2.5 Structured P2P (with DHTs)– 6.2.6 Performance of P2P Lookup Protocols– 6.2.7 Bi-Dimensional P2P

Page 82: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

82

6.2.4 Unstructured P2P (Gnutella)• Two phases (like Napster)

– Localization + exchange• No server• Open source

– gnutella.wego.com• Distributed search

– The query is flooded– Loop avoidance– Limited TTL (not all nodes are visited)

Page 83: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

83

6.2.4 Unstructured P2P (Gnutella)

Page 84: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

84

Main Contents• 6.1 Mobile Ad Hoc Networks• 6.2 P2P Networks

– 6.2.1 Introduction to P2P– 6.2.2 Why P2P?– 6.2.3 Overview of P2P– 6.2.4 Unstructured P2P (Gnutella)– 6.2.5 Structured P2P (with DHTs)– 6.2.6 Performance of P2P Lookup Protocols– 6.2.7 Bi-Dimensional P2P

Page 85: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

85

6.2.5 Structured P2P (with DHTs)• Based on distributed hash tables (DHTs)• No flooding

– Exact matches• Overhead

– Gnutella-like: O(n)– DHT: O(log n)

• Examples– CAN, Pastry, Chord, Kademlia, Tapestry, etc.

Page 86: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

86

6.2.5 The Chord P2P Lookup Protocol• Main Features of Chord

– Fully distributed– Efficient lookup of a node which stores data items for a

particular search key– Load balancing via Consistent Hashing– Small routing tables: log n– Small routing delay (average number of hop): log n– Fast join/leave protocol– Automatically adjusts internal tables to reflect changes

Page 87: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

87

6.2.5 Consistence Hashing• Assigns both nodes and

objects from an m-bit key• Order these nodes around

an identifier circle according to the order of their keys (0 .. 2m-1). This ring is known as the Chord Ring

• Object with key k is assigned to the first node whose key is ≥ k (called the successor node of key k)

N32

N90

N105

D80

D20

D120

Example: Node 90 is the “successor” of document 80.

(0)

N=128Circular 7-bit

ID space

Page 88: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

88

6.2.5 Consistent Hashing• Property 1

– If there are N nodes and K keys, then with high probability, each node is responsible for (1+ )K/N keys. ( = O(log N)

• Property 2– When an (N+1) joins or leaves the network, the

responsibility of at most O(K/N) keys changes hand (only to or from the node that is joining or leaving

Page 89: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

89

6.2.5 Chord’s Fingers(0)

Each node knows of only log N other nodes.

N80

1/8

1/161/321/641/128

Circular (log N)-bitID space

Distance of N80’sneighbors from

N80

1/4 1/2

Page 90: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

90

6.2.5 Chord Finger Table(0)

N32

N60

N79

N70

N113

N102

N40

N52

33..33 N4034..35 N4036..39 N4040..47 N4048..63 N5264..95 N7096..31 N102

Node n’s i-th entry: first node n + 2i-1

N32’sFinger Table

N80

N85

N=128

Page 91: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

91

6.2.5 Chord Lookup

33..33 N4034..35 N4036..39 N4040..47 N4048..63 N5264..95 N7096..31 N102

N32’sFinger Table

Node 32, lookup(82): 32 70 80 85.

71..71 N7972..73 N7974..77 N7978..85 N8086..101 N102102..5 N1026..69 N32

N70’sFinger Table

(0)

N32

N60N79

N70

N113

N102

N40

N52

N80

N85

81..81 N8582..83 N8584..87 N8588..95 N10296..111 N102112..15 N11316..79 N32

N80’sFinger Table

Page 92: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

92

6.2.5 New Node Joining Procedure(0)

N32

N60

N80

N70

N113

N102

N40

N52

21..2122..2324..2728..3536..5152..8384..19

N20’sFinger Table

N20

Page 93: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

93

6.2.5 New Node Joining Procedure(0)

N32

N60

N80

N70

N113

N102

N40

N52

21..21 N3222..23 N3224..27 N3228..35 N3236..51 N4052..83 N5284..19 N102

N20’sFinger Table

N20

Node 20 asks any node for successor to 21, 22, …, 52, 84.

Page 94: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

94

6.2.5 After Joining(0)

N32

N60

N80

N70

N113

N102

N40

N52

21..21 N3222..23 N3224..27 N3228..35 N3236..51 N4052..83 N5284..19 N102

N20’sFinger Table

N20

Node 20 moves documents from node 32.

D114..20

Page 95: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

95

Main Contents• 6.1 Mobile Ad Hoc Networks• 6.2 P2P Networks

– 6.2.1 Introduction to P2P– 6.2.2 Why P2P?– 6.2.3 Overview of P2P– 6.2.4 Unstructured P2P (Gnutella)– 6.2.5 Structured P2P (with DHTs)– 6.2.6 Performance of P2P Lookup Protocols– 6.2.7 Bi-Dimensional P2P

Page 96: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

96

6.2.6 Performance of P2P Lookup ProtocolsGnutella Chord F-Chord(1)

Degree ( routing table size )Diameter ( maximum hop )

Average hop

2log N

2log N

2log 2N

21.44 log 2N

20.720log N

20.398log N

0

1N

1 2N

0 Diameter

Degree

Information of all nodes included in the routing table

Optimal trade-off

Chord , Pastry , Tapestry……

Gnutella

N - 1

O(log N)

1 O(log N) N - 1

Page 97: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

97

Main Contents• 6.1 Mobile Ad Hoc Networks• 6.2 P2P Networks

– 6.2.1 Introduction to P2P– 6.2.2 Why P2P?– 6.2.3 Overview of P2P– 6.2.4 Unstructured P2P (Gnutella)– 6.2.5 Structured P2P (with DHTs)– 6.2.6 Performance of P2P Lookup Protocols– 6.2.7 Bi-Dimensional P2P

Page 98: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

98

6.2.7 Bi-Dimensional P2P

• Bi-Dimensional P2P– Assume the Hash space to be– Assume all nodes exist in the Hash space– Place all nodes on the plain

• Path Length– Definition, for any , the path length between and is

defined as the number of hop for the lookup from to assuming there is only next node in each node’s routing table

– Maximum path length of Chord

0,1, 2 1m

2 22 2m m

/ 2, , , 1, 2, 2ma b c d ,a bn,c dn

, ,,path a b c dL n n,a bn ,c dn

2 21,1 2 ,2, 2 1.m m

mpathL n n

Page 99: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

99

6.2.7 Bi-Dimensional P2P

Page 100: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

100

6.2.7 Performance Comparison

Degree Diameter

Chord

F-Chord

MRBD-2(2)

MRBD-3(3)

MRBD-3(4)

m

0.720m

m

1.44 2m

222 log 2

m

m 2 22 2log 2 log 2

m m

m

3log 2 2 0.63 2m m

0.75 2m243 log 2 0.75

m

m

23 3

33 log 2 log 2 0.9462

m m m

Page 101: 第六章 分布式网络 Chapter 6  Distributed Networks

现代通信新技术导论 第六章 分布式网络

101

A Brief Review• MANETs

– Distributed• Advantages• Disadvantages

– Design Issues– Routing Protocols

• P2P Networks– Distributed

• Advantages• Disadvantages

– Architecture– Lookup Protocols