0% found this document useful (0 votes)
14 views49 pages

NDMOT

NDMOT is a file transfer protocol that enhances data transmission efficiency by allowing larger block sizes and incorporating data compression and error checking. It avoids the limitations of older protocols by dynamically adjusting block sizes and utilizing a 16-bit Cyclic Redundancy Check (CRC) for error detection. The protocol is designed to operate effectively in high noise environments and supports user validation and connection establishment for secure data transfer.

Uploaded by

mrpctechnologies
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views49 pages

NDMOT

NDMOT is a file transfer protocol that enhances data transmission efficiency by allowing larger block sizes and incorporating data compression and error checking. It avoids the limitations of older protocols by dynamically adjusting block sizes and utilizing a 16-bit Cyclic Redundancy Check (CRC) for error detection. The protocol is designed to operate effectively in high noise environments and supports user validation and connection establishment for secure data transfer.

Uploaded by

mrpctechnologies
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 49

ABSTRACT

Developers of their own communications programs can integrate NDMOT

support. NDMOT requires as little as 79K RAM to run and can be built without any

floating point support libraries. NDMOT provides more intelligent block sizing, data

compression and CRC support. Many of the older protocols were designed when 1200

baud was state of art.

As such, they use fairly small block sizes, which typically range from 128 to

1024 bytes in length. After each block gets transmitted, the older protocols require an

immediate acknowledgement before any more data will be sent. The

acknowledgement overhead and block size limitations together slow transmissions

down up to 25% less that its maximum throughput.

NDMOT avoids the block size and acknowledgement login by allowing block

sizes to increase to 8192 bytes in length. NDMOT starts out the block size at 512

bytes in length. With each successively correct transmission, it doubles the block size

to 1024, 2048, 4096 and finally 8192 bytes. Similarly, each successfully incorrect

transmission causes it to have the previous block size. Block sizes are as small as 64

bytes allow transmission even in a high noise environment.

NDMOT remains one of the few File Transfer Protocols with in-built data

compression. It will provide Run-Length Encoding (RLE) on blocks in which an

efficiency can be obtained. In pre-compressed data scenarios, such as transmission of

Zip-ed files, NDMOT automatically disables its compression. Realistically, RLE can

significantly help out older 2400-baud (v 22 bis) modems on uncompressed data.

1
However, RLE cannot act as modern hardware implemented compression protocols

such as Microcom Networking Protocol (MNP 5) and CCITT v.42bis LZW

compression. MNP 5 typically achieves 2:1 compression and v.42 bis achieves 4:1

compression.

NDMOT should provide 16 bit Cyclic Redundancy Check (CRC) for further

protection against transmission errors. However, the 16-bit CRC means that only

about 1 in 2^132 errors will go undetected.

2
CHAPTER- I

INTRODUCTION

The basic idea of this utility is it provides more intelligent block sizing, data

compression and error checking support. NDMOT is used for transferring files with

high speed over the network system.

NDMOT differs from other client server application in the way that it

establishes two connections between the hosts. One connection is used for data

transfer and the other for control information. NDMOT avoids the block size and

acknowledgement logjam by allowing block sizes to increase to number of bytes in

length.

We have number of protocol. Some of the protocols are HTTP, FTP, NEWS

and TELNET. HTTP is connectionless protocol. Messages in HTTP are divided into

two broad categories request and response. For only three request packets and one

type of response packet have been defined. The request command is sent from the

client to server. The response command is sent from the server to client. The get-

request command is used to retrieve information from the server. The head- request

command is used by the client receive just header information not data. The post -

request command is sent by the client to the server for passing information to the

server. It is usually used for sending mail, news bulletin boards and so on. FTP is

connection- oriented protocol.

3
Many of older protocols were designed when 1200 baud. As such, they use

fairly small sizes, which typically range from 128 to 1024 bytes in length. After each

block gets transmitted, the older protocol requires an immediate acknowledgement

before any more data will be send. The acknowledgement overhead and block size

limitations together slow transmission down up to 25% less than its maximum

throughput. The reason for using NDMOT is that it provides more intelligent block

sizing, data compression and error checking support.

NDMOT differs from other client server applications in that are establishes

two connections between the hosts. One connection is used for data transfer and the

other for control information. The request command is sent from the client to server.

The response command is sent from the server to client with each successively

correct transmission. It doubles the block size to number of bytes. Similarly, each

successively in correct transmission causes to halve the previous block size. Block

sizes are small as 64 bytes allow transmission even in high noise environment.

NDMOT avoids the block size and acknowledgement logjam by allowing

block sizes to increase to number of bytes in length with each successively

transmission and it doubles the block size to number of bytes. Interface between the

end- user and server. Client machines want some information or copy file from the

server. The client downloads the information or file from the server. The server

wants some information from the client means the information are up loaded from

the client to server. Information or data’s are transferred from one machine to

another machine. NDMOT is used to calculate data transferred rate.

4
DATA COLLECTION

SYSTEM INPUT SYSTEM OUTPUT

Request Data transferred

Reply Uploading information

Send data Downloading information

Get ACK/NACK Calculate data transfer rate

Doubling the block size

Data send

5
CHAPTER-II

PROBLEM DEFINITION AND METHODOLOGY

It is noted that to avoid the block size and acknowledgement logjam

NDMOT is used. It increases the number of bytes in length as doubled to number of

bytes in each successive transmission and it acts as interface between end-user and

the server. It is also used to calculate data transfer rate.

The following modules have been developed in this project.

 Validation of Users

 Establishing connection

 Cyclic redundancy check

 Compression of data

VALIDATION OF USERS

Before getting into the project, the first step is validation of users. When we

