CSE 4213: Computer Networks II

Slides:



Advertisements
Similar presentations
Network Programming and Java Sockets
Advertisements

Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Application Layer – Lecture.
2: Application Layer 1 Socket programming Socket API r introduced in BSD4.1 UNIX, 1981 r explicitly created, used, released by apps r client/server paradigm.
9/23/2003-9/25/2003 Sockets & DNS September 23-25, 2003.
1 Creating a network app Write programs that  run on different end systems and  communicate over a network.  e.g., Web: Web server software communicates.
2: Application Layer1 Data Communication and Networks Lecture 4  Application Protocols (P2P, DNS)  Java Sockets September 30, 2004.
2: Application Layer P2P applications and Sockets.
2: Application Layer1 Data Communication and Networks Lecture 12 Java Sockets November 30, 2006.
2: Application Layer1 Socket programming Socket API r introduced in BSD4.1 UNIX, 1981 r explicitly created, used, released by apps r client/server paradigm.
1 Overview r Socket programming with TCP r Socket programming with UDP r Building a Web server.
1 Review of Previous Lecture r Electronic Mail r DNS r P2P file sharing.
Internet and Intranet Protocols and Applications Lecture 4: Application Layer 3: Socket Programming February 8, 2005 Arthur Goldberg Computer Science Department.
Networking Overview February 2, /2/2004 Assignments Due – Homework 0 Due – Reading and Warmup questions Work on Homework 1.
2: Application Layer1 Chapter 2 (continued) Application Layer – part 2 Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim.
TCP Socket Programming. r An abstract interface provided to the application programmer  File descriptor, allows apps to read/write to the network r Allows.
TCP Socket Programming CPSC 441 Department of Computer Science University of Calgary.
2: Application Layer1 Socket Programming. 2: Application Layer2 Socket-programming using TCP Socket: a door between application process and end- end-transport.
1 Network Layers Application Transport Network Data-Link Physical bits.
Protocols Rules for communicating between two entities (e.g., a client and a server) “A protocol definition specifies how distributed system elements interact.
Welcome to CIS 235 Computer Networks Fall, 2007 Prof Peterson.
2: Application Layer 1 Socket Programming Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross Addison-Wesley,
CPSC 441: DNS1 Instructor: Anirban Mahanti Office: ICT Class Location: ICT 121 Lectures: MWF 12:00 – 12:50 Notes derived.
P2P File Sharing Systems
2: Application Layer 1 Socket Programming TCP and UDP.
JAVA Socket Programming Source: by Joonbok Lee, KAIST, 2003.
Socket programming in C. Socket programming Socket API introduced in BSD4.1 UNIX, 1981 explicitly created, used, released by apps client/server paradigm.
1 1 Socket programming Socket API r introduced in BSD4.1 UNIX, 1981 r explicitly created, used, released by apps r client/server paradigm r two types of.
2: Application Layer1 Chapter 2 Application Layer Computer Networking: A Top Down Approach Featuring the Internet, 2 nd edition. Jim Kurose, Keith Ross.
2: Application Layer1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail  SMTP,
2: Application Layer1 Socket programming Socket API r introduced in BSD4.1 UNIX, 1981 r explicitly created, used, released by apps r client/server paradigm.
CS 3830 Day 11 Introduction : Application Layer 2 Server-client vs. P2P: example Client upload rate = u, F/u = 1 hour, u s = 10u, d min ≥ u s.
1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services.
18-1 Last time □ Fast retransmit ♦ 3 duplicate ACKs □ Flow control ♦ Receiver windows □ Connection management ♦ SYN/SYNACK/ACK, FIN/ACK, TCP states □ Congestion.
Chapter 2 Application Layer Computer Networking: A Top Down Approach, 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April A note on the use.
Winter 2002Suprakash Datta1 Socket programming Socket API introduced in BSD4.1 UNIX, 1981 explicitly created, used, released by apps client/server paradigm.
-1- Georgia State UniversitySensorweb Research Laboratory CSC4220/6220 Computer Networks Dr. WenZhan Song Associate Professor, Computer Science.
Socket Programming Lee, Sooyong
Network Programming and Sockets CPSC 363 Computer Networks Ellen Walker Hiram College (Includes figures from Computer Networking by Kurose & Ross, © Addison.
Socket Programming Tutorial. Socket programming Socket API introduced in BSD4.1 UNIX, 1981 explicitly created, used, released by apps client/server paradigm.
2: Application Layer1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
2: Application Layer1 Chapter 2: Application layer r 2.1 Principles of network applications  app architectures  app requirements r 2.2 Web and HTTP r.
Java Socket programming. Socket programming with TCP.
2: Application Layer1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail  SMTP,
2: Application Layer1 Socket programming Socket API Explicitly created, used, released by apps Client/server paradigm Two types of transport service via.
1 CSCD 330 Network Programming Spring 2014 Some Material in these slides from J.F Kurose and K.W. Ross All material copyright Lecture 7 Application.
Chapter 2 Application Layer Application 2-1. Chapter 2: Application layer 2.1 Principles of network applications 2.2 Web and HTTP 2.3 FTP 2.4 Electronic.
1 Socket programming Socket API r introduced in BSD4.1 UNIX, 1981 r explicitly created, used, released by apps r client/server paradigm r two types of.
1 COMP 431 Internet Services & Protocols Client/Server Computing & Socket Programming Jasleen Kaur February 2, 2016.
Socket programming in C. Socket programming Socket API introduced in BSD4.1 UNIX, 1981 explicitly created, used, released by apps client/server paradigm.
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 11 Omar Meqdadi Department of Computer Science and Software Engineering University.
1 All rights reserved to Chun-Chuan Yang Upon completion you will be able to: The OSI Model and the TCP/IP Protocol Suite Understand the architecture of.
05 - P2P applications and Sockets
Socket Programming Socket Programming Overview
DNS: Domain Name System
EECS 3214: Computer Networks Protocols and Applications
Socket programming with TCP
Chapter 2 Application Layer
CSCD 330 Network Programming
DMET 602: Networks and Media Lab
Chapter 2: outline 2.1 principles of network applications
Socket programming - Java
Socket Programming Socket Programming Overview
Socket Programming.
Socket Programming 2: Application Layer.
DNS: Domain Name System
DNS: Domain Name System
COSC 4213: Computer Networks II
DNS: Domain Name System
Presentation transcript:

CSE 4213: Computer Networks II Suprakash Datta datta@cs.yorku.ca Office: CSEB 3043 Phone: 416-736-2100 ext 77875 Course page: http://www.cs.yorku.ca/course/4213 These slides are adapted from Jim Kurose’s slides. 11/13/2018 COSC 4213 - S.Datta

Today Finish DNS Look at P2P systems 11/13/2018 COSC 4213 - S.Datta

RR format: (name, value, type, ttl) DNS records DNS: distributed db storing resource records (RR) RR format: (name, value, type, ttl) Type=A name is hostname value is IP address Type=CNAME name is alias name for some “cannonical” (the real) name www.ibm.com is really servereast.backup2.ibm.com value is cannonical name Type=NS name is domain (e.g. foo.com) value is IP address of authoritative name server for this domain Type=MX value is name of mailserver associated with name 11/13/2018 COSC 4213 - S.Datta

DNS protocol, messages Name, type fields for a query RRs in reponse to query records for authoritative servers additional “helpful” info that may be used 11/13/2018 COSC 4213 - S.Datta

Inserting records into DNS Example: just created startup “Network Utopia” Register name networkuptopia.com at a registrar (e.g., Network Solutions) Need to provide registrar with names and IP addresses of your authoritative name server (primary and secondary) Registrar inserts two RRs into the com TLD server: (networkutopia.com, dns1.networkutopia.com, NS) (dns1.networkutopia.com, 212.212.212.1, A) Put in authoritative server Type A record for www.networkuptopia.com and Type MX record for networkutopia.com How do people get the IP address of your Web site? 11/13/2018 COSC 4213 - S.Datta

Alice runs P2P client application on her notebook computer P2P file sharing Example Alice runs P2P client application on her notebook computer Intermittently connects to Internet; gets new IP address for each connection Asks for “Hey Jude” Application displays other peers that have copy of Hey Jude. Alice chooses one of the peers, Bob. File is copied from Bob’s PC to Alice’s notebook: HTTP While Alice downloads, other users uploading from Alice. Alice’s peer is both a Web client and a transient Web server. All peers are servers = highly scalable! 11/13/2018 COSC 4213 - S.Datta

P2P: centralized directory directory server peers Alice Bob 1 2 3 original “Napster” design 1) when peer connects, it informs central server: IP address content 2) Alice queries for “Hey Jude” 3) Alice requests file from Bob 11/13/2018 COSC 4213 - S.Datta

