Data Streams David Meredith Source Chapter 19 of – Shiffman, D. (2008). Learning Processing. Morgan Kaufmann, Burlington, MA. ISBN:

Slides:



Advertisements
Similar presentations
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 Network Services Networking for Home and Small Businesses – Chapter 6.
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.
Network Terminology … Remember: Knowledge is Power!
Chapter 2: Application Layer
The Internet Useful Definitions and Concepts About the Internet.
1 Java Networking – Part I CS , Spring 2008/9.
Definitions, Definitions, Definitions Lead to Understanding.
Application Layer  We will learn about protocols by examining popular application-level protocols  HTTP  FTP  SMTP / POP3 / IMAP  Focus on client-server.
Introduction 1 Lecture 5 Application Layer slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science & Engineering Department.
Web Design Terms and Concepts Ms. Scales. Q. What is a Server? A. A server is a computer that stores information many people can access. It runs special.
TCP Sockets Reliable Communication. TCP As mentioned before, TCP sits on top of other layers (IP, hardware) and implements Reliability In-order delivery.
Lightning Talk Fred Rodriguez Aakash Juneja CPSC 473 March 16, 2012.
? INTERNET WHAT, WHY, HOW. DEFINITION The Internet is a massive public spiderweb of computer connections. It connects personal computers, laptops, tablets,
Syllabus outcomes Describes and applies problem-solving processes when creating solutions Designs, produces and evaluates appropriate solutions.
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.
CS 3830 Day 7 Introduction : Application Layer 2 Processes communicating Process: program running within a host. r within same host, two processes.
思科网络技术学院理事会. 1 Application Layer Functionality and Protocols Network Fundamentals – Chapter 3.
1 Computer Communication & Networks Lecture 28 Application Layer: HTTP & WWW p Waleed Ejaz
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public ITE PC v4.0 Chapter 1 1 Network Services Networking for Home and Small Businesses – Chapter.
Introduction to Interprocess communication SE-2811 Dr. Mark L. Hornick 1.
Network Services Networking for Home & Small Business.
ITIS 1210 Introduction to Web-Based Information Systems Chapter 23 How Web Host Servers Work.
HOW WEB SERVER WORKS? By- PUSHPENDU MONDAL RAJAT CHAUHAN RAHUL YADAV RANJIT MEENA RAHUL TYAGI.
Chapter 1: The Internet and the WWW CIS 275—Web Application Development for Business I.
1 7-Oct-15 OSI transport layer CCNA Exploration Semester 1 Chapter 4.
1 CSC111H Client-Server: An Introduction Dennis Burford
Lab 6: Introduction to Sockets (Web Programming – Part 1) Reference: Head First Java (2 nd Edition) by Kathy Sierra & Bert Bates.
Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 17 This presentation © 2004, MacAvon Media Productions Multimedia and Networks.
2: Application Layer 1 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,
Vassil Roussev 2 A socket is the basic remote communication abstraction provided by the OS to processes. controlled by operating system.

