Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 The Internet. 2 The Internet is an open system Details publicly available A lot of software is free Lots of publicly available expertise available via.

Similar presentations

Presentation on theme: "1 The Internet. 2 The Internet is an open system Details publicly available A lot of software is free Lots of publicly available expertise available via."— Presentation transcript:

1 1 The Internet

2 2 The Internet is an open system Details publicly available A lot of software is free Lots of publicly available expertise available via such things as newsgroups Dangers with privacy

3 3 Implications of open systems Wide variety of implementations, for example of TCP/IP Cost of implementation less High level of compatibility Wide variety of developers selling products

4 4 Examples of open systems and code HTTP TCP/IP Java Linux Apache

5 5 Network topolocies Bus network Ring network Hub network

6 6 Bus network Terminator Devices: computers, printers etc

7 7 Ring network Computer Printer Mass storage device

8 8 Hub network Ports Backplane

9 9 The Internet has a layered architecture Level of functionality Each level draws upon facilities in a lower level As you proceed downwards you get nearer the computer Achieves separation of concerns

10 10 Internet history (i) ARPA started the ARPAnet network ARPAnet originally used the NCP protocol 1974 Cerf and Kahn developed TCP/IP

11 11 Internet history (ii) Splitting of ARPAnet into MILnet and ARPAnet Renaming of ARPAnet as Internet Development of Web at CERN Development of new protocols to cope with huge growth

12 12 Internet protocols(i) Telnet, used for connections File Transfer Prototcol (FTP), used for file transfer Simple Mail Transfer Protocol (SMTP), used for electronic mail Kerberos, used for security functions

13 13 Internet protocols(ii) Network File System (NFS), used for transparent file sharing Trivial File Transfer Protocol (TFTP), used for fast transmission of files Transmission Control Protocol (TCP), used for fast transmission of files.

14 14 Internet protocols(iii) User Datagram Protocol (UDP), used for fast transfer of data, unreliable. HyperText Transfer Protocol (HTTP), used for transferring Web documents Internet Protocol (IP), basic functioning of moving data

15 15 Identifying computers on the Internet A basic function of any network is naming: identifying computers and other resources using some unique name. Dotted quad notation identifies an IP address Domain naming uses symbolic names

16 16 IP addresses IP addresses expressed in dotted quad identify a computer. Addresses can be class A, class B, class C or class D. They identify a network and a computer on the entwork.

17 17 An example: the class A address Network address Computer address 1 bit 7 bits 24 bits 1 bit used to designate class A 7 bits used to identify network 24 bits used to identify computer

18 18 Dotted quad notation Used to identify a computer, four 8 bit quantities reflecting the 32 bits used in the Internet Example

19 19 The loopback address The address is known as the loop-back address. Any data which is sent to this address from a computer will return straight to the computer

20 20 Domain Name System Dotted quad suffers from a major problem: difficult to remember Better for symbolic names to be used This is the purpose of the Domain Name System (DNS)

21 21 An example Name of the computer Name of organisation Academic organisation, edu used in America Country of origin

22 22 Some domains com, a commercial company edu or ac, educational insitution gov, governmental organisation mil, military organisation museum, museums

23 23 Hierarchic naming com edu gov …… uk fr mit cs athena The computer athena in the cs department at MIT

