You are on page 1of 146

TCP-SMART FRAMING

TCP SMART FRAMING


TCP-SMART FRAMING

INDEX

1. Introduction

2. System Analysis

a. Existing System

b. proposed System

3. Feasibility Report

a. Technical Feasibility

b. Operational Feasibility

c. Economical Feasibility

4. System Requirement Specification Document

a. Overview

b. Modules Description

c. Process Flow

d. SDLC Methodology

e. Software Requirements

f. Hardware Requirements

5. System Design

a. DFD

b. E-R diagram
TCP-SMART FRAMING

c. UML

d. Data Dictionary

6. Technology Description

7. Coding

8. Testing & Debugging Techniques

9. Output Screens

10. Reports

11. Future Enhancements

12. Bibliography
TCP-SMART FRAMING

INTRODUCTION
TCP-SMART FRAMING

Project Name: TCP SMART FRAMING


Introduction: Balancing greediness and gentleness has always

been the distinctive feature of congestion control in the TCP


protocol [1]. Mindful of the presence of other traffic sharing the
same network resources, TCP tries to grab as much bandwidth as
possible, eventually causing congestion and data loss. Data lost
by TCP is used as congestion signal, and cause the source to slow
down its transmission rate. Thus, lost data can actually be seen as
bandwidth used to control and regulate the network, since every
segment the network discards is an indication that a TCP source
has been congesting the network and should temporarily back off.

This scheme has been successfully applied over the


years, while the traffic pattern has shifted from long file transfers
and short, persistent connections, typical of terminal-emulation
traffic, to the “Click-and-Run” paradigm found in Web
interactions. The design of the segmentation algorithm we are
proposing was motivated by the analysis of real traffic
measurements that highlighted the prominent role of short-lived
flows in today’s Internet traffic.

In this paper, we propose a new approach to data


segmentation in the early stages of Slow Start that adheres to the
TCP guidelines listed in [2] and, at the same time, address the
nature of today’s Internet traffic: short, spotty client-server
interactions between a Web client and a Web server. We will refer
to this variant of TCP as TCP Smart Framing, or TCP-SF for short.
TCP-SMART FRAMING

As will be detailed below, we advocate an increase in


the number of segments transmitted by a TCP source, without
increasing the amount of application data actually sent in the
congestion window. This will be done whenever the congestion
window is “small”, i.e., at the beginning of each Slow Start phase,
and in particular at the connection startup.

The main observation is that Classic TCP’s congestion


control is only marginally driven by the rate at which bytes leave
the source but, rather, by the rate at which segments (and their
respective ACKs) are sent (or received) at the source.

TCP infers that a segment is lost whenever one of the


following two events occurs: Retransmission Time Out expiration,
or the arrival of three duplicate ACKs that triggers the Fast
Retransmit algorithm. Of these two events, RTO is the most
undesirable one as the RTO period is usually much larger than the
Round Trip Time .1 Indeed, regardless of the actual amount of
bytes transmitted, a coarse RTO expiration can be prevented only
if enough segments are sent in the transmission window (i.e., at
least three more following the lost segment). This situation can
occur only if: 1) the congestion window is larger than 4 MSS
(Maximum Segment Size) and 2) the flow is long enough to allow
the transmission of at least 4 segments (i.e., it is not a so-called
short-lived flow). Also, it should be pointed out that repeatedly
forcing a short-lived connection into RTO often results in
excessive penalty for the connection itself that would otherwise
be finished in few more segments, rather than in actual network
TCP-SMART FRAMING

decongestion. While Classic TCP2 starts sending one segment, in


our scheme a TCP-SF source is allowed to send segments, whose
aggregate payload is equal to the MSS associated to the
connection. Thus, the resulting network load is, byte-wise, the
same of a Classic TCP connection (except for the protocol
overhead). When the window size grows past a threshold, the
Classic TCP behavior is restored.

WITH CONGESTION OCCURRENCE:

When congestion occurs, the client sends zero (no)


acknowledgements to the server. Hence server retransmits the
data through fast recovery. The with congestion occurrence is
depicted in Fig.

SEND THE
FAST
SEGMENTED
SERVER RECOVERING
DATA

SEND THE ACK


IS ZERO CLIENT

Congestion occurrence
TCP-SMART FRAMING

SYSTEM ANALYSIS
TCP-SMART FRAMING

EXISTING SYSTEM OF CLASSIC TCP TRANSMITION:

If congestion window is small fast recovery of packets


are not possible. Classic TCP always tries to send full-sized
segments if even one segment is lost. Time Consuming Flexibility
is less as it sends the full sized segment even if the small
segment is lost.

The Classic TCP algorithms (Slow Start, Congestion Avoidance,


Fast Retransmit, and Fast Recovery) are not otherwise affected.
However, the modification introduces a number of key
advantages:

1. The lengthy first-window RTO (set to 3 s) is no longer the


only outcome if a loss occurs at the onset of a connection.

2. When Delayed ACKs are employed and the congestion


window is 1 segment large, the receiver does not have to
wait up to 500 ms before generating an ACK; several current
TCP implementations, start a connection with a window of 2
TCP-SMART FRAMING

segments, a widely employed, acknowledged workaround to


the Delayed ACK initial slowdown.

3. Short-lived flows, for which the Completion Time is


paramount, are less likely to experience a coarse RTO
expiration, since the number of transmitted segments grants
a bigger chance of triggering FR.

4. Shorter segments can exploit pipelined transmission,


completing the transfer in a shorter time because of the
store and- forward at routers; this is especially useful in slow
links.

5. In a wireless environment, shorter packets suffer smaller


transmission error probability.

6. Not requiring any contribution from the receiver, the scheme


can quite easily be deployed on a source-only basis;
furthermore, it can equally benefit well-established Classic
TCP flavors, such as TCP Reno, New Reno, ACK, and also
works coupled with Early Congestion Notification.
TCP-SMART FRAMING

Stop- And- Wait

In a stop-and-wait method of flow control, the sender waits


for an ACK after every frame it send. Only when an ACK has been
received the next frame sent. This process of alternately sending
and waiting repeats until the sender transmits an end of
transmission frame. Stop and wait can be compared to a picky
executive giving dictation.

In this stop-and-wait method of flow control, the sender


sends one frame and waits for and ACK before sending the next
frame is sent. The disadvantage is inefficiency: Stop-and-wait is
slow. Each frame must travel all the way to the receiver and an
ACK must travel all the way back before the next frame can be
sent. The operations of the stop-and-wait protocol are given
following steps.

To initiator first transmits a frame called an asking if the


receiver is available to receive data. The receive must answer
either with an ack frame if it is ready to receive or with a Negative
TCP-SMART FRAMING

ACK frame if it is not. If the response is positive, the initiator is


free to send its data. Once all of its data have been transmitted,
the sending system finishes with an end of transmission frame.

SENDER RECIVER

Wait Time

Wait Time

TCP Stop-and -Wait Protocol

Sliding Window

In the sliding window of flow control, the sender can transmit


several frames before needing an ACK. Frame can be sent one
TCP-SMART FRAMING

after another meaning that the link can carry several frames and
its capacity can be used efficiently. The receiver ack only some of
the frames using a single ACK, it includes the number of the next
frame it expects to receive. The sliding window of the sender
shrinks forms the left when frames of data are sent. The sliding
window of the sender expands to the right when ACK are
received.

TCP - SMART FRAMING

TCP-SF transmits four small segments which are


denoted by the state s4. State FR, represents the case in which
first segment out of four is lost. P (s4, FR1) = ps(1-ps)3. FR is
entered if at least 3 out of 4 segments transmitted after the lost
one are successfully delivered

State machine of FS-TCP in the small window region


TCP-SMART FRAMING

Once FR is completed, the SM will always move to state


s8 where 8 small segments are sent. If a loss pattern occurs, FR
cannot be entered. Then SM moves from s4 to T0.By ordering the
stases we get <s4, FR1, FR2, FR3, FR4, T0, s8, s10>

This project on designing a TCP-SF system compress of four


major phases

1. Congestion detecting
2. Segmentation
3. Fast transmission
4. Fast recovery

Congestion Detecting

When too many packets are contending for same link, the
queue overflows and packets have to be dropped when such a
drop become common events, the network is said to be
congested. The networks provide a congestion detecting
mechanism to deal with following situation

RTT = TS+TR

RTT -> Round trip time

TS -> Time duration of sending packets from server to


client
TCP-SMART FRAMING

TR ->Time duration of receiving packets from client to


server.

RTO= RTT/2

RTO ->Retransmit Time Out

Due to this RTO, server gets an acknowledgement from the


