Basic Protocols 24-Nov-18.

Slides:



Advertisements
Similar presentations
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 22 World Wide Web and HTTP.
Advertisements

Layer 7- Application Layer
Chapter Extension 7 How the Internet Works © 2008 Prentice Hall, Experiencing MIS, David Kroenke.
28-Jun-15 Basic Protocols. 2 Sockets Sockets, or ports, are a very low level software construct that allows computers to talk to one another When you.
© 2004, Robert K. Moniot Chapter 1 Introduction to Computers and the Internet.
15-Jul-15 Basic Protocols. 2 Sockets Sockets, or ports, are a very low level software construct that allows computers to talk to one another When you.
Computer Networks  Network - A system of computers interconnected in order to share information.  Data transmission - consists of sending and receiving.
 TCP/IP is the communication protocol for the Internet  TCP/IP defines how electronic devices should be connected to the Internet, and how data should.
How Web Servers and the Internet Work by by: Marshall Brainby: Marshall Brain
Internet Concept and Terminology. The Internet The Internet is the largest computer system in the world. The Internet is often called the Net, the Information.
4-Oct-15 Basic Protocols. 2 Sockets Sockets, or ports, are a very low level software construct that allows computers to talk to one another When you send.
1 CSC111H Client-Server: An Introduction Dennis Burford
Application Layer Khondaker Abdullah-Al-Mamun Lecturer, CSE Instructor, CNAP AUST.
The Web and Web Services Jim Graham NR 621 Spring 2009.
TCP/IP (Transmission Control Protocol / Internet Protocol)
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
INTERNET PROTOCOLS. Microsoft’s Internet Information Server Home Page Figure IT2031 UNIT-3.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
CSI 3125, Preliminaries, page 1 Networking. CSI 3125, Preliminaries, page 2 Networking A network represents interconnection of computers that is capable.
URL Programming Mimi Opkins CECS277. What is a URL?  URL is an acronym for Uniform Resource Locator and is a reference (an address) to a resource on.
Internet Basics. The Internet: Then and Now The Internet was created by the Advanced Research Projects Agency (ARPA) and the U.S. Department of Defense.
The Internet: What is it? How does it work? There are supposedly at least 14 billion pages on the internet and, as per Smithsonian, “from every single.
World Wide Web. The World Wide Web is a system of interlinked hypertext documents accessed via the Internet The World Wide Web is a system of interlinked.
Prepared by: Dr. Abdallah Mohamed, AOU-KW Unit9: Internet programming 1.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
4.01 How Web Pages Work.
Internet.
Introduction to the Internet
4.01 How Web Pages Work.
Chapter Objectives In this chapter, you will learn:
Web fundamentals: Clients, Servers, and Communication
4.01 How Web Pages Work.
Instructor Materials Chapter 5 Providing Network Services
How is all that data traffic controlled on the Internet?
Networking COMP
Computing with C# and the .NET Framework
Introduction To Web Design
Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Introduction to Computers
Some bits on how it works
Protocols and networks in the TCP/IP model initially.
Web Design Introduction to the Internet Week One
Networking for Home and Small Businesses – Chapter 6
Lecture 6: TCP/IP Networking By: Adal Alashban
Inside of a computer… What happens when you turn your computer on? What loads? Where are applications stored? How are do they run? In what form is information.
Web Development & Design Chapter 1, Sections 4, 5 & 6
Networking for Home and Small Businesses – Chapter 6
Computer Communication & Networks
1 Introduction to the Internet.
Clients and Servers 19-Nov-18.
Chapter 27 WWW and HTTP.
Application layer Lecture 7.
ACT102 Introduction to web design
Web Design & Development
Clients and Servers 1-Dec-18.
ACT102 Introduction to web design
Lecture 6: TCP/IP Networking 1nd semester By: Adal ALashban.
Inside of a computer… What happens when you turn your computer on? What loads? Where are applications stored? How are do they run? In what form is information.
Basic Protocols 19-Feb-19.
Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
How Our Customers Communicate With Us
Networking for Home and Small Businesses – Chapter 6
INFORMATION FLOW ACROSS THE INTERNET
4.01 How Web Pages Work.
Computer Networks Protocols
4.01 How Web Pages Work.
Clients and Servers 19-Jul-19.
Clients and Servers 13-Sep-19.
Presentation transcript:

Basic Protocols 24-Nov-18

