New York University Computer Science Department Courant Institute of Mathematical Sciences



Similar documents
New York University Computer Science Department Courant Institute of Mathematical Sciences

New York University Computer Science Department Courant Institute of Mathematical Sciences

FTP client Selection and Programming

CS 164 Winter 2009 Term Project Writing an SMTP server and an SMTP client (Receiver-SMTP and Sender-SMTP) Due & Demo Date (Friday, March 13th)

1 Recommended Readings. 2 Resources Required. 3 Compiling and Running on Linux

webmethods Certificate Toolkit

Programming Languages CIS 443

COMP 356 Programming Language Structures Notes for Chapter 4 of Concepts of Programming Languages Scanning and Parsing

CafePilot has 3 components: the Client, Server and Service Request Monitor (or SRM for short).

TCP Performance Management for Dummies

StreamServe Persuasion SP4 Service Broker

IBM WebSphere Adapter for PeopleSoft Enterprise Quick Start Tutorials

Integrating VoltDB with Hadoop

Computer Networks. Chapter 5 Transport Protocols

Forming a P2P System In order to form a P2P system, the 'central-server' should be created by the following command.

COMP 431 INTERNET SERVICES & PROTOCOLS

Introduction to Basics of Communication Protocol

TCP SYN Flood - Denial of Service Seung Jae Won University of Windsor wons@uwindsor.ca

Question1-part2 What undesirable consequences might there be in having too long a DNS cache entry lifetime?

Advanced Computer Networks Project 2: File Transfer Application