enter into Windows, we will get the prompt login. In this we have to enter the user

name then it will lead as into a password prompt. After we type the password, if we

are valid user, it will make us get logged us into the project.

For example in our project we use

login:RAMESH

password : ******

If the user is valid user, it will give us a common Windows message as

6
The user have got a new mail tty1 22-04-03

If the user is invalid , it will lead us into login prompt again

login :

This will happen until we are a valid user.

ESTABLISHING CONNECTION

After we enter into our login, it establishes connection and then we can run

the .exe file.

For example in our program we use .rded

First we have to compile and run this exe file. (Note this exe file is for server

connection). After that now take the client exe file and it is .rdecli, compile and run

this exe file. This will ask for a machine IP. Enter the correct IP address it will get

connected to the equivalent server holding that IP address. It will establish the

connection which will help for further actions.

 Now the server will send the message as “Connection Established”.

 If the machine IP is incorrect it will send the message as “Connection

Refused”.

7
After deduction of error we have to use make file which is nothing but an

update file. After that we have to again run the exe file as told above, then after

getting establish we can proceed with data transfer.

CYCLIC REDUNDANCY CHECK

The CRC is a very powerful but easily implemented technique to obtain data

reliability. The CRC technique is used to protect blocks of data called Frames. Using

this technique, the transmitter appends an extra n- bit sequence to every frame called

Frame Check Sequence (FCS). The FCS holds redundant information about the frame

that helps the transmitter detect errors in the frame. The CRC is one of the most used

techniques for error detection in data communications. The technique gained its

popularity because it combines three advantages

 Extreme error detection capabilities.

 Little overhead.

 Ease of implementation.

The following sections will explain the CRC more in depth

1. How the CRC algorithm works

2. Implementing the CRC algorithm in hardware

3. Implementing the CRC algorithm in software

4. The Most used CRC polynomials

HOW THE CRC ALGORITHM WORKS

The CRC algorithm works with the binary field. The algorithm treats all bit

streams as binary polynomials. Given the original frame, the transmitter generates the

FCS for that frame. The FCS is generated so that the resulting frame (the cascade of

8
the original frame and the FCS), is exactly devisable by some pre-defined polynomial.

This pre-defined polynomial is called the devisor or CRC Polynomial.

For the formal explanation we will define the following :

M - The original frame to be transmitted, before adding the FCS. It is k bits long.

F - The resulting FCS to be added to M. It is n bits long.

T - The cascading of M and F. This is the resulting frame that will be transmitted. It is

k+n bits long.

P - The pre-defined CRC Polynomial. A pattern of n+1 bits.

The main idea behind the CRC algorithm is that the FCS is generated so that the

reminder of T/P is zero. Its clear that

(1) T= M * x^n + F

This is because by cascading F to M we have shifted T by n bits to the left and then

added F to the result. We want the transmitted frame, T, to be exactly divisible by the

pre-defined polynomial P, so we would have to find a suitable Frame Check Sequence

(F) for every raw message (M).

Suppose we divided only M*x^n by P, we would get:

(2) M*x^n / P = Q + R/P

There is a quotient and a reminder. We will use this reminder, R, as our FCS (F).

Returning to Eq. 1:

(3) T= M*x^n + R

We will now show that this selection of the FCS makes the transmitted frame (T)

exactly divisible by P:

(4) T/P = (M*x^n + R)/P = M*x^n / P +R/P = Q + R/P + R/P = Q + (R+R)/P

but any binary number added to itself in a modulo 2 field yields zero so:

(5) T/P = Q, With no reminder.

9
Following is a review of the CRC creation process

1. Get the raw frame

2. Left shift the raw frame by n bits and the divide it by P.

3. The reminder of the last action is the FCS.

4. Append the FCS to the raw frame. The result is the frame to transmit

And a review of the CRC check process

1. Receive the frame.

2. Divide it by P.

3. Check the reminder. If not zero then there is an error in the frame.

It can be easily seen that the CRC algorithm must compute the reminder of the

division of two polynomials. The process is described in the following documents:

CRC Example Number 1

To Clear the definitions let's assume that:

M=1010001101 (k=10) and,

P=110101 (n+1=6)

Then the FCS to be calculated by the transmitter will be n=5 bits in length. Lets

assume that the transmitter has calculated the FCS to be:

F=1110 (n=5)

Then the transmitted frame will be:

T=1010001101 1110

BINARY POLYNOMIAL

A Binary Polynomial is a polynomial with coefficients from the binary field ,

for example X^3+X+1. Every sequence of bits can be represented by a binary

10
polynomial. The sequence 101011, for example, can be represented by the

polynomial:

X^5+X^3+X^1+X^0 = X^5+X^3+X+1.

From the example, the rightmost bit of the sequence represents the lowest degree of

the polynomial (degree zero). Logical left shift of i bits can be represented by

multiplying the polynomial by X^i. Modulo-2 Arithmetic

The multiplication process is merely a series of logical ANDs and XORs. In

the figure bellow, the vector [1001] is multiplied by the identity matrix I. This serves

to demonstrate the technique of modulo-2 matrix multiplication, as well as to prove

that dI = d.

Each row of the matrix corresponds to a bit in the data vector, with the top row

being the most significant bit, and the bottom row being the least significant. The

multiplication of the vector [1001] by the first column [1000] is :

1001 & 1000 = 1000

The addition modulo-2 of the vector [1000] is:

1^0^0^0 = 1

giving the first bit of the product vector.

|1 0 0 0 |

|0 1 0 0 |

[1 0 0 1] * |0 0 1 0 | = [1 0 0 1]

|0 0 0 1 |

11
FIG 2.1 Data

