Peer-to-Peer Networks The Internet 6th Week - - PowerPoint PPT Presentation

peer to peer networks
SMART_READER_LITE
LIVE PREVIEW

Peer-to-Peer Networks The Internet 6th Week - - PowerPoint PPT Presentation

Peer-to-Peer Networks The Internet 6th Week Albert-Ludwigs-Universitt Freiburg Department of Computer Science Computer Networks and Telematics Christian Schindelhauer Summer 2008 Montag, 9. Juni 2008 1 Peer-to-Peer Networks Internet 2


slide-1
SLIDE 1

Albert-Ludwigs-Universität Freiburg Department of Computer Science Computer Networks and Telematics Christian Schindelhauer Summer 2008

Peer-to-Peer Networks

The Internet 6th Week

1 Montag, 9. Juni 2008

slide-2
SLIDE 2

Internet

Peer-to-Peer Networks

2

2 Montag, 9. Juni 2008

slide-3
SLIDE 3

Peer-to-Peer-Networks Summer 2008 Computer Networks and Telematics Albert-Ludwigs-Universität Freiburg Christian Schindelhauer

Die Internet-Schichten TCP/IP-Layer

Application Peer-to-Peer Networks, HTTP (Web), SMTP (E- Mail), ... Transport TCP (Transmission Control Protocol) UDP (User Datagram Protocol) Network IP (Internet Protocol) + ICMP (Internet Control Message Protocol) + IGMP (Internet Group Management Protoccol) Link LAN (e.g. Ethernet, Token Ring etc.) 3

3 Montag, 9. Juni 2008

slide-4
SLIDE 4

Peer-to-Peer-Networks Summer 2008 Computer Networks and Telematics Albert-Ludwigs-Universität Freiburg Christian Schindelhauer

Internet Layers At Work

4

4 Montag, 9. Juni 2008

slide-5
SLIDE 5

Peer-to-Peer-Networks Summer 2008 Computer Networks and Telematics Albert-Ludwigs-Universität Freiburg Christian Schindelhauer

Internet Headers

5

5 Montag, 9. Juni 2008

slide-6
SLIDE 6

Peer-to-Peer-Networks Summer 2008 Computer Networks and Telematics Albert-Ludwigs-Universität Freiburg Christian Schindelhauer

Network Layer

  • IP (Internet Protocol) & Helping Protocols
  • ICMP (Internet Control Management Protocol)
  • error handling
  • IGMP (Internet Group Management Protocol)
  • for multicasting
  • IP is an unreliable connectionless datagram exchange

service

  • Datagram consists of application data and header

6

6 Montag, 9. Juni 2008

slide-7
SLIDE 7

Peer-to-Peer-Networks Summer 2008 Computer Networks and Telematics Albert-Ludwigs-Universität Freiburg Christian Schindelhauer

IP-Header (RFC 791)

  • Version: 4 = IPv4
  • Total Length: header length
  • in 32 bit words (>5)
  • Checksum
  • Source and destination IP-address
  • Protocol
  • identifies protocol
  • e.g. TCP

, UDP , ICMP , IGMP

  • Time to Live
  • maximum hops

0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Version| IHL |Type of Service| Total Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Identification |Flags| Fragment Offset | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Time to Live | Protocol | Header Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Source Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Destination Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Options | Padding | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

7

7 Montag, 9. Juni 2008

slide-8
SLIDE 8

Peer-to-Peer-Networks Summer 2008 Computer Networks and Telematics Albert-Ludwigs-Universität Freiburg Christian Schindelhauer

IP Addresses and Domain Name System

  • IP Addresses
  • Each interface of a host has a unique IP address
  • worldwide
  • local
  • 32 bits separated in Net-ID and Host-ID
  • Net-ID assigned by Internet Network Information Center
  • Host-ID assigned by local network administration
  • Domain Name System (DNS)
  • enables names as substitutes for IP Addresses
  • e.g. http://www.ifvl.de/ for80.67.17.75
  • distributed robust database

8

8 Montag, 9. Juni 2008

slide-9
SLIDE 9

Peer-to-Peer-Networks Summer 2008 Computer Networks and Telematics Albert-Ludwigs-Universität Freiburg Christian Schindelhauer

IPv4- Addresses

  • Until 1993 (not in use)
  • 5 classes (A,B,..,E) with fixed prefix
  • then sub-net of fixed length (depending on class) and host-ID
  • Since 1993
  • Classless Inter-Domain-Routing (CIDR)
  • Network address and host-ID have variable length
  • e.g.
  • network mask

