a process that allows an application on one machine to send a message to an application on another machine. The idea is that the sending application must be able to identify the receiving application.
How does addressing work?
to identify the receiving application, one must specify the name or address of the host machine. As well as the identity of the receiving process (receiving application) on the receiving side.
In the case of the internet, what is the destination host's address specified by?
IP address
can hardware ip address change? what about network ip address?
hardware ip address cannot change. Network ip address can change if it is moved from one network to another.
how many bits is an IP address?
32
how many bits is a port number
16
what is an analogy for ip addresses and port numbers?
ip addresses are like the street address of an apartment building. port numbers are like the number of a particular apartment within the building. In order for a data packet, or letter, to be delivered properly, both numbers must be known.
what is a software port?
a virtual data connection that can be used by programs to exchange data directly, rather than through a file or other temp storage. The two most common are TCP and UDP ports, used to exchange data between computers on the internet.
what is the structure of a network application?
the user interface; allows user to control application functionality.
application logic; software code, processing instructions that provide functionality
application-level protocol; the format and order of messages exchanged between processes, as well as actions taken on a transmission or receipt of message
what data is being sent over the internet?
packets: data, broken into smaller pieces for easier sending
How can you use the internet in Processing?
the Network library. It allows you to communicate with another processing application, download data from the internet, send data to be stored or processed remotely.
how do you implement the use of the Network library in Processing
Use the Client class. it is used to create a client object that connects to a server to exchange data.
import processing.net.*;
Client networkClient = new Client(this, "www.oreilly.com", 80);
// connects to the server on port 80
what are the characteristics of a client
sends the request
initiates requests
waits for and receives replies
usually connects to a small number of servers at one time
typically interacts directly with end-users using a GUI
what is the Server class from the Network library used for?
to create server objects that can send and receive data to and from any client connected to it.
you can create a new server object by passing the port number that the server should be available on:
Server srv = new Server(this, 5204);
what are the characteristics of a Server?
it is the receiver of a request which is sent by a client
passive
waits for requests from clients
upon receipt of requests, processes them and then serves replies
usually accepts connections from a large number of clients
typically does not interact directly with end-users
what is the transport layer?
the layer of the network responsible for making sure packets get to their destination. Two protocols used to handle transport of packets on the internet: Transmission Control Protocol (TCP) and User Datagram Protocol (UDP)
what are the characteristics of the UDP model?
lightweight transport protocol with minimalist service model
connectionless, no handshaking before two processes start to communicate
provides unreliable data transfer service; no guarantee that message will reach receiver
messages may arrive out of order
no flow control; data may be sent at any rate.
good option for real-time data transfer, as lack of acknowledgements or retransmissions prevents transmission being slowed
Torn down. The connection is a "connection-oriented "or "virtual circuit" service. the two processed are connected end-to-end in a loose manner without support from intermediate nodes
How does the user understand what an application is doing, how user actions have been interpreted, and How to get the application to do what the user wants?
Feedback and Output
What are some benefits of communicating over networks?
Enables applications to work remotely
gather data from internet
ability to network multiple devices and machines
does all the communication in an interactive application have to be between the user and the app?
No, in most interactive applications, a great part of the communication goes on between the application and other devices or applications
what is the simplest network
one-to-one connection between two objects
Before communication between two objects takes place, what has to be established?
Rules for communication must be established
what are the layers of agreement (rules) for the communication between to objects?
physical: physical ports,pins
electrical: voltage levels
logical: what does an increase in voltage represent?
data: bit transfer (timing, size, packages or not)
application: how are groups of bits arranged into messages?
In a simple network like Arduino to computer you only have two points: sender and receiver. What is used/needed In a more complex network, like the internet?
A map to keep track of objects: addressing scheme.
what are the different types of networks?
Directly connected Network; every system connected to each other
Star network; one hub and every system connected to the hub
Ring network; systems connected to only one system in a circle.