IMPLEMENTING THE CRC ALGORITHM IN SOFTWARE

The simplest way of implementing the CRC algorithm in software is to take

the hardware implementation and write the appropriate code, replacing the shift

register with a variable and the XOR gates with the xor operator. This method is the

easiest to implement and consumes very little memory. It's performance, however is

poor.

When the time of the CRC process is of importance, faster software

algorithms should be used. Those algorithms process one byte at a time and not one

bit at a time like the hardware implementation does. Those algorithms have one main

disadvantage: they have to keep tables in memory and so need more memory than the

bitwise algorithm does.

IMPLEMENTING THE CRC ALGORITHM IN HARDWARE

The hardware CRC implementation is shown in the figure 2.2. The

Implementation shown is for a specific set of parameters:

Message M=1010001101

Pattern P=110101

FIG 2.2

FCS F=1110 (to be calculated)

12
The circuit is implemented as follows

1. The register contains n bits, equal to the length of the FCS

2. There are up to n XOR gates

3. The presence or absence of a gate corresponds to the presence or absence of a

term in the divisor polynomial P(X)

The same circuit is used for both creation and check of the CRC. When

creating the FCS, the circuit accepts the bits of the raw frame and then a sequence of

zeros. The length of the sequence is the same as the length of the FCS. The contents

of the shift register will be the FCS to append. When checking the FCS, the circuit

accepts the bits of the received frame (raw frame appended by FCS and perhaps

corrupted by errors). The contents of the shift register should be zero or else there are

errors.

The Most used CRC polynomials

Following is a list of the most used CRC polynomials

 CRC-12: X^12+X^11+X^3+X^2+X+1

 CRC-16: X^16+X^15+X^2+1

 CRC-CCITT: X^16+X^12+X^5+1

 CRC-32:

X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+

X^2+X+1

The CRC-12 is used for transmission of streams of 6-bit characters and

generates 12-bit FCS. Both CRC-16 and CCRC-CCITT are used for 8 bit

transmission streams and both result in 16 bit FCS. The last two are widely used in

the USA and Europe respectively and give adequate protection for most applications.

Applications that need extra protection can make use of the CRC-32 which generates

13
32 bit FCS. The CRC-32 is used by the local network standards committee (IEEE-

802) and in some DOD application.

32 BIT CRC FILE CALCULATION

FIG 2.3

Use this utility to verify Cyclic Redundancy Check numbers for disk files. The

C++ source code demonstrates a minimal implementation of the CRC-32 algorithm.

Companion to the CRC Text Calculation program.

COMPRESSION OF DATA

If the data are too large, when it is transmitted through the communication

channel, it takes more time for transmission. Thus some redundant data must me

identified and it must be given some other shorter code so that original code may be

reduced. For that the data which is transferred is to be compressed and this is done

with help of run length encoding [RLE] and slightly modifiedin this project.

14
RUN LENGTH ENCODING

In modified Run Length Encoding (RLE) method, the data which have

undergone for compression from the data sources , the concept of Block Sorting is

used. While similar to the standard form of RLE, the method described here offers a

potentially more optimal encoding scheme for data where the length of symbol runs is

highly variable. The compression results posted later in work show an overall

compression improvement for the Calgary corpus of 11k when employed with the

M99 data coder. Further use of this technique (specific to M99 encoding scheme) has

produced a reduction 20k to the same corpus over M99 without this modified RLE

technique.

The basic idea behind the method described here is to encode character runs

with an RLE scheme while not introducing data into the transformed stream which

will interrupt the character runs left behind. Furthermore, this scheme is designed to

be optimal for small runs while being capable of providing good encoding for larger

runs.

The implementation details are as follows

Only runs of length 3 or greater are encoded. All runs of 1 and two are left

unchanged. For any run of symbols in an input stream greater than 2, a run of the

same symbol will be placed into the stream with a length equal to (N+3)/2 where

N=the length of the original run. The following demonstrates this encoding.

Original Run -> Coded run

AAA -> AAA

15
AAAA -> AAA

AAAAA -> AAAA

AAAAAA -> AAAA

AAAAAAA -> AAAAA

AAAAAAAA -> AAAAA

The only overhead needed to reverse this encoding is one bit which indicates

whether the original run of symbols was even or odd. These bits are packed together

and stored at the end of the file. Given this, the above example is completely encoded

as follows

Original Run -> Coded run + 1 bit

AAA -> AAA + 0

AAAA -> AAA + 1

AAAAA -> AAAA + 0

AAAAAA -> AAAA + 1

AAAAAAA -> AAAAA +0

AAAAAAAA -> AAAAA +1

This method leaves large runs of symbols smaller but uninterrupted for

encoding with standard Block Sorting methods but reduces common symbol runs

nearly in half.

16
The decoding for this scheme is very straight forward. For every run of

symbols in the encoded stream, the original run is 2N-2 where N is the length of the

encoded symbol run. This value is decremented by one if the extra encoded bit is a 0.

17
CHAPTER – III

REQUIREMENT ANALYSIS DESIGN

HARDWARE REQUIREMENTS

DEVICE USED NEEDED

CPU Core 2 Duo 2.7 GHz Dual Core 2 GHz

Memory 4 GB 2 GB

Disk Free 500 GB 120 GB

Screen 19’’ LED Monitor

Keyboard 102 Keyboard 101 TVS keyboard

Mouse Logitech Mouse Logitech Mouse

SOFTWARE REQUIREMENTS

Operating System Windows Family

Language PHYTHON 3.8.16

SERVER CLIENT

PENTIUM Core 2 Duo 2.7GHz Dual Core 2 GHz

4 GB RAM 2MB RAM

