38
12:53:25 AM H. Levy, Sadna P2P 2011 1 Sadna Advanced Internet applications and Systems: Peer to Peer Hanoch Levy & Hillel Avni (hanoch at cs.tau.ac.il , [email protected] ) Some slides adopted from Y. Mansour, Y. Afek

Sadna Advanced Internet applications and Systems: Peer to Peer

  • Upload
    yaron

  • View
    39

  • Download
    0

Embed Size (px)

DESCRIPTION

Sadna Advanced Internet applications and Systems: Peer to Peer. Hanoch Levy & Hillel Avni ( hanoch at cs.tau.ac.il , [email protected] ) Some slides adopted from Y. Mansour, Y. Afek. Course Information. Lectures: Tuesday Shreiber 007 Teaching Assistant: Hillel Avni. - PowerPoint PPT Presentation

Citation preview

Page 1: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:11 PM H. Levy, Sadna P2P 2011 1

Sadna Advanced Internet applications and Systems: Peer to Peer

Hanoch Levy & Hillel Avni (hanoch at cs.tau.ac.il, [email protected])

Some slides adopted from Y. Mansour, Y. Afek

Page 2: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:11 PM H. Levy, Sadna P2P 2010 2/60

Course Information

Lectures: Tuesday Shreiber 007Teaching Assistant: Hillel Avni Web site: http://www.cs.tau.ac.il/~hanochSearch for sadna

1. An Engineering Approach to Computer Networking / Keshav

2. Computer Networks / Tanenbaum 3. Data Networks / Bertsekas and Gallager

Supporting Books (computer networks – little P2P):

Resources: Articles: Web, UsFramework : Hillel Avni

Page 3: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:11 PM H. Levy, Sadna P2P 2010 3/60

What is P2P + Questions

1. An “unnatural” way to ship traffic in a network:• Pass the traffic between the clients • Instead of: from server to clients

2. “Against nature laws”…3. Rose due to “legal reasons”.. 4. Turned out to have positive technical properties 5. Can it survive 6. Can it operate in a decent environment

Page 4: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:11 PM H. Levy, Sadna P2P 2010 4/60

Peer to Peer

“Historical” Internet : send data from A to K.

Client-server model: A = server = data source K = client data consumer

If C wants too – get from A (unicast or broadcast)

Page 5: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:11 PM H. Levy, Sadna P2P 2010 5/60

Peer to Peer

A (source) sends to K.

K (client) may become now a server.

K sends to C (another client).

Page 6: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:11 PM H. Levy, Sadna P2P 2010 6/60

Course Objective

1. Get to understand very well P2P systems – with application to Video

2. Understand advantages and limitations 3. Understand “efficiency” and scheduling 4. Hands-on experience5. Gate for Master thesis? ….

Page 7: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:11 PM H. Levy, Sadna P2P 2010 7/60

Structure + Grades

Structure:1) A few general lectures by team.2) Work on your own with team guidance. 3) 3 deadlines for turning in material • Grade:

• Based on what is turned in• Quality:

• How good the program performs• How good the students understand the

problem/solution

Page 8: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:11 PM H. Levy, Sadna P2P 2010 8/60

Motivation

Last 10-15 years: communications revolution Internet + Computer communications

Is a key factor of the Information revolution Implications

A drastic change of some aspects of life Revolution is affected by life Technology drives applications Applications drive technology

Page 9: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:12 PM H. Levy, Sadna P2P 2010 9/60

Motivation (cont)

Applications / technology / research rapidly change over time

If want to stay in frontier: => Research material very

dynamic => Course material very dynamic

Page 10: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:12 PM H. Levy, Sadna P2P 2010 10/60

Objectives Computer Networking course: Internet infra-

structure 1 Introduction and Layering 2 Physical Layer, Data Link Layer, MAC Protocols 3 Hubs, Bridges, SwitchesData Link Layer 4 Switching UnitsSTP, Switching Fabric 5 Scheduling: Buffer Management Scheduling, WFQ example 6 Network Layer: RoutingRouting 7 Reliable Data TransferIP 8 End to End ProtocolsARQ 10 Flow Control, Congestion ControlTCP flow & congestion control 11 Network SecurityNetwork Sniffing (no slides) 12 DNS, HTTPTCP (state chart) 13 DDoS ALL – operations of network of networks.

Page 11: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:12 PM H. Levy, Sadna P2P 2010 11/60

Objectives (2)

Advanced Material – network development following technology Peer to Peer (P2P): Bittorent, Skype

Songs /movies / video-on-demand/video online