client. With respect to that acknowledgement, the segmented
data is retransmitted to the corresponding client. Current existing
system use slow start techniques, the source starts out by the
setting congestion window to one packet. When the
acknowledgement from that packet arrives TCP adds 1 to
congestion window and then sends the packets. Upon receiving
the corresponding two acknowledgement, TCP increments
congestion window by two, one for each acknowledgement and
resends the four packets. The end result is that TCP effectively
doubles the number the number of packets it has in transmitting
every RTT. Slow start continues to double the congestion windows
in each RTT until there is a loss at which time a timeout causes
multiplicative decrease to divide congestion window by two.
TCP-SMART FRAMING

State machine of classic TCP in the small region

Cwnd (congestion window) is comprised bandwidth and


threshold Cwnd min = 4.When slow start is entered, cwnd =1 and
SM is represented by state1.When packets are state to transmit &
there is no loss, then SM moves from state 1 to state 2. With prob
(1-p). P stands for segment loss Probability State Time out .If the
segment is retransmitted after TO expiration, SM remains in to.
When retransmitted segment is delivered, SM leaves TO and
enters to the state 2.

Fast Retransmission

The fast retransmit is a heuristic that sometimes triggers the


retransmission of a dropped packet sooner than the regular time
out mechanism the fast retransmission mechanism does not
replace regular timeouts. The idea of fast retransmit is straight
forward Every time a data packet arrives at the receiving side, the
receiver responses with an acknowledgement even if the
sequence numbers have already been acknowledged. Thus when
a packet arrives out of order that is TCP cannot yet acknowledge
the data the packet contains because earlier data has not yet
arrived. TCP resends the same acknowledgement it sent last time.
The second transmission of the same acknowledgement is called
TCP-SMART FRAMING

a Duplicate acknowledgement. when the sending side sees a


duplicate ack, it knows that the other side must have received a
packet out of order, which suggest that an earlier packet might
have been loosed since it is also possible that the earlier packet
has only been delayed rather than loss, the sender waits until it
sees some number of duplicate ack and than retransmit the
missing packet. In proposed system the TCP waits until it has
been three duplicate ack before retransmitting the packets

Receiv
Sender
Packet 1 er

ACK 1
Packet 2
ACK 2
Packet 3

ACK 2
Packet 4
Packet 5
ACK 2
Packet 6
ACK 2
Retrans
mission
packet 3 ACK3

Fast Retransmit Based On Duplicate Acks


TCP-SMART FRAMING

The fig 4 illustrates how duplicate ACK lead to a fast re transmit.


The destination receives packet 1 and 2, but packet 3 is loss in
network. Thus, the destination will send ACK for packet 2 when
packet 4 arrives, again when packet 5 arrives and soon. When the
sender sees third duplicate ACK for packet 2: the one sent
because the receiver had gotten packet 6: it retransmit packet 3

Performance measure

Performance measure

Classic FS-TCP-
HOST SF
%F %RT %F %RT
R O R O
sigcomm.cmcl.cs.cm 24. 75.8 53. 46.8
u.edu 2 2

88.9 27.5
manchester-
11. 72.
1.cmcl.cs.edu 1 5
81.0 27.7
ssh.workspot.net
19. 72.
0 3

Fragmentation
TCP-SMART FRAMING

In this technique, the server gets the query from the


client and then gets the file packet formation process. The
requested file sends the client means where the data of the file
are lost due to the size of the file. While transmitting bulk of data
means loss occurs normally. So, we segment the data to avoid the
data losses with respect to segmentation technique. This
segmentation process is used to split the congestion packet into
the two packets for avoidance of the losses.

Fast Recovery

In this technique, retransmit the congested data from


the server to the client. In the Server side, set the
acknowledgement factor to find the lost data. In the client side, if
the data is received the acknowledgement factor sent is 1,
otherwise 0.If server receives 1 then the file is transmitted
successfully but if it gets 0 means the particular data is to be
retransmitted to the client until the transmission is complete
TCP-SMART FRAMING

FEASIBILITY REPORT
TCP-SMART FRAMING

Fact Finding Techniques

In this system we are going to develop a facility to a user that he will not

face any difficulty at the time of usage like data missing, one way

contacts, one view contacts. As we are developing this system with an

encoding technique of images the user will not be bothered on which

camera support is using, as well in sound. As we are maintaining one

technique of speed controlling the frame relay will not be a problem for

the user like over speed display, hanged display.

Feasibility Study

A feasibility study is a high-level capsule version of the entire System

analysis and Design Process. The study begins by classifying the problem
TCP-SMART FRAMING

definition. Feasibility is to determine if it’s worth doing. Once an acceptance

problem definition has been generated, the analyst develops a logical model

of the system. A search for alternatives is analyzed carefully. There are 3

parts in feasibility study.

Operational Feasibility:

Question that going to be asked are

• Will the system be used if it developed and implemented.

• If there was sufficient support for the project from the management and

from the users.

• Have the users been involved in planning and development of the

Project.

• Will the system produce poorer result in any respect or area?

This system can be implemented in the organization because there is

adequate support from management and users. Being developed in Java

so that the necessary operations are carried out automatically.

Technical feasibility

• Does the necessary technology exist to do what is been suggested

• Does the proposed equipment have the technical capacity for using the new

system?

• Are there technical guarantees of accuracy, reliability and data security?

• The project is developed on Pentium IV with 256 MB RAM.


TCP-SMART FRAMING

• The environment required in the development of system is any windows

platform

• The observer pattern along with factory pattern will update the results

eventually

• The language used in the development is JAVA 1.5 & Windows Environment

Financial and Economical Feasibility:

The system developed and installed will be good benefit to the organization.

The system will be developed and operated in the existing hardware and

software infrastructure. So there is no need of additional hardware and

software for the system.

SYSTEM REQUIREMENT SPECIFICATION


TCP-SMART FRAMING

Functional Requirements:

1. Secure Registration Maintain facilities for Users.


2. User get the Private File and Public Files From the System
3. User Select the One File either public or private and send to Server
4. Select File divides in to number of packets depends up on the file size.
5. Server Fast Recover the loss Packets from clients.
6. This System allows to reduce the Congestion detection .
Non functional Requirements:
1. Secure access of confidential data (user’s details). SSL can be used.

2. Better component design to get better performance at peak time


TCP-SMART FRAMING

3. Flexible service based architecture will be highly desirable for future


extension

METHODOLOGIES

Authentication Module:

Every user must need an authentication. Authentication


is for only prescribed users entering the network rather than
unauthorized access. Client and Server have an authentication
entry and also it is to differentiate between them. In this
authentication procedure is maintaining the privacy of the each
client database and secures the server database.

Start

Enter Username &


Pwd

Is

valid?
NO
YES

Register with the


server

Authentication Module

Client Module:
TCP-SMART FRAMING

In this module, the client sends the query to the server.


Due to that query the server send the corresponding file to the
client. Before this process, the client authentication step is
involved for quit the unauthorized person. In this client side, we
also generate the acknowledgement factor for congestion
detection process.

Client

Registers with the


server

Request for file to the server

Client Module

Server Module:

In the server side, it checks the client name and its


password for security process. If it is satisfied and then received
the queries form the client and search the corresponding files in
the database. Finally, find that file and send to the client. The
segmentation process and retransmitting procedure are coupled
with this server process. The Congestion packet counts are also
store in its memory space and retrieve it for retransmitting
procedure.
TCP-SMART FRAMING

Get the user defined query

Search the file in the data


base

Get the file for


transmission

Send the file to


corresponding client with
some process

Server Module

Congestion Detecting Module:

In this module, the server sends the segmented data to


the client under the transmission the data are jammed or
overlapped due to congestion occurs. We include the retransmit
time out factor for detect the congestion. In this time factor, we
are setting in the client side for congestion finding and give the
duplicate acknowledgement to the server for retransmitting that
particular packet. Otherwise, it gives acknowledgement for next
packet transmission.
TCP-SMART FRAMING

Based on the acknowledgement


factor, the server makes decision

If acknowledgement is one, the


packets are transmitted
successfully

If acknowledgement is zero, the


congestion is detect by the server
with help of client

Congestion Detecting Module

Segmentation:

In this technique, the server gets the query from the


client and then gets the file packet formation process. The
requested file sends the client means where the data of the file
are lost due to the size of the file. While transmitting bulk of data
means loss occurs normally. So, we segment the data to avoid the
data losses with respect to segmentation technique. This
segmentation process is used to split the congestion packet into
the two packets for avoidance of the losses.
TCP-SMART FRAMING

Get the file from the


database

Spitted the file into number of


packets with threshold size

Send the packet to the


client

If congestion occurs, get the


congestion packet

Arrange the packets of the


file in segment manner

Segmentation

Fast Recovery Algorithm:;

In this technique, we retransmit the congested data


from the server to the client. In the Server side, we set the
acknowledgement factor it is used to find the lost data. In the
client side, it received the data means send the acknowledgement
factor is 1 otherwise 0.In server, it get 1 means file transmitted
successfully but it get 0.Here,the duplicate acknowledgement is
TCP-SMART FRAMING