320 GB HDD 160 GB HDD

18
CHAPTER – IV

SYSTEM STUDY

EXISTING SYSTEM

We have number of protocol. Some of the protocols are HTTP, FTP, NEWS

and TELNET. HTTP is connectionless protocol. Messages in HTTP are divided into

two broad categories request and response. For only three request packets and one

type of response packet have been defined. The request command is sent from the

client to server. The response command is sent from the server to client. The get-

request command is used to retrieve information from the server. The head- request

command is used by the client receive just header information not data. The post -

request command is sent by the client to the server for passing information to the

server. It is usually used for sending mail, news bulletin boards and so on. FTP is

connection- oriented protocol.

Many of older protocols were designed when 1200 baud. As such, they use

fairly small sizes, which typically range from 128 to 1024 bytes in length. After each

block gets transmitted, the older protocol requires an immediate acknowledgement

before any more data will be send. The acknowledgement overhead and block size

limitations together slow transmission down up to 25% less than its maximum

throughput. Many of the older protocols were designed when 1200 baud was state of

art. The reason for using NDMOT protocol is that it provides more intelligent block

sizing, data compression and error checking support.

PROPOSED SYSTEM

19
The basic idea of this utility is it provides more intelligent block sizing, data

compression and error checking support. NDMOT is used for transferring files with

high speed over the network system. And other main features are,

 it requires as little as 79K RAM to run

 it provides more intelligent block sizing

 In-Built Data compression and

 CRC support.

FEASIBILITY STUDY

NDMOT use fairly small block sizes, which typically range from 128 to 1024

bytes in length. After each block gets transmitted, the older protocols require an

immediate acknowledgement before any more data will be sent. The

acknowledgement overhead and block size limitations together slow transmissions

down up to 25% less that its maximum throughput.

20
CHAPTER –V

IMPLEMENTATION AND TESTING

IMPLEMENTATION

After finishing the development of any computer based system the next

complicated time consuming process is system testing. During the time of testing only

the development company can know that, how far the user requirements have been

met out, and so on.

Following are the some of the testing methods applied to this effective project

SOURCE CODE TESTING

This examines the logic of the system. If we are getting the output that is

required by the user, then we can say that the logic is perfect.

SPECIFICATION TESTING

We can set with, what program should do and how it should perform under

various condition. This testing is a comparative study of evolution of system

performance and system requirements.

21
MODULE LEVEL TESTING

In this the error will be found at each individual module, it encourages the

programmer to find and rectify the errors without affecting the other modules.

UNIT TESTING

Unit testing focuses on verifying the effort on the smallest unit of software-

module. The local data structure is examined to ensure that the date stored temporarily

maintains its integrity during all steps in the algorithm’s execution. Boundary

conditions are tested to ensure that the module operates properly at boundaries

established to limit or restrict processing.

INTEGRATION TESTING

Data can be tested across an interface. One module can have an inadvertent,

adverse effect on the other. Integration testing is a systematic technique for

constructing a program structure while conducting tests to uncover errors associated

with interring.

VALIDATION TESTING

It begins after the integration testing is successfully assembled. Validation

succeeds when the software functions in a manner that can be reasonably accepted by

22
the client. In this the majority of the validation is done during the data entry operation

where there is a maximum possibility of entering wrong data. Other validation will be

performed in all process where correct details and data should be entered to get the

required results.

PERFORMANCE TESTING

Performance Testing is used to test runtime performance of software within

the context of an integrated system. Performance test are often coupled with stress

testing and require both software instrumentation.

OUTPUT TESTING

After performing the validation testing, the next step is output testing of the

proposed system since no system would be termed as useful until it does produce the

required output in the specified format. Output format is considered in two ways, the

screen format and the printer format.

USER ACCEPTANCE TESTING

User Acceptance Testing is the key factor for the success of any system. The

system under consideration is tested for user acceptance by constantly keeping in

touch with prospective system users at the time of developing and making changes

whenever required.

23
CHAPTER –VI

SOFTWARE DESCRIPTION

OPERATING SYSTEM

What is Windows 10?

Windows 10 is a Microsoft operating system for personal computers, tablets,

embedded devices and internet of things devices.

Microsoft released Windows 10 in July 2015 as a follow-up to Windows 8. Windows

10 has an official end of support date of October, 2025, with Windows 11 as it's

successor.

Anyone adopting Windows 10 can upgrade legacy machines directly from Windows

7 or Windows 8 to Windows 10 without re-imaging or performing intrusive and time-

consuming system wipes and upgrade procedures. To upgrade from a previous

version of Windows 10, IT or users run the Windows 10 OS installer, which transfers

any applications and software on the previous OS, as well as settings and preferences

over to Windows 10.

Organizations and users can pick and choose how they will patch and update

Windows 10. IT or users can access a Windows 10 upgrade through the Windows

Update Assistant to manually begin an upgrade or wait for Windows Update to offer

an upgrade when it is set to run.

Windows 10 features built-in capabilities that allow corporate IT departments to

use mobile device management (MDM) software to secure and control devices

running the operating system. In addition, organizations can use traditional desktop

management software such as Microsoft System Center Configuration Manager.

24
Windows 10 features

The familiar Start Menu, which Microsoft replaced with Live Tiles in Windows 8,

returned in Windows 10. Users can still access Live Tiles and the touch-centric Metro

interface from a panel on the right side of the Start Menu, however.

The server processes are further divided into two types.

1. When the server can handle a client request in a known, short amount of time,

the server process handles the request itself. We call these iterative servers.

The server typically handles a time-of-day service in an iterative fashion.