Sockets Sockets, or ports, are a very low level software construct that allows computers to talk to one another When you send information from one computer to another, you send it to a port on the receiving computer If the computer is “listening” on that port, it receives the information In order for the computer to “make sense” of the information, it must know what protocol is being used Common port numbers are 80 (for web pages), 23 (for telnet) and 25 and 110 (for mail) Port numbers above 1024 are available for other kinds of communication between our programs

Protocols In order for computers to communicate with one another, they must agree on a set of rules (a “language”) for who says what, when they say it, and what format they say it in This set of rules is a protocol Different programs can use different protocols Protocols may be in ASCII (characters) or in binary Some common protocols are HTTP (for web pages), FTP (for file transfer), and SMTP (Simple Mail Transfer Protocol)

TCP/IP The Internet (and most other computer networks) are connected through TCP/IP networks TCP/IP is actually a combination of two protocols: IP, Internet Protocol, is used to move packets (chunks) of data from one place to another Places are specified by IP addresses: four single-byte (0..255) numbers separated by periods Example: 192.168.1.1 TCP, Transmission Control Protocol, ensures that all necessary packets are present, and puts them together in the correct order TCP/IP forms a “wrapper” around data of any kind The data uses its own protocol, for example, FTP

Hostnames and DNS servers The “real” name of a computer on the internet is its four-byte IP address People, however, don’t like to remember numbers, so we use hostnames instead For example, the hostname www.cis.upenn.edu is 158.130.12.9 A DNS (Domain Name Server) is a computer that translates hostnames into IP addresses Think of it as like a phone book--names to useful numbers Of course, you have to know the IP address of the DNS in order to use it! You usually get two DNS numbers from your Internet Service Provider (ISP)

DHCP If you have a web site, it must be hosted on a computer that is “permanently” on the Web This computer must have a permanent IP address There aren’t enough IP addresses for the number of computers there are these days If you have no permanent web site, you can be given a temporary (dynamically allocated) IP address each time you connect to the Web Similarly, if you have a home or office network, only one computer needs a permanent IP address The rest of the computers can be assigned internal, permanent IP addresses (not known to the rest of the world) They can also be assigned internal IP addresses dynamically DHCP (Dynamic Host Configuration Protocol) is a way of assigning temporary IP addresses as needed

URLs A URL, Uniform Resource Locater, defines a location on the Web A URL has up to five parts: http://www.xyz.com:80/ad/index.html#specials Protocol -- http is used for Web pages Hostname Port -- 80 is default for http requests Path to a given page Anchor -- a location within the page

ShowURL.java import java.net.*; // Gittleman, Example 2.2, pp. 67-68 import java.applet.Applet; public class ShowURL extends Applet { public void init() { try { URL url = new URL(getParameter("url")); getAppletContext().showDocument(url); } catch(MalformedURLException e) { e.printStackTrace(); } } }

About the ShowURL.java applet import java.net.*; This is the package that defines sockets, URLs, etc. URL url = new URL(getParameter("url")); Constructs a URL object from a text string getAppletContext() An AppletContext describes the document containing this applet and the other applets in the same document showDocument(url) Replaces the Web page currently being viewed with the given URL catch(MalformedURLException e) This exception is thrown if the given String cannot be parsed by newURL(String)

Running the applet (BlueJ) 1 2 3

Running the applet (Eclipse) Choose Run --> Run... from the menus In the left pane, click on ShowURL under Java applet Click on the Parameters tab, then Add... or Edit... parameters (in this case, give the url parameter some appropriate URL) Run the applet in the usual way

Applet results If the applet is run using appletviewer, you get an applet, but it’s blank Unless, that is, the page you go to has a applet on it If the applet is run using a browser, First, a web page appears, with a gray rectangle for the applet (which is just starting up) Then the initial web page is replaced by the web page specified by the URL You are now in your regular browser, just as if you had typed the URL into it

TryURL.java, I ShowURL.java is an applet; it runs in a browser, gets a web page, and displays it in that browser TryURL.java is an application; it runs standalone, gets a web page, and displays the HTML that it got Basic structure: import java.net.*; import java.io.*; public class TryURL { public static void main(String[] args) { try { ...important code goes here.... } catch (Exception e) { ... } } }

TryURL.java, II BufferedReader input; String line; URL url = new URL( "http://www.cis.upenn.edu/~matuszek/cit597-2006"); input = new BufferedReader( new InputStreamReader(url.openStream())); line = input.readLine(); while (line != null) { System.out.println(line); line = input.readLine(); } input.close();

TryURL.java, III TryURL just writes out the “raw” HTML that it receives A more complex program could use javax.swing.JEditorPane, which can display a subset of HTML JEditorPane can also display RTF (Rich Text Format)

The End