11111111.11111111.11111111.00000000

  • divides IP addresses

  • 10000100. 11100110. 10010110. 11110011
  • into network

  • 10000100. 11100110. 10010110
  • and host 11110011

9

9 Montag, 9. Juni 2008

slide-10
SLIDE 10

Peer-to-Peer-Networks Summer 2008 Computer Networks and Telematics Albert-Ludwigs-Universität Freiburg Christian Schindelhauer

Routing Table and Packet Forwarding

  • IP Routing Table
  • stores for a destination the address of the next hop

(gateway)

  • destination can be a host or a whole sub-net
  • for all unspecified destinations it stores a default

gateway

  • Packet Forwarding
  • (aka. packet routing)
  • IP packet (datagram) contains start and destination IP

address

10

10 Montag, 9. Juni 2008

slide-11
SLIDE 11

Peer-to-Peer-Networks Summer 2008 Computer Networks and Telematics Albert-Ludwigs-Universität Freiburg Christian Schindelhauer

Packet Forwarding

  • IP packet (datagram) consists of
  • TTL (Time-to-Live)
  • start IP address
  • destination IP address
  • Packet Forwarding Algorithm at Router
  • Decrement TTL
  • If TTL ≠ 0 then forward packet according routing table
  • If TTL = 0 or if problems occur during packet forwarding
  • delete packet
  • if packet is not an ICMP-packet

send ICMP packet with

  • start = router‘s IP address
  • destination = original start IP address

11

11 Montag, 9. Juni 2008

slide-12
SLIDE 12

Peer-to-Peer-Networks Summer 2008 Computer Networks and Telematics Albert-Ludwigs-Universität Freiburg Christian Schindelhauer

AS, Intra-AS and Inter-AS

  • Autonomous Systems (AS)
  • two layer model for routing in the

Internet

  • example for AS
  • uni-freiburg.de
  • Intra-AS-Routing
  • find routes inside an AS
  • e.g. RIP

, OSPF , IGRP , ...

  • Inter-AS-Routing
  • decentral routing
  • ASs choose optimization criteria
  • BGP (Border Gateway Protocol)

12

12 Montag, 9. Juni 2008

slide-13
SLIDE 13

Peer-to-Peer-Networks Summer 2008 Computer Networks and Telematics Albert-Ludwigs-Universität Freiburg Christian Schindelhauer

IPv6

Why IPv6

  • IP address are rare
  • 32 bit address space allow 4 billion possible IPv4-addresses (32 Bit)
  • combination of Net-ID and Host-ID leads to overhead
  • Auto-Configuration
  • DHCP

, Mobile IP , renumbering

  • New Services
  • Security (IPSec)
  • Quality of Service (QoS)
  • Multicast
  • Simplifications for routers
  • no IP check sums
  • no partitioning of IP datagrams

13

13 Montag, 9. Juni 2008

slide-14
SLIDE 14

Peer-to-Peer-Networks Summer 2008 Computer Networks and Telematics Albert-Ludwigs-Universität Freiburg Christian Schindelhauer

IPv6-Header (RFC 2460)

  • Version: 6 = IPv6
  • Traffic Class
  • for QoS
  • Flow Label
  • for QoS or real-time applications
  • Payload Length
  • size of the rest of the datagram
  • Next Header (IPv4: protocol)
  • e.g. ICMP

, IGMP , TCP , EGP , UDP , ...

  • Hop Limit (Time to Live)
  • maximum hops
  • Source Address
  • Destination Address
  • 128 bit IPv6 addresses

0 1 2 3 0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Version| Traffic Class | Flow Label | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Payload Length | Next Header | Hop Limit | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | | + Source Address + | | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | | + Destination Address + | | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

14

14 Montag, 9. Juni 2008

slide-15
SLIDE 15

Peer-to-Peer-Networks Summer 2008 Computer Networks and Telematics Albert-Ludwigs-Universität Freiburg Christian Schindelhauer

Transport Layer

  • TCP (transmission control protocol)
  • generates reliable bidirected byte flow between two hosts
  • Partitions data flow into segments (packets)
  • sends acknowledgments
  • UDP (user datagram protocol)
  • simple unreliable service for transport of single datagrams
  • application layer determines datagram size
  • Transmission by network layer
  • No routes: end to end protocol

15

15 Montag, 9. Juni 2008