Sockets process sends/receives messages to/from its socket
RGEC MEERUT(IWT CS703) 1 Java Networking RGEC Meerut.
CIS 250 Advanced Computer Applications Internet/WWW Review.
1 Welcome to CSC 301 Web Programming Charles Frank.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
The Web and Web Services Jim Graham NR 621 Spring 2009.
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.
Introduction to Internet. Chapter 1 Objectives Origins of the Internet Packets and Routers TCP/IP DNS HTTP URL Client-Server.
2: Application Layer1 Chapter 2 Application Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross.
Network Programming All networked computers have an IP Address – Unique – In the form of xxx.xxx.xxx.xxx ( ) – 32 bits = ~4 billion possibilities.
Socket Programming Introduction. Socket Definition A network socket is one endpoint in a two-way communication flow between two programs running over.
2: Application Layer 1 Chapter 2: Application layer r 2.1 Principles of network applications  app architectures  app requirements r 2.2 Web and HTTP.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1 Fundamentals.
Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 17 This presentation © 2004, MacAvon Media Productions Multimedia and Networks.
CSI 3125, Preliminaries, page 1 Networking. CSI 3125, Preliminaries, page 2 Networking A network represents interconnection of computers that is capable.
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 7 Omar Meqdadi Department of Computer Science and Software Engineering University of.
Computer Network Architecture Lecture 6: OSI Model Layers Examples 1 20/12/2012.
COMP2322 Lab 4 Socket Programming Toby Lam March 2, 2016.
How Web Servers and The Internet Work The Basic Process.
1 Network Communications A Brief Introduction. 2 Network Communications.
1 14-Jun-16 S Ward Abingdon and Witney College CCNA Exploration Semester 1 OSI transport layer CCNA Exploration Semester 1 Chapter 4.
The Echo Server Problem. Contents  Basic Networking Concepts  The Echo Server Problem.
Computing with C# and the .NET Framework
MCA – 405 Elective –I (A) Java Programming & Technology
Some bits on how it works
Working at a Small-to-Medium Business or ISP – Chapter 7
Working at a Small-to-Medium Business or ISP – Chapter 7
Computer Communication & Networks
I. Basic Network Concepts
Working at a Small-to-Medium Business or ISP – Chapter 7
Starting TCP Connection – A High Level View
The Client Server Model
The Client Server Model
Internet Applications & Programming
Lecture 14: JSON and Web SERVICES
Computer Networks Protocols
Your computer is the client
The Internet and Electronic mail
Q/ Compare between HTTP & HTTPS? HTTP HTTPS
Presentation transcript:

Data Streams David Meredith

Source Chapter 19 of – Shiffman, D. (2008). Learning Processing. Morgan Kaufmann, Burlington, MA. ISBN:

Getting information from the web

The XMLWeather program sometimes takes some time to get the information it needs to print its output It needs to have a “conversation” with a machine somewhere else in the world (a server) This conversation is called an HTTP Request HTTP stands for “Hyper-text transfer protocol” HTTP is a “request/response” protocol used for transferring information around on the internet

HTTP Request/Response Suppose you start a web browser and type in the URL, The web browser (client) sends an HTTP Request to a server computer called to ask for the server to send its default home pagewww.aau.dk Lots of other clients might also be asking the server to send information, so we may have to wait a little Then, after a while, the server computer sends back an HTTP Response that includes all the byte data for your browser to display the home page The client sends another message to the server telling it that it has recieved the data The connection between the server and the client is then stopped This is bi-directional, asynchronous communication

Synchronous, socket connection Asynchronous connection is fine for the web But time lags would be disastrous in, e.g., a multi-player game, internet chat or a real-time performance application For this we use a synchronous, socket connection Continuous connection between two computers via a socket on each computer A socket has an IP number, identifying the machine and a port number identifying the program on the machine that the information is being sent to/from

Server programs A server (in this context) is a program running on a “server” computer – Note that the word is used to refer to both machines and programs The server program accepts requests for connections from other programs called clients The server program is identified by a 16-bit number called a port number – A port number is between 0 and – Avoid port numbers less than 1025 – these are used for common services (e.g., FTP, HTTP, SMTP)

Creating a server Import the network library Declare a Server object Create a Server object and set it to wait for incoming connections on port 5204 Checks if message available from client. If so, returns Client, if not, returns null Read and trim the message from the client Server sends a message back to client serverEvent() callback function called when a new client connects Get the IP address of the client Can use telnet or putty to connect to the server program

Creating a client

Broadcasting We’ve seen how information can be sent between a client and a server in the form of Strings What if we want to send numeric data? – e.g., continuously broadcast the temperature outside your house or the amount of motion of a camera Have a server program running that broadcasts this number Clients can then connect to this server program and read the information it broadcasts

Broadcasting numeric data Reads one byte of data

Multi-user communication: The Server In the previous example, the server broadcast information to multiple clients What if we want information from a client to be broadcast to all other clients? For example, could have a shared “whiteboard” that five or more clients all draw on and all see If a client draws something on the blackboard, information is sent to the server which then re- broadcasts it to all the clients

Formatting the data Suppose we need to send multiple data, e.g. current x and y co-ordinates of the mouse position Can send the data as a String, but first need to encode it in a way that can be understood at the other end For example, can have a format as follows:, * e.g. “125,200*”, “50,150*” String data = mouseX + “,” + mouseY + “*”

Multi-User Communication