Distributed Computing Systems Project 3 – Nutella a P2P Streaming Movie System Due: Sunday, February 14 th.

Slides:



Advertisements
Similar presentations
Socket Programming 101 Vivek Ramachandran.
Advertisements

Introduction to Sockets Jan Why do we need sockets? Provides an abstraction for interprocess communication.
Programming with UDP – I Covered Subjects: IPv4 Socket Address Structure Byte Ordering Functions Address Access/Conversion Functions Functions: 1.socket()
Programming with TCP – I
Elementary TCP Sockets© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer.
Socket Programming Application Programming Interface.
Multicasting - Part II© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer.
Sockets CS 3516 – Computer Networks. Outline Socket basics Socket details (TCP and UDP) Socket options Final notes.
Distributed Computing Systems Sockets. Outline Socket basics Socket details (TCP and UDP) Socket options Final notes.
UDP and Multi-thread Socket Programming
MULTICAST USING UDP SOCKETS. PRELIMINARIES *CAST Unicast Communication is strictly from one sender to another specified receiver eg: TCP on LAN Broadcast.
Networks: TCP/IP Socket Calls1 Elementary TCP Sockets Chapter 4 UNIX Network Programming Vol. 1, Second Ed. Stevens.
Computer Networks Sockets.
Elementary TCP Sockets Chapter 4 UNIX Network Programming Vol. 1, Second Ed. Stevens.
Socket Programming.
Multimedia Networking Sockets. Outline Socket basics Socket details (TCP and UDP) Socket options Final notes.
Sockets Basics Conectionless Protocol. Today IPC Sockets Basic functions Handed code Q & A.
Sockets IMGD Outline Socket basics Socket details (TCP and UDP) Socket options Final notes.
Tutorial 8 Socket Programming
CSE/EE 461 Getting Started with Networking. Basic Concepts  A PROCESS is an executing program somewhere.  Eg, “./a.out”  A MESSAGE contains information.
Client Server Model The client machine (or the client process) makes the request for some resource or service, and the server machine (the server process)
Computer Networks Sockets. Outline F Socket basics F Socket details.
UNIX Sockets COS 461 Precept 1. Clients and Servers Client program – Running on end host – Requests service – E.g., Web browser Server program – Running.
UNIX Sockets COS 461 Precept 1.
Elementary UDP Sockets© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer.
1 Introduction to Raw Sockets 2 IP address Port address MAC address TCP/IP Stack 67 Bootp DHCP OSPF protocol frame type UDP Port # TCP Port.
ECE 4110 – Internetwork Programming Client-Server Model.
Elementary TCP Sockets
University of Calgary – CPSC 441.  UDP stands for User Datagram Protocol.  A protocol for the Transport Layer in the protocol Stack.  Alternative to.
Chapter 17 Networking Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William Stallings.
Server Sockets: A server socket listens on a given port Many different clients may be connecting to that port Ideally, you would like a separate file descriptor.
CS162B: IPv4 Socketing Jacob T. Chan. Socketing in the Real World  Most computer games are multiplayer in nature or have multiplayer components  DotA,
Review: How to create a TCP end point? What is the right format for sin_port and sin_addr in the sockaddr_in data structure? How many different ways we.
Chapter 2 Applications and Layered Architectures Sockets.
Distributed Computing Systems Project 3 – Nutella: A P2P Streaming Movie System Due: Tuesday, April 15 th.
Ports Port - A 16-bit number that identifies the application process that receives an incoming message. Reserved ports or well-known ports (0 to 1023)
Remote Shell CS230 Project #4 Assigned : Due date :
Networking Tutorial Special Interest Group for Software Engineering Luke Rajlich.
Advanced Sockets API-II Vinayak Jagtap
CPSC 441 TUTORIAL – FEB 13, 2012 TA: RUITNG ZHOU UDP REVIEW.
1 Computer Networks An Introduction to Computer Networks University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani Lecture 3: Sockets.
Distributed Computing A Programmer’s Perspective.
CSCE 515: Computer Network Programming UDP Socket Wenyuan Xu Department of Computer Science and Engineering.
UNIX Sockets COS 461 Precept 1. Socket and Process Communication The interface that the OS provides to its networking subsystem application layer transport.
CSE/EE 461 Getting Started with Networking. 2 Basic Concepts A PROCESS is an executing program somewhere. –Eg, “./a.out” A MESSAGE contains information.
Programming with UDP – II Covered Subjects: Creating UDP sockets Client Server Sending data Receiving data Connected mode.
CSCI 330 UNIX and Network Programming Unit XV: Transmission Control Protocol.
Today’s topic: UDP Reliable communication over UDP.
S OCKET P ROGRAMMING IN C Professor: Dr. Shu-Ching Chen TA: HsinYu Ha.
Review: –Concurrent server and multiplexed server How they work? Which one is better?
CMPT 471 Networking II Network Programming © Janice Regan,
CSCI 330 UNIX and Network Programming Unit XIV: User Datagram Protocol.
Socket Programming. Computer Science, FSU2 Interprocess Communication Within a single system – Pipes, FIFOs – Message Queues – Semaphores, Shared Memory.
1 Spring Semester 2008, Dept. of Computer Science, Technion Internet Networking recitation #7 Socket Programming.
Lecture 3 TCP and UDP Sockets CPE 401 / 601 Computer Network Systems slides are modified from Dave Hollinger.
1 K. Salah Application Layer Module K. Salah Network layer duties.
Sockets Intro to Network Programming. Before the internet... Early computers were entirely isolated No Internet No network No model No external communications.
1 UDP Sockets Programming Creating UDP sockets.Creating UDP sockets. –Client –Server Sending data.Sending data. Receiving data.Receiving data. Connected.
SOCKET PROGRAMMING Presented By : Divya Sharma.
Sockets and Beginning Network Programming
UNIX Sockets COS 461 Precept 1.
Elementary UDP Sockets
CHAPTER 8 ELEMENTARY UDP SOCKETS
Network Programming CSC- 341
UNIX Sockets Outline Homework #1 posted by end of day
UDP Sockets Programming
Chapter 07. Socket Options.
Chapter 06. UDP Server/Client.
Internet Networking recitation #8
Socket Programming with UDP
Presentation transcript:

Distributed Computing Systems Project 3 – Nutella a P2P Streaming Movie System Due: Sunday, February 14 th

Overview of Nutella Instead of movie from server – ala YouTube Obtain movie from other peers, other users participating in system – Ala BitTorrent Provides for de-centralized search – Ala Gnutella – Multicast queries Stream (unicast) directly from participating peer

Nutella Videos Text-based frames Stored in single file – Delimiter between frames (e.g., “end”) One to ten frames per second (See samples) Taking a Walk 0 | Taking a Walk 0 | / \ Taking a Walk 0 |

Basic Nutella Player from File Open file While file not empty 1.Read everything until “end”, writing to stdout 2.Discard “end” 3.Pause appropriate amount (e.g., nanosleep() ) 4.Clear screen (see clear.c ) clear.c 5.Repeat from step 1 Close file

Only ASCII? Check out Star Wars ____ `. / /,-.-. \ (/# /__`-'_| || || ) ||# []/()] O || || | __` '__ |--| |<=={_______}=|| |--| | | | || | | | | |={_______}==>|| | | | | | |: _ :| || | | > _| |___|:===:| || |__< :| | __| |: - :| || | |: :| | ==| |: _ :| || | |: :| | ==|_|:===:|___||_| |: :| |___|_|:___:|___||_| |: :| ||| ||/_\|| ||| -| |: ;I_|||[]_||\_/|| ||| -|_I; |_ |__________________| _| | `\\\___|____|____/_//' | J : | \____/ | : L _|_: | |__| | :_|_ -/ _-_.' -/ \- `.-_- \- /______\ /______\ /______\

“HD” ASCII Videos (About 200x60 “pixels”) See also ASCIImeo: (these are not hand-created)

Searching Looking Get query (i.e., movie name) from user Multicast query to well-known address Listen for peer response – Will provide IP and port for contact If no response, assume no movie If response, contact remote peer and request movie Once movie done or query fails, repeat Listening Listen on well-known address If query matches local movie, send IP and port If request comes to IP and port, stream movie

Streaming Local client contacts Nutella peer and requests movie – Check that have requested movie Nutella peer sends each movie frame – UDP (why?) – Pause between frames sleep(), usleep(), nanosleep(), setitimer() Local client receives each movie frame Play frame as it arrives

Streaming Initiating video request Send unicast request for movie to IP and port – Option to play once or repeat Receive frames on socket Play each frame as it arrives Note: should be able to play video and serve video Providing video Listen for movie request at unicast IP address and port Parse request for movie name Stream movie to IP and port of client – One frame at a time Repeat movie once done (if desired) Note: only needs to stream 1 video at time