Distributed nets (serve the user) Semi organized nets :

serve the provider (e.g. video provider, Youtube?) Serve Internet Service provider (ISP=Bezeq Intl.)

Page 12: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:12 PM H. Levy, Sadna P2P 2010 12/6012

Backbone ISPISP ISP

Internet Physical InfrastructureResidential access

Cable Fiber DSL Wireless

Campus access, e.g.,

Ethernet Wireless

The Internet is a network of networks

Each individually administrated network is called an Autonomous System (AS)

Page 13: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:12 PM H. Levy, Sadna P2P 2010 13/60

Data Networks

Set of interconnected nodes exchange information sharing of the transmission circuits= "switching". many links allow more than one path between

every 2 nodes. network must select an appropriate path for each

required connection.

Page 14: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:12 PM H. Levy, Sadna P2P 2010 14/60

Real Network

Page 15: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:12 PM H. Levy, Sadna P2P 2010 15/60

Layers:

Person delivery of parcel

Post office counter handling

Ground transfer: loading on trucks

Airport transfer: loading on airplane

Airplane routing from source to destination

each layer implements a service

via its own internal-layer actions

relying on services provided by layer below

Peer entities

Page 16: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:13 PM H. Levy, Sadna P2P 2010 17/60

The seven Layers

Presentation

Application

Session

Transport

Network

Data Link

Physical

Presentation

Application

Session

Transport

Network

Data Link

Physical

Network

Data Link

Physical

End system End systemIntermediate system

There are only 5!!

Application

Page 17: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:13 PM H. Levy, Sadna P2P 2010 18/60

The seven Layers - protocol stack

Presentation

Application

Session

Transport

Network

Data Link

Physical

Presentation

Application

Session

Transport

Network

Data Link

Physical

data

DH+data+DT

bits

data

data

data

data

AH

PH

SH

TH

Network

Data Link

Physical

dataNH

Session and presentation layers are not so important, and are often ignoredSession and presentation layers are not so important, and are often ignored

Page 18: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:13 PM H. Levy, Sadna P2P 2010 19/60

עיקרון השכבות

Application

Transport

Network

Data-Link

Application

Transport

Network

Data-Link

Network

Identical message

Identical message

Identical message

Source Destination בשכבהXמתקבלת הודעה זהה להודעה ששכבה

Xמסרה בצד המקור

Page 19: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:22 PM H. Levy, Sadna P2P 2010 20/60

Internet protocol stack

application: supporting network applications ftp, smtp, http

transport: host-host data transfer tcp, udp

network: routing of datagrams from source to destination ip, routing protocols

link: data transfer between neighboring network elements ppp, ethernet

physical: bits “on the wire”

application

transport

network

link

physical

Page 20: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:22 PM H. Levy, Sadna P2P 2010 21/60

applicationtransportnetwork

Linkphysical

applicationtransportnetwork

Linkphysical

source destination

M

M

M

M

Ht

HtHn

HtHnHl

M

M

M

M

Ht

HtHn

HtHnHl

message

segment

datagram

frame

Protocol layering and data

Page 21: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:22 PM H. Levy, Sadna P2P 2010 22/60

Physical layer L1

Moves bits between physically connected end-systems

Standard prescribes coding scheme to represent a bit shapes and sizes of connectors bit-level synchronization

Internet technology to move bits on a wire, wireless link,

satellite channel etc.

Page 22: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:22 PM H. Levy, Sadna P2P 2010 23/60

Datalink layer L2

(Reliable) communication over a single link. Introduces the notion of a frame

set of bits that belong together Idle markers tell us that a link is not carrying a

frame Begin and end markers delimit a frame Internet

a variety of datalink layer protocols most common is Ethernet others are FDDI, SONET, HDLC

Page 23: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:22 PM H. Levy, Sadna P2P 2010 24/60

Datalink layer (contd.)

Datalink layer protocols are the first layer of software Very dependent on underlying physical link properties Usually bundle both physical and datalink in hardware.

Ethernet (broadcast link) end-system must receive only bits meant for itneed datalink-layer addressalso need to decide who gets to speak nextthese functions are provided by Medium ACcess sublayer (MAC)

Page 24: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:22 PM H. Levy, Sadna P2P 2010 25/60

Network layer L3

Carries data from source to destination. Logically concatenates a set of links to form the

abstraction of an end-to-end link Allows an end-system to communicate with any other

end-system by computing a route between them Hides individual behavior of datalink layer Provides unique network-wide addresses Found both in end-systems and in intermediate

systems