P2P: problems with centralized directory Single point of failure Performance bottleneck Copyright infringement file transfer is decentralized, but locating content is highly decentralized 11/13/2018 COSC 4213 - S.Datta

Query flooding: Gnutella fully distributed no central server public domain protocol many Gnutella clients implementing protocol overlay network: graph edge between peer X and Y if there’s a TCP connection all active peers and edges is overlay net Edge is not a physical link Given peer will typically be connected with < 10 overlay neighbors 11/13/2018 COSC 4213 - S.Datta

Query message sent over existing TCP connections Gnutella: protocol File transfer: HTTP Query message sent over existing TCP connections peers forward Query message QueryHit sent over reverse path Query QueryHit Scalability: limited scope flooding 11/13/2018 COSC 4213 - S.Datta

Gnutella: Peer joining Joining peer X must find some other peer in Gnutella network: use list of candidate peers X sequentially attempts to make TCP with peers on list until connection setup with Y X sends Ping message to Y; Y forwards Ping message. All peers receiving Ping message respond with Pong message X receives many Pong messages. It can then setup additional TCP connections Peer leaving? 11/13/2018 COSC 4213 - S.Datta

Exploiting heterogeneity: KaZaA Each peer is either a group leader or assigned to a group leader. TCP connection between peer and its group leader. TCP connections between some pairs of group leaders. Group leader tracks the content in all its children. 11/13/2018 COSC 4213 - S.Datta