2. When the amount of time to service a request depends on the request itself (so

that the server doesn't know ahead of time how much effort it takes to handle

each request), the server typically handles it in a concurrent fashion. These are

called concurrent servers. A concurrent server invokes another process to

handle each client request, so that the original server process can go back to

sleep, waiting for the next client request. Naturally, this type of server requires

an operating system that allows multiple processes to run at the same time.

There are two machines involved in an ftp transaction, a client machine, which is

sometimes called the local host, and a server machine, which is sometimes called the

remote host. The client is always the machine that initiates the transfer. During an ftp

session, it is extremely important to keep track of which machine is the client and

which is the server, because this will determine whether the user use a get command

or a put command to move files. The get command is always used to copy files from

the server to the client, and the put command is used to copy files from the client to

the server.

25
As a simple example, consider the case where the user desktop computer (e.g.,

a Macintosh or a DOS PC) runs an ftp client in order to connect to the ftp server on

the machine ux1.cso.uiuc.edu. To initiate the process on, say, a DOS machine, might

type the following command, using the Clarkson or PC/TCP ftp program:

C:\PCTCP>ftp ux1.cso.uiuc.edu

After some negotiation with ux1, the user ftp client and the ux1 ftp server

would be talking to each other, and would type commands for putting and getting

files. Since the user PC was used to initiate the ftp connection, it is the client and ux1

is the server. In this case, "putting" means uploading files from r PC to the ux1, and

"getting" means downloading files from the to the user PC as shown in the diagram

below:

FIG 1.6

The situation can be more complicated, and sometimes it's difficult to decide

whether to put or to get. A common example of this is when the user are running

26
telnet on a PC to log in to the user WINDOWS account. The user log in to the user

account on ux1 and read the user e-mail using Pine. Someone has sent the user an

attachment that is a DOS executable, typically a self-extracting ZIP file, and the user

want to download it to the user PC. Many telnet applications have a built-in ftp server,

allowing the user, during a telnet session with a remote WINDOWS system, to initiate

an ftp session from the WINDOWS system back to the user PC. In fact, some telnet

applications (e.g., NCSA telnet, PC/TCP, CUTCP), automatically generate the

WINDOWS ftp command for the user with the IP address filled in, as if the user had

typed the WINDOWS command:

ux1> ftp 128.174.xxx.yyy

where xxx and yyy have been replaced with the appropriate numbers from the

user machine's IP address. This is exactly equivalent to starting up the WINDOWS ftp

client to establish an ftp connection with the user PC. In this case, ux1 is the client

machine (or local host), and the user PC is the server machine (or remote host) as

illustrated in the next diagram. (Needless to say, in this instance, the terms "local" and

"remote" are counter-intuitive, since the user PC is geographically "closer" to the

user than ux1.) In order to download the user file to the user PC, the user must use

the put command, since the user are using the WINDOWS ftp client to copy the file to

the user PC, which is acting as the server machine. To upload files to the user

WINDOWS account, the user would use the get command, for the same reason.

27
FIG 1.7

There is a third situation in which the user PC, acting as a telnet client only, is

used to initiate an ftp session between two remote computers, and therefore is not

directly involved in the ftp transaction. In such instances, the user PC is neither the

ftp client nor the ftp server. For example, if the user log in to ux1 and then use the ftp

client on ux1 to start an ftp session between ux1 and uiarchive, ux1 is ftp client and

uiarchive is the ftp server:

In this case, the user get files from uiarchive to ux1, and, if the user have

special privileges, the user can copy files to uiarchive using the put command. This

situation is illustrated in the following diagram:

28
ux1> ftp uiarchive.cso.uiuc.edu

FIG 1.8

The proper use of several other ftp commands, in addition to put and get, also

hinges on an understanding of client and server. For example, the the cd (change

directory) command is used to move from one directory to another on the server. If

the user want to change directories on the client machine, the user must instead use

the lcd command, which stands for local change directory. As long as the user keep in

mind the examples and principles outlined above, however, the user should have no

trouble deciding when to put or get, whether to lcd or cd, etc.

29
CONNECTIONS AND ASSOCIATIONS

We use the term connection to define the communication link between two

processes. The term association is used for the 5-tuple that completely specifies the

two processes that make up a

connection{protocol, local-address, local-process, remote-address, remote-process}

The local-address and the remote-address specify the network and host IP

addresses. The local-process and foreign-process identify the specific processes on

each system that are involved in the connection. In TCP/IP, an example could be

{tcp, 192.43.65.160, 1250, 192.61.66.25, 23}

Here, the protocol is TCP, the local IP address is 192.43.65.160, the local-

