Download presentation
Presentation is loading. Please wait.
Published byElfreda Nichols Modified over 8 years ago
1
Chapter 2 Application Layer Computer Networking: A Top Down Approach, 4 th edition. Jim Kurose, Keith Ross Addison-Wesley, July 2007.
2
Last Lecture DNS
3
Today’s Lecture P2P architecture Centralized Index Decentralized Index Query Flooding Limited Query Flooding Hierarchical Overlay Chapter 3 Transport Layer
4
Pure P2P Architecture r no always-on server r Arbitrary end systems directly communicate r Peers are intermittently connected and change IP addresses r “P2P is a class of applications that takes advantage of resources e.g. storage, content, human presence, available at the edges of the Internet” Source: OpenP2P.com, Clay Shirky peer-peer
5
Examples of P2P Technologies File sharing Programs: Gnutella,Napster,LimeWire, Kazaa etc. Instant messaging: ICQ, Jabber etc Conferencing Netmeeting, Voice over IP (VoIP) etc
6
P2P File Sharing r Alice runs P2P client application on her notebook computer r Intermittently connects to Internet; gets new IP address for each connection r Registers her content in P2P system Asks for some music file Application displays other peers that have copy of that file. Alice chooses one of the peers, Bob. File is copied from Bob’s PC to Alice’s notebook: P2P While Alice downloads, other users uploading from Alice. How a peer determines which peers have the desired content Three approaches for organizing and searching for contents Different approaches are used by different P2P file sharing systems.
7
P2P: Centralized Index original “Napster” design When peer connects, it informs central server: IP address Content that it is making available r Central Server collects info from peers that becomes active r Creates a centralized dynamic database that maps each object name to a set of IP addresses r Hybrid of P2P and client-server File distribution is P2P Search is client-server centralized directory server peers Alice Bob 1 1 1 1 2 3
8
www.napster.com Main Server File List: UserC song.mp3 UserD another.mp3 ….. User A 2. User A searches for song.mp3 User C (Song.mp3) 1. Construct Database Users connect to Napster Server Server builds up a list of available songs and locations User D (Another.mp3) User B … 3. Server searches database. Finds song on User C’s machine 4. Server informs User A of the location of song.mp3 5. User A connects to User C and downloads song.mp3 File Sharing with Napster
9
P2P: Problems with Centralized Directory r Single Point of Failure If directory server crashes, the entire P2P application crashes. r Performance Bottleneck Thousands of connected users Server must maintain a huge database and must respond to thousands of queries per second r Copyright Infringement Easy to obtain copyrighted material for free Heavy metal rock group Metallica sued Napster for copyright infringement in April 2000. file transfer is decentralized, but locating content is highly centralized
10
Decentralized Directory Query Flooding r Directory/Index is fully distributed over the community of peers No central server r Used by Gnutella r Each peer indexes the files it makes available for sharing (and no other files) Overlay Network: r Peers form an abstract, logical network called an overlay network r Edge between peer X and Y if there’s a TCP connection r All active peers and edges form overlay network r edge: virtual (not physical) link r Overlay network may have thousands of participating peers but Given peer typically connected with < 10 overlay neighbors
11
Query Flooding Query Query Hit Query QueryHit Query Query Hit File transfer r Query message sent over existing TCP connections r Peers forward Query message r Query-Hit message sent over reverse path Non-scalable Significant amount of traffic among the peers in the underlying network connecting the peers
12
Limited Query Flooding r A peer-count field in the message is set to specific limit (say, 7). r Each time the query message reaches a new peer, the peer decrements the peer-count field before forwarding the query to its overlay neighbor. r Stops forwarding the query when peer-count field set to zero r Flooding is localized to a region of the overlay network r Reduces the query traffic r Peer seeking the content may not be able to locate that content.
13
Gnutella: Peer Joining 1. Joining peer X must find another peer in the overlay network Maintain a list of peers (IP addresses ) that are often up in the overlay network Peer X can also contact a tracker site that maintains such a list 2. Peer X sequentially attempts TCP connections with candidate peers until connection setup with some peer Y. 3. Peer X sends Ping message to Peer Y that forwards this message to his overlay neighbors (who then forward to their neighbors….) 4. Peer Z on receiving Ping message respond to Peer X with Pong message (IP address) 5. Peer X receives many Pong messages, and can then setup additional TCP connections Creating multiple edges from itself into the overlay network
14
Hierarchical Overlay r Between centralized index and query flooding approaches r No dedicated server for indexing files r Super Peers: Peers with high bandwidth connections into internet and high availability. Ordinary peer is assigned as a child to super peer. r A new peer Establishes a TCP connection with one of super peers Informs all the files it is sharing r Super peer maintains an index of IP addresses of children holding different files. r Significant more peers can be checked for a match without creating an excessive quantity of query traffic
15
Home Assignment r What are structured P2P systems? How are they different from unstructured P2P? r What is a Distributed Hash table? How does it work? r CHORD, PASTRY? r Bit Torrent Protocol? r Anti-Snubbing, Pipelining, Endgame mode, Peer Churn? r http://torrentfreak.com/mininova-deletes-all- infringing-torrents-and-goes-legal-091126/ r http://www.brighthub.com/computing/smb- security/articles/48875.aspx
16
Chapter 3: Transport Layer Our goals: r Understand principles behind transport layer services: m Multiplexing/De-multiplexing m Reliable data transfer m Congestion control m Flow Control r Learn about transport layer protocols in the Internet: m UDP: connectionless transport m TCP: connection-oriented transport m TCP congestion control m TCP Flow Control m Datagram Congestion Control Protocol (DCCP)
17
Transport Services and Protocols r Transport layer protocol provide logical communication between app processes running on different hosts m From application’s perspective as if the host running the process are directly connected r Transport protocols run in end systems m Not in routers m Sender side: Breaks app messages into segments, passes to network layer m Receiver side: Reassembles segments into messages, passes to application layer r More than one transport protocol available to applications m Internet: TCP and UDP application transport network data link physical application transport network data link physical logical end-end transport
18
Transport vs. Network layer r Network layer: logical communication between hosts r Transport layer: logical communication between processes Household Analogy: r 12 kids sending letters to 12 kids r processes = kids r app messages = letters in envelopes r hosts = houses r transport protocol = Ann and Bill r network-layer protocol = postal service r Transport layer relies on Network layer
19
Internet Transport Layer Protocols r Internet Protocol (IP) Best effort delivery service No guarantees for segment delivery No guarantees for orderly delivery of data IP is unreliable service Extending Host-to-Host delivery to process-to-process delivery. Transport layer Multiplexing and De-multiplexing r UDP and TCP also provide integrity checking by including error detection field in their segment headers. UDP services Process to process data delivery Error checking TCP Reliable data Transfer Congestion Control, sequence numbers, acknowledgements and timers
20
Multiplexing/De-Multiplexing Every process has a socket which allows Data to pass from the network to the process Data to pass from the process to the network Receiving host directs an incoming transport layer segment to appropriate socket. Uses set of fields in the transport layer segments Delivering data in the transport layer segment to the correct socket is called de-multiplexing. Gathering data chunks at the source host from different sockets,appending header information and passing to the network layer is called multiplexing Household analogy
21
Multiplexing/De-multiplexing application transport network link physical P1 application transport network link physical application transport network link physical P2 P3 P4 P1 host 1 host 2 host 3 = process= socket delivering received segments to correct socket Demultiplexing at rcv host: gathering data from multiple sockets, enveloping data with header (later used for demultiplexing) Multiplexing at send host:
22
How De-multiplexing works r Sockets have unique identifier r Each segment has special field that indicate the socket to which the segment is to be delivered Source port number Destination port number Port is a 16 bit number 0 to 65535 0 to 1023 are well known port numbers and are reserved Source Port #Dest Port # 32 bits Application Data (message) Other Header Fields Transport Layer Segment Format
23
Connectionless Transport:UDP r Internet transport protocol RFC 768 r UDP does just about as little as a transport layer protocol can do r Multiplexing/De-multiplexing r Error checking r “Best Effort” service, UDP segments may be: lost delivered out of order to applications r Connectionless: No handshaking between UDP sender, receiver Each UDP segment handled independently of others
24
Connectionless Transport:UDP Why is there a UDP? r No connection establishment TCP uses a three way handshake UDP has no delay to establish a connection DNS uses UDP r No connection state at sender, receiver TCP maintains connection state Congestion control parameters, sequence numbers etc. UDP maintains no connection state Server can support many more active clients with UDP than over TCP r Small segment header 20 bytes of header in TCP Only 8 bytes of header in UDP r No congestion control UDP can blast away as fast as desired
25
UDP: Segment Structure r The application data occupies the data field of the UDP segment. r UDP header has four fields Each of two bytes r Checksum Used by receiving host to check for errors in the segment r Length Length of the UDP segment source port # dest port # 32 bits Application data (message) UDP segment format length checksum Length, in bytes of UDP segment, including header
26
Connectionless (UDP) De-multiplexing Client IP:B P2 client IP: A P1 P3 server IP: C SP: 6428 DP: 9157 SP: 9157 DP: 6428 SP: 6428 DP: 5775 SP: 5775 DP: 6428 SP provides “return address”
27
UDP Checksum Sender: r Treat segment contents as sequence of 16-bit word r Checksum: 1’s complement of the sum of all the 16- bit words. r Sender puts checksum value into UDP checksum field Receiver: r All segments are added and than sum is added with sender's checksum. r If no errors are introduced into the packet, then clearly the sum at the receiver will be all 1’s. r If receiver side checksum contains any 0 then, error is detected and the packet is discarded. Checksum is used to determine whether bits within the UDP segment have been altered e.g. noise in the link.
28
Checksum Example (16 bits segment) 0110011001100110 0101010101010101 0000111100001111 The sum of first of these 16-bits integer is: 0110011001100110 0101010101010101 1011101110111011 Adding the third one to the above sum gives 1011101110111011 0000111100001111 1100101011001010 (sum of all segments) The checksum at sender side is : 0011010100110101 (1’s complement). Now at the receiver side, again all segments are added and sum is added with sender's checksum. r If no error than check of receiver would be : 1111111111111111
29
Checksum Example r Note m When adding numbers, a carryout from the most significant bit needs to be added to the result r Example: Add two 16-bit words 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1 wraparound sum checksum
30
UDP Lite? Home Assignment
31
Thank You
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.