zero ,it’s for retransmitted the particular data to the client until
the transmission completed.

This retransmission procedure is not takes place


instantly; first we store all the congestion packets and then take
the corresponding packet and applying the segmentation
procedure to that packet for reduces the TCP Latency. We
retransmitted those corresponding packet with limited time.

The server detects congestion occurred


packet

Retrieve the lost packet from the file

Send the particular packet to the


client

After getting the acknowledgement


from the client, the server sent the
next packet

Retransmitted the lost packet until the


transmitted successfully

Fast Recovery Algorithm


TCP-SMART FRAMING

DESIGN TECHNIQUES

The implementation of segmented data, fast


retransmission and fast recovery in TCP is what the design is all
about. The segmented data is a whole data unit, which is divided
into fragments or packets. Unique number identifies each packet.
Fragments are transmitted form server to client. If any data
packet is lost that particular packet will be retransmitted to the
client until the acknowledgement received by the server. The
design technique involved in smart framing for developing smart
frames of TCP data proceeds with the following methodologies.

1. Congestion detecting modules.

2. Implementation of segmentation algorithm

3. Implementation of Fast Retransmit/Recovery


algorithm
TCP-SMART FRAMING

DATAFLOW DIAGRAM FOR TCP-SF

Send
Client reque If
Server
st Bursty
data
send
Send Proces Data
ACK s lost
Congesti
on
REQ Detectio
Send n
data
Seg
Alg

Send seg FRR Alg


data

Data Flow Diagram For Smart Framing


TCP-SMART FRAMING

SEQUENCE DIAGRAM FOR TCP-SF

Congestion Seg FRR


Client Server
Detection Algorithm Alg

Reque
st
CONG
DATA DETECT

SEG
ACTIVATED
Burs
FRR
t
ACTIVATED

SEND THE SEGMENTED DATA

Sequence Diagram for Smart Framing


TCP-SMART FRAMING

COLLABORATION DIAGRAM FOR TCP-SF:

CLIENT

Congestion
Detection

Segmentatio
n Algorithm

1 2 3 4 5 FRR ALG

SERVER

Collaboration Diagram For Smart Framing

1. Client request.

2. Server ACK.

3. Server sends Data.

4. Busty Data

5. No ACK
TCP-SMART FRAMING

CONGESTION DETECTION

In this module, the server the segmented data to the


client under the transmission the data are jammed or overlapped
due to congestion occurs. We include the retransmit time out
factor for detect he congestion. In this time factor, we are setting
in the client side for congestion finding and give the duplicate
acknowledgment to the server for retransmitting that particular
packet.

Request

SERVER
ACK

CLIENT
Response

Congestion
Detection
Bursty Data
Data lost

Data Flow Diagram for Collaboration Detection


TCP-SMART FRAMING

SEGMENTATION

In this technique, the server gets the query form the client
and them gets the file packet formation process. The requested
file sends the client means where the data of the file are lost due
to the size of the file. While transmitting bulk of data means loss
occurs normally. So, we segment the data to avoid the data
losses with respect to segmentation technique. This segmentation
process is used to split the congestion packet into the two packets
for avoidance of the avoidance of the losses.

SERVER
Send ACK

Congestio
Segmentation
n CLIENT
Algorithm
Detection

Data Flow Diagram for Segmentation Module


TCP-SMART FRAMING

FAST RECOVERY ALGORITHM

In this technique, we retransmit the congested data form the


server to the client. In the server side, we set the
acknowledgement factor it is used to find the lost data. In the
client side, it received the data means send the acknowledgment
factor is 1 otherwise 0. In server, if it gets 1 means file
transmitted successfully but it get 0. Here, the duplicate
acknowledgement is zero, it’s for retransmitted the particular
data to the client until the transmission is completed. But this
retransmission procedure is not takes place in stantly; first we
store all the congestion packets and then take the corresponding
packet and applying the segmentation procedure to that packet
for reduces the TCP Latency. We retransmitted those
corresponding packet with limited time.
TCP-SMART FRAMING

SERVER Send ACK for


smaller
segments

Send Fast
Segmented Retransmit/ CLIENT
Data Recovery

Data Flow Diagram for Fast Recovery Algorithm

SDLC METHDOLOGIES
TCP-SMART FRAMING

SDLC METHDOLOGIES

This document play a vital role in the development of life cycle (SDLC) as

it describes the complete requirement of the system. It means for use by

developers and will be the basic during testing phase. Any changes made

to the requirements in the future will have to go through formal change

approval process.

SPIRAL MODEL was defined by Barry Boehm in his 1988 article, “A spiral

Model of Software Development and Enhancement. This model was not

the first model to discuss iterative development, but it was the first model

to explain why the iteration models.

As originally envisioned, the iterations were typically 6 months to 2 years

long. Each phase starts with a design goal and ends with a client

reviewing the progress thus far. Analysis and engineering efforts are
TCP-SMART FRAMING

applied at each phase of the project, with an eye toward the end goal of

the project.

The steps for Spiral Model can be generalized as follows:

• The new system requirements are defined in as much details as

possible. This usually involves interviewing a number of users

representing all the external or internal users and other aspects of

the existing system.

• A preliminary design is created for the new system.

• A first prototype of the new system is constructed from the

preliminary design. This is usually a scaled-down system, and

represents an approximation of the characteristics of the final

product.

• A second prototype is evolved by a fourfold procedure:

1. Evaluating the first prototype in terms of its strengths,

weakness, and risks.

2. Defining the requirements of the second prototype.

3. Planning an designing the second prototype.

4. Constructing and testing the second prototype.

• At the customer option, the entire project can be aborted if the risk

is deemed too great. Risk factors might involved development cost

overruns, operating-cost miscalculation, or any other factor that


TCP-SMART FRAMING

could, in the customer’s judgment, result in a less-than-satisfactory

final product.

• The existing prototype is evaluated in the same manner as was the

previous prototype, and if necessary, another prototype is

developed from it according to the fourfold procedure outlined

above.

• The preceding steps are iterated until the customer is satisfied that

the refined prototype represents the final product desired.

• The final system is constructed, based on the refined prototype.

• The final system is thoroughly evaluated and tested. Routine

maintenance is carried on a continuing basis to prevent large scale

failures and to minimize down time.

The following diagram shows how a spiral model acts like:


TCP-SMART FRAMING

Fig 1.0-Spiral Model

ADVANTAGES:

• Estimates(i.e. budget, schedule etc .) become more relistic as work

progresses, because important issues discoved earlier.


TCP-SMART FRAMING

• It is more able to cope with the changes that are software

development generally entails.

• Software engineers can get their hands in and start woring on the

core of a project earlier.


TCP-SMART FRAMING

SOFTWARE REQUIREMENT

The software requirement specification can produce at the culmination of the


analysis task. The function and performance allocated to software as part of system
engineering are refined by established a complete information description, a
detailed functional description, a representation of system behavior, an indication of
performance and design constrain, appropriate validation criteria, and other
information pertinent to requirements. This project requires the following H/W and
S/W equipment in order to execute them. They are as given below.

Software Requirements:

Software Requirements :
TCP-SMART FRAMING

Operating System : Windows XP/2003 or Linux


Programming Language : Java IO, AWT, NET Packages.
IDE/Workbench : My Eclipse 6.0
TCP-SMART FRAMING

HARDWARE REQUIREMENT

Hardware Requirements:

• System Configuration

Pentium III Processor with 700 MHz Clock Speed

256 MB RAM 20 GB HDD, 32 Bit PCI Ethernet Card.


TCP-SMART FRAMING
TCP-SMART FRAMING

SYSTEM DESIGN
TCP-SMART FRAMING

PROCESS FLOW

DATA FLOW DIAGRAMS

DATA FLOW DIAGRAMS:

A graphical tool used to describe and analyze the moment of data through a

system manual or automated including the process, stores of data, and

delays in the system. Data Flow Diagrams are the central tool and the basis

from which other components are developed. The transformation of data


TCP-SMART FRAMING

from input to output, through processes, may be described logically and

independently of the physical components associated with the system. The

DFD is also know as a data flow graph or a bubble chart.

DFDs are the model of the proposed system. They clearly should show the

requirements on which the new system should be built. Later during design

activity this is taken as the basis for drawing the system’s structure charts.

The Basic Notation used to create a DFD’s are as follows:

1. Dataflow: Data move in a specific direction from an origin to a

destination.

2. Process: People, procedures, or devices that use or produce (Transform)

Data. The physical component is not identified.

3. Source: External sources or destination of data, which may be People,

programs, organizations or other entities.

4. Data Store: Here data are stored or referenced by a process in the

System.
TCP-SMART FRAMING

DATAFLOW DIAGRAM FOR TCP-SF


TCP-SMART FRAMING

Send
Client reque If
Server
st Bursty
data
send
Send Proces Data
ACK s lost
Congesti
on
REQ Detectio
Send n
data
Seg
Alg