Page 25: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:22 PM H. Levy, Sadna P2P 2010 26/60

Internet network layer is provided by Internet

Protocol (IP) found in all end-systems and intermediate

systems provides abstraction of end-to-end link segmentation and reassembly packet-forwarding, routing, scheduling unique IP addresses can be layered over anything, but only best-

effort service

Network layer (contd.)

Page 26: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:22 PM H. Levy, Sadna P2P 2010 27/60

At intermediate systems participates in routing protocol to create

routing tables responsible for forwarding packets schedules the transmission order of packets chooses which packets to drop

Network layer (contd.)

At end-systems

primarily hides details of datalink layer segments and reassemble detects errors

Page 27: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:22 PM H. Levy, Sadna P2P 2010 28/60

Transport layer L4

Reliable end-to-end communication. creates the abstraction of an error-controlled,

flow-controlled and multiplexed end-to-end link(Network layer provides only a ‘raw’ end-to-end service)

Some transport layers provide fewer services e.g. simple error detection, no flow control, and no retransmission

Internet TCP provides error control, flow control, multiplexing

UDP provides only multiplexing

Page 28: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:22 PM H. Levy, Sadna P2P 2010 29/60

Transport layer (contd.)

Error control GOAL: message will reach destination despite packet loss,

corruption and duplication ACTIONS: retransmit lost packets; detect, discard, and

retransmit corrupted packets; detect and discard duplicated packets

Flow control match transmission rate to rate currently sustainable on

the path to destination, and at the destination itself Multiplexes multiple applications to the

same end-to-end connection adds an application-specific identifier (port number) so

that receiving end-system can hand in incoming packet to the correct application

Page 29: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:23 PM H. Levy, Sadna P2P 2010 30/60

Session layer

Not common Provides full-duplex service, expedited

data delivery, and session synchronization

Internet doesn’t have a standard session layer

Page 30: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:23 PM H. Levy, Sadna P2P 2010 31/60

Duplex if transport layer is simplex, concatenates two

transport endpoints together

Expedited data delivery allows some messages to skip ahead in end-system

queues, by using a separate low-delay transport layer endpoint

Synchronization allows users to place marks in data stream and to

roll back to a prespecified mark

Session layer (cont.)

Page 31: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:23 PM H. Levy, Sadna P2P 2010 32/60

Presentation layer

Usually ad hoc Touches the application data (Unlike other layers which deal with headers) Hides data representation differences

between applications characters (ASCII, unicode, EBCDIC.)

Can also encrypt data Internet

no standard presentation layer only defines network byte order for 2- and 4-

byte integers

Page 32: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:23 PM H. Levy, Sadna P2P 2010 33/60

Application layer

The set of applications that use the network Doesn’t provide services to any other layer

Page 33: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:23 PM H. Levy, Sadna P2P 2010 34/60

עיקרון השכבות

3אפליק

UDP

Network (IPv4)

Ethernet

Application

Transport

Network

Data-Link

Network

Source Destination

2אפליק 1אפליק

TCP

WiFiModem

Page 34: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:37 PM H. Levy, Sadna P2P 2010 35/60

עיקרון השכבות

Network

Source Destination

3אפליק

UDP

Network (IPv4)

Ethernet

2אפליק 1אפליק

TCP

WiFiModem

3אפליק

UDP

Network (IPv4)

Ethernet

2אפליק 1אפליק

TCP

WiFiModem

Page 35: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:53 PM H. Levy, Sadna P2P 2010 36/60

Peer to Peer

“Historical” Internet : send data from A to K.

Client-server model: A = server = data source K = client data consumer

If C wants too – get from A (unicast or broadcast)

Page 36: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:54 PM H. Levy, Sadna P2P 2010 37/60

Peer to Peer

A (source) sends to K.

K (client) may become now a server.

K sends to C (another client).

Page 37: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:54 PM H. Levy, Sadna P2P 2010 38/60

Peer to Peer – WHY ??

Legal (this is how it started…) Broadcast is not really implemented

If implemented – not easy Need at intermediate routers to keep

state of conversation For each packet to memorize who got it. Large overhead when traffic speed is

high A is bottleneck Resource Utilization: K is idle X%

(95?)of the day Communications (costs!!) CPU

Page 38: Sadna Advanced Internet applications and Systems: Peer to Peer

04:45:54 PM H. Levy, Sadna P2P 2010 39/60

Peer to Peer – WHY ??

Scalability Can reach N clients at very low cost; By doubling the load on each recipient

(which needs to become server now) can reduce the server load from N to 1.

The network traffic is less than doubled.