This sequence diagram was generated with EventStudio System Designer (

HW3: Programming with stacks

Using Subversion in Computer Science

Appendix. Web Command Error Codes. Web Command Error Codes

NASA Workflow Tool. User Guide. September 29, 2010

Configuring Health Monitoring

Building a Multi-Threaded Web Server

Web Services for Management Perl Library VMware ESX Server 3.5, VMware ESX Server 3i version 3.5, and VMware VirtualCenter 2.5

Java Application Developer Certificate Program Competencies

Project 5 Twitter Analyzer Due: Fri :59:59 pm

CS155: Computer and Network Security

Java Language Tools COPYRIGHTED MATERIAL. Part 1. In this part...

Custom Encryption in Siebel & Siebel Web Service Security Test Guide 1.0

XMLVend Protocol Message Validation Suite

The POSIX Socket API

Workshop on Network Traffic Capturing and Analysis IITG, DIT, CERT-In, C-DAC. Host based Analysis. {Himanshu Pareek,

Transport Layer. Chapter 3.4. Think about

CRM Setup Factory Installer V 3.0 Developers Guide

Denial of Service Attack Techniques: Analysis, Implementation and Comparison

EE360: Digital Design I Course Syllabus

CSEE 4119: Computer Networks, Spring 2014

Life of a Packet CS 640,

SY system so that an unauthorized individual can take over an authorized session, or to disrupt service to authorized users.

Configuring and Monitoring SiteMinder Policy Servers

Configuring and Monitoring Hitachi SAN Servers

DOSarrest Security Services (DSS) Version 4.0

Ulteo Open Virtual Desktop - Protocol Description

IBM SDK, Java Technology Edition Version 1. IBM JVM messages IBM

MS Enterprise Library 5.0 (Logging Application Block)

COMP 112 Assignment 1: HTTP Servers

Programming Project 1: Lexical Analyzer (Scanner)

TOE2-IP FTP Server Demo Reference Design Manual Rev1.0 9-Jan-15

smtplib SMTP protocol client

Tableau Server Trusted Authentication

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science

Homework 2 assignment for ECE374 Posted: 02/21/14 Due: 02/28/14

EXTENDED FILE SYSTEM FOR FMD AND NANO-10 PLC

Java 7 Recipes. Freddy Guime. vk» (,\['«** g!p#« Carl Dea. Josh Juneau. John O'Conner

IBM Operational Decision Manager Version 8 Release 5. Getting Started with Business Rules

This sequence diagram was generated with EventStudio System Designer (

File Transfer Protocol (FTP) Chuan-Ming Liu Computer Science and Information Engineering National Taipei University of Technology Fall 2007, TAIWAN

CS170 Lab 11 Abstract Data Types & Objects

Jenkins on Windows with StreamBase

PERFORMANCE COMPARISON OF COMMON OBJECT REQUEST BROKER ARCHITECTURE(CORBA) VS JAVA MESSAGING SERVICE(JMS) BY TEAM SCALABLE

Programming Assignment II Due Date: See online CISC 672 schedule Individual Assignment

IDS 561 Big data analytics Assignment 1

FILE TRANSFER PROTOCOL INTRODUCTION TO FTP, THE INTERNET'S STANDARD FILE TRANSFER PROTOCOL

TrueSight Operations Management Monitoring Studio

>>> SOLUTIONS <<< c) The OSI Reference Model has two additional layers. Where are these layers in the stack and what services do they provide?

Setting up in Outlook Express

EXTENDED FILE SYSTEM FOR F-SERIES PLC

LICENSE4J FLOATING LICENSE SERVER USER GUIDE

3.5. cmsg Developer s Guide. Data Acquisition Group JEFFERSON LAB. Version

Novell Identity Manager

Listeners. Formats. Free Form. Formatted

DOSarrest Security Services (DSS) Version 4.0

Learning From Lectures:

Division of Informatics, University of Edinburgh

Finite State Machine. RTL Hardware Design by P. Chu. Chapter 10 1

Creating While Loops with Microsoft SharePoint Designer Workflows Using Stateful Workflows

CS 557- Project 1 A P2P File Sharing Network

Introduction to Synoptic

3 SOFTWARE AND PROGRAMMING LANGUAGES

Centralized Auditing in Windows Derek Melber

Intrusion Detection System Based Network Using SNORT Signatures And WINPCAP

NEC Express5800 Series NEC ESMPRO AlertManager User's Guide

KB Windows 2000 DNS Event Messages 1 Through 1614

ICOM : Computer Networks Chapter 6: The Transport Layer. By Dr Yi Qian Department of Electronic and Computer Engineering Fall 2006 UPRM

Netbeans IDE Tutorial for using the Weka API

Tips and Tricks SAGE ACCPAC INTELLIGENCE

Managing your accounts

CFX_AIM_JAVA. A payment card gateway solutions for ColdFusion users of Authorize.Net s Advanced Integration Method (AIM)

Eventia Log Parsing Editor 1.0 Administration Guide

Computing Concepts with Java Essentials

Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation

Hadoop Streaming. Table of contents

Transcription:

New York University Computer Science Department Courant Institute of Mathematical Sciences Course Title: Data Communications & Networks Course Number: g22.2662-001 Instructor: Jean-Claude Franchitti Session: 6 Assignment #8 I. Due Thursday, December 13 2012, at the beginning of class. II. Objectives 1. Get introduced to (or reacquainted with) a very neat computational model called a finite state machine. 2. Build a finite state machine implementation of the TCP connection protocol (3- way handshake) for the both the client (active) side and the server (passive) side of a connection. 3. Leverage a JAVA package that implements a programmable finite state machine to write a program that uses these classes to implement the TCP connection protocol given in Figure 1 below. 4. Since you won t really get events from a communications link, a sequence of events will be simulated by reading and parsing commands from "standard input" (System.in in Java)

PASSIVE / Λ CLOSED ACTIVE / <syn> CLOSE / LISTEN SEND / <syn> CLOSE / SYN / <syn-ack> SYN_RCVD SYN / <syn-ack> SYN_SENT CLOSE / <fin> ACK / Λ SYNACK/ <ack> CLOSE / <fin> FIN / ESTABLISHED FIN_WAIT_1 ACK / Λ FIN / RDATA / SDATA / <n> CLOSE_WAIT CLOSE / <fin> FIN_WAIT_2 FIN / CLOSING ACK / Λ LAST_ACK ACK / Λ TIME_WAIT TIMEOUT / Λ CLOSED Figure 1 TCP Connection Protocol (symbol Λ means no action ) III. References 1. Slides and handouts posted on the course Web site 2. Textbook chapters as applicable IV. Software Required 1. Microsoft Word. 2. Win Zip as necessary. 3. Java SE 6.0 and above

V. Assignment 1. Get introduced (or reacquainted) with FSMs: Finite state machines (fsm) are used to implement simulations, compilers, and, of most interest to us, communications protocols. You can learn about finite state machines from any text that covers Automata Theory or Theory of Switching Circuits, or from a myriad of sources on the World Wide Web. For our purposes, here is what you need to know: Machines are devices that respond to a set of stimuli (events) by generating predictable responses (actions) based on a history of prior events (current state). Any object that behaves according to this stimulus/response relationship may be considered as a machine. In order to represent a machine as a computational model, you need to define: 1. States 2. Events 3. Transitions 4. Start State States represent the particular configurations that a machine can assume. Events define the various inputs that a machine will recognize Transitions represent a change of state from a current state to another (possibly the same) state that is dependent upon a specific event. In a Mealy machine, an FSM may generate an output upon a transition. The Start State is the state of the machine before is has received any events. Generally, finite a state machine is classified as either a Mealy machine - one that generates an output for each transition, or a Moore machine - one that generates an output for each state. Moore machines can do anything a Mealy machine can do (and vice versa). Practically, Mealy machines are more useful for implementing communications protocols. The FSM that you will experiment with in this assignment is a Mealy machine.

2. Understand your program inputs requirements: Your program MUST accept as input (from standard input) the Strings for events in the following table EVENT Passive Open Active Open SYN received SYN + ACK received ACK received Data received from network Data to be sent from application FIN received Client or Server issues close() Timed wait ends Input string PASSIVE ACTIVE SYN SYNACK ACK RDATA SDATA FIN CLOSE TIMEOUT Events in standard input will be separated by white space (note: EOL is also white space!). NOTE 1: Events must be specified exactly as shown in the table above. All events must be entered in uppercase letters only. Any parsed token (word) that does not exactly match one of these should be treated as invalid (incorrect) input. NOTE 2: Figure 1 shows a transition from LISTEN state to SYN-SENT state driven by the SEND event. Your program should not handle this case so you should ignore this transition. A SEND event occurs when a server socket is converted implicitly from server to client by the owning application doing a write on the server socket.

3. Understand the classes provided in the FSM package: The classes in the FSM package are: FSM State Event Transition Action FsmException The finite state machine class. An abstract class that you will use to define the states for your FSM. A class that you will use to define the events for your FSM A class that you will use to define the transitions in your FSM An abstract class that you will use to define the actions that you take on each transition. A class used to generate detectable errors in package classes. The code for the FSM package is HERE. The package is in a jar file, so you will need to extract it or use the jar file in your classpath. To use the classes, your JAVA program must import the classes in the Fsm package. The easiest way to use the package is to include the jar file in your class path when you compile and execute. For example, on Unix, you might try: javac -cp.;./fsm.jar myprogram.java java -cp.;./fsm.jar myprogram to compile myprogram.java, and to run myprogram On Windows, the command is the same, but the classpath command argument is introduced by -cp rather than -classpath. The documentation for the FSM package is HERE. 4. Implement your program to operate as follows: Your program should loop, reading ONE event from standard in and processing that event completely, including display of any output, then continuing to read and process the next event, until end of input stream (end of file) You MUST implement ALL of the states shown in the transition diagram. You MUST Implement all of the transitions shown in the transition diagram AND the transitions for RDATA and SDATA.

Notice that there are two transitions in the Established state to handle data events. These are the SDATA (application request to send data) and the RDATA (data received from the network) events that can occur while in the ESTABLISHED State. You should handle these Events by writing an output message: DATA received n when the event is RDATA "DATA sent n" when the event is SDATA Where n is a number representing the number of SDATA or RDATA Events received to date, including this (R S)DATA Event. The transition for the ( S)DATA Event should leave the FSM in the ESTABLISHED State. The purpose of this requirement is to ask you to figure out how to associate a variable with a state. In practice, you would call a data transfer process which would have it's own FSM to implement flow control. To simplify your task, you may treat ANY String that you read from standard input that is NOT one of the events defined here by writing: "Error: unexpected Event: xxx" where xxx is the invalid event. Your program should then continue as if the bad input did not occur. 5. Review the following FAQs: OK, so how do I use these classes to make an FSM? 1. Create classes for your states (by extending State) and allocate your states. 2. Allocate an FSM, giving it a name and a Start State (see the constructor). NOTE: Use ONLY the constructor that allows you to specify the FSM name and starting state: public FSM(String fsmname, State start) 3. Create your events (by allocating instances of Event). 4. Create classes for the actions to take on each transition (by extending Action) and allocate your actions. 5. Allocate instances of the Transaction class using the allocated State, Event, and Action objects, and add these Transition objects to your FSM object (see the addtransition() method in FSM). How to I "send" events into the FSM?

The FSM class has a "doevent" method that takes an Event object as its input. What happens when I send an Event to the FSM? Well, this is a Mealy machine, so the FSM will locate the Transition you defined that associates the Event with the current state of the FSM, then set the current state to the state defined in this Transition as the next state, then it will execute the action method you specified in this Transition's Action object. What do I do in my "Action" methods? For all Transitions EXCEPT those caused by the (R S)DATA Events, write the message: "Event eee received, current State is sss" where eee is the Event and sss is the current State. For the Actions on the ESTABLISHED/(R S)DATA Transitions, write the message: DATA received n when the event is RDATA "DATA sent n" when the event is SDATA where n is a number representing the number of SDATA or RDATA Events received to date, including this (R S)DATA Event. What do I do if you send my program an Event that is not defined for the current State? The FSM.doEvent() method will throw an FsmException if you pass an Event that is not defined for the current State. Make sure that you catch this exception and just display the exception (every Exception has a tostring() method). Your program should then continue as if the bad Event did not occur. How does my program terminate? When you detect the end of the input stream on standard input, just exit. 6. Email your assignment file to your TA.

VI. Deliverables 1. Electronic: Your assignment file must be emailed to the TA. The file must be created and sent by the beginning of class. After the class period, the homework is late. The email clock is the official clock. Your assignment file should contain your program source code packaged as a JAR file. To create the JAR file containing your JAVA source code (please do not include the class files), change your working directory to the directory where your JAVA files are located and execute the command: jar cvf xxx.jar *.java where xxx is YOUR STUDENT ID. Include the jar file in your assignment zip file and send the zip file as an email attachmentl to the grader. The associated documentation provided in your zip file MUST include a readme file containing the name of the class that contains the main() method. You may send questions to the class mailing list ONLY. 2. Written: Printout of the files as necessary (report/hardcopy portion of the assignment). The cover page supplied on the next page must be the first page of your assignment file Fill in the blank area for each field. NOTE: The sequence of the hardcopy submission is: 1. Cover sheet 2. Assignment Answer Sheet(s) VII. Sample Cover Sheet:

Name Username: Date: (last name, first name) Section: Assignment 8 Assignment Layout (25%) Assignment is neatly assembled on 8 1/2 by 11 paper. Cover page with your name (last name first followed by a comma then first name), username and section number with a signed statement of independent effort is included. Program and documentation submitted for Assignment #8 are satisfactory. File name is correct. Total in points Professor s Comments: Affirmation of my Independent Effort: (Sign here)