Send seg FRR Alg


data

Data Flow Diagram For Smart Framing

SEQUENCE DIAGRAM FOR TCP-SF


TCP-SMART FRAMING

Congestion Seg FRR


Client Server
Detection Algorithm Alg

Reque
st
CONG
DATA DETECT

SEG
ACTIVATED
Burs
FRR
t
ACTIVATED

SEND THE SEGMENTED DATA

Sequence Diagram for Smart Framing

COLLABORATION DIAGRAM FOR TCP-SF


TCP-SMART FRAMING

CLIENT

Congestion
Detection

Segmentatio
n Algorithm

1 2 3 4 5 FRR ALG

SERVER

Collaboration Diagram For Smart Framing

1. Client request.

2. Server ACK.

3. Server sends Data.

4. Busty Data

5. No ACK

CONGESTION DETECTION
TCP-SMART FRAMING

In this module, the server the segmented data to the


client under the transmission the data are jammed or overlapped
due to congestion occurs. We include the retransmit time out
factor for detect he congestion. In this time factor, we are setting
in the client side for congestion finding and give the duplicate
acknowledgment to the server for retransmitting that particular
packet.

Request

SERVER
ACK

CLIENT
Response

Congestion
Detection
Bursty Data
Data lost

Data Flow Diagram for Collaboration Detection

SEGMENTATION
TCP-SMART FRAMING

In this technique, the server gets the query form the client
and them gets the file packet formation process. The requested
file sends the client means where the data of the file are lost due
to the size of the file. While transmitting bulk of data means loss
occurs normally. So, we segment the data to avoid the data
losses with respect to segmentation technique. This segmentation
process is used to split the congestion packet into the two packets
for avoidance of the avoidance of the losses.

SERVER
Send ACK

Congestio
Segmentation
n CLIENT
Algorithm
Detection

Data Flow Diagram for Segmentation Module

UML Diagrams
TCP-SMART FRAMING

Unified Modeling Language:

The Unified Modeling Language allows the software engineer to express an

analysis model using the modeling notation that is governed by a set of

syntactic semantic and pragmatic rules.

A UML system is represented using five different views that describe the

system from distinctly different perspective. Each view is defined by a set of

diagram, which is as follows.

• User Model View

i. This view represents the system from the users

perspective.

ii. The analysis representation describes a usage scenario

from the end-users perspective.

• Structural model view

i. In this model the data and functionality are arrived from

inside the system.

ii. This model view models the static structures.

• Behavioral Model View

It represents the dynamic of behavioral as parts of the system,

depicting the interactions of collection between various structural

elements described in the user model and structural model view.


TCP-SMART FRAMING

• Implementation Model View

In this the structural and behavioral as parts of the system are

represented as they are to be built.

• Environmental Model View

In this the structural and behavioral aspects of the environment

in which the system is to be implemented are represented.

UML is specifically constructed through two different domains they are:

 UML Analysis modeling, this focuses on the user model and structural

model views of the system.

 UML design modeling, which focuses on the behavioral modeling,

implementation modeling and environmental model views.

Use case Diagrams represent the functionality of the system from a user’s

point of view. Use cases are used during requirements elicitation and

analysis to represent the functionality of the system. Use cases focus on the

behavior of the system from external point of view.

Actors are external entities that interact with the system. Examples of actors

include users like administrator, bank customer …etc., or another system like

central database.
TCP-SMART FRAMING

Class Diagram:
TCP-SMART FRAMING

Registeration

Login

ViewPrivateFiles

ViewPublicFiles
Client

SendFiles

Exit

USECASE-2

getPackets

viewPackets

Server

VerifyPackets

recollectsPackets
TCP-SMART FRAMING

Activity Diagram:

Client:

Client

Login

fail
enter username,password

success

ViewFiles Send Exit


TCP-SMART FRAMING

Server:

Server

ViewPackets FinLossPackets Recovery


TCP-SMART FRAMING

Sequence Diagram:

Client:

Client Authentication PrivateFiles() PublicFiles() Send Exit

login()

Check()

Fails()

viewPrivateFiles()

ViewPublicfiles()

SendFiles()

exit()
TCP-SMART FRAMING

Server:

Server Packets Recollect

GetPackets()

ViewPackets()

VerifyPackets()

RecollectPAcets()
TCP-SMART FRAMING

Collaboration Diagram:

Client:

2: Check()

1: login() 4: viewPrivateFiles()
Client Authentic Private
ation Files()
3: Fails()

5: ViewPublicfiles() 6: SendFiles()

7: exit()

Public
Files()
Send Exit
TCP-SMART FRAMING

Server:

1: GetPackets()
2: ViewPackets()
3: VerifyPackets()
Server Packets

4: RecollectPAcets()

Recollect
TCP-SMART FRAMING

Deployment Diagram:

Component Diagram:
TCP-SMART FRAMING
TCP-SMART FRAMING

TECHNOLOGY DESCRIPTION

FEATURES OF THE LANGUAGE USED:

About Java:
TCP-SMART FRAMING

Initially the language was called as “oak” but it was renamed as “Java” in

1995. The primary motivation of this language was the need for a platform-

independent (i.e., architecture neutral) language that could be used to

create software to be embedded in various consumer electronic devices.

 Java is a programmer’s language.

 Java is cohesive and consistent.

 Except for those constraints imposed by the Internet

environment, Java gives the programmer, full control.

Finally, Java is to Internet programming where C was to system

programming.

Swings:

Swing, which is an extension library to the AWT, includes new and improved

components that enhance the look and functionality of GUIs. Swing can be used to

build Standalone swing Gui Apps as well as Servlets and Applets. It employs a

model/view design architecture. Swing is more portable and more flexible than

AWT.

Swing is built on top of AWT and is entirely written in Java, using AWT’s lightweight
component support. In particular, unlike AWT, t he architecture of Swing
components makes it easy to customize both their appearance and behavior.
Components from AWT and Swing can be mixed, allowing you to add Swing support
to existing AWT-based programs. For example, swing components such as JSlider,
JButton and JCheckbox could be used in the same program with standard AWT
labels, textfields and scrollbars. You could subclass the existing Swing UI, model, or
TCP-SMART FRAMING

change listener classes without having to reinvent the entire implementation. Swing
also has the ability to replace these objects on-the-fly.

• 100% Java implementation of components


• Pluggable Look & Feel
• Lightweight components
• Uses MVC Architecture
Model represents the data
View as a visual representation of the data
Controller takes input and translates it to changes in data

• Three parts
Component set (subclasses of JComponent)
Support classes
Interfaces

In Swing, classes that represent GUI components have names beginning


with the letter J. Some examples are JButton, JLabel, and JSlider. Altogether
there are more than 250 new classes and 75 interfaces in Swing — twice as
many as in AWT.

Java Swing class hierarchy

The class JComponent, descended directly from Container, is the root class for most
of Swing’s user interface components.
TCP-SMART FRAMING

Swing contains components that you’ll use to build a GUI. I am listing you some of
the commonly used Swing components. To learn and understand these swing
programs, AWT Programming knowledge is not required.

Applications and Applets

An application is a program that runs on our Computer under the operating

system of that computer. It is more or less like one creating using C or C++.

Java’s ability to create Applets makes it important. An Applet is an

application designed, to be transmitted over the Internet and executed by a

Java –compatible web browser. An applet is actually a tiny Java program,

dynamically downloaded across the network, just like an image. But the

difference is, it is an intelligent program, not just a media file. It can react to

the user input and dynamically change.


TCP-SMART FRAMING

FEATURES OF JAVA:

Security

Every time you that you download a “normal” program, you are risking a

viral infection. Prior to Java, most users did not download executable

programs frequently, and those who did scanned them for viruses prior to

execution. Most users still worried about the possibility of infecting their

systems with a virus. In addition, another type of malicious program

exists that must be guarded against. This type of program can gather

private information, such as credit card numbers, bank account balances,

and passwords. Java answers both of these concerns by providing a

“firewall” between a networked application and your computer. When you

use a Java-compatible Web browser, you can safely download Java

applets without fear of virus infection or malicious intent.

Portability

For programs to be dynamically downloaded to all the various types of platforms

connected to the Internet, some means of generating portable executable code is

needed .As you will see, the same mechanism that helps ensure security also helps

create portability. Indeed, Java’s solution to these two problems is both elegant and

efficient.
TCP-SMART FRAMING

The Byte code

The key that allows the Java to solve the security and portability problem is that the

output of Java compiler is Byte code. Byte code is a highly optimized set of

instructions designed to execute by the Java run-time system, which is called the

Java Virtual Machine (JVM). That is, in its standard form, the JVM is an interpreter

for byte code.

Translating a Java program into byte code helps makes it much easier to run a

program in a wide variety of environments. The reason is, Once the run-time