24 24 import*; public class Whoami { public static void main(String[] args) throws Exception { if(args.length < 1) { System.err.println( You need to supply a Machine name"); System.exit(1); } InetAddress a = InetAddress.getByName(args[0]); System.out.println(a); }

25 25 Client and servers A network can be envisioned as a set of clients and servers Servers provide a service, for example a Web server delivers Web documents Clients call on the services provided by a server

26 26 Distributed Computing in Java "The Network is the Computer"--Scott McNealy, CEO of Sun Microsystems Make computing across networks as simple and reliable as stand-alone computing In Java, programming across networks is based on simple IO. So we will review that.

27 27 What are the main distributed computing tasks: Remember Mickey Mouse Fetch the Water: Fetch some information from a distant machine machine over there and move it to this machine here, or vice versa. The easiest way to do this is via Sockets. This is based on streams and is very like IO. We will start our Java here.

28 28 Make a connection to a water supply: Connect to a database, possibly residing on one or more other machines. Java DataBase Connectivity (JDBC), is an abstraction away from the messy, platform- specific details of SQL. We will start with the messy way.

29 29 Make your water available:Provide services via a Web server. Three ways to do this in Java: Applets: download the Java Code and run it on your own machine Servlets:run it on the Web server Java Server Pages (JSPs)incorporate in web pages.

30 30 Control brooms from afar: Execute methods on Java objects that live on remote machines. This is accomplished with Javas Remote Method Invocation (RMI).

31 31 Integrate with other pre-written spells. Use code written in other languages, running on other architectures. Common Object Request Broker Architecture (CORBA), which is supported In Java.

32 32 Other Java technologies Enterprise Java Beans Separate out functionality from connection JINI Add and remove objects

33 33 Concurrency Remember in Mickey: there are lots of brooms at the same pool There are essentially two ways to do this: HeavyWeight Processes: keep them quiet separate LightWeight Proceses: interleave them Java supports Lightweight processes through the use of threads

34 34 Layers of Distribution in Java 1. Sockets The model here is computer to computer connection 2. RMI (Remote Method Invocation) The model here is object to object connection. Relies on the same semantics, probably same language And still need to know where it is

35 35 3. CORBA (Common Object Request Broker Architecture) Here the language and location are abstracted away. 4. Voyager and mobile agents Here objects can be moved

36 36 Ports and sockets A port is a logical TCP/IP idea, not to be confused with a hardware port Ports are used for data communications Numbered Some ports are dedicated to certain applications

37 37 Some dedicated ports 80 is used for Web traffic 25 is used for the Simple Mail Transfer Protocol 110 is used for the Post Office Protocol version 3 service 21 is used for the File Transfer Protocol

38 38 Sockets and server sockets A socket is a connection into a computer A server socket is used to create a socket on a server Java contains facilities for setting up sockets and server sockets and connecting streams

39 39 Address of Computer: IP Address Address of a connection to a computer: Port (e.g. 25 for telnet) Communication Channel through a port: Socket

40 40 Sockets and data input in Java Socket ss = new Socket(, 2048); InputStream is = ss.getInputStream(); BufferedReader bf = new BufferedReader (new InputStreamReader(is)); Creates a BufferedReader to the computer igor at Goldsmiths College via port 2048, data can now be read from igor

41 41 Sockets and data output in Java Socket ss = new Socket(, 2048); OutputStream os = ss.getOutputStream(); PrintWriter pw = new PrintWriter(os, true): Sets up a PrintWriter object attached to the computer scorpio at Goldsmiths College. The client can then write data to this computer. Note that true in the PrintWriter constructor flushes data from the buffer automatically

42 42 The ServerSocket class Used to generate sockets at a server. Has a constructor which specifies the port to be used. Method accept blocks until a client connection is made and then generates a Socket object.

43 43 Streams Abstraction for arbitrary data streams e.g. System.out.println() System is in java.lang in out and err are static fields in System each is a stream (actually a subclass, e.g PrintStream)

44 44 There are InputStreams and OutputStreams These are abstract classes Children are things like input byte streams

45 45 Generating streams at a server ServerSocket ss = new ServerSocket(200); //Wait for a connection while (true) { System.out.println (waiting for client); Socket Client = ss.accept(); InputStream is = sockS.getInputStream(); OutputStream os = sockS.getOutputStream(); // is and os can then be used for communication // to the server

46 46

47 47

Download ppt "1 The Internet. 2 The Internet is an open system Details publicly available A lot of software is free Lots of publicly available expertise available via."

Similar presentations

Ads by Google