slide-16
SLIDE 16

Peer-to-Peer-Networks Summer 2008 Computer Networks and Telematics Albert-Ludwigs-Universität Freiburg Christian Schindelhauer

UDP Header

  • Port Addresses
  • Source Port
  • Destination Port
  • Length of data
  • Checksum for header

16

0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Source Port | Destination Port | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Length | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

16 Montag, 9. Juni 2008

slide-17
SLIDE 17

Peer-to-Peer-Networks Summer 2008 Computer Networks and Telematics Albert-Ludwigs-Universität Freiburg Christian Schindelhauer

TCP-Header

  • Sequence Number
  • number of the first byte in the

segment

  • Acknowledgement Number
  • activated by ACK flag
  • number of the next awaited data

byte

  • = last sequence number + last

segment size

  • Port Addresses
  • Source Port
  • Destination Port
  • resolve service type

0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Source Port | Destination Port | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sequence Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Acknowledgment Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Data | |U|A|P|R|S|F| | | Offset| Reserved |R|C|S|S|Y|I| Window | | | |G|K|H|T|N|N| | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Checksum | Urgent Pointer | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Options | Padding | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

17

17 Montag, 9. Juni 2008

slide-18
SLIDE 18

Peer-to-Peer-Networks Summer 2008 Computer Networks and Telematics Albert-Ludwigs-Universität Freiburg Christian Schindelhauer

TCP Open Connection

  • Client-Server
  • client sends SYN (synchronize)

segment

  • combined with MSS maximum

segment size

  • server answers with
  • SYN segment with
  • piggy packed ACK segment
  • client sends ACK
  • Connection is established

18

18 Montag, 9. Juni 2008

slide-19
SLIDE 19

Peer-to-Peer-Networks Summer 2008 Computer Networks and Telematics Albert-Ludwigs-Universität Freiburg Christian Schindelhauer

TCP Closing Connection

  • Half Close
  • sender announces end with a FIN

segment and waits for acknowledgment

  • opposite direction is still open for

sending

  • Two half close close the TCP

connection

19

19 Montag, 9. Juni 2008

slide-20
SLIDE 20

Peer-to-Peer-Networks Summer 2008 Computer Networks and Telematics Albert-Ludwigs-Universität Freiburg Christian Schindelhauer „Das“ Seq.nr. 154 „ist“ Seq.nr. 157 „es“ Seq.nr. 160 ACK: 162 „World“ Seq.nr. 23 „bla bla“ Seq.nr. 91 ACK: 91+7=98 „Hello!“ Seq.nr. 17 ACK: 17+6=23

Acknowledgments

  • Piggyback
  • ACKs ride on the data segment of

the opposite direction

  • ACKs can acknowledge many

segments

20

20 Montag, 9. Juni 2008

slide-21
SLIDE 21

Peer-to-Peer-Networks Summer 2008 Computer Networks and Telematics Albert-Ludwigs-Universität Freiburg Christian Schindelhauer

Host to Network Layer

  • Interface to local network
  • e.g. Ethnernet or WLAN
  • Transform IP address to MAC (medium access layer)

address

  • ARP (Address Resolution Protocol)
  • RARP (Reverse Address Resolution Protocol)
  • Possibly further partitioning of datagrams into smaller

packets

21

21 Montag, 9. Juni 2008

slide-22
SLIDE 22

Peer-to-Peer-Networks Summer 2008 Computer Networks and Telematics Albert-Ludwigs-Universität Freiburg Christian Schindelhauer

Summary Internet as Underlay

  • IP Network Layer
  • NAT, PAT, DHCP and Firewalls are
  • bstacles to direct peer to peer

connections

  • hosts cannot be addressed

directly

  • IPv6
  • solves the IP address problem
  • back porting of DHCP and

IPsec prevents the growth of IPv6

  • IPsec enables secure direct

connections

  • Transport Layer
  • UDP is unreliable, but fast and

simple

  • TCP is reliable with some overhead
  • own network protocols can be

implemented using UDP

  • yet fairness and efficiency of

TCP connections are at stake

  • Good peer to peer network designs

take the structure of the Internet into account

22

22 Montag, 9. Juni 2008

slide-23
SLIDE 23

Albert-Ludwigs-Universität Freiburg Department of Computer Science Computer Networks and Telematics Christian Schindelhauer Summer 2008

Peer-to-Peer Networks

End of 6th Week

23 Montag, 9. Juni 2008