package exists for a given system, any Java program can run on it.

Although Java was designed for interpretation, there is technically nothing

about Java that prevents on-the-fly compilation of byte code into native

code. Sun has just completed its Just In Time (JIT) compiler for byte code.

When the JIT compiler is a part of JVM, it compiles byte code into executable

code in real time, on a piece-by-piece, demand basis. It is not possible to

compile an entire Java program into executable code all at once, because

Java performs various run-time checks that can be done only at run time.

The JIT compiles code, as it is needed, during execution.

Java Virtual Machine (JVM)

Beyond the language, there is the Java virtual machine. The Java virtual

machine is an important element of the Java technology. The virtual machine

can be embedded within a web browser or an operating system. Once a

piece of Java code is loaded onto a machine, it is verified. As part of the


TCP-SMART FRAMING

loading process, a class loader is invoked and does byte code verification

makes sure that the code that’s has been generated by the compiler will not

corrupt the machine that it’s loaded on. Byte code verification takes place at

the end of the compilation process to make sure that is all accurate and

correct. So byte code verification is integral to the compiling and executing

of Java code.

The above picture shows the development process a typical Java

programming uses to produce byte codes and executes them. The first box

indicates that the Java source code is located in a. Java file that is processed

with a Java compiler called JAVA. The Java compiler produces a file called a.

class file, which contains the byte code. The class file is then loaded across

the network or loaded locally on your machine into the execution

environment is the Java virtual machine, which interprets and executes the

byte code.
TCP-SMART FRAMING

Java Architecture

Java architecture provides a portable, robust, high performing environment

for development. Java provides portability by compiling the byte codes for

the Java Virtual Machine, which is then interpreted on each platform by the

run-time environment. Java is a dynamic system, able to load code when

needed from a machine in the same room or across the planet.

Compilation of Code

When you compile the code, the Java compiler creates machine code (called

byte code) for a hypothetical machine called Java Virtual Machine (JVM). The

JVM is supposed to execute the byte code. The JVM is created for

overcoming the issue of portability. The code is written and compiled for one

machine and interpreted on all machines. This machine is called Java Virtual

Machine.

Compiling and interpreting Java Source Code


TCP-SMART FRAMING

During run-time the Java interpreter tricks the byte code file into thinking

that it is running on a Java Virtual Machine. In reality this could be a Intel

Pentium Windows 95 or Suns ARC station running Solaris or Apple Macintosh

running system and all could receive code from any computer through

Internet and run the Applets.

SIMPLE

Java was designed to be easy for the Professional programmer to learn and to use

effectively. If you are an experienced C++ programmer, learning Java will be even
TCP-SMART FRAMING

easier. Because Java inherits the C/C++ syntax and many of the object oriented

features of C++. Most of the confusing concepts from C++ are either left out of

Java or implemented in a cleaner, more approachable manner. In Java there are a

small number of clearly defined ways to accomplish a given task.

Object-Oriented

Java was not designed to be source-code compatible with any other language. This

allowed the Java team the freedom to design with a blank slate. One outcome of

this was a clean usable, pragmatic approach to objects. The object model in Java is

simple and easy to extend, while simple types, such as integers, are kept as high-

performance non-objects.

Robust

The multi-platform environment of the Web places extraordinary demands on a

program, because the program must execute reliably in a variety of systems. The

ability to create robust programs was given a high priority in the design of Java.

Java is strictly typed language; it checks your code at compile time and run time.

Java virtually eliminates the problems of memory management and de-allocation,

which is completely automatic. In a well-written Java program, all run time errors

can –and should –be managed by your program.

What is networking?

Computers running on the Internet communicate to each other using either the

Transmission Control Protocol (TCP) or the User Datagram Protocol (UDP), as this

diagram illustrates:
TCP-SMART FRAMING

When you write Java programs that communicate over the network, you are

programming at the application layer. Typically, you don't need to concern yourself

with the TCP and UDP layers. Instead, you can use the classes in the java.net

package. These classes provide system-independent network communication.

However, to decide which Java classes your programs should use, you do need to

understand how TCP and UDP differ.

TCP

When two applications want to communicate to each other reliably, they

establish a connection and send data back and forth over that connection.

This is analogous to making a telephone call. If you want to speak to Aunt

Beatrice in Kentucky, a connection is established when you dial her phone

number and she answers. You send data back and forth over the connection

by speaking to one another over the phone lines. Like the phone company,

TCP guarantees that data sent from one end of the connection actually gets

to the other end and in the same order it was sent. Otherwise, an error is

reported.
TCP-SMART FRAMING

TCP provides a point-to-point channel for applications that require reliable

communications. The Hypertext Transfer Protocol (HTTP), File Transfer

Protocol (FTP), and Telnet are all examples of applications that require a

reliable communication channel. The order in which the data is sent and

received over the network is critical to the success of these applications.

When HTTP is used to read from a URL, the data must be received in the

order in which it was sent. Otherwise, you end up with a jumbled HTML file,

a corrupt zip file, or some other invalid information.

Definition: TCP (Transmission Control Protocol) is a connection-based protocol

that provides a reliable flow of data between two computers.

UDP

The UDP protocol provides for communication that is not guaranteed between two

applications on the network. UDP is not connection-based like TCP. Rather, it sends

independent packets of data, called datagrams, from one application to another.

Sending datagrams is much like sending a letter through the postal service: The

order of delivery is not important and is not guaranteed, and each message is

independent of any other.

Definition: UDP (User Datagram Protocol) is a protocol that sends independent

packets of data, called datagram’s, from one computer to another with no

guarantees about arrival. UDP is not connection-based like TCP.


TCP-SMART FRAMING

For many applications, the guarantee of reliability is critical to the success of

the transfer of information from one end of the connection to the other.

However, other forms of communication don't require such strict standards.

In fact, they may be slowed down by the extra overhead or the reliable

connection may invalidate the service altogether.

Consider, for example, a clock server that sends the current time to its client

when requested to do so. If the client misses a packet, it doesn't really make

sense to resend it because the time will be incorrect when the client receives

it on the second try. If the client makes two requests and receives packets

from the server out of order, it doesn't really matter because the client can

figure out that the packets are out of order and make another request. The

reliability of TCP is unnecessary in this instance because it causes

performance degradation and may hinder the usefulness of the service.

Another example of a service that doesn't need the guarantee of a reliable

channel is the ping command. The purpose of the ping command is to test

the communication between two programs over the network. In fact, ping

needs to know about dropped or out-of-order packets to determine how

good or bad the connection is. A reliable channel would invalidate this

service altogether.

The UDP protocol provides for communication that is not guaranteed

between two applications on the network. UDP is not connection-based like


TCP-SMART FRAMING

TCP. Rather, it sends independent packets of data from one application to

another. Sending datagrams is much like sending a letter through the mail

service: The order of delivery is not important and is not guaranteed, and

each message is independent of any others.

Note: Many firewalls and routers have been configured not to allow UDP packets.

If you're having trouble connecting to a service outside your firewall, or if clients

are having trouble connecting to your service, ask your system administrator if UDP

is permitted.

Understanding Ports

Generally speaking, a computer has a single physical connection to the network. All

data destined for a particular computer arrives through that connection. However,

the data may be intended for different applications running on the computer. So

how does the computer know to which application to forward the data? Through the

use of ports.

Data transmitted over the Internet is accompanied by addressing

information that identifies the computer and the port for which it is destined.

The computer is identified by its 32-bit IP address, which IP uses to deliver

data to the right computer on the network. Ports are identified by a 16-bit

number, which TCP and UDP use to deliver the data to the right application.

In connection-based communication such as TCP, a server application binds

a socket to a specific port number. This has the effect of registering the
TCP-SMART FRAMING

server with the system to receive all data destined for that port. A client can

then rendezvous with the server at the server's port, as illustrated here:

Definition: The TCP and UDP protocols use ports to map incoming data to a

particular process running on a computer.

In datagram-based communication such as UDP, the datagram packet

contains the port number of its destination and UDP routes the packet to the

appropriate application, as illustrated in this figure:

Port numbers range from 0 to 65,535 because ports are represented by 16-bit

numbers. The port numbers ranging from 0 - 1023 are restricted; they are reserved

for use by well-known services such as HTTP and FTP and other system services.

These ports are called well-known ports. Your applications should not attempt to

bind to them.
TCP-SMART FRAMING

Networking Classes in the JDK

Through the classes in java.net, Java programs can use TCP or UDP to

communicate over the Internet. The URL, URL Connection, Socket, and Server

Socket classes all use TCP to communicate over the network. The Datagram

Packet, Datagram Socket, and Multicast Socket classes are for use with UDP.

What Is a URL?

If you've been surfing the Web, you have undoubtedly heard the term URL

and have used URLs to access HTML pages from the Web.

It's often easiest, although not entirely accurate, to think of a URL as the