Each file has a hash and a descriptor KaZaA: Querying Each file has a hash and a descriptor Client sends keyword query to its group leader Group leader responds with matches: For each match: metadata, hash, IP address If group leader forwards query to other group leaders, they respond with matches Client then selects files for downloading HTTP requests using hash as identifier sent to peers holding desired file 11/13/2018 COSC 4213 - S.Datta

Limitations on simultaneous uploads Request queuing Kazaa tricks Limitations on simultaneous uploads Request queuing Incentive priorities Parallel downloading 11/13/2018 COSC 4213 - S.Datta

File sharing – Napster, Gnutella, Kazaa…. P2P services File sharing – Napster, Gnutella, Kazaa…. Communication – Instant messaging, VoIP (Skype) Computation seti@home DHTs – Chord, CAN, Pastry, Tapestry…. Applications built on emerging overlays Planetlab P2P file systems – Past, Farsite Wireless Ad-hoc Networking? 11/13/2018 COSC 4213 - S.Datta

Edges are TCP connections or pointer to an IP address Overlay graphs Edges are TCP connections or pointer to an IP address Edges maintained by periodic “are you alive” messages. Typically new edge established when a neighbor goes down New nodes BOOTSTRAP Structured vs Unstructured 11/13/2018 COSC 4213 - S.Datta

Edges arranged in a preplanned manner. Structured overlays Edges arranged in a preplanned manner. DNS is an example of a structured overlay (but not P2P) Mostly still in the research stage – so has not made it to the textbook! 11/13/2018 COSC 4213 - S.Datta

Challenge: locating content Gnutella-type search – expensive, no guarantee, need many cached copies for technique to work well. Directed search – assign particular nodes to hold particular content (or pointers to it). - Problems: Distributed Handling join/leave 11/13/2018 COSC 4213 - S.Datta

Distributed hash tables Introduce a hash function to map objects to identifiers. E.g. h(“Britney Spears”) = 111 Distribute the range of the hash function among all nodes Each node must “know about” at least one copy of each object that hashes within its range (when one exists) 11/13/2018 COSC 4213 - S.Datta

Switch to the tutorial by Prof. Ross. Now… Switch to the tutorial by Prof. Ross. We will only cover a small portion on DHTs in this lecture 11/13/2018 COSC 4213 - S.Datta

Community/Network issues Polluted files Flash crowds Freeloading Major problems User issues Security Viruses Community/Network issues Polluted files Flash crowds Freeloading 11/13/2018 COSC 4213 - S.Datta

Copyright infringement issues: direct vs indirect. Thought questions Is success due to massive number of servers or simply because content is free? Copyright infringement issues: direct vs indirect. 11/13/2018 COSC 4213 - S.Datta

A very brief description of socket programming Next: A very brief description of socket programming 11/13/2018 COSC 4213 - S.Datta

explicitly created, used, released by apps client/server paradigm Socket programming Goal: learn how to build client/server application that communicate using sockets Socket API introduced in BSD4.1 UNIX, 1981 explicitly created, used, released by apps client/server paradigm two types of transport service via socket API: unreliable datagram reliable, byte stream-oriented a host-local, application-created, OS-controlled interface (a “door”) into which application process can both send and receive messages to/from another application process socket 11/13/2018 COSC 4213 - S.Datta