process is 1500 (port #), the remote IP address is 192.61.66.25 and the remote-process

is 23 (port #).

ELEMENTARY SOCKET SYSTEM CALLS

SOCKET SYSTEM CALL

To do network I/O, a process must first call the socket system call, specifying

the type of communication protocol desired (TCP, UDP). The socket system call

returns a small integer value, similar to a file descriptor. This is the socket descriptor.

In the 5-tuple association described above, the socket system call just specifies the

first element, the protocol. Before the socket descriptor is of any real use, the

remaining four elements of the association must be specified. What the process would

do next depends on whether the server is connection-oriented (uses TCP at the

transport-layer) or connectionless (uses UDP at the transport-layer).

30
BIND SYSTEM CALL

The bind system call assigns a name to an unnamed socket. Basically, bind fills in

the local-address and local-process elements of the 5-tuple associations. There are

three uses of bind.

1. Servers register their well-known address with the system. It tells the system

"this is my address and any messages received for this address are to be given

to me". Both connection-oriented and connectionless servers need to do this

before accepting client requests.

2. A client can register a specific address for itself.

3. A connectionless client needs to assure that the system assigns it some unique

address, so that the other end (the server) has a valid return address to send its

responses to. This corresponds to making certain an envelope has a valid

return address, if we expect to get a reply from the person we send the letter

to.

CONNECT SYSTEM CALL

A client process connects a socket descriptor following the socket system call

to establish a connection. For most connection-oriented protocols (TCP being one

example), the connect system call results in the actual establishment of a connection

between the local system and the foreign system. Messages are typically exchanged

between the two systems and specific parameters relating to the conversation might be

agreed on (buffer sizes, amount of data to exchange between acknowledgements,

etc.). In these cases the connect system call does not return until the connection is

established, or an error is returned to the process.

31
The client does not have to bind a local address before calling connects. The

connection typically causes these four elements of the association 5-tuple to be

assigned: local address, local-process, remote-address, remote-process.

LISTEN SYSTEM CALL

A connection-oriented server to indicate that it is willing to received

connections uses this system call. Listen is executed after both socket and bind system

calls.

ACCEPT SYSTEM CALL

After a connection-oriented server executes the listen system call, an actual

connection from some client process is waited for by having the server execute the

accept system call. Accept takes the first connection request on the queue and creates

another socket with the same properties as the initial socket. If there are no connection

requests pending, this call blocks the caller until one arrives. The typical scenario is as

follows

int sockfd, newsockfd;

if ((sockfd = socket(...)) < 0)

error_handle("socket error");

if (bind(sockfd, ...) < 0)

error_handle("bind error");

if (listen(sockfd, ...) < 0)

error_handle("listen error);

for ( ; ; ) {

newsockfd=accept(sockfd, ...); /* blocks */

if (newsockfd < 0)

error_handle("accept error");

32
if (fork() == 0) {

close(sockfd); /* child */

doit(newsockfd); /* process the request */

exit(0);

close(newsockfd); /* parent */

When a connection request is received and accepted, the process forks, with

the child process serving the connection and the parent waiting for another connection

request. All five elements of the 5-tuple associated with newsockfd have been filled in

on return from accept.

SEND, RECV SYSTEM CALLS

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

additional arguments are required.

CLOSE SYSTEM CALL

The normal Windows close system call is also used to close a

socket.

33
WHAT IS PYTHON?

Python is a programming language that is widely used in web applications, software

development, data science, and machine learning (ML). Developers use Python

because it is efficient and easy to learn and can run on many different platforms.

Python software is free to download, integrates well with all types of systems, and

increases development speed.

What are the benefits of Python?

Benefits of Python include:

 Developers can easily read and understand a Python program because it has

basic, English-like syntax.

 Python makes developers more productive because they can write a Python

program using fewer lines of code compared to many other languages.

 Python has a large standard library that contains reusable codes for almost any

task. As a result, developers do not have to write code from scratch.

 Developers can easily use Python with other popular programming languages

such as Java, C, and C++.

 The active Python community includes millions of supportive developers

around the globe. If you face an issue, you can get quick support from the

community.

 Plenty of helpful resources are available on the internet if you want to learn

Python. For example, you can easily find videos, tutorials, documentation, and

developer guides.

 Python is portable across different computer operating systems such as

Windows, macOS, Linux, and Unix.

34
How is Python used?

The Python language has several use cases in application development, including the

following examples:

SERVER-SIDE WEB DEVELOPMENT

Server-side web development includes the complex backend functions that websites

perform to display information to the user. For example, websites must interact with

databases, talk to other websites, and protect data when sending it over the network.

Python is useful for writing server-side code because it offers many libraries that

consist of prewritten code for complex backend functions. Developers also use a wide

range of Python frameworks that provide all the necessary tools to build web

applications faster and more easily. For example, developers can create the skeleton

web application in seconds because they don’t need to write it from scratch. They can

then test it using the framework’s testing tools, without depending on external testing

tools.

AUTOMATION WITH PYTHON SCRIPTS

A scripting language is a programming language that automates tasks that humans

normally perform. Programmers widely use Python scripts to automate many day-to-

day tasks such as the following:

 Renaming a large number of files at once

 Converting a file to another file type

 Removing duplicate words in a text file

 Performing basic mathematical operations

 Sending email messages

35
 Downloading content

 Performing basic log analysis

 Finding errors in multiple files

DATA SCIENCE AND MACHINE LEARNING

Data science is extracting valuable knowledge from data, and machine learning

(ML) teaches computers to automatically learn from the data and make accurate

predictions. Data scientists use Python for data science tasks such as the following:

 Fixing and removing incorrect data, which is known as data cleaning

 Extracting and selecting various features of data

 Data labeling, which is adding meaningful names for the data

 Finding different statistics from data

 Visualizing data by using charts and graphs such as line charts, bar graphs,

histograms, and pie charts

Data scientists use Python ML libraries to train ML models and build classifiers that

accurately classify data. People in different fields use Python-based classifiers to do

classification tasks such as image, text, and network traffic classification; speech

recognition; and facial recognition. Data scientists also use Python for deep learning,

an advanced ML technique.

Software development

Software developers often use Python for different development tasks and software

applications such as the following:

 Keeping track of bugs in the software code

 Automatically building the software

36
 Handling software project management

 Developing software prototypes

 Developing desktop applications using Graphical User Interface (GUI)

libraries

 Developing simple text-based games to more complex video games

SOFTWARE TEST AUTOMATION

Software testing is the process of checking whether the actual results from the

software match the expected results to ensure that the software is error-free.

 Developers use Python unit test frameworks, such as Unittest, Robot, and

PyUnit, to test the functions they write.

 Software testers use Python to write test cases for various test scenarios. For

example, they use it to test the user interface of a web application, multiple

software components, and new features.

Developers can use several tools to automatically run test scripts. These tools are

known as Continuous Integration/Continuous Deployment (CI/CD) tools. Software

testers and developers use CI/CD tools such as Travis CI and Jenkins to automate

tests. The CI/CD tool automatically runs the Python test scripts and reports the test

results whenever developers introduce new code changes.

WHAT IS THE HISTORY OF PYTHON?

Guido Van Rossum, a computer programmer in the Netherlands, created Python. He

started it in 1989 at Centrum Wiskunde & Informatica (CWI), initially as a hobby

project to stay busy during Christmastime. The name for the language was inspired by

37
the BBC TV show Monty Python’s Flying Circus because Guido Van Rossum was a

big fan of the show.

History of Python releases

 Guido Van Rossum published the first version of the Python code (version

0.9.0) in 1991. It already included good features such as some data types and

functions for error handling.

 Python 1.0 was released in 1994 with new functions to easily process a list of

data, such as map, filter, and reduce.

 Python 2.0 was released on October 16, 2000, with new useful features for

programmers, such as support for Unicode characters and a shorter way to

loop through a list.

 On December 3, 2008, Python 3.0 was released. It included features such as

the print function and more support for number division and error handling.

WHAT ARE THE FEATURES OF PYTHON?

Following features of the Python programming language make it unique:

An interpreted language

Python is an interpreted language, which means it directly runs the code line by line.

If there are errors in the program code, it will stop running. Therefore, programmers

can quickly find errors in the code.

An easy-to-use language

Python uses English-like words. Unlike other programming languages, Python

doesn’t use curly brackets. Instead, it uses indentation.

38
A dynamically typed language

Programmers do not have to declare variable types when writing code because Python

determines them at runtime. Because of this, you can write Python programs more

quickly.

A high-level language

Python is closer to human languages than some other programming languages.

Therefore, programmers do not have to worry about its underlying functionalities

such as architecture and memory management.

AN OBJECT-ORIENTED LANGUAGE

Python considers everything to be an object, but it also supports other types of

programming such as structured and functional programming.

What are Python libraries?

A library is a collection of frequently used codes that developers can include in their

Python programs to avoid writing code from scratch. By default, Python comes with

the Standard Library, which contains a lot of reusable functions. In addition, more

than 137,000 Python libraries are available for various applications, including web

development, data science, and machine learning (ML).

WHAT ARE THE MOST POPULAR PYTHON LIBRARIES?

Matplotlib

Developers use Matplotlib to plot data in high-quality two- and three-dimensional (2D

and 3D) graphics. It is often used in scientific applications. With Matplotlib, you can

39
visualize data by displaying it in different charts such as bar charts and line charts.

You can also plot multiple charts at once, and the graphics are portable across all

platforms.

Pandas

Pandas provides optimized and flexible data structures that you can use to manipulate

time-series data and structured data, such as tables and arrays. For example, you can

use Pandas to read, write, merge, filter, and group data. Many people use it for data

science, data analysis, and ML tasks.

NumPy

NumPy is a popular library that developers use to easily create and manage arrays,

manipulate logical shapes, and perform linear algebra operations. NumPy supports

integration with many languages such as C and C++.

REQUESTS

The Requests library provides useful functions that are required for web development.

You can use it to send HTTP requests, add headers, add URL parameters, add data,

and perform many more tasks when communicating with web applications.

OPENCV-PYTHON

OpenCV-Python is a library that developers use to process images for computer

vision applications. It provides many functions for image processing tasks such as

reading and writing images simultaneously, building a 3D environment from a 2D

one, and capturing and analyzing images from video.

40
KERAS

Keras is Python's deep neural network library with excellent support for data

processing, visualization and much more. Keras supports many neural networks. It

has a modular structure that offers flexibility in writing innovation applications.

WHAT ARE PYTHON FRAMEWORKS?

A Python framework is a collection of packages and modules. A module is a set of

related code, and a package is a set of modules. Developers can use Python

frameworks to build Python applications more quickly because they do not have to

worry about low-level details such as how communications happen in the web

application or how Python will make the program faster. Python has two types of

frameworks:

 A full-stack framework includes almost everything that is required to build a

large application.

 A microframework is a basic framework that provides minimal functionalities

for building simple Python applications. It also provides extensions if

applications need more sophisticated functions.

WHAT ARE THE MOST POPULAR PYTHON FRAMEWORKS?

Developers can use multiple Python frameworks to make their development efficient,

including the following frameworks:

Django

Django is one of the most widely used full-stack Python web frameworks for

developing large-scale web applications. It provides several useful features, including

a web server for development and testing, a template engine to build the website

frontend, and various security mechanisms.

41
Flask

Flask is a micro-framework for developing small web applications. Its features

include strong community support, well-written documentation, a template engine,

unit testing, and a built-in web server. It also provides extensions for validation

support, database mapping layers, and web security.

TurboGears

TurboGears is a framework designed to build web applications faster and easier.

These are some of its popular features:

 A specific database table structure

 Tools for creating and managing projects

 A template engine to build the databases

 A template engine to build the frontend

 Mechanisms to handle web security

Apache MXNet

Apache MXNet is a fast, flexible, and scalable deep learning framework that

developers use to build research prototypes and deep learning applications. It supports

multiple programming languages, including Java, C++, R, and Perl. It provides a rich

set of tools and libraries to support development. For example, you can find an

interactive machine learning (ML) book, computer vision toolkits, and deep learning

models for Natural Language Processing (NLP), which processes natural language

such as text and speech.

42
PyTorch

PyTorch is a framework for ML that has been built on top of the Torch library, which

is another open-source ML library. Developers use it for applications such as NLP,

robotics, and computer vision, finding meaningful information in images and videos.

They also use it to run those applications in CPUs and GPUs.

What are Python IDEs?

An integrated development environment (IDE) is software that gives developers the

tools they need to write, edit, test, and debug code in one place.

What are the most popular Python IDEs?

PyCharm

JetBrains, a Czech company that develops software tools, created PyCharm. It has a

free community edition that is suitable for small Python applications and a paid

professional edition that is suitable for building large-scale Python applications, with

the following full set of features:

 Automatic code completion and code inspection

 Error handling and quick fixes

 Code cleaning without changing the functionality

 Support for web application frameworks such as Django and Flask

 Support for other programming languages, such as JavaScript, CoffeeScript,

TypeScript, AngularJS, and Node

 Scientific tools and libraries such as Matplotlib and NumPy

 Ability to run, debug, test, and deploy applications in remote virtual machines

 A debugger to find errors in the code, a profiler to identify performance issues

in the code, and a test runner for running unit tests

43
 Support for databases

IDLE

Integrated Development and Learning Environment (IDLE) is the Python IDE

installed by default. It has been developed only with Python using the Tkinter GUI

toolkit and offers the following features:

 Works across many operating systems such as Windows, Unix, and macOS

 Provides a shell window to run commands and display the output

 Offers a multiple-window text editor that provides code syntax highlighting

and automatic code completion

 Has its own debugger

Spyder

Spyder is an open-source IDE that many scientists and data analysts use. It provides a

comprehensive development experience with features for advanced data analysis, data

visualization, and debugging. It also includes the following features:

 A rich code editor that supports multiple languages

 An interactive IPython console

 A basic debugger

 Scientific libraries such as Matplotlib, SciPy, and NumPy

 Ability to explore variables in the code

 Ability to view documentation in real time

Atom

Atom is a free editor developed by GitHub that supports coding in many

programming languages, including Python. Using Atom, developers can directly work

44
with GitHub, the website where you can save your code centrally. Atom offers the

following features:

 Ability to use with many operating systems

 Easy installation or creation of new packages

 Faster automatic code completion

 Ability to search files and projects

 Easy customization of the interface

What are Python SDKs?

A software development kit (SDK) is a collection of software tools that developers

can use to create software applications in a particular language. Most SDKs are

specific to different hardware platforms and operating systems. Python SDKs include

many tools such as libraries, code samples, and developer guides that developers find

helpful when writing applications.

What is Boto3 in Python?

Boto3 is the AWS SDK for Python. You can use it to create, configure, and manage

AWS services such as Amazon Elastic Compute Cloud (EC2), Amazon Simple

Storage Service (S3), and Amazon DynamoDB. Boto3 also provides two types

of APIs: low-level APIs and Resource APIs for developers.

45
COMMUNICATIONS PROGRAMMING

CONCEPTS

KERNEL SERVICE SUBROUTINES

accept Accepts a connection on a socket to create a new socket.

bind Binds a name to a socket.

connect Connects two sockets.

getdomainname Gets the name of the current domain.

gethostid Gets the unique identifier of the current host.

gethostname Gets the unique name of the current host.

getpeername Gets the name of the peer socket.

getsockname Gets the socket name.

getsockopt Gets options on sockets.

listen Listens for socket connections and limits the backlog of incoming

connections.

recv Receives messages from connected sockets.

recvfrom Receives messages from sockets.

recvmsg Receives a message from any socket.

send Sends messages from a connected socket.

sendmsg Sends a message from a socket by using a message structure.

sendto Sends messages through a socket.

send_file Sends the contents of a file through a socket.

setdomainname Sets the name of the current domain.

sethostid Sets the unique identifier of the current host.

46
sethostname Sets the unique name of the current host.

setsockopt Sets socket options.

shutdown Shuts down all socket send and receive operations.

socket Creates an end point for communication and returns a descriptor.

socketpair Creates a pair of connected sockets.

 exit

exit will come out of the Windows environment.

 Debug

Debug is use to display the errors explanation if there is error occurred

in Upload or Download the file.

CHAPTER –VII

CONCLUSION

47
This “NETWORK DATA MOST OPTIMIZED TRANSFER” is a

rewarding experience in more than one way. Every command, every transfer, in this

new system represents the real fastness, which the world is expecting for. The

requirements of a new protocol are covered to a little extent. The protocol is faster

when compared to any other existing system, even though it will be better if we make

use of any other new compression technique, which will help to make the transfer still

faster. This protocol is waiting for it’s launching after still more improvements are

made.

BIBLIOGRAPHY

48
1. Engle wood Cliffs, N.J., WINDOWS System V Release 3.2 – Network

Programmer’s Guide.,AT & T 1989a, Prentice hall., 1989.

2. Engle wood Cliffs, N.J, W.Richard Stevens, AT & T 2000, WINDOWS

Network Programming, Prentice hall, 2000.

3. AEleen Frisch, Essential System Administration, 3rd Edition, August 2002.

4. Yashavant Kanetkar Let Us C, 3 rd Edition, BPB publications, 1999.

5. Ellen Siever, Stephen Spainhour, JessicaHekman, Stephen Figgins, Windows

in a Nutshell, 3rd Edition, August 2000.

6. Mark G. Sobell,Practical ,Guide to Windows, A Addison Wesley Professional ,

1997.

7. Web Site:

[email protected]

 www.amazon.com

 www.colostate.edu

 www.crystalftp.com

 www.commeng.cso.uiuc.edu

 www.hrssun.gsfc.nasa.gov

49

You might also like