name of a file on the World Wide Web because most URLs refer to a file on

some machine on the network. However, remember that URLs also can point

to other resources on the network, such as database queries and command

output.

Definition: URL is an acronym for Uniform Resource Locator and is a reference (an

address) to a resource on the Internet.

The following is an example of a URL which addresses the Java Web site

hosted by Sun Microsystems:


TCP-SMART FRAMING

As in the previous diagram, a URL has two main components:

• Protocol identifier

• Resource name

Note that the protocol identifier and the resource name are separated by a

colon and two forward slashes. The protocol identifier indicates the name of

the protocol to be used to fetch the resource. The example uses the

Hypertext Transfer Protocol (HTTP), which is typically used to serve up

hypertext documents. HTTP is just one of many different protocols used to

access different types of resources on the net. Other protocols include File

Transfer Protocol (FTP), Gopher, File, and News.

The resource name is the complete address to the resource. The format of

the resource name depends entirely on the protocol used, but for many

protocols, including HTTP, the resource name contains one or more of the

components listed in the following table:


TCP-SMART FRAMING

The name of the machine on which the resource


Host Name
lives.

Filename The pathname to the file on the machine.

The port number to which to connect (typically


Port Number
optional).

A reference to a named anchor within a resource


Reference that usually identifies a specific location within a file
(typically optional).

For many protocols, the host name and the filename are required, while the

port number and reference are optional. For example, the resource name for

an HTTP URL must specify a server on the network (Host Name) and the

path to the document on that machine (Filename); it also can specify a port

number and a reference. In the URL for the Java Web site java.sun.com is the

host name and the trailing slash is shorthand for the file named /index.html.

Sequence of socket calls for connection-oriented protocol:

System Calls

Socket - create a descriptor for use in network communication. On success, socket

system call returns a small integer value similar to a file descriptor Name.

Bind - Bind a local IP address and protocol port to a socket

When a socket is created it does not have nay notion of endpoint address. An

application calls bind to specify the local; endpoint address in a socket. For TCP/IP
TCP-SMART FRAMING

protocols, the endpoint address uses the socket address in structure. Servers use

bind to specify the well-known port at which they will await connections.

Connect - connect to remote client

After creating a socket, a client calls connect to establish an actual connection to a

remote server. An argument to connect allows the client to specify the remote

endpoint, which include the remote machines IP address and protocols port

number. Once a connection has been made, a client can transfer data across it.

Accept () - accept the next incoming connection

Accept creates a new socket for each new connection request and returns the

descriptor of the new socket to its caller. The server uses the new socket only for

the new connections it uses the original socket to accept additional connection

requests once it has accepted connection, the server can transfer data on the new

socket.

Return Value:

This system-call returns up to three values

An integer return code that is either an error indication or a new socket

description

The address of the client process

The size of this address

Listen - place the socket in passive mode and set the number of incoming TCP

connections the system will en-queue. Backlog - specifies how many connections
TCP-SMART FRAMING

requests can be queued by the system while it wants for the server to execute the

accept system call it us usually executed after both the socket and bind system

calls, and immediately before the accept system call.

Send, send to, recv and recvfrom system calls

These system calls are similar to the standard read and write system calls, but

additional arguments are requested.

Close - terminate communication and de-allocate a descriptor. The normal UNIX

close system call is also used to close a socket.


TCP-SMART FRAMING

CODING
TCP-SMART FRAMING

Server:

import java.io.*;

import java.awt.event.*;

import java.awt.*;

import javax.swing.*;

import javax.swing.event.*;

import java.net.*;

public class server extends JFrame

public JPanel pan,pan1;

public JLabel lab1,lab2;

public JTextField tf1;

public JPasswordField tf2;

public JButton jb1,jb2;

public server() throws Exception

{
TCP-SMART FRAMING

super("Server Window");

Container c=getContentPane();

c.setBackground(new Color(84,69,103));

UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.Wind

owsLookAndFeel");

lab1=new JLabel("servername");

lab1.setForeground(Color.BLACK);

lab2=new JLabel("serverpass");

lab2.setForeground(Color.BLACK);

tf1=new JTextField();

tf2=new JPasswordField();

jb1=new JButton("Start");

jb1.setBackground(new Color(32,43,32));

jb1.setForeground(Color.white);

jb2=new JButton("Stop");

jb2.setBackground(new Color(32,43,32));

jb2.setForeground(Color.white);

pan=new JPanel();
TCP-SMART FRAMING

pan.setLayout(new GridLayout(2,2));

pan.add(lab1);

pan.add(tf1);

pan.add(lab2);

pan.add(tf2);

pan1=new JPanel();

pan1.setLayout(new GridLayout(1,2));

pan1.setBackground(new Color(84,69,103));

pan1.add(jb1);

pan1.add(jb2);

jb1.addActionListener(new ActionListener()

public void actionPerformed(ActionEvent

a)

if(tf1.getText().equalsIgnoreCase("server") &&

tf2.getText().equalsIgnoreCase("server"))

{
TCP-SMART FRAMING

JOptionPane.showMessageDialog(null,"server

started successfully");

dispose();

new serverListen();

new form();

}else

tf1.setText("");tf2.setText("");

JOptionPane.showMessageDialog(null,"Invalid

values");

});

jb2.addActionListener(new ActionListener()

public void actionPerformed(ActionEvent

a)
TCP-SMART FRAMING

System.exit(0);

});

c.setLayout(new BorderLayout());

c.add(pan,BorderLayout.CENTER);

c.add(pan1,BorderLayout.SOUTH);

setLocation(250,200);

setResizable(false);

setDefaultCloseOperation(3);

setSize(200,100);

show();

public static void main(String args[])

try{
TCP-SMART FRAMING

new server();

}catch(Exception e)

System.out.println("Err in server->"+e);

User:

import java.io.*;

import java.awt.event.*;
TCP-SMART FRAMING

import java.awt.*;

import javax.swing.*;

import javax.swing.event.*;

import java.net.*;

public class user extends JFrame

public JButton jb1,jb2,jb3;

public JLabel l1,l2,j2,j3,j4,ju;

public JTextField jt1,jt2;

public JPasswordField jt3;

public String serip,username;

public int portnum;

private Socket

new_socket=null,send_socket=null;

private ObjectOutputStream send_out,new_out;

private ObjectInputStream send_in,new_in;

public String usern,ipad=null;


TCP-SMART FRAMING

public user()

Container c=getContentPane();

try

UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.Wind

owsLookAndFeel");

}catch(Exception mm)

System.out.println(mm.toString());

c.setLayout(null);

c.setBackground(new Color(153,204,255));

String str= "TCP SMART FRAMING

PROCESS WINDOW";

j2=new JLabel(str);

j2.setFont(new

Font("DIALOG",Font.BOLD,15));
TCP-SMART FRAMING

j2.setBounds(135,30,600,20);

ju=new JLabel("IPADDRESS");

ju.setBounds(150,110,100,20);

jt1=new JTextField("machine8",20);

jt1.setBounds(300,110,150,20);

j3=new JLabel("USERNAME");

j3.setBounds(150,160,100,20);

jt2=new JTextField(20);

jt2.setBounds(300,160,150,20);

j4=new JLabel("PASSWORD");

j4.setBounds(150,210,100,20);

jt3=new JPasswordField(20);

jt3.setBounds(300,210,150,20);

jb1=new JButton("NEW USER");

jb1.setBounds(170,300,100,20);

jb1.setMnemonic('n');
TCP-SMART FRAMING

jb1.addActionListener(new reg());

jb2=new JButton("CONNECT");

jb2.setBounds(325,300,100,20);

jb2.setMnemonic('c');

jb2.addActionListener(new con());

c.add(j2);

c.add(ju);c.add(jt1);

c.add(j3);c.add(jt2);

c.add(j4);c.add(jt3);

c.add(jb1);c.add(jb2);

setLocation(50,75);

setDefaultCloseOperation(3);

setResizable(false);

setSize(600,400);

show();

public class reg implements ActionListener


TCP-SMART FRAMING

public void actionPerformed(ActionEvent se)

try

packet new_packet= new packet();

new_packet.set_ip(jt1.getText().trim());

new_packet.set_user(jt2.getText().trim());

new_packet.set_pass(jt3.getText().trim());

new_socket=new

Socket(jt1.getText().trim(),3000);

new_out=new

ObjectOutputStream(new_socket.getOutputStream());

new_packet.set_act("new");

new_out.writeObject(new_packet);

new_in=new

ObjectInputStream(new_socket.getInputStream());

packet

get_resp=(packet)new_in.readObject();
TCP-SMART FRAMING

if(get_resp.get_act().equals("reg"))

JOptionPane.showMessageDialog(new

JFrame(),"You are Registered Successfully","Message From

Server",JOptionPane.PLAIN_MESSAGE);

jt1.setText("");

jt2.setText("");

jt3.setText("");

}else