Socket-programming using TCP Socket: a door between application process and end-end-transport protocol (UCP or TCP) TCP service: reliable transfer of bytes from one process to another controlled by application developer controlled by application developer process TCP with buffers, variables socket process TCP with buffers, variables socket controlled by operating system controlled by operating system internet host or server host or server 11/13/2018 COSC 4213 - S.Datta

Socket programming with TCP Client must contact server server process must first be running server must have created socket (door) that welcomes client’s contact Client contacts server by: creating client-local TCP socket specifying IP address, port number of server process When client creates socket: client TCP establishes connection to server TCP When contacted by client, server TCP creates new socket for server process to communicate with client allows server to talk with multiple clients source port numbers used to distinguish clients (more in Chap 3) TCP provides reliable, in-order transfer of bytes (“pipe”) between client and server application viewpoint 11/13/2018 COSC 4213 - S.Datta

Stream jargon A stream is a sequence of characters that flow into or out of a process. An input stream is attached to some input source for the process, eg, keyboard or socket. An output stream is attached to an output source, eg, monitor or socket. 11/13/2018 COSC 4213 - S.Datta

Socket programming with TCP Example client-server app: 1) client reads line from standard input (inFromUser stream) , sends to server via socket (outToServer stream) 2) server reads line from socket 3) server converts line to uppercase, sends back to client 4) client reads, prints modified line from socket (inFromServer stream) Client process client TCP socket 11/13/2018 COSC 4213 - S.Datta

Client/server socket interaction: TCP Server (running on hostid) Client create socket, port=x, for incoming request: welcomeSocket = ServerSocket() TCP connection setup close connectionSocket read reply from clientSocket create socket, connect to hostid, port=x clientSocket = Socket() wait for incoming connection request connectionSocket = welcomeSocket.accept() send request using clientSocket read request from connectionSocket write reply to 11/13/2018 COSC 4213 - S.Datta

Example: Java client (TCP) import java.io.*; import java.net.*; class TCPClient { public static void main(String argv[]) throws Exception { String sentence; String modifiedSentence; BufferedReader inFromUser = new BufferedReader(new InputStreamReader(System.in)); Socket clientSocket = new Socket("hostname", 6789); DataOutputStream outToServer = new DataOutputStream(clientSocket.getOutputStream()); Create input stream Create client socket, connect to server Create output stream attached to socket 11/13/2018 COSC 4213 - S.Datta

Example: Java client (TCP), cont. Create input stream attached to socket BufferedReader inFromServer = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); sentence = inFromUser.readLine(); outToServer.writeBytes(sentence + '\n'); modifiedSentence = inFromServer.readLine(); System.out.println("FROM SERVER: " + modifiedSentence); clientSocket.close(); } Send line to server Read line from server 11/13/2018 COSC 4213 - S.Datta

Example: Java server (TCP) import java.io.*; import java.net.*; class TCPServer { public static void main(String argv[]) throws Exception { String clientSentence; String capitalizedSentence; ServerSocket welcomeSocket = new ServerSocket(6789); while(true) { Socket connectionSocket = welcomeSocket.accept(); BufferedReader inFromClient = new BufferedReader(new InputStreamReader(connectionSocket.getInputStream())); Create welcoming socket at port 6789 Wait, on welcoming socket for contact by client Create input stream, attached to socket 11/13/2018 COSC 4213 - S.Datta

Example: Java server (TCP), cont DataOutputStream outToClient = new DataOutputStream(connectionSocket.getOutputStream()); clientSentence = inFromClient.readLine(); capitalizedSentence = clientSentence.toUpperCase() + '\n'; outToClient.writeBytes(capitalizedSentence); } Create output stream, attached to socket Read in line from socket Write out line to socket End of while loop, loop back and wait for another client connection 11/13/2018 COSC 4213 - S.Datta

Our study of network apps now complete! Chapter 2: Summary Our study of network apps now complete! Application architectures client-server P2P hybrid application service requirements: reliability, bandwidth, delay Internet transport service model connection-oriented, reliable: TCP unreliable, datagrams: UDP specific protocols: HTTP FTP SMTP, POP, IMAP DNS 11/13/2018 COSC 4213 - S.Datta

Most importantly: learned about protocols Chapter 2: Summary Most importantly: learned about protocols typical request/reply message exchange: client requests info or service server responds with data, status code message formats: headers: fields giving info about data data: info being communicated control vs. data msgs in-band, out-of-band centralized vs. decentralized stateless vs. stateful reliable vs. unreliable msg transfer “complexity at network edge” 11/13/2018 COSC 4213 - S.Datta