Example SERVER PEER CLIENT PEER Server started. Client started. Listening... Enter movie name: Thor Sending search request Waiting for response... Received search request for "Thor" Movie not here, so no response Listening... Timeout, movie not found Enter movie name: Walk Sending search request Received search request "Walk“ Movie here Sending IP , port 7832 Listening... Received IP and port from server Sending request to stream... Connection request received. Streaming movie "Walk" to client... O Movie done. Sending done message. | Listening... / \... Received done message. Enter movie name:

IP Multicast - Raw Just like UDP client-server (see Socket slide deck or next two slides)  But special addresses Server – Send to to addr.sin_addr.s_addr = inet_addr( ); – Port Receiver struct ip_mreq mreq; mreq.imr_multiaddr.s_addr = inet_addr( ); mreq.imr_interface.s_addr = htonl(INADDR_ANY); setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq));

UDP Client-Server socket() bind() recvfrom() Server socket() sendto() recvfrom() Client (Block until receive datagram) sendto() Data (request) Data (reply) close() “well-known” port Versus TCP Client-Server -No “handshake” -No simultaneous close

Sending and Receiving int recvfrom(int sockfd, void *buff, size_t mbytes, int flags, struct sockaddr *from, socklen_t *addrlen); int sendto(int sockfd, void *buff, size_t mbytes, int flags, const struct sockaddr *to, socklen_t addrlen); Same as recv() and send() but for addr – recvfrom fills in address of where packet came from – sendto requires address of where sending packet to

IP Multicast - Middleware /* msockcreate -- Create socket from which to read. return socket descriptor if ok, -1 if not ok. */ int msockcreate(int type, char *address, int port); /* msockdestroy -- Destroy socket by closing. return socket descriptor if ok, -1 if not ok. */ int msockdestroy(int sock); /* msend -- Send multicast message to given address. return number of bytes sent, -1 if error. */ int msend(int sock, char *message, int len); /* mrecv -- Receive message on given mcast address. Will block. return bytes received, -1 if error. */ int mrecv(int sock, char *message, int max_len); (See msock.tar )

IP Multicast – Be Careful! Debug twice, run once From: "Charles R. Anderson" To: Cc: Subject: cs.wpi.edu flooding network cs.wpi.edu is flooding the network with multicast traffic, causing network outages in Fuller Labs. I have disabled the port. -- Charles R. Network Engineer(508) Computing and Communications CenterX2220 on-campus Worcester Polytechnic Institute Fax (508)

Experiments Network data rates of working system – All users query (find), watch, repeat Based on – Query size and rate – Movie rate – State assumptions! Compute number of users typical LAN Repeat for actual movies (non-text based) Writeup – Design – how determine data rates (Nutella and otherwise) – Results and analysis – show computations, present results (table or graph) As appropriate, provide references!

Hand In Include all source code (headers, project/Makefiles, etc.) Include movies that work with your system README.txt with directions Experiment document Clean and zip up Turn in online

Grading Guidelines 15%Client peer movie search. 15%Server peer response to search. 10%Server peer movie parsing. 20%Server peer streaming. 20%Client peer movie playing. 5% Movie looping (request another or repeat). 5%Overall socket communication, multicast. 7%Experiment report 3%Documentation to run, Makefile, etc.

Grading Rubric The streaming system meets all specified requirements. Nutella p2p streaming fully implemented, with clients able to query movie, server processes responding, clients playing and the system being robust overall. Proper use of multicast and socket communication. All documentation included. Experiment report is clear, complete and includes all needed information The streaming system meets most specified requirements. Nutella p2p streaming implemented, with queries, response and movie playing, but occasional bugs and/or documentation is missing. Experiment report is complete and includes all needed information The streaming system meets some specified requirements. Nutella p2p streaming framework setup, but query or response not fully functioning and playout of movie may not commence properly. Occasional bugs, but system still compiles and runs. Documentation may be missing. Experiment report is incomplete and/or is missing some needed information The streaming system fails to meet many specified requirements. Nutella p2p streaming not functional. Server and client pieces compile and run but are not fully integrated. Socket communication works for some aspects of the system but not completely. May be some bugs. Documentation may be missing. Experiment report is incomplete and is missing some needed information The streaming system does not meet most specified requirements. Nutella p2p system not implemented in that most of the system cannot be started, significant problems or crashes arise during even short runs. Documentation missing and/or problems in compilation. Experiment report is mostly incomplete or is missing.