JOptionPane.showMessageDialog(new

JFrame(),"Sorry,UserName Already Existed.Change

Username/Password.","Message From Server",0);

jt1.setText("");

jt2.setText("");

jt3.setText("");

}catch(Exception e)
TCP-SMART FRAMING

JOptionPane.showMessageDialog(new

JFrame(),"Error-->"+e,"Exception Message",0);

public class con implements ActionListener

public void actionPerformed(ActionEvent re)

try

packet send_packet= new packet();

send_packet.set_ip(jt1.getText().trim());

serip=jt1.getText().trim();

send_packet.set_user(jt2.getText().trim());

username=jt2.getText().trim();
TCP-SMART FRAMING

send_packet.set_pass(jt3.getText().trim());

send_packet.set_locip(InetAddress.getLocalHost().getHostName().t

oString());

send_socket=new

Socket(jt1.getText().trim(),3000);

portnum=3000;

send_out=new

ObjectOutputStream(send_socket.getOutputStream());

send_packet.set_act("log");

send_out.writeObject(send_packet);

send_in=new

ObjectInputStream(send_socket.getInputStream());

packet get_res=(packet)send_in.readObject();

if(get_res.get_act().equals("permit"))

JOptionPane.showMessageDialog(new

JFrame(),"Successfully Connected with the server.","Mesage From

Server",JOptionPane.PLAIN_MESSAGE);

jt3.setText("");

jt1.setText("");
TCP-SMART FRAMING

jt2.setText("");

hide();

dispose();

new

packet_send(serip,username,portnum);

new listen(get_res.get_cip());

}else

JOptionPane.showMessageDialog(new

JFrame(),"Sorry,Try Again.","Message From Server",0);

jt3.setText("");

jt1.setText("");

jt2.setText("");

}catch(Exception e)

{
TCP-SMART FRAMING

JOptionPane.showMessageDialog(new

JFrame(),"Error-->"+e,"Exception Message",0);

public static void main(String args[])

new user();

Packet Send:

import java.io.*;

import java.awt.*;

import java.awt.event.*;

import java.net.*;
TCP-SMART FRAMING

import javax.swing.*;

import javax.swing.tree.*;

import javax.swing.event.*;

import java.lang.*;

import java.util.*;

public class packet_send extends JFrame

public JLabel l1,l2,l3,l4,l5;

public Socket send_socket=null;

public ObjectOutputStream send_out;

public ObjectInputStream send_in;

public JButton b1,b2,b3;

public static JTextArea ta;

public static JList flist,dlist;

public JScrollPane tajsp,fjsp,djsp;

public Vector dv,fv,fcur,dcur;

public String

server_ip,user_name,dval,ofval,listname="",filen="";
TCP-SMART FRAMING

public packet p,send_packet=null;

public int server_port=0,cc=2000,y=0,rem;

public packet_send(String serip,String

username,int port)

super("USER REQUEST PANEL

====>"+username);

try

UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.Wind

owsLookAndFeel");

}catch(Exception mm)

System.out.println(mm.toString());

Container c=getContentPane();

c.setBackground(new Color(153,204,255));

this.server_port=port;
TCP-SMART FRAMING

this.server_ip=serip;

this.user_name=username;

c.setLayout(null);

JLabel pan=new JLabel("TCP SMART FRAMING

PACKET REQUESTING//RECEIVING WINDOW");

pan.setFont(new Font("Bold",Font.BOLD,18));

pan.setBounds(10,0,800,100);

l4=new JLabel("PERMITFILES");

l4.setBounds(50,150,100,20);

l3=new JLabel("PUBLICFILES");

l3.setBounds(200,150,100,20);

l5=new JLabel("PACKET INFORMATION");

l5.setBounds(350,150,150,20);

ta=new JTextArea();

tajsp=new JScrollPane(ta);

tajsp.setBounds(350,190,300,200);

flist=new JList();

fjsp=new JScrollPane(flist);

fjsp.setBounds(50,190,125,200);
TCP-SMART FRAMING

dlist=new JList();

djsp=new JScrollPane(dlist);

djsp.setBounds(200,190,125,200);

b1=new JButton("view");

b1.setBounds(100,450,100,25);

b1.setBackground(new Color(153,204,255));

b1.addActionListener(new ActionListener()

public void actionPerformed(ActionEvent

ae)

getfile();

});

b2=new JButton("Get");

b2.setBounds(300,450,100,25);

b2.setBackground(new Color(153,204,255));

b2.addActionListener(new store());
TCP-SMART FRAMING

b3=new JButton("exit");

b3.setBounds(500,450,100,25);

b3.setBackground(new Color(153,204,255));

b3.addActionListener(new ActionListener()

public void actionPerformed(ActionEvent

ae)

try{

packet send_packet= new packet();

send_packet.set_user(user_name);

send_packet.set_locip(InetAddress.getLocalHost().getHostName().t

oString());

Socket send_socket=new

Socket(server_ip,3000);

ObjectOutputStream send_out=new

ObjectOutputStream(send_socket.getOutputStream());

send_packet.set_act("exit");

send_out.writeObject(send_packet);
TCP-SMART FRAMING

ObjectInputStream send_it=new

ObjectInputStream(send_socket.getInputStream());

packet

pl=(packet)send_it.readObject();

if(pl.get_act().equals("ok"))

JOptionPane.showMessageDialog(new

JFrame(),"You are Loggedout Successfully","Message From

Server",JOptionPane.PLAIN_MESSAGE);

System.exit(0);

}else

JOptionPane.showMessageDialog(new

JFrame(),"Sorry,Some Problems.","Message From Server",0);

}catch(Exception gh)

{System.out.println("err in log->"+gh);

}
TCP-SMART FRAMING

});

flist.addListSelectionListener(new

ListSelectionListener()

public void valueChanged(ListSelectionEvent

le)

listname="";

filen="";

// dlist.setEnabled(false);

listname="permit";

filen=String.valueOf(flist.getSelectedValue());

});

dlist.addListSelectionListener(new

ListSelectionListener()

{
TCP-SMART FRAMING

public void valueChanged(ListSelectionEvent

le)

listname="";

filen="";

// flist.setEnabled(false);

listname="public";

filen=String.valueOf(dlist.getSelectedValue());

});

c.add(pan);

c.add(l3);

c.add(fjsp);

c.add(l4);

c.add(djsp);

c.add(l5);

c.add(tajsp);
TCP-SMART FRAMING

c.add(b1);c.add(b2);c.add(b3);

setSize(700,600);

setLocation(50,50);

setDefaultCloseOperation(3);

show();

public void getfile()

try

packet send_packet= new packet();

send_packet.set_user(user_name);

send_packet.set_locip(InetAddress.getLocalHost().getHostName().t

oString());

Socket send_socket=new

Socket(server_ip,3000);
TCP-SMART FRAMING

ObjectOutputStream send_out=new

ObjectOutputStream(send_socket.getOutputStream());

send_packet.set_act("get");

send_out.writeObject(send_packet);

ObjectInputStream send_it=new

ObjectInputStream(send_socket.getInputStream());

packet pl=(packet)send_it.readObject();

if(pl.get_act().equals("list"))

dv=new Vector();

fv=new Vector();

String dir[]=pl.getdirectories();

String file[]=pl.getfiles();

int dlen=dir.length;

int flen=file.length;

for(int i=0;i<dlen;i++)

dv.addElement(dir[i]);

}
TCP-SMART FRAMING

for(int x=0;x<flen;x++)

fv.addElement(file[x]);

dlist.removeAll();

dlist.setListData(dv);

flist.removeAll();

flist.setListData(fv);

}else

JOptionPane.showMessageDialog(null,"Server

Cannot able to process your request","Not Found

Message",JOptionPane.ERROR_MESSAGE);

Vector dvv=new Vector();

Vector fvv=new Vector();

flist.removeAll();

flist.setListData(fvv);

dlist.removeAll();

dlist.setListData(dvv);
TCP-SMART FRAMING

}catch(Exception p)

JOptionPane.showMessageDialog(null,"error in

ps-->"+p);

public class store implements ActionListener

public void actionPerformed(ActionEvent er)

try

String listnames=listname;

String fn=filen;

packet send_packet= new packet();

send_packet.set_user(user_name);
TCP-SMART FRAMING

send_packet.set_locip(InetAddress.getLocalHost().getHostName().t

oString());

Socket send_socket=new

Socket(server_ip,3000);

ObjectOutputStream send_out=new

ObjectOutputStream(send_socket.getOutputStream());

send_packet.set_act("abs");

send_packet.set_orgfilename(filen);

send_packet.set_filename(listnames);

send_out.writeObject(send_packet);

}catch(Exception mg)

