Socket based Client/Server Systems Exercises in. Exercises Build a generic client Build an echo server Build a http client and server Build a proxy/firewall.

Slides:



Advertisements
Similar presentations
Cross-Site Scripting Issues and Defenses Ed Skoudis Predictive Systems © 2002, Predictive Systems.
Advertisements

Chapter 17: WEB COMPONENTS
Java Network Programming Vishnuvardhan.M. Dept. of Computer Science - SSBN Java Overview Object-oriented Developed with the network in mind Built-in exception.
Table of Contents This document describes about XML application to control, customize, initiate action of phone. Overview of XML Application Each Function.
Java Security CS-328. JDK 1.0 Security Model Sandbox Java Virtual Machine Local Code Remote Code Local Host System Resources (File System, Sockets, Printers…)
Using JavaServer Pages Harry R. Erwin, PhD CIT304/CSE301.
1 Content Delivery Networks iBAND2 May 24, 1999 Dave Farber CTO Sandpiper Networks, Inc.
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB JavaForum.
LAB#2 JAVA SECURITY OVERVIEW Prepared by: I.Raniah Alghamdi.
Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
Servlets and a little bit of Web Services Russell Beale.
18-Jun-15 JSP Java Server Pages Reference: Tutorial/Servlet-Tutorial-JSP.html.
JSP Java Server Pages Reference:
Cornell CS502 Web Basics and Protocols CS 502 – Carl Lagoze Acks to McCracken Syracuse Univ.
1 Web Content Delivery Reading: Section and COS 461: Computer Networks Spring 2007 (MW 1:30-2:50 in Friend 004) Ioannis Avramopoulos Instructor:
Tomcat Configuration A Very, Very, Very Brief Overview.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
 Proxy Servers are software that act as intermediaries between client and servers on the Internet.  They help users on private networks get information.
IST346:  Web Services. Today’s Agenda  Learn the basics of how the Web works  Understand various web service architectures  Address scaling, security,
Quick Tour of the Web Technologies: The BIG picture LECTURE A bird’s eye view of the different web technologies that we shall explore and study.
Web server and web browser It’s a take and give policy in between client and server through HTTP(Hyper Text Transport Protocol) Server takes a request.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
DONE-10: Adminserver Survival Tips Brian Bowman Product Manager, Data Management Group.
Comp2513 Forms and CGI Server Applications Daniel L. Silver, Ph.D.
Access Gateway Operation
MCSE Guide to Microsoft Exchange Server 2003 Administration Chapter Four Configuring Outlook and Outlook Web Access.
Chapter 4: Core Web Technologies
TCP/IP Protocol Suite 1 Chapter 22 Upon completion you will be able to: World Wide Web: HTTP Understand the components of a browser and a server Understand.
Web application architecture
Bacon A Penetration and Auditing Framework Hernan Gips
JavaScript, Fourth Edition
JSP Java Server Pages Softsmith Infotech.
An program As a simple example of socket programming we can implement a program that sends to a remote site As a simple example of socket.
CS4273: Distributed System Technologies and Programming Lecture 13: Review.
JAVA SERVER PAGES. 2 SERVLETS The purpose of a servlet is to create a Web page in response to a client request Servlets are written in Java, with a little.
Chapter 18 Networking F Client/Server Communications F Simple Client/Server Applications F Serve Multiple Clients F Create Applet Clients F Send and Retrieve.
Chapter 3 Servlet Basics. 1.Recall the Servlet Role 2.Basic Servlet Structure 3.A simple servlet that generates plain text 4.A servlet that generates.
Hour 7 The Application Layer 1. What Is the Application Layer? The Application layer is the top layer in TCP/IP's protocol suite Some of the components.
1 Welcome to CSC 301 Web Programming Charles Frank.
BASIC INTERNET PROTOCOLS: http, ftp, telnet. Mirela Walczak.
Chapter 2 Web app architecture. High-level web app architecture  When a client request coming in and needs servlet to serve dynamic web content, what.
Chapter 16: Networking F Client/Server Communications F Serving Multiple Clients F Applet Clients F Viewing HTML Pages F Retrieving Files from Web Servers.
1 Java Servlets l Servlets : programs that run within the context of a server, analogous to applets that run within the context of a browser. l Used to.
JSP BASICS AND ARCHITECTURE. Goals of JSP Simplify Creation of dynamic pages. Separate Dynamic and Static content.
JS (Java Servlets). Internet evolution [1] The internet Internet started of as a static content dispersal and delivery mechanism, where files residing.
What is a Servlet? Java Program that runs in a Java web server and conforms to the servlet api. A program that uses class library that decodes and encodes.
CS562 Advanced Java and Internet Application Introduction to the Computer Warehouse Web Application. Java Server Pages (JSP) Technology. By Team Alpha.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
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.
Java Network Programming Network Programming Spring 2000 Jeffrey E. Care
Internet User’s Guide The path to... GB757. Internet User's Guide2 Objectives  Understand the Internet architecture  Understand Internet Services 
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB Markus.
Protocols Monil Adhikari. Agenda Introduction Port Numbers Non Secure Protocols FTP HTTP Telnet POP3, SMTP Secure Protocols HTTPS.
Chapter 4 Request and Response. Servlets are controlled by the container.
Java Server Pages. 2 Servlets The purpose of a servlet is to create a Web page in response to a client request Servlets are written in Java, with a little.
Bayu Priyambadha, S.Kom. Static content  Web Server delivers contents of a file (html) 1. Browser sends request to Web Server 3. Web Server sends HTML.
JSP / Servlets and Beans
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
1 Chapter 22 World Wide Web (HTTP) Chapter 22 World Wide Web (HTTP) Mi-Jung Choi Dept. of Computer Science and Engineering
Web Development Web Servers.
Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Processes The most important processes used in Web-based systems and their internal organization.
Chapter 18 Networking Client/Server Communications
CompTIA Server+ Certification (Exam SK0-004)
IS333D: MULTI-TIER APPLICATION DEVELOPMENT
WEB API.
Windows Server Administration Fundamentals
Presentation transcript:

Socket based Client/Server Systems Exercises in

Exercises Build a generic client Build an echo server Build a http client and server Build a proxy/firewall Using code pieces from the Java examples book (see resources) we will: We will discuss general design issues as well! (patterns etc)

Preparations Download zipped examples Create Jbuilder project Go to net directory and include all java files into the project.

Clients GenericClient (allows input to any server and displays responses. Use e.g. with the example server or a remote smtp mail server) HttpClient (connects to a web-server and downloads URL from command line)

Servers HttpMirror (sends http parameters back) Server (generic server, multithreaded with built in services like time, httpmirror, remote control, echo etc.) First step to servlet engine or application server Needed: a simple web-server (e.g. from Newards book)

Dynamic Server Serve() Time service, Port X http mirror service Port Y Server creates new socket, loads service dynamically and provides threads from a pool for the service connect If we change Serve() to ServiceRequest() and use a URL (e.g. ) which is parsed by server to load the proper service, then we have the basic servlet engine or application container. Tread

Dynamic Server (2) Separates application code from processing context (thread/socket combination) Allows call interception e.g. to enforce authentication or authorization Allows new services to be added dynamically These are the basic jobs of an application server or a servlet engine

Compilation Problems Clients: none Server: include all classes in project and specify the name of the service parameter as a fully qualified inner class name, e.g. ….net.Server$Time as a command line parameter.

A poor man’s directory service You will notice quickly that a client needs to know some parameters of a service it wants to use: -hostname and port number -Possibly also a service name Write all available servers and their names and ports on the white board! This works just like a directory service. You (client) can locate services now. You (server) need to offer your service here.

Advanced For advanced socket programmers the use of JSSE (Java Secure Sockets Extension) to support security between clients and servers is a good example. See: and download the article on “securing Java programs with JSSE” by Jamie… Create trust- and keystores, keys etc. Use dummy browser and web-server (both provided) in a secure mode!

Adding Proxy Servers Define a proxy as an intermediate instance that intercepts calls between client and server. The proxy may look like the real server to clients thereby hiding everything that is behind it from client view (allows transparent infrastructure changes) Other reasons for proxies: enforce authentication, check access rights, filter content, translate content, balance load between invisible servers

Persistent URLs They are a nice example of a proxy pattern in action: URLs from are persistent because purl.org will redirect a request for a certain PURL to a URL stored at purl.org. This URL really points to where the resource is located and can be changed without clients noticing.

Proxy Architecture client serverproxy The proxy looks like a server for the client and like a client to the server. It can manipulate both data streams. Problem: Encrypted content cannot be modified! Reverse Proxies frequently terminate the SSL session at the proxy.

Runtime Problems Missing debug or logging in the server and proxy code forced us to insert trace statements to see if both are running. The use of a logging/tracing framework like log4j.org became obvious. Some code uses reflection to load classes which could cause performance problems especially in servlet like environments with complicated class loader paths.

System Management You will notice quickly that your client sometimes does not work even though you believe your code works and host/port is OK. - A colleague stopped his server You (client): How can you know whether the server is up and running? You (server): If you need to stop your service, do you know which client will be affected? Which MIGHT be affected? Strategies you can use to warn clients? Something you can do to avoid service interruption at all? What are your service guarantees anyway?

Resources David Flanagan, Java Examples in a Nutshell, O’Reilly, chapter 5. Code: Ted Neward, Server Based Java Programming chapter 10, Code: Doug Lea, Concurrent Programming in Java (logging package)