System.out.println("Error in get

class-->"+mg);

public static void main(String ad[])

{
TCP-SMART FRAMING

new packet_send("dfff","sdfsf",3000);

TESTING
TCP-SMART FRAMING

Testing Concepts

• Testing

• Testing Methodologies

 Black box Testing:

 White box Testing.

 Gray Box Testing.

• Levels of Testing

 Unit Testing.

 Module Testing.

 Integration Testing.

 System Testing.

 User Acceptance Testing.

• Types Of Testing

 Smoke Testing.
TCP-SMART FRAMING

 Sanitary Testing.

 Regression Testing.

 Re-Testing.

 Static Testing.

 Dynamic Testing.

 Alpha-Testing.

 Beta-Testing.

 Monkey Testing.

 Compatibility Testing.

 Installation Testing.

 Adhoc Testing.

 Ext….

TCD (Test Case Documentation)

• STLC

 Test Planning.

 Test Development.

 Test Execution.

 Result Analysis.

 Bug-Tracing.

 Reporting.

• Microsoft Windows – Standards

• Manual Testing
TCP-SMART FRAMING

• Automation Testing (Tools)

 Win Runner.

 Test Director.

Testing:

• The process of executing a system with the intent of finding an error.

• Testing is defined as the process in which defects are identified,

isolated, subjected for rectification and ensured that product is defect

free in order to produce the quality product and hence customer

satisfaction.

• Quality is defined as justification of the requirements

• Defect is nothing but deviation from the requirements

• Defect is nothing but bug.

• Testing --- The presence of bugs

• Testing can demonstrate the presence of bugs, but not their absence

• Debugging and Testing are not the same thing!

• Testing is a systematic attempt to break a program or the AUT

• Debugging is the art or method of uncovering why the script /program

did not execute properly.


TCP-SMART FRAMING

Testing Methodologies:

• Black box Testing: is the testing process in which tester can

perform testing on an application without having any internal

structural knowledge of application.

Usually Test Engineers are involved in the black box testing.

• White box Testing: is the testing process in which tester can

perform testing on an application with having internal structural

knowledge.

Usually The Developers are involved in white box testing.

• Gray Box Testing: is the process in which the combination of black

box and white box tonics’ are used.

Levels of Testing:
TCP-SMART FRAMING

Module1 Module2 Module3

Units Units Units

i/p Integration o/p i/p Integration o/p

System Testing: Presentation + business +Databases

€ UAT: user acceptance testing

STLC (SOFTWARE TESTING LIFE CYCLE)

Test Planning:
TCP-SMART FRAMING

1.Test Plan is defined as a strategic document which

describes the procedure how to perform various testing on the

total application in the most efficient way.

2.This document involves the scope of testing,

3. Objective of testing,

4. Areas that need to be tested,

5. Areas that should not be tested,

6. Scheduling Resource Planning,

7. Areas to be automated, various testing tools

Used….

Test Development:

1. Test case Development (check list)

2. Test Procedure preparation. (Description of the Test cases).

1. Implementation of test cases. Observing the result.

Result Analysis: 1. Expected value: is nothing but expected behavior


TCP-SMART FRAMING

Of application.

2. Actual value: is nothing but actual behavior of

application

Bug Tracing: Collect all the failed cases, prepare documents.

Reporting: Prepare document (status of the application)

Types Of Testing:

> Smoke Testing: is the process of initial testing in which tester looks for

the availability of all the functionality of the application in order to perform

detailed testing on them. (Main check is for available forms)

> Sanity Testing: is a type of testing that is conducted on an application

initially to check for the proper behavior of an application that is to check all

the functionality are available before the detailed testing is conducted by on

them.
TCP-SMART FRAMING

> Regression Testing: is one of the best and important testing.

Regression testing is the process in which the functionality, which is already

tested before, is once again tested whenever some new change is added in

order to check whether the existing functionality remains same.

>Re-Testing: is the process in which testing is performed on some

functionality which is already tested before to make sure that the defects are

reproducible and to rule out the environments issues if at all any defects are

there.

Static Testing: is the testing, which is performed on an application when

it is not been executed.ex: GUI, Document Testing

Dynamic Testing: is the testing which is performed on an application

when it is being executed.ex: Functional testing.

Alpha Testing: it is a type of user acceptance testing, which is conducted

on an application when it is just before released to the customer.


TCP-SMART FRAMING

 Beta-Testing: it is a type of UAT that is conducted on an application

when it is released to the customer, when deployed in to the real time

environment and being accessed by the real time users.

 Monkey Testing: is the process in which abnormal operations, beyond

capacity operations are done on the application to check the stability of it in

spite of the users abnormal behavior.

Compatibility testing: it is the testing process in which usually the

products are tested on the environments with different combinations of

databases (application servers, browsers…etc) In order to check how far the

product is compatible with all these environments platform combination.

Installation Testing: it is the process of testing in which the tester try to

install or try to deploy the module into the corresponding environment by

following the guidelines produced in the deployment document and check

whether the installation is successful or not.

Adhoc Testing: Adhoc Testing is the process of testing in which unlike the

formal testing where in test case document is used, with out that test case
TCP-SMART FRAMING

document testing can be done of an application, to cover that testing of the

future which are not covered in that test case document. Also it is intended

to perform GUI testing which may involve the cosmotic issues.

TCD (Test Case Document):

Test Case Document Contains

• Test Scope (or) Test objective

• Test Scenario

• Test Procedure

• Test case

This is the sample test case document for the Case Investigate details of

Client project:

Test scope:

• Test coverage is provided for the screen “ Login check” form of a

Administration module of Forensic Manager application

• Areas of the application to be tested

Test Scenario:
TCP-SMART FRAMING

• When the office personals use this screen for the data entry, adding

sections, courts, grades and Case Registration information on s basis

and quit the form.

Test Procedure:

• The procedure for testing this screen is planned in such a way that the

data entry, status calculation functionality, saving and quitting

operations are tested in terms of GUI testing, Positive testing,

Negative testing using the corresponding GUI test cases, Positive test

cases, Negative test cases respectively


TCP-SMART FRAMING

Test Cases:

• Template for Test Case

T.C.No Description Exp Act Result

Guidelines for Test Cases:

1. GUI Test Cases:

• Total no of features that need to be check

• Look & Feel

• Look for Default values if at all any (date & Time, if at all any require)

• Look for spell check


TCP-SMART FRAMING

Example for Gui Test cases:

T.C.No Description Expected Actual value Result

value

Check for all the The

features in the screen


1
screen must

contain

all the

features

Check for the The

alignment of the alignment


2
objects as per should be

the validations in proper

way

2. Positive Test Cases:

• The positive flow of the functionality must be considered


TCP-SMART FRAMING

• Valid inputs must be used for testing

• Must have the positive perception to verify whether the requirements

are justified.

3. Positive Test Cases:

• The positive flow of the functionality must be considered

• Valid inputs must be used for testing

• Must have the positive perception to verify whether the requirements

are justified.

Example for Positive Test cases:

T.C.No Description Expected Actual value Result

value

1 Input Redirect to Redirect to Redirect to

UserName and HomePage Home Page Home Page

Password
TCP-SMART FRAMING

4. Negative Test Cases:

• Must have negative perception.

• Invalid inputs must be used for test.

Example for Negative Test cases:

T.C.No Description Expected Actual value Result

value

1 Input Login Page Login Page Login Page

username and

password

2
TCP-SMART FRAMING

SCREENS
TCP-SMART FRAMING

Start Server:
TCP-SMART FRAMING

Connect to server:
TCP-SMART FRAMING

Start Client:
TCP-SMART FRAMING

Connect To Server:
TCP-SMART FRAMING

SERVER PROCESSING WINDOW:


TCP-SMART FRAMING

TCP-SF PACKET REQUESTING/RECEIVING WINDOW

TCP-SF Packet Requesting/Receiving Window


TCP-SMART FRAMING

Server Processing Window:


TCP-SMART FRAMING

FUTURE ENHANCEMENTS:

It is not possible to develop a system that makes all the requirements of

the user. User requirements keep changing as the system is being used.

Some of the future enhancements that can be done to this system are:

• As the technology emerges, it is possible to upgrade the system and

can be adaptable to desired environment.

• Because it is based on object-oriented design, any further changes can

be easily adaptable.

• Based on the future security issues, security can be improved using

emerging technologies.
TCP-SMART FRAMING

BIBLIOGRAPHY
TCP-SMART FRAMING

REFERENCES

(1) Java Complete Reference By Herbert Shield

(2) Database Programming with JDBC and Java By George Reese

(3) Java and XML By Brett McLaughlin

(4) Wikipedia, URL: http://www.wikipedia.org.

(5) Answers.com, Online Dictionary, Encyclopedia and much more, URL:

http://www.answers.com

(6) Google, URL: http://www.google.co.in

(7)Project Management URL: http://www.startwright.com/project.htm

(8) http://it.toolbLox.com/wiki/index.php/Warehouse_Management
TCP-SMART FRAMING

You might also like