100% found this document useful (2 votes)
511 views

Client Server

The document is a learning assignment for a networking course that asks the student to design and implement a client-server computing system. It provides background on the scenario, which involves designing a system for an IT solutions company to meet growing needs. The tasks involve exploring client-server concepts, analyzing communication protocols, examining application layer protocols with Wireshark, and creating a UDP and TCP client-server model in Linux with an application layer protocol like DNS. The document outlines the pass, merit and distinction criteria for evaluating the assignment and emphasizes that the work must be the student's own with proper citations.

Uploaded by

Fahad Ahmad
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
511 views

Client Server

The document is a learning assignment for a networking course that asks the student to design and implement a client-server computing system. It provides background on the scenario, which involves designing a system for an IT solutions company to meet growing needs. The tasks involve exploring client-server concepts, analyzing communication protocols, examining application layer protocols with Wireshark, and creating a UDP and TCP client-server model in Linux with an application layer protocol like DNS. The document outlines the pass, merit and distinction criteria for evaluating the assignment and emphasizes that the work must be the student's own with proper citations.

Uploaded by

Fahad Ahmad
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 127

Client Server and Computing2017

INTERNATIONAL SCHOOL OF MANAGEMENT AND TECHNOLOGY


KATHMANDU, NEPAL
Qualification Unit Number & Title
BTEC HND IN COMPUTING L/615/1680 - Unit 36: Client/Server Computing Systems
Student Name Assessor Name
Rajendra Paudyal
Assignment Launch Date Due Date Completion Date
06/02/2021 08/01/2021
Session/Year Assignment Number 1/1
Assignment Title Design and Implementation of Client Server computing system

Assignment submission format

Each student has to submit their assignment as guided in the assignment brief. The students are
guided what sort of information is to produce to meet the criteria targeted. You are required to
make use of headings, paragraphs and subsections as appropriate, and all work must be
supported with research and referenced using the APA referencing system.

Learning outcomes covered

 LO1. Explore the concepts of servers, clients, and processes and the differences
between PPID and PID.

 LO2. Analyze the communication processes between clients and servers in


different application protocols with records captured from the internet.
 LO3. Create a client/server model in a Linux system with User Datagram
Protocol (UDP), Transmission Control Protocol (TCP) and Application Layer
protocols.

PRABIN POUDEL 2
(HNDFourtSemester)
Purpose of this assignment

The purpose of this assignment is to enable learners to understand concepts of servers, clients
and processes, and client-server computing concepts, how they work, how they operate, and the
protocols, standards, and models associated with client-server technology.

Scenario

Nepal IT solution, established under the Company Act 2053 as a public limited company on
2063/02/22). Nepal IT solution is the foremost IT service provider company established by
private investors. The promoters of the company are a group of well-known IT experts,
businessmen, and business houses of Nepal. Within the 12 years of operation, the Company has
set up an excellent business record and has a strong financial position.
To meet the growing customer needs and market demands, the company expanded its system and
network infrastructure to provide services like email service, Internet service, Domain
registration, Web hosting, and Network Management and Monitoring service, Company wants to
upgrade the system by improving IT skills of their staffs by training.
Nepal IT solution has hired you as a junior System Administrator to design and implement most
suitable system architecture solution for their business. Your major responsibilities are to plan,
manage, design, implement and optimize the system and network that fulfill the company's
current needs. Major tasks are as below:
 Explore the concepts of servers, clients, and processes and the differences between PPID
and PID.
 Analyse the communication processes between clients and servers in different application
protocols with records captured from the internet.
 Examining the different application layer protocols used in client-server computing
captured with Wireshark.
 Create the client and server model in a Linux system with UDP/TCP and any application
layer protocol.
 Attach the presentation slides that you have prepared.
 Submit the report.

The company has asked you to produce a final report of your design and implementation that
demonstrates your understanding of the principle of Client-Server computing no later than the
26th of June.

Assignment Task

With reference to the scenario, prepare a report which:

PART 1

Produce Technical report which illustrate the communication processes between


servers and clients and compare parent process and child process PID and PPID.
PRABIN POUDEL 3
(HNDFourtSemester)
Further to the above task you are required to recognize parent process and child process
in a communication record (such as the records obtained by Wire Shark) between servers
and clients and design a model composed of parent process and child process to realize a
simple function. It is recommended that you design a realistic model to realize a
function in real life using an Application Layer protocol.

You are required to examine the concepts and functions of several Application Layer
Protocols and operate wire shark software and recognize the different windows in the
wire shark interface.

Illustrate the communication processes of Application Layer protocols based on the


client/server system.

Analyze communication records captured from the internet based on Application


Layer protocols.

PART 2

Create a client/server model in a Linux system with User Datagram Protocol (UDP),
Transmission Control Protocol (TCP) and Application Layer protocols.

Build a system with DNS and illustrate it by a flowchart and do implement the created
DNS system in Linux.

You may implement the system with some advanced functions such as breakpoint
resume.

Pass Merit Distinction


LO1 Explore the concepts of servers, clients, and processes and
the differences between PPID and PID
P1 Illustrate the M1 Recognize parent process LO1 and LO2
communication processes and child process in a
between servers and clients. communication record (such as D1 Design a realistic
the records obtained by Wire model to realize a function
P2 Compare parent process shark) between servers and in real life using an
and child process, PID and clients. Application Layer
PPID. protocol.
M2 Design a model composed
of parent process and child
process to realize a simple
function.

PRABIN POUDEL 4
(HNDFourtSemester)
LO2 Analyze the communication processes between clients and
servers in different application protocols with records captured
from the internet
P3 Examine the concepts and M2 Illustrate the communication
functions of several processes of Application Layer
Application Layer protocols. protocols based on the
client/server system.
P4 Operate Wireshark
software, and recognize the M4 Analyze communication
different windows in the records captured from the
Wireshark interface. internet based on Application
Layer protocols.

LO3 Create a client/server model in a Linux system with User


Datagram Protocol (UDP), Transmission Control Protocol LO3
(TCP) and Application Layer protocols D2 Implement the system
P5 Create a UDP system in M5 Build a system with DNS with some advanced
Linux. and illustrate it by a flowchart. functions such as
breakpoint resume.
P6 Create a TCP system in M6 Implement the created DNS
Linux system in Linux.

Grades Achieved

Note: Refer the unit details provided in your handbook when responding all the tasks above. Make sure that
you have understood and developed your response that matches the highlighted key words in each task.

Plagiarism Notice
You are remined that there exist Academic Misconduct Policy and Regulation concerning Cheating and
Plagiarism.
Extracts from the Policy:
Section 3.4.1: Allowing others to do assignments / Copying others assignment is an offence
Section 3.4.2: Plagiarism, using the views, opinion or insights / paraphrasing of another person’s original
phraseology without acknowledgement
Requirements
 It should be the student’s own work – Plagiarism is unacceptable.
 Clarity of expression and structure are important features.
 Your work should be submitted as a well presented, word-processed document with headers and
footers, and headings and subheadings, both in hard and soft copies.
 You are expected to undertake research on this subject using books from the Library, and resources
available on the Internet.
 Any sources of information should be listed as references at the end of your document and these
sources should be referenced within the text of your document using APA Referencing style

PRABIN POUDEL 5
(HNDFourtSemester)
 Your report should be illustrated with screen-prints, images, tables, charts and/or graphics.
 All assignments must be typed in Times New Roman, font size 12, 11/2 spacing.

The center policy is that you must submit your work within due date to achieve “Merit” and
“Distinction”. Late submission automatically eliminates your chance of achieving “Merit and
Distinction”. Also, 80% attendance is required to validate this assignment.
I declare that all the work submitted for this assignment is my own work and I understand that if any part of
the work submitted for this assignment is found to be plagiarised, none of the work submitted will be allowed
to count towards the assessment of the assignment.
Assignment Prepared By Signature Date

Rajendra Paudyal April 12, 2021

Brief Checked By Signature Date

Dhruba Babu Joshi April 14, 2021

Table of Contents

PRABIN POUDEL 6
(HNDFourtSemester)
Introduction about the whole Project.....................................................................................................6

Part-1 (Introduction)...............................................................................................................................6

Client-server Network............................................................................................................................7

In depth about client server architecture................................................................................................7

Characteristics of a client...................................................................................................................8

Comparison to Peer-to-Peer Architecture..........................................................................................9

Comparison to Client-Queue-Client Architecture..............................................................................9

Advantages.........................................................................................................................................9

Disadvantages...................................................................................................................................10

Examples..........................................................................................................................................10

Communication process between client and server.............................................................................10

Compare and contrast between PID and PPID....................................................................................11

Process..............................................................................................................................................11

Parent Process...................................................................................................................................11

Child Process....................................................................................................................................12

init.....................................................................................................................................................14

What is the PPID?............................................................................................................................14

Why is the PPID Important?.............................................................................................................14

pstree.................................................................................................................................................15

htop...................................................................................................................................................15

Identifying parent process and child process in a communication record...........................................16

The pstree/ init process.....................................................................................................................17

Some other way of analyzing pid in rhel7 server.............................................................................19

Process life cycle..............................................................................................................................23

Design a model composed of parent process and child process to realize a simple function..............25

PRABIN POUDEL 7
(HNDFourtSemester)
Client Server and Computing2017

Examining the several application layers protocols.............................................................................26

Application Layer Protocol Types...............................................................................................27

Illustrating the communication process of Email, DHCP, DNS, HTTP and FTP worked on
application layer protocols...................................................................................................................29

SMTP (Simple Mail Transfer Protocol)...........................................................................................29

Mail Processing Scenario.............................................................................................................29

DHCP...............................................................................................................................................32

1. Automatic Allocation................................................................................................................34

2. Manual Allocation.....................................................................................................................34

How does the DHCP Dora process work?...................................................................................34

Discovery ( DHCP discover )......................................................................................................35

OFFER ( DHCP offer )................................................................................................................35

REQUEST ( DHCP request ):......................................................................................................35

ACKNOWLEDGE ( DHCP ack ):...............................................................................................35

DNS (Domain Name Server)............................................................................................................35

HTTP................................................................................................................................................37

FTP (File Transfer Protocol)............................................................................................................37

The FTP Model............................................................................................................................38

The FTP Response.......................................................................................................................39

Types of Connection....................................................................................................................39

Discussed..........................................................................................................................................40

Operating Wireshark and recognizing the different windows in the Wireshark interfaces.................40

Getting Wireshark............................................................................................................................41

Capturing Packets.............................................................................................................................41

Color Coding....................................................................................................................................42

Sample Captures...............................................................................................................................43

Filtering Packets...............................................................................................................................44

PRABIN POUDEL 8
(HNDFourtSemester)
Client Server and Computing2017

Inspecting Packets............................................................................................................................46

Analyzing the communication records from the internet of the Application Layer............................47

Process of communication................................................................................................................47

Realistic model used in application layer.............................................................................................52

Recursive Query...............................................................................................................................52

Case-1...........................................................................................................................................53

Case-2...........................................................................................................................................53

Iterative Query..................................................................................................................................54

Case-1...........................................................................................................................................54

Case-2...........................................................................................................................................54

Conclusion............................................................................................................................................55

Part-2....................................................................................................................................................56

Introduction..........................................................................................................................................56

TCP/IP..................................................................................................................................................56

Services and Segment structure in TCP...............................................................................................56

Process-to-Process Communication.................................................................................................56

Stream oriented.................................................................................................................................56

Connection oriented service.............................................................................................................57

Reliability.........................................................................................................................................57

Multiplexing.....................................................................................................................................57

Byte number, Sequence number and Acknowledgement number.......................................................57

TCP Segment structure........................................................................................................................58

Source Port Address.........................................................................................................................59

Destination Port Address..................................................................................................................59

Sequence Number.............................................................................................................................59

Acknowledgement Number..............................................................................................................60

PRABIN POUDEL 9
(HNDFourtSemester)
Client Server and Computing2017

Header Length (HLEN)....................................................................................................................60

Control flags.....................................................................................................................................60

Window size.....................................................................................................................................60

Checksum.........................................................................................................................................60

Urgent pointer...................................................................................................................................60

UDP......................................................................................................................................................61

Applications of UDP:...........................................................................................................................62

When to use UDP?...............................................................................................................................62

About Socket Programming.................................................................................................................62

Creating UDP in Linux using C...........................................................................................................62

Implementation of UDP...................................................................................................................63

Creating TCP system in Linux using C................................................................................................72

Implementing TCP system in Linux using C:..................................................................................73

Building DNS.......................................................................................................................................83

Considering scenario DNS in flowchart..............................................................................................87

What IP addresses are for.................................................................................................................87

What DNS is for...............................................................................................................................88

TTL...................................................................................................................................................88

Implementing the DNS (Domain Name System) in the Linux............................................................90

Changing Host Name.......................................................................................................................97

Configuring the DNS........................................................................................................................98

Setting breakpoints manually.............................................................................................................105

Digression - process addresses and entry point..............................................................................108

Setting breakpoints in the debugger with int 3...............................................................................109

More on int 3..................................................................................................................................112

Encapsulating some gory details....................................................................................................113

PRABIN POUDEL 10
(HNDFourtSemester)
Client Server and Computing2017

Tracing a C program.......................................................................................................................113

The code.........................................................................................................................................116

Conclusion and next steps..............................................................................................................116

Conclusion..........................................................................................................................................116

PRABIN POUDEL 11
(HNDFourtSemester)
Client Server and Computing2017

Introduction about the whole Project


Nepal IT solution has hired me as a consultant to advise them on the best and most suitable system
architecture solution for their business. My major responsibilities are to plan, manage, design,
implement and optimize the system and network that fulfill company current needs. Major tasks are
as below:

• Designing, implementation and commissioning of servers.

• Illustrating the communication processes between Email, DHCP, DNS, HTTP and FTP servers and
clients.

• Examining the different application layer protocols used in client server computing captured with
Wire shark.

• Submit the report.

The company has asked me to produce a final report of my design and implementation that need to
be demonstrated on the basis of my understanding about the principle of Client Server computing no
later than the 5 November 2019.

Part-1 (Introduction)
Here as the Consultant of the Nepal IT Solution need to produce the technical report which explores
the concepts of servers, clients, and processes and the differences between PPID and PID & need to
analyze the communication processes between clients and servers in different application protocols
with records captured from the internet also need to design a model composed of parent process and
child process to realize a simple function and need to examine the concepts and functions of several
Application Layer protocols also need to show how to operate Wire shark software, and recognize
the different windows in the Wire shark interface after that need to illustrate the communication
processes of Application Layer protocols based on the client/server system and analyze
communication records captured from the internet based on Application Layer protocols. At last
need to design the realistic model to realize a function in real life using an Application Layer
protocol and end with conclusion.

PRABIN POUDEL 12
(HNDFourtSemester)
Client Server and Computing2017

Client-server Network
A client-server network is designed for end-users, called clients, to access resources such as files,
songs, video collections, or some other service from a central computer called a server. A server's
sole purpose is to do what its name implies - serve its clients! You may have been using this
configuration and not even have known it. Have you ever played Xbox Live or used the PlayStation
Network? Your Xbox One is the client, and when it logs into the network, it contacts the Xbox Live
servers to retrieve gaming resources like updates, video, and game demos.

In depth about client server architecture


Client server is a computing architecture which separates a client from a server, and is almost always
implemented over a computer network. A client-server application is a distributed system that
constitutes of both client and server software. A client is a software or process that may initiate a
communication session, while a server can not initiate sessions, but is waiting for a requests from a
client. Client and server may also aim at the host computer hardware connected to a network, that are
residing the client and server software respectively.

Client/server describes the relationship between two computer programs in which one program, the
client, makes a service request from another program, the server, which fulfills the request. Although
the client/server idea can be used by programs within a single computer, it is a more important idea
in a network. In a network, the client/server model provides a convenient way to interconnect
programs that are distributed efficiently across different locations. Computer transactions using the
client/server model are very common. Most Internet applications, such as email, web access and
database access, are based on the client/server model. For example, a web browser is a client
program at the user computer that may access information at any web server in the world. To check
your bank account from your computer, a web browser client program in your computer forwards
your request to a web server program at the bank. That program may in turn forward the request to
its own database client program that sends a request to a database server at another bank computer to
retrieve your account balance. The balance is returned back to the bank database client, which in turn
serves it back to the web browser client in your personal computer, which displays the information
for you.

The client/server model has become one of the central ideas of network computing. Most business
applications being written today use the client/server model. So does the Internet’s main application

PRABIN POUDEL 13
(HNDFourtSemester)
Client Server and Computing2017

Protocols, such as HTTP, SMTP, Telnet, DNS, etc. In marketing, the term has been used to
distinguish distributed computing by smaller dispersed computers from the “monolithic” centralized
computing of mainframe computers. But this distinction has largely disappeared as mainframes and
their applications have also turned to the client/server model and become part of network computing.

Each instance of the client software can send data requests to one or more connected servers. In turn,
the servers can accept these requests, process them, and return the requested information to the
client. Although this concept can be applied for a variety of reasons to many different kinds of
applications, the architecture remains fundamentally the same.

The most basic type of client-server architecture employs only two types of hosts: clients and
servers. This type of architecture is sometimes referred to as two-tier. It allows devices to share files
and resources.

These days, clients are most often web browsers, although that has not always been the case. Servers
typically include web servers, database servers and mail servers. Online gaming is usually client-
server too. In the specific case of MMORPG, the servers are typically operated by the company
selling the game; for other games one of the players will act as the host by setting his game in server
mode.

The interaction between client and server is often described using sequence diagrams. Sequence
diagrams are standardized in the Unified Modeling Language.

When both the client- and server-software are running on the same computer, this is called a single
seat setup.

Characteristics of a client
1. Request sender is known as client
2. Initiates requests
3. Waits for and receives replies.
4. Usually connects to a small number of servers at one time
5. Typically interacts directly with end-users using a graphical user interface
6. Characteristics of a Server
7. Receiver of request which is sent by client is known as server
8. Passive (slave)
9. Waits for requests from clients

PRABIN POUDEL 14
(HNDFourtSemester)
Client Server and Computing2017

10. Upon receipt of requests, processes them and then serves replies
11. Usually accepts connections from a large number of clients
12. Typically does not interact directly with end-users

Comparison to Peer-to-Peer Architecture


Another type of network architecture is known as peer-to-peer, because each host or instance of the
program can simultaneously act as both a client and a server, and because each has equivalent
responsibilities and status. Peer-to-peer architectures are often abbreviated using the acronym P2P.

Both client-server and P2P architectures are in wide usage today.

Comparison to Client-Queue-Client Architecture


While classic Client-Server architecture requires one of communication endpoints to act as a server,
which is much harder to implement, Client-Queue-Client allows all endpoints to be simple clients,
while the server consists of some external software, which also acts as passive queue (one software
instance passes its query to another instance to queue, e.g. database, and then this other instance pulls
it from database, makes a response, passes it to database etc.). This architecture allows greatly
simplified software implementation. Peer-to-Peer architecture was originally based on Client-Queue-
Client concept.

Advantages
In most cases, a client-server architecture enables the roles and responsibilities of a computing
system to be distributed among several independent computers that are known to each other only
through a network. This creates an additional advantage to this architecture: greater ease of
maintenance. For example, it is possible to replace, repair, upgrade, or even relocate a server while
its clients remain both unaware and unaffected by that change. This independence from change is
also referred to as encapsulation.

All the data is stored on the servers, which generally have far greater security controls than most
clients. Servers can better control access and resources, to guarantee that only those clients with the
appropriate permissions may access and change data.

Since data storage is centralized, updates to those data are far easier to administer than would be
possible under a P2P paradigm. Under a P2P architecture, data updates may need to be distributed
and applied to each “peer” in the network, which is both time-consuming and error-prone, as there

PRABIN POUDEL 15
(HNDFourtSemester)
Client Server and Computing2017

can be thousands or even millions of peers.

Many mature client-server technologies are already available which were designed to ensure
security, ‘friendliness’ of the user interface, and ease of use.

It functions with multiple different clients of different capabilities.

Disadvantages
Traffic congestion on the network has been an issue since the inception of the client-server paradigm.
As the number of simultaneous client requests to a given server increases, the server can become
severely overloaded. Contrast that to a P2P network, where its bandwidth actually increases as more
nodes are added, since the P2P network’s overall bandwidth can be roughly computed as the sum of
the bandwidths of every node in that network.

The client-server paradigm lacks the robustness of a good P2P network. Under client-server, should a
critical server fail, clients’ requests cannot be fulfilled. In P2P networks, resources are usually
distributed among many nodes. Even if one or more nodes depart and abandon a downloading file,
for example, the remaining nodes should still have the data needed to complete the download.

Examples
Imagine you are visiting an e-commerce web site. In this case, your computer and web browser
would be considered the client, while the computers, databases, and applications that make up the
online store would be considered the server. When your web browser requests specific information
from the online store, the server finds all of the data in the database needed to satisfy the browser’s
request, assembles that data into a web page, and transmits that page back to your web browser for
you to view.

Specific types of clients include web browsers, email clients, and online chat clients.

Specific types of servers include web servers, ftp servers, application servers, database servers, mail
servers, file servers, print servers, and terminal servers. Most web services are also types of servers.

Communication process between client and server


Imagine a customer sitting at a restaurant. He is waiting for the server to come by and take his order.
The same rules apply in a client-server network the client, which can be a laptop, desktop, a
smartphone, or pretty much any computerized device, can make a request from the server.

PRABIN POUDEL 16
(HNDFourtSemester)
Client Server and Computing2017

The client uses the network as a way to connect with and speak to the server. Just as the customer
speaks to his server, the client uses the network to send and receive communications about its order,
or request. The server will take the request and make sure that the request is valid. If everything
checks out okay, then the server will fetch the request and serve the client.

The server can make a request from the client as well. It may want to check up on the status of the
client, or ask if it has received any security patches, or if it still needs resources from the server. If
not, the server will close the connection in order to free up network traffic.

Compare and contrast between PID and PPID


In Operating System, the fork() system call is used by a process to create another process. The
process that used the fork() system call is the parent process and process consequently created is
known as the child process.

Details about these are given as follows:

Process
A process is an active program i.e a program that is under execution. It is more than the program
code as it includes the program counter, process stack, registers, program code etc. Compared to this,
the program code is only the text section.

A process changes its state as it executes. This state partially depends on the current activity of a
process. The different states that a process is in during its execution are new, ready, running,
blocked, terminated.

A process control block is associated with each of the processes. It contains important information
about the process it is associated with such as process state, process number, program counter, list of
files and registers, CPU information, memory information etc.

Parent Process
All the processes in operating system are created when a process executes the fork() system call
except the startup process. The process that used the fork() system call is the parent process. In other
words, a parent process is one that creates a child process. A parent process may have multiple child
processes but a child process only one parent process.

On the success of a fork() system call, the PID of the child process is returned to the parent process
and 0 is returned to the child process. On the failure of a fork() system call, -1 is returned to the

PRABIN POUDEL 17
(HNDFourtSemester)
Client Server and Computing2017

parent process and a child process is not created.

Child Process
A child process is a process created by a parent process in operating system using a fork() system
call. A child process may also be called a subprocess or a subtask.

A child process is created as its parent process’s copy and inherits most of its attributes. If a child
process has no parent process, it was created directly by the kernel.

If a child process exits or is interrupted, then a SIGCHLD signal is send to the parent process.

A diagram that demonstrates parent and child process is given as follows:

(Ricky Baranes, 2018)

If you have ever opened System Monitor or top you no doubt noticed a column named ID or PID
containing a list of numbers. You might even see a value called PPID. What do these numbers mean?

Here is a short explanation of these Linux terms.

In Linux, an executable stored on disk is called a program, and a program loaded into memory and
running is called a process. When a process is started, it is given a unique number called process ID
(PID) that identifies that process to the system. If you ever need to kill a process, for example, you

PRABIN POUDEL 18
(HNDFourtSemester)
Client Server and Computing2017

can refer to it by its PID. Since each PID is unique, there is no ambiguity or risk of accidentally
killing the wrong process (unless you enter the wrong PID).

If you open top (in a terminal, type top and press enter), the PID column lists the process IDs of all
processes currently loaded into memory regardless of state (sleeping, zombie, etc.). Both daemons
(system processes) and user processes (processes you started either automatically or manually) have
their own process IDs. The PIDs are not always assigned in numerical order, so it’s normal to see
what appears to be a random selection of numbers.

PRABIN POUDEL 19
(HNDFourtSemester)
Client Server and Computing2017

init
One very important process is called init. init is the grandfather of all processes on the system
because all other processes run under it. Every process can be traced back to init, and it always has a
PID of 1. The kernel itself has a PID of 0.

What is the PPID?


In addition to a unique process ID, each process is assigned a parent process ID (PPID) that tells
which process started it. The PPID is the PID of the process’s parent.

For example, if process1 with a PID of 101 starts a process named process2, then process2 will be
given a unique PID, such as 3240, but it will be given the PPID of 101. It’s a parent-child
relationship. A single parent process may spawn several child processes, each with a unique PID but
all sharing the same PPID.

Why is the PPID Important?


Occasionally, processes go bad. You might try to quit a program only to find that it has other
intentions. The process might continue to run or use up resources even though its interface closed.

PRABIN POUDEL 20
(HNDFourtSemester)
Client Server and Computing2017

Sometimes, this leads to what is called a zombie process, a process that is still running, but dead.

One effective way to kill a zombie process is to kill its parent process. This involves using the ps
command to discover the PPID of the zombie process and then sending a kill signal to the parent. Of
course, any other children of the parent process will be killed as well.

pstree
pstree is a useful program that shows the relationship of all processes in a tree-like structure.

Give it a try to see how processes are arranged on your system. Processes do not float by themselves
somewhere in memory. Each one has a reason for its existence, and a tree view helps show how it
relates to others.

pstree supports options to adjust the output, so check man pstree for more details. Entering the
following command lists the PID with each process and organizes processes by their ancestors
(numerically) to show their relationship with each other.

pstree -pn

htop
For simpler process management and a better way to see how processes are organized, have a look at
the program htop, which displays PID, optional PPID, process tree view, and much more information
in glorious color!

PRABIN POUDEL 21
(HNDFourtSemester)
Client Server and Computing2017

Htop showing processes arranged in tree view along with PID and PPID.

Identifying parent process and child process in a communication record


Every process has a parent process and it may or may not have child processes. Lets take this one by
one. Consider the output of ps command on my Linux machine :

Integers in second and third column of the above output represent process ID and parent process ID.
Observe the figures highlighted in bold. When I executed the command ‘ps -aef’, a process was

PRABIN POUDEL 22
(HNDFourtSemester)
Client Server and Computing2017

created, its process ID is 6191. Now, look at its parents process ID, it is 3079. If you look towards
the beginning of the output you will see that ID 3079 is the process ID of bash process. This
confirms that bash shell is the parent for any command that you run through it.

Similarly, even for processes that are not created through shell, there is some parent process. Just run
‘ps -aef’ command on your Linux machine and observe the PPID (parent process ID) column. You
will not see any empty entry in it. This confirms that every process has a parent process.

Now, lets come to child processes. Whenever a process creates another process, the former is called
parent while latter is called child process. Technically, a child process is created by calling fork()
function from within the code. Usually when you run a command from shell, the fork() is followed
by exec() series of functions.

The pstree/ init process


When Linux system is booted, First thing that gets loaded into memory is vmlinuz. It is the
compressed Linux kernel executable. This results in the creation of pstree / init process. This is the
first process that gets created. Init process has PID of one, and is the super parent of all the processes
in a Linux session. If you consider Linux process structure as a tree then init is the starting node of
that tree.

To confirm that init is the first process, you can run the pstree command on your Linux box. This
command displays the tree of processes for a Linux session. In our case using rhel7 we used pstree.

Here is a sample output :

PRABIN POUDEL 23
(HNDFourtSemester)
Client Server and Computing2017

PRABIN POUDEL 24
(HNDFourtSemester)
Client Server and Computing2017

The output confirms that pstree is at the top of process tree. Also, if you observe the text in bold, you
will see the complete parent child relation of pstree process.

Now, lets come back to the question (we left open in the last section) about the consequences when
parent process gets killed while child is still alive. Well in this case, the child obviously becomes
orphan but is adopted by the pstree/init process. So, pstree/init process becomes the new parent of
those child processes whose parents are terminated.

Some other way of analyzing pid in rhel7 server


Parent ID

Terminal PID

VSFTPD PID

Creating and Visiting the ftp server through the google browser in physical Device to identify
the PID.

PRABIN POUDEL 25
(HNDFourtSemester)
Client Server and Computing2017

Monitoring the communication between the client and server in wireshark.

Identify wheather the connection was estabilshed or not from the server side.

PRABIN POUDEL 26
(HNDFourtSemester)
Client Server and Computing2017

Using help of wireshark obtained port number used to identify the pid.

PRABIN POUDEL 27
(HNDFourtSemester)
Client Server and Computing2017

Using the help of wireshark after analyzing the destination port number finding PID value in
server.

PRABIN POUDEL 28
(HNDFourtSemester)
Client Server and Computing2017

Process life cycle


Here we will discuss the life cycle of a normal Linux process covers before it is killed and removed
from kernel process table.

1) As already discussed, a new process is created through fork() and if a new executable is to be
run then exec() family of functions is called after fork(). As soon as this new process is
created, it gets queued into the queue of processes that are ready to run.
2) If only fork() was called then it is highly likely that new process runs in user mode but if
exec() is called then the new process will run in kernel mode until a fresh process address
space is created for it.
3) While the process is running, a higher priority process can pre-empt it through an interrupt. In
this case, the pre-empted process again goes into queue of processes that are ready to run.
This process is picked up by the scheduler at some later stage.
4) A process can enter into kernel mode while running. This is possible when it requires access
some resource like text file which is kept on hard disk. As operations involving access to

PRABIN POUDEL 29
(HNDFourtSemester)
Client Server and Computing2017

hardware may take time, it is highly likely that process will go to sleep and will wake up only
when the requested data is available. When the process is awakened, it does not mean that it
will start executing immediately, it will again queue up and will be picked for execution by
scheduler at appropriate time.
5) A process can be killed through many ways. It can call exit() function to exit or can
process Linux signals to exit. Also, some signals cannot be caught and cause the process to
terminate immediately.
6) There are different types of Linux process. Once the process is killed, it does not get
completely eliminated. An entry containing some information related to it is kept in the
Kernel process address table till the parent process explicitly calls wait() or waitpid()
functions to get the exit status of child process. Until parent process does this, the terminated
process is known as zombie process.

PRABIN POUDEL 30
(HNDFourtSemester)
Client Server and Computing2017

Design a model composed of parent process and child process to realize a simple function
The complete designed flowchart for parent and child process to realize a simple function.

PRABIN POUDEL 31
(HNDFourtSemester)
Client Server and Computing2017

Implementation

Examining the several application layers protocols


The application layer is the top-most layer in the OSI Model and is used for establishing process-to-
process communication and user services in a network. It's the interface between user applications
and the underlying network. Whether you open a web page in a browser or read an email, you are
interacting with the application layer of the network. In short, it's a layer which involves human
interaction with applications and software to connect users together across the globe.

A protocol is a set of rules used to communicate between systems in a network. Although the
application layer is the medium through which you are able to communicate with other users, a set of

PRABIN POUDEL 32
(HNDFourtSemester)
Client Server and Computing2017

protocols are required to assist with this communication. For example, if you have to open a web
page, you need the HTTP or HTTPS protocols. Similarly, you would require POP3 or IMAP and
SMTP for sending and receiving emails. Let us take a look at the various types of protocols with
their uses.

Application Layer Protocol Types


Application layer protocols can be broadly categorized as is shown in the figure appearing here:

1. Browsing Protocols
Hypertext Transfer Protocol (HTTP) and Hypertext Transfer Protocol Secure (HTTPS) are used
when you attempt to open any web page online. You've probably seen that whenever you open a web
page in a browser, http or https is always mentioned in the URL or web site address which was also
used in the national it solution websites while lunching it in the webserver.

2. File Transfer Protocols


File Transfer Protocol (FTP) and Trivial File Transfer Protocol (TFTP) are used for transferring
small and large files across a network. The only difference between the two protocols is that FTP
allows authentication and TFTP does not. Here in this organization national it solution used
internally LAN for sharing the common files required to the employees and several restriction are

PRABIN POUDEL 33
(HNDFourtSemester)
Client Server and Computing2017

implemented while sharing those file over the same bandwidth or network.

3. Email Protocols
Post Office Protocol version 3 (POP3) is a standard mail protocol used to receive emails from a
remote server to a local email client. POP3 allows you to download email messages on your local
computer and read them even when you are offline. Note, that when you use POP3 to connect to
your email account, messages are downloaded locally and removed from the email server. This
means that if you access your account from multiple locations, that may not be the best option for
you. On the other hand, if you use POP3, your messages are stored on your local computer, which
reduces the space your email account uses on your web server.

By default, the POP3 protocol works on two ports:

1. Port 110 - this is the default POP3 non-encrypted port


2. Port 995 - this is the port you need to use if you want to connect using POP3 securely

Similarly used The Internet Message Access Protocol (IMAP) is a mail protocol used for accessing
email on a remote web server from a local client. IMAP and POP3 are the two most commonly used
Internet mail protocols for retrieving emails. Both protocols are supported by all modern email
clients and web servers.

While the POP3 protocol assumes that your email is being accessed only from one application,
IMAP allows simultaneous access by multiple clients. This is why IMAP is more suitable for you if
you're going to access your email from different locations or if your messages are managed by
multiple users.

By default, the IMAP protocol works on two ports:

1) Port 143 - this is the default IMAP non-encrypted port


2) Port 993 - this is the port you need to use if you want to connect using IMAP securely.

As well as used the Simple Mail Transfer Protocol (SMTP) is the standard protocol for sending
emails across the Internet.

By default, the SMTP protocol works on three ports:

1) Port 25 - this is the default SMTP non-encrypted port


2) Port 2525 - this port is opened on all SiteGround servers in case port 25 is filtered (by your

PRABIN POUDEL 34
(HNDFourtSemester)
Client Server and Computing2017

ISP for example) and you want to send non-encrypted emails with SMTP
3) Port 465 - this is the port used if you want to send messages using SMTP securely

4. Telnet and SSH Protocols


Here both protocols used for remotely accessing inside the network but telnet is the traditionally
way to communicate with network remotely which was not secured because using any network
monitoring tools all the user name and password of the network admin can be decrypted easily
but SSH will assured that username and password of the network admin cannot easily decrypted
using any tools. In the national IT solution I will prefer to use SSH for remotely accessing inside
the network when any trouble arise.

Illustrating the communication process of Email, DHCP, DNS, HTTP and FTP worked on
application layer protocols
SMTP (Simple Mail Transfer Protocol)
SMTP is the standardization for transmission of electronic mails on the Internet.

It is used by the e-mail server for sending and receiving messages, but the client host-based
application only uses it for sending messages to the mail server. For receiving purposes, they use
POP3 or IMAP.

It is a TCP/IP application layer protocol and the TCP port used by the mail servers is 25 while the
mail clients use the port 587 or 465 for communication.

The outlook mail system of Microsoft system, Gmail and Yahoo mail, deploy SMTP for sending and
retrieving emails from the exterior world whereas for interior mail exchange between their respective
systems they use their own protocols.

Mail Processing Scenario


The client using the e-mail services known as mail user agent (MUA) deposit mail to the mail server,
Mail submission agent (MSA) using SMTP on port 587. The MSA forwards the mail to its Mail
transfer agent (MTA) which in turn does the processing on the PC or laptop host device.

1. Sometimes for sending the mail to the recipient host, it can move through many intermediate
computer host devices, therefore, each device uses SMTP to forward messages on the next
host device until it reaches the destination.

PRABIN POUDEL 35
(HNDFourtSemester)
Client Server and Computing2017

2. The MTA deploys the DNS to find out the mail exchanger record (MX), which provide the
details about the domain of the receiver. (Means the part of the mail address after
@ For Example Gmail or Yahoo mail etc).

On the basis of information gathered from the MX record about the destination host, the MTA finds
out the exchange server and connects to it as a SMTP client for message delivery.

3. The transportation of message can move through a single hop or series of intermediate hops
to reach the final destination. Once the final destination is reached, the MTA handovers the
message to MDA (message delivery agent) for final delivery. The MDA stores messages in
the appropriate mailbox format.

4. After the delivery of the mail to the local mail server, the mail is stored, so that it can be
retrieved by authenticated end users, i.e. MUA’s. The e-mail clients use IMAP or POP
protocol to access the emails and for receiving the mail in the desired format Microsoft
Outlook, Lotus Notes etc., which are designed for the SMTP format are used.

5. The SMTP only concerns about the transportation of the e-mail and not the content of it. It is
a connection-oriented protocol and the protocol messages are text-based.

A particular SMTP session includes commands initiated by a SMTP client and the respective
response from the SMTP server. At the sending end, the initiating agent performs the actions while at
the receiving end the listening agents and the recipient perform the tasks.

The role of SMTP in outlook is shown with the help of the below screenshots and which of the
configurations of SMTP is done for sending e-mails is described as well.

Screenshot 1: In the below figure, the default settings of the mailbox are set and SMTP is chosen for
sending e-mails.

PRABIN POUDEL 36
(HNDFourtSemester)
Client Server and Computing2017

Screenshot 2: In the below figure, after doing e-mail settings, the internet e-mail settings is done in
which the address of the outgoing mail server is set, and the default server chosen by outlook is
SMTP. Hence, as per the web address of the web server, we are using, the server address is set as
webmail.nationalit.in.

After this, we go to the more settings tab, in which on the outgoing server option, we checkmark as
SMTP authentication required for the outgoing server and also checkmark the same settings for the
incoming server. It is not necessary to choose the same settings for the incoming server as well, but
here we are using the same server for both.

PRABIN POUDEL 37
(HNDFourtSemester)
Client Server and Computing2017

Screenshot 3: Now let's move to the advanced setting tab of the more settings option, here the
incoming and outgoing server port is defined as 995 and 465 as mentioned earlier and check mark on
the encrypted connection to ensure secure communication.

So from the above configuration settings of the mailbox in outlook, we can send and receive e-mails
over internet connections by using SMTP.

DHCP
The Dynamic Host Configuration Protocol (DHCP) automates the assignment of IP addresses,

PRABIN POUDEL 38
(HNDFourtSemester)
Client Server and Computing2017

subnet masks, default gateway, and other IP parameters.

When a DHCP-configured client (be it a computer or any other network aware device) connects to a
network, the DHCP client sends a broadcast query requesting necessary information from a DHCP
server. The DHCP server manages a pool of IP addresses and information about client configuration
parameters such as the default gateway, the domain name, the DNS servers, other servers such as
time servers, and so forth. Upon receipt of a valid request the server will assign the computer an IP
address, a lease (the length of time for which the allocation is valid), and other TCP/IP configuration
parameters, such as the subnet mask and the default gateway. The query is typically initiated
immediately after booting and must be completed before the client can initiate IP-based
communication with other hosts.

DHCP provides three modes for allocating IP addresses. The best-known mode is dynamic, in which
the client is provided a “lease” on an IP address for a period of time. Depending on the stability of
the network, this could range from hours (a wireless network at an airport) to months (for desktops in
a wired lab). At any time before the lease expires, the DHCP client can request renewal of the lease
on the current IP address. A properly-functioning client will use the renewal mechanism to maintain
the same IP address throughout its connection to a single network, otherwise it may risk losing its
lease while still connected, thus disrupting network connectivity while it renegotiates with the server
for its original or a new IP address.

The two other modes for allocation of IP addresses are automatic (also known as DHCP
Reservation), in which the address is permanently assigned to a client, and manual, in which the
address is selected by the client (manually by the user or any other means) and the DHCP protocol
messages are used to inform the server that the address has been allocated.

The automatic and manual methods are generally used when finer-grained control over IP address is
required (typical of tight firewall setups), although typically a firewall will allow access to the range
of IP addresses that can be dynamically allocated by the DHCP server.

Depending on implementation, the DHCP server has three methods of allocating IP-addresses
Dynamic Allocation: A network administrator assigns a range of IP addresses to DHCP, and each
client computer on the LAN has its IP software configured to request an IP address from the DHCP
server during network initialization. The request-and-grant process uses a lease concept with a
controllable time period, allowing the DHCP server to reclaim (and then reallocate) IP addresses that

PRABIN POUDEL 39
(HNDFourtSemester)
Client Server and Computing2017

are not renewed (dynamic re-use of IP addresses).

1. Automatic Allocation
The DHCP server permanently assigns a free IP address to a requesting client from the range
defined by the administrator.

2. Manual Allocation
The DHCP server allocates an IP address based on a table with MAC address – IP address pairs
manually filled in by the server administrator. Only requesting clients with a MAC address listed
in this table will be allocated an IP address.

Some DHCP server software can manage hosts by more than one of the above methods. For
example, the known hosts on the network can be assigned an IP address based on their MAC address
(manual allocation) whereas “guest” computers (such as laptops via Wi-Fi) are allocated a temporary
address out of a pool compatible with the network to which they are attached (dynamic allocation).

How does the DHCP Dora process work?


DHCP operation divides into 4 phases.

1. Server Discovery
2. IP Lease Offer
3. IP Lease Request
4. IP lease Acknowledgement

This DHCP operation called DORA Process.

Note For example I used unicast IP Address.

PRABIN POUDEL 40
(HNDFourtSemester)
Client Server and Computing2017

At First, I am telling you about DORA process in DHCP

Discovery ( DHCP discover ):


By this message interaction start between server and client. Discovery sent by a client that is
connected to a local subnet. While send discovery destination address is broadcast 255.255.255.255
and source address is 0.0.0.0.

OFFER ( DHCP offer ):


Offer is a response to the Discovery message by the DHCP server to the DHCP clients. It contains a
network configuration setting for the client like an IP address offered to client 10.1.1.1.

REQUEST ( DHCP request ):


Response to Offer is indicating that the client has accepted the network configuration. It means to
accept the offer by the DHCP server with IP 10.1.1.1. this message sent by the client with destination
address 255.255.255.255 and the source address is 10.1.1.1.

ACKNOWLEDGE ( DHCP ack ):


After the request message or accept the IP by DHCP SERVER, the server sent an ACK to the client.
This message clear to the client that now you can start using the network.

This four-phase of DORA process and describe how IP assign to a Client by DHCP server. By
default Receiver or client receive IP from DHCP SERVER for 24 Hour. By using time connectivity
is fine or message always going unicast.

After 50% time (12 hours): Connectivity is ok then IP is renewing 24 hours, if no then time goes on.

After 75% time (18 hours): Connectivity is ok then IP is renewing for 24 hours if no then the left
time going on continues.

After 100% time (24 Hours): Connectivity is ok then IP is renewing for 24 hours if connectivity no
then IP got by ISP 169.254.255.0.

DNS (Domain Name Server)


If any user from the personal computer, laptop or tablet uses the Internet and tries to login into some
website then the user is using DNS for sure. Thus, it is very important to understand the working on
a domain name server.

PC’s, laptop or tablets don’t understand the language of a web address, which means the domain

PRABIN POUDEL 41
(HNDFourtSemester)
Client Server and Computing2017

name like Google.com to make them understand for which site we are looking for. Thus, DNS came
into the role and provides the host with the mapped IP address in respect to the domain name of the
website.

As shown in the above figure, when we request for a web page from our PC on the Internet like PC1
is requesting for www.nationalit.com, then resolving the domain name query and providing the
respective IP address in return is the part of work of the DNS server.

DNS server stores the database of all the relevant IP addresses mapped with their respective domain
names.

The DNS query for requesting the IP address in respect to the domain name goes to the DNS server 1
from PC1. The server checks within itself, if it has the IP address regarding the query, and it returns a
DNS response with the resolution.

Otherwise, it forwards it to another DNS server 2 requesting for information. This time it gets the
resolution from the DNS 2 and it gets mapped with the IP address i.e. 10.150.120.2 corresponding to
the Domain name in response and sends it back to PC1.

The PC1 now have the destination IP address and it can communicate further with the known IP

PRABIN POUDEL 42
(HNDFourtSemester)
Client Server and Computing2017

address as per the routing.

Now the question arises, as of how the PC will come to know which DNS should be used to get the
IP address.

The answer to this is when we connect our system to the ISP, the network devices like a router or
switch which assigns the routing information and other configurations as well send which or how
many DNS server the PC should connect with to get the address translation.

HTTP
HTTP is a request/response standard between a client and a server. A client is the end-user, the
server is the web site. The client making an HTTP request – using a web browser, spider, or other
end-user tool – is referred to as the user agent. The responding server – which stores or creates
resources such as HTML files and images – is called the origin server. In between the user agent and
origin server may be several intermediaries, such as proxies, gateways, and tunnels. HTTP is not
constrained to using TCP/IP and its supporting layers, although this is its most popular application on
the Internet. Indeed, HTTP can be implemented on top of any other protocol on the Internet, or on
other networks. HTTP only presumes a reliable transport; any protocol that provides such guarantees
can be used.

Typically, an HTTP client initiates a request. It establishes a Transmission Control Protocol (TCP)
connection to a particular port on a host (port 80 by default). An HTTP server listening on that port
waits for the client to send a request message. Upon receiving the request, the server sends back a
status line, such as “HTTP/1.1 200 OK”, and a message of its own, the body of which is perhaps the
requested file, an error message, or some other information.

The reason that HTTP uses TCP and not UDP is because much data must be sent for a webpage, and
TCP provides transmission control, presents the data in order, and provides error correction. See the
difference between TCP and UDP.

Resources to be accessed by HTTP are identified using Uniform Resource Identifiers (URIs) (or,
more specifically, Uniform Resource Locators (URLs)) using the http: or https URI schemes.

FTP (File Transfer Protocol)


It is one of the widely used application layer protocol of the TCP/IP protocol suite. FTP is basically
used to exchange data between two host devices over the Internet or Intranet securely.

PRABIN POUDEL 43
(HNDFourtSemester)
Client Server and Computing2017

It is referred to as one of the safest modes of file sharing among systems, and thus it is deployed by
large industries, universities, and offices.

It works in the client-server model and thus the user needs an FTP client program to run FTP on its
system. The common types of FTP client program include Filezilla and Dreamweaver etc.

The data transfer takes place only in one direction at a time. The FTP protocol carry out many duties
apart from file transfer like creation and deletion of data files, listing, renaming, etc.

The FTP Model


In this model, one host behaves as the client and another host as a server. The one who requests for
file-sharing or data is the client host and one which in response completes the request is the server
host.

Firstly the FTP connection is established between the client and server computer and data exchange
take place after that. Two channels come into the picture of FTP connection i.e. control channel and
data channel.

The control channel establishes the connection between the client and server and remains open for
the overall session. The control channel port number is 21 in TCP/IP. While the data channel opens
when the client request for a file sharing and get closed after the completion of the request by the
server.

(softwaretesting, 2019)

Two processes naming data transfer process (DTP) and protocol interpreter (PI) are used in

PRABIN POUDEL 44
(HNDFourtSemester)
Client Server and Computing2017

managing the communication between the client and the server. The DTP establishes and manages
the connection for the data channel, while PI manages the DTP by applying commands given by the
control channel.

The server host end PI is accountable for analyzing the commands received from the client host end
via the control channel, connection establishment, and in running the DTP. The client PI is
accountable for forwarding the FTP commands, receiving the response from the server and
establishment of the connection with the FTP server.

After the establishment of a connection between the FTP client and the FTP server, the client builds
up the connection and sends the FTP commands to the server. The server analyzes them and in
response completes the request.

Now the server end PI sends the port detail on which the files will be forwarded to the client DTP.
The client DTP then waits for the data to arrive at the decided port from the server.

The FTP Response


To make out a secure and reliable file transfer between the client and server, it is important that the
server and client should remain in synchronization with each other.

Thus for each command executed by the client, a user is acknowledged by the response and the
action is performed by the server host in order. The response consists of a 3 digit code plus a text (a
character string is separated from digit by a space) denoting the processing of the commands.

Types of Connection
The FTP server is connected to the FTP client on the control port 21. After this, the client will decide
which type of connection it will make with the FTP server, i.e. whether an active or passive
connection.

1. Active Connection: If an active connection is established, then the data connection from the
server end is opened on port 20 or to a greater range towards the client's end. Then all the
data flow will take place on this connection.

2. Passive Connection: If the passive connection is established, the client requests for passive
connection from the server and assigns any port greater than 10,000. The server bounds itself
to this port and gets back to the client with it.

PRABIN POUDEL 45
(HNDFourtSemester)
Client Server and Computing2017

The client then opens a new data connection for a particular session on this newly bounded port. In a
passive connection, every time a new port is assigned when a new data connection request is raised
from the client’s end. The latest trend in the networking system operates mostly in passive mode.

Example: Let’s take the example of a software organization, where hundreds of performance and
daily activity reports are generated by the employees and those need to be shared with their vertical
head, CEO or seniors at the remote end.

One way of sharing the daily reports and tracker is to send an e-mail to all of them. However, it takes
a lot of time and if the size of the attachment is big in an e-mail, then it will take much time for
downloading and the mailbox will get full frequently due to oversized mails.

The other way to do this is that the creators of data will put the reports and trackers on the FTP
server and share the path with each concern. In this case, the end-user will behave as the client host
and can access the files of their era from the server by just logging onto the server.

The server can be made secure by putting a password. Only the concerns will have the username and
password to access it. The port used here is 21. As per rights granted to the clients, they can also
create a copy, modify and delete the files on the server and from the server.

Discussed
We have discussed some of the important application layer protocols of the TCP/IP protocol suite
here in this task.

We can conclude that these are very useful in our daily activities in the field of communication over
the Internet. These, in turn, have a great significance in the information and networking systems
industry.

Operating Wireshark and recognizing the different windows in the Wireshark interfaces
Wireshark, a network analysis tool formerly known as Ethereal, captures packets in real time and
display them in human-readable format. Wireshark includes filters, color coding, and other features
that let you dig deep into network traffic and inspect individual packets.

As required of the task here we will discuss about the basics of capturing packets, filtering them, and
inspecting them. We can use Wireshark to inspect a suspicious program’s network traffic, analyze
the traffic flow on your network, or troubleshoot network problems.

PRABIN POUDEL 46
(HNDFourtSemester)
Client Server and Computing2017

Getting Wireshark
We can download Wireshark for Windows or macOS from its official website. If you’re using Linux
or another UNIX-like system, you’ll probably find Wireshark in its package repositories. For
example, if you’re using Ubuntu, you’ll find Wireshark in the Ubuntu Software Center.

Capturing Packets
After downloading and installing Wireshark, you can launch it and double-click the name of a
network interface under Capture to start capturing packets on that interface. For example, if you want
to capture traffic on your wireless network, click your wireless interface. You can configure
advanced features by clicking Capture Options, but this isn’t necessary for now.

As soon as you click the interface’s name, you’ll see the packets start to appear in real time.
Wireshark captures each packet sent to or from your system.

If you have promiscuous mode enabled it’s enabled by default you’ll also see all the other packets on
the network instead of only packets addressed to your network adapter. To check if promiscuous
mode is enabled, click Capture, Options and verify the “Enable promiscuous mode on all interfaces”
checkbox is activated at the bottom of this window.

PRABIN POUDEL 47
(HNDFourtSemester)
Client Server and Computing2017

Click the red “Stop” button near the top left corner of the window when you want to stop capturing
traffic.

Color Coding
You’ll probably see packets highlighted in a variety of different colors. Wireshark uses colors to help
you identify the types of traffic at a glance. By default, light purple is TCP traffic, light blue is UDP

PRABIN POUDEL 48
(HNDFourtSemester)
Client Server and Computing2017

traffic, and black identifies packets with errors, for example, they could have been delivered out of
order.

To view exactly what the color codes mean, click View Coloring Rules. You can also customize and
modify the coloring rules from here, if you like.

Sample Captures
If there’s nothing interesting on your own network to inspect, Wireshark’s wiki has you covered. The
wiki contains a page of sample capture files that you can load and inspect. Click File then Open in
Wireshark and browse for your downloaded file to open one.

You can also save your own captures in Wireshark and open them later. Click File and Save to save
your captured packets.

PRABIN POUDEL 49
(HNDFourtSemester)
Client Server and Computing2017

Filtering Packets
If you’re trying to inspect something specific, such as the traffic a program sends when phoning
home, it helps to close down all other applications using the network so you can narrow down the
traffic. Still, you’ll likely have a large number of packets to sift through. That’s where Wireshark’s
filters come in.

The most basic way to apply a filter is by typing it into the filter box at the top of the window and
clicking Apply (or pressing Enter). For example, type “dns” and you’ll see only DNS packets. When
you start typing, Wireshark will help you autocomplete your filter.

You can also click Analyze and Display Filters to choose a filter from among the default filters
included in Wireshark. From here, you can add your own custom filters and save them to easily
access them in the future.

Another interesting thing you can do is right-click a packet and select Follow TCP Stream.

You’ll see the full TCP conversation between the client and the server. You can also click other

PRABIN POUDEL 50
(HNDFourtSemester)
Client Server and Computing2017

protocols in the Follow menu to see the full conversations for other protocols, if applicable.

Close the window and you’ll find a filter has been applied automatically. Wireshark is showing you
the packets that make up the conversation.

PRABIN POUDEL 51
(HNDFourtSemester)
Client Server and Computing2017

Inspecting Packets
Click a packet to select it and you can dig down to view its details.

You can also create filters from here by just right-click one of the details and use the Apply as Filter
submenu to create a filter based on it.

PRABIN POUDEL 52
(HNDFourtSemester)
Client Server and Computing2017

Wireshark is an extremely powerful tool, and this task is just scratching the surface of what we can
do with it. Professionals use it to debug network protocol implementations, examine security
problems and inspect network protocol internals.

Analyzing the communication records from the internet of the Application Layer
Application layer is the most top layer of the OSI model but while analyzing the communication of
data can say it is intermediate layer in between users and transport layer. Application layer provides
security also available in different application form beside these factors it’s also used for tracking the
users required webpages or application. Usually client/users send their request for any data using the
application layers protocols such as: - HTTP/ HTTPS/ FTP/DNS and many others.

Process of communication
At first the user send the request which has the source and destination (server) IP address and when it
reached to the server it will search the relevant application that client requested and as the response
server will allow you to access the application you searched for, If the provided request was not

PRABIN POUDEL 53
(HNDFourtSemester)
Client Server and Computing2017

available in the server it will filter and send the unknown response to the users form where they are
accessing. Here are the DNS communication records captured through the Wireshark: -

Captured In wireshark

Filtering TCP using the port number.

PRABIN POUDEL 54
(HNDFourtSemester)
Client Server and Computing2017

All the port number 53 (TCP) was shown in the wirshark the above list are the packet list we used it
to analyze the communication records of these packets At last the packet Bytes are avilable and in
between the Packet list and the Packet bytes all the packet details are avilable.

PRABIN POUDEL 55
(HNDFourtSemester)
Client Server and Computing2017

Define Communication Record using wireshark :- In the follwing wireshark captured packet list I
select the one packet from the packet list and analyze it’s communication records as we can see in the
packet details it shows that the packet used the DNS protocols(Application layer) which holds the 75
bytes and used the IPV4 for logical addressing where the packets holds the source IP address as
10.44.10.138 and destination IP address was 10.44.10.1 similarly you can see the packet used the
55346 port to send the request and port 53 for the reciving and sending request and response
respectively. We also can filter the unique transaction id provided by wireshark inside the
DNS(query) to view only the specific that transaction realted packets.

As I said before all the transaction related packets and there details were shown in the following
figure.

PRABIN POUDEL 56
(HNDFourtSemester)
Client Server and Computing2017

PRABIN POUDEL 57
(HNDFourtSemester)
Client Server and Computing2017

As you can see in the figure user will send the request to the application layer where the FTP client
and DNS client was available to send the request and receive the response for the requested host IP
address and the DNS server will filter out the unique IP address of the requested host and it will
forward to the DHCP client and FTP client. Similarly FTP client will send the resolved ip addresss to
the transport layer and complete whole TCP/IP layers which will encrypt and decrypt all the related
data for client requested in the few seconds and appear in front of the client form where they are
accessing (In any application layer protocols or applications).

Realistic model used in application layer


Talking about the application protocol DNS protocol will be the best choice to elaborate the real
example of DNS with the given scenario domain www.nationalit.com. Basically DNS have to types
of Query or working procedure which is :- Recursive and iterative and both query and working flow
we will discussed by adjoin the real life examples:-

Recursive Query
In a recursive query, a DNS client provides a hostname, and the DNS Resolver must provide an
answer it responds with either a relevant resource record, or an error message if it can't be found. The

PRABIN POUDEL 58
(HNDFourtSemester)
Client Server and Computing2017

resolver starts a recursive query process, starting from the DNS Root Server, until it finds the
Authoritative Name Server (for more on Authoritative Name Servers) that holds the IP address and
other information for the requested hostname.

Let us consider in the realistic example of recursive method

Here as you see there are two case how recursive query works in DNS: -

Case-1
If you have access on any host in multiple times then it will found in the local case/ DNS Resolver
and immediately it will response back to your request because it will store mostly visited domain IP
address for quick access.

Case-2
If it will not found in the local cache it will send query as the request to the root server and root
server will also forward the request to the top level server due to the generic domain and then last it
will send it to the authoritative server where the actual’s IP’s are located and after that it will filter
for the domain IP address you are looking for in this case www.nationalit.com when it will found the
IP address of the domain then it will send it as the response to the top level domain server, root
server, local cache and finally you will get the resolved IP address of your domain and at last it will
fetch out the information from which networks it belongs to.

PRABIN POUDEL 59
(HNDFourtSemester)
Client Server and Computing2017

Iterative Query
In an iterative query, a DNS client provides a hostname, and the DNS Resolver returns the best
answer it can. If the DNS resolver has the relevant DNS records in its cache, it returns them. If not, it
refers the DNS client to the Root Server, or another Authoritative Name Server which is nearest to
the required DNS zone. The DNS client must then repeat the query directly against the DNS server it
was referred to. Lets us consider in the following diagram:-

Case-1
If users interact with www.nationalit.com many times then it will resolve the IP address in the DNS
resolver in second steps and forward the response query as the resolved ip address of
www.nationalit.com.

Case-2
If it was not found in the DNS resolver then it will forward the request query for the
www.nationalit.com IP address to the Root server and now again the root server will send the request
to the local cache to identify the top level Domain server IP address and local cache will forward as
the response to the TOP LEVEL DOMAIN SERVER and again TOP LEVEL DOMAIN SERVER
will asked the DNS resolver to resolve the IP address of the AUTHORITATIVE SERVER where the
actual IP’s are located and DNS resolver will send the request response by forwarding to the
Authoritative server and last authoritative server will identify the ip address of www.nationalit.com

PRABIN POUDEL 60
(HNDFourtSemester)
Client Server and Computing2017

and forward that IP address to the DNS Resolver and to the Machine/Browser respectively.

Conclusion
I have illustrated the communication processes between servers and clients and compare parent
process and child process, PID and PPID after that recognized parent process and child process in a
communication record (such as the records obtained by Wire shark) between servers and clients also
designed the model composed of parent process and child process to realize a simple function and
examined the concepts and functions of several Application Layer protocols also show how to
operate Wireshark software, and recognize the different windows in the Wireshark interface with that
I have illustrated the communication processes of Application Layer protocols based on the
client/server system and analyzed the communication records captured from the internet based on
Application Layer protocols. At last designed a realistic model to realize a function in real life using
an Application Layer protocol and wrap up with this conclusion.

PRABIN POUDEL 61
(HNDFourtSemester)
Client Server and Computing2017

Part-2
Create a client/server model in a Linux system with User Datagram Protocol (UDP), Transmission
Control Protocol (TCP) and Application Layer protocols

Introduction
In this task I will explain the details of TCP and UDP protocols and create in the Linux and after that
need to build a system with DNS and explain it with the help of Flowchart after that I will implement
the DNS serever in the Linux server and also show some use of advanced functions such as
breakpoints and resume using any programming languages.

TCP/IP
TCP/IP, in full Transmission Control Protocol/Internet Protocol,
standard Internet communications protocols that allow digital computers to communicate over long
distances. The Internet is a packet-switched network, in which information is broken down into small
packets, sent individually over many different routes at the same time, and then reassembled at the
receiving end. TCP is the component that collects and reassembles the packets of data, while IP is
responsible for making sure the packets are sent to the right destination. TCP/IP was developed in
the 1970s and adopted as the protocol standard for ARPANET (the predecessor to the Internet) in
1983.

Services and Segment structure in TCP


The Transmission Control Protocol is the most common transport layer protocol. It works together
with IP and provides a reliable transport service between processes using the network layer service
provided by the IP protocol.

The various services provided by the TCP to the application layer are as

follows: Process-to-Process Communication –


TCP provides process to process communication, i.e, the transfer of data takes place between
individual processes executing on end systems. This is done using port numbers or port addresses.
Port numbers are 16 bit long that help identify which process is sending or receiving data on a host.

Stream oriented
This means that the data is sent and received as a stream of bytes(unlike UDP or IP that divides the
bits into datagrams or packets). However, the network layer, that provides service for the TCP, sends

PRABIN POUDEL 62
(HNDFourtSemester)
Client Server and Computing2017

packets of information not streams of bytes. Hence, TCP groups a nuber of bytes together into
a segment and adds a header to each of these segments and then delivers these segments to the
network layer. At the network layer, each of these segments are encapsulated in an IP packet for
transmission. The TCP header has information that is required for control purpose which will be
duscussed along with the segment structure.

Full duplex service –


This means that the communication can take place in both directions at the same time.

Connection oriented service


 Unlike UDP, TCP provides connection oriented service. It defines 3 different phases:
 Connection establishment
 Data transfer
 Connection termination

(IMP: This is a virtual connection, not a physical connection, means during the transmission the
resources will not be reserved and the segments will not follow the same path to reach the destination
but it is a connection orientation in the sense that segments will arrive in order by the help of
sequence number.)

Reliability –
TCP is reliable as it uses checksum for error detection, attempts to recover lost or corrupted packets
by re-transmission, acknowledgement policy and timers. It uses features like byte number and
sequence number and acknowledgement number so as to ensure reliability. Also, it uses congestion
control mechanisms.

Multiplexing –
TCP does multiplexing and de-multiplexing at the sender and receiver ends respectively as a number
of logical connections can be established between port numbers over a physical connection.

Byte number, Sequence number and Acknowledgement number:

All the data bytes that are to be transmitted are numbered and the beginning of this numbering is
arbitrary. Sequence numbers are given to the segments so as to reassemble the bytes at the receiver
end even if they arrive in a different order. Sequence number of a segment is the byte number of the
first byte that is being sent. Acknowledgement number is required since TCP provides full duplex

PRABIN POUDEL 63
(HNDFourtSemester)
Client Server and Computing2017

service. Acknowledgement number is the next byte number that the receiver expects to receive
which also provides acknowledgement for receiving the previous bytes.
Example:

In this example we see that, A sends acknowledgement number1001, which means that it has
received data bytes till byte number 1000 and expects to receive 1001 next, hence B next sends data
bytes starting from 1001. Similarly, since B has received data bytes till byte number 13001 after the
first data transfer from A to B, therefore B sends acknowledgement number 13002, the byte number
that it expects to receive from A next.

TCP Segment structure


TCP segment consists of data bytes to be sent and a header that is added to the data by TCP as
shown:

PRABIN POUDEL 64
(HNDFourtSemester)
Client Server and Computing2017

The header of a TCP segment can range from 20-60 bytes. 40 bytes are for options. If there are no
options, header is of 20 bytes else it can be of upmost 60 bytes.
Header fields:

Source Port Address


16 bit field that holds the port address of the application that is sending the data segment.

Destination Port Address


16 bit field that holds the port address of the application in the host that is receiving the data
segment.

Sequence Number

32 bit field that holds the sequence number, i.e, the byte number of the first byte that is sent in that

PRABIN POUDEL 65
(HNDFourtSemester)
Client Server and Computing2017

particular segment. It is used to reassemble the message at the receiving end if the segments are
received out of order.

Acknowledgement Number
32 bit field that holds the acknowledgement number, i.e, the byte number that the receiver expects to
receive next. It is an acknowledgment for the previous bytes being received successfully.

Header Length (HLEN)


This is a 4 bit field that indicates the length of the TCP header by number of 4-byte words in the
header, i.e, if the header is of 20 bytes(min length of TCP header), then this field will hold 5
(because 5 x 4 = 20) and the maximum length: 60 bytes, then it’ll hold the value 15(because 15 x 4 =
60). Hence, the value of this field is always between 5 and 15.

Control flags
These are 6 1-bit control bits that control connection establishment, connection termination,
connection abortion, flow control, mode of transfer etc. Their function is:

 URG: Urgent pointer is valid


 ACK: Acknowledgement number is valid( used in case of cumulative acknowledgement)
 PSH: Request for push
 RST: Reset the connection
 SYN: Synchronize sequence numbers
 FIN: Terminate the connection

Window size
This field tells the window size of the sending TCP in bytes.

Checksum
This field holds the checksum for error control. It is mandatory in TCP as opposed to UDP.

Urgent pointer
This field (valid only if the URG control flag is set) is used to point to data that is urgently required
that needs to reach the receiving process at the earliest. The value of this field is added to the
sequence number to get the byte number of the last urgent byte.

PRABIN POUDEL 66
(HNDFourtSemester)
Client Server and Computing2017

UDP
User Datagram Protocol (UDP) is a Transport Layer protocol. UDP is a part of Internet Protocol
suite, referred as UDP/IP suite. Unlike TCP, it is unreliable and connectionless protocol. So, there is
no need to establish connection prior to data transfer.

Though Transmission Control Protocol (TCP) is the dominant transport layer protocol used with
most of Internet services; provides assured delivery, reliability and much more but all these services
cost us with additional overhead and latency. Here, UDP comes into picture. For the realtime
services like computer gaming, voice or video communication, live conferences; we need UDP.
Since high performance is needed, UDP permits packets to be dropped instead of processing delayed
packets. There is no error checking in UDP, so it also save bandwidth.
User Datagram Protocol (UDP) is more efficient in terms of both latency and bandwidth.

UDP header is 8-bytes fixed and simple header, while for TCP it may vary from 20 bytes to 60 bytes.
First 8 Bytes contains all necessary header information and remaining part consist of data. UDP port
number fields are each 16 bits long, therefore range for port numbers defined from 0 to 65535 port
number 0 is reserved. Port numbers help to distinguish different user requests or process.

 Source Port : Source Port is 2 Byte long field used to identify port number of source.
 Destination Port : It is 2 Byte long field, used to identify the port of destined packet.
 Length : Length is the length of UDP including header and the data. It is 16-bits field.
 Checksum : Checksum is 2 Bytes long field. It is the 16-bit one’s complement of the one’s
complement sum of the UDP header, pseudo header of information from the IP header and
the data, padded with zero octets at the end (if necessary) to make a multiple of two octets.

PRABIN POUDEL 67
(HNDFourtSemester)
Client Server and Computing2017

Applications of UDP:
 Used for simple request response communication when size of data is less and hence there is
lesser concern about flow and error control.
 It is suitable protocol for multicasting as UDP supports packet switching.
 UDP is used for some routing update protocols like RIP(Routing Information Protocol).
 Normally used for real time applications which can not tolerate uneven delays between
sections of a received message.
 Following implementations uses UDP as a transport layer protocol:
 NTP (Network Time Protocol)
 DNS (Domain Name Service)
 BOOTP, DHCP.
 NNP (Network News Protocol)
 Quote of the day protocol
 TFTP, RTSP, RIP, OSPF.
 Application layer can do some of the tasks through UDP-
 Trace Route
 Record Route
 Time stamp
 UDP takes datagram from Network Layer, attach its header and send it to the user. So, it
works fast.
 Actually UDP is null protocol if you remove checksum field.

When to use UDP?


 Reduce the requirement of computer resources.
 When using the Multicast or Broadcast to transfer.
 The transmission of Real-time packets, mainly in multimedia applications.

About Socket Programming


Socket programming is a way of connecting two nodes on a network to communicate with each
other. One socket(node) listens on a particular port at an IP, while other socket reaches out to the
other to form a connection. Server forms the listener socket while client reaches out to the server.

Creating UDP in Linux using C


There are two major transport layer protocols to communicate between hosts : TCP and UDP We

PRABIN POUDEL 68
(HNDFourtSemester)
Client Server and Computing2017

will first discussed and create the UDP in the Linux.

Implementation of UDP

Create the folder in Desktop with any name like here udp

Create file in the .c extension name. Like here udpServer.c

Server side code written in C program.

PRABIN POUDEL 69
(HNDFourtSemester)
Client Server and Computing2017

Open two terminal one for client and another for server access purpose.

PRABIN POUDEL 70
(HNDFourtSemester)
Client Server and Computing2017

Both terminals are opend.

Give previlged to the user to access the udpServer.c File.

Compile the file udpServer.c.

PRABIN POUDEL 71
(HNDFourtSemester)
Client Server and Computing2017

Succesfully compiled the udpServer.c File now getting access in the udpServer which port number
was 4455.

Accessing server using the IP address and port number.

Successfully got access in the server you can see the message has appear both side.

PRABIN POUDEL 72
(HNDFourtSemester)
Client Server and Computing2017

Create file for client side in the same destination where the udp directory is created.

Client side coding.

Change the access mode and compile the file you created for the udpClient socket. Which was
sucessfully compiled as you see in the follwing screenshots.

PRABIN POUDEL 73
(HNDFourtSemester)
Client Server and Computing2017

Acessing udpClient using the port number.

Sucessfully runed the udp socket program you cans see in both terminal the messages is appear.

Accessing udp client and udp server using the port number respectively. One terminal was used for
udp client and another is use for ud server.

PRABIN POUDEL 74
(HNDFourtSemester)
Client Server and Computing2017

Updating code in udpServer.c for sending messages.

Compiling the udpServer.c file which was running sucessfully as you can see in the follwing screen
shots.

PRABIN POUDEL 75
(HNDFourtSemester)
Client Server and Computing2017

You can see now sending the message was also possible in the udpServer socket programming.

Updating the udpClient.c file for the receving the data from the server.

PRABIN POUDEL 76
(HNDFourtSemester)
Client Server and Computing2017

Compileing the udpClient.c file was succesfully worked.

Here now udpClient can send the mesaages to the udpServer and Server is also replying the
messages to the udpClient abd udpClient also recived the messages.

PRABIN POUDEL 77
(HNDFourtSemester)
Client Server and Computing2017

Here as required UDP was created in the Linux system.

Creating TCP system in Linux using C


If we are creating a connection between client and server using TCP then it has few functionality
like, TCP is suited for applications that require high reliability, and transmission time is relatively
less critical. It is used by other protocols like HTTP, HTTPs, FTP, SMTP, Telnet. TCP rearranges
data packets in the order specified. There is absolute guarantee that the data transferred remains
intact and arrives in the same order in which it was sent. TCP does Flow Control and requires three
packets to set up a socket connection, before any user data can be sent. TCP handles reliability and
congestion control. It also does error checking and error recovery. Erroneous packets are
retransmitted from the source to the destination.

The entire process can be broken down into following steps:

PRABIN POUDEL 78
(HNDFourtSemester)
Client Server and Computing2017

Implementing TCP system in Linux using C: -


Create file with .c extension for the client side.

All this socket programming is for cllient.

PRABIN POUDEL 79
(HNDFourtSemester)
Client Server and Computing2017

Allwing the access for the tcpClient.c file to make it executable.

Compiling the file which was successfully compiled.

PRABIN POUDEL 80
(HNDFourtSemester)
Client Server and Computing2017

Opening the two terminal tos how the communication of the client.

Using the local machine IP and port number to accing the client side which was sucessfully done as
you see in the screen shots.

PRABIN POUDEL 81
(HNDFourtSemester)
Client Server and Computing2017

As we see in the screenshots the typed message was recevied by the client.

Now create the file for the server side socket programming using .c extension.

PRABIN POUDEL 82
(HNDFourtSemester)
Client Server and Computing2017

All the server side socket programming are done which was shown in the follwing screen shots as
mention above code are based on C programming.

Allowing the acess in the file.

PRABIN POUDEL 83
(HNDFourtSemester)
Client Server and Computing2017

Compileing the server side socket programming file which was succesfully done.

PRABIN POUDEL 84
(HNDFourtSemester)
Client Server and Computing2017

As you see in the both terminal tcpServer send the messages to the tcpClient.

For making more clear updating the server side socket programming and client side socket
programming.

PRABIN POUDEL 85
(HNDFourtSemester)
Client Server and Computing2017

PRABIN POUDEL 86
(HNDFourtSemester)
Client Server and Computing2017

As we see in the both terminal both client side socket programming file and server side programming
file was sucessfullly compiled which means there was no error in both socket programming.

PRABIN POUDEL 87
(HNDFourtSemester)
Client Server and Computing2017

As you see in the screen server succesfully eastbilished the connection with the cleint and bind the
port number send the data succefully to the client.

PRABIN POUDEL 88
(HNDFourtSemester)
Client Server and Computing2017

Successfully created the TCP system in the Linux with the help of C programming.

Building DNS
DNS servers are divided into public and private DNS servers. While the majority of the public
servers are run by larger Internet Service Providers and commercial companies, the private DNS
servers are used mainly for private home networks. Setting up DNS servers in the home network is
highly recommended in cases when your network includes more than a few computers with the
purpose of increasing its efficiency.

With a DNS Server set up for your private home network you can centralize the management
of host information and track the host file for every client in your network. In addition, private DNS
servers allow your clients to make DNS resolution requests within your home network, since they
have the ability to cache DNS information.

PRABIN POUDEL 89
(HNDFourtSemester)
Client Server and Computing2017

Requirements: -

1. Static IP for the system.


2. Host name

Step-1 :- Setting up a DNS server using BIND

Setting up a name server using BIND is quite straightforward, so I'll show you how to do so on any
computer you might have available for experimentation. This little lab project will show you how
to install and configure BIND on your computer as a caching name server, test it, then set it up as a
primary name server with a zone file that you can use as a name resolver for your network or just
for testing.

Setting up a name server on any GNU/Linux computer you have available is technically possible
because it will not interfere with other hosts on the network or their operation. However, you
should probably not do this on a computer that you do not own or have the right to modify unless
you have explicit permission to do so.

My setup:-

I will first assigned the static IP address for the system I am using which is rhel 7 in virtual
machine. After that I will also renamed the hostname as the www.nationalit.com and also mount
and copy all the packages rhel provided in the local machine and after that I will start configuring
the DNS for the www.nationalit.com

Step:1 At first go to the terminal and switch the user in the root by using the command su -

Step-2:- I will configure the bind by assigning the command yum install bind* -y

Step-3:- After installation of bind I will go to the directory etc where already the named.conf file
will generated I will open the file and edit it by providing the static ip that I was created before
starting the configuration of DNS.

PRABIN POUDEL 90
(HNDFourtSemester)
Client Server and Computing2017

Step-4 :- I will start the named server and check the status too. TO be sure that whether it’s
working or not. By firing the following commands:-

Systemctl Start named

Systemctl enable named

Systemctl status named

Step-5:- I will enable firewall for both tcp and udp ports by using the command:-

Firewall-cmd – -permanent –add-port=53/tcp

Firewall-cmd – -permanent –add-port=53/tcp

Firewall-cmd reload

Step-6:- I will check the ports are applied or not by using the command

Firewall-cmd –list-all

PRABIN POUDEL 91
(HNDFourtSemester)
Client Server and Computing2017

Step-7:- Once again I will visit the directory etc and open the named.conf file and create the zone
inside the file.

Using commnds in this section are

At last of this named.conf file type

Zone www.nationalit.com IN{


type master;

File “forward.nationalit.com”;

Allow-update {none;};

};

Zone “1.168.192.in.addr.arp” IN{

Type master;

File “reverse.nationait.com”;

Allow-update{none;};

And exit with this file by clicking esc button and typing :wq and enter

Step:-7 I will create the another file called forward.nationalit.com by copying the named.localhost
file

Used commands

Cp named.localhost forward.nationalit.com

And open the file using the command

Vi forward.nationalit.com

Step-8:- Inside the forward.nationalit.com I will configure by providing the hostname as well as
the IP used in the future for DNS purpose.

PRABIN POUDEL 92
(HNDFourtSemester)
Client Server and Computing2017

Step-9:- Again I will create revers.nationalit.com with similar type of configuration I have done in
the forward.nationalit.com.

Step-10:- I will give access to the root for both of the file created now using following commands:-

Chmod root:named forward.nationalit.com

Chmod root:named reverse.nationalit.com

Step-11:- Now I will check the configured named server working or not by using following
commands:-

Named-checkconf -z /etc/named.conf

If it show no errors then it was successfully configured otherwise by observing the nature of the
error we have to act like that in configuration files.

You can also check the other configured file like forward and reverse.nationalit.com respectively it
was working or not by using the following commands

Named-checkzone forward /var/named/forward.nationalit.com/

Named-checkzone reverse /var/named/reverse.nationalit.com/

Step-10:- If you don’t find the errors on the zones you created then you have successfully
configured DNS use this command to restart the named server:- sytemctl restart named

So, these are some steps used in the Linux to configure the DNS. As I say before to configure DNS
you need one static IP and hostname in your local machine to configure the DNS properly.

Considering scenario DNS in flowchart


Basically, the domain name system is a software program that is run on a dedicated server called the
DNS server. It’s there to resolve the domain names we can easily understand and remember into the
IP addresses.

What IP addresses are for


Each network member, from a server to a personal computer, router or similar hardware component,
has its own identification number, or IP address, which allows other network members to identify

PRABIN POUDEL 93
(HNDFourtSemester)
Client Server and Computing2017

them via TCP/IP protocols and send them data packets or receive data packets from them.

These IP addresses are fully numerical, or in case of IPv6, hexadecimal, and thus very inconvenient
to understand or remember. It is much easier to say that your website is www.nationalit.com, then to
always refer to it by its IPv4 address, 192.168.1.10

What DNS is for


The domain name system exists to associate the numeric IP addresses with the readable and easily-
understood domain names. The DNS consists of a complex hierarchy of the so-called name servers
that keep track of which IP address is associated with which domain name. Thus, in theory, when the
end-user enters an URL in his or her browser window, the browser sends a query to the
corresponding name server, which answers with an IP address of the domain name entered. The
browser sends a session request to the server with the IP address it has received from the name
server, and receives a response.

However, in reality all this is much more complicated.

First of all, the end-user’s PC can’t really remember all the name servers for each web page. So, to
look up the name server authoritative for the web-page that needs to be opened, the web-browser
first queries root DNS servers. The root servers give the IP address and now the browser can query
the authoritative name server directly.

In order not to send dozens of queries to-and-from for opening one single website, the DNS
information is stored with intermediary network members, such as ISP providers.

TTL
Since the DNS information isn’t static and changes constantly due to domain name expiration, server
migration, IP address changes etc., etc., the DNS information must also be updated regularly.

For that, the so-called time-to-live, or TTL for short, is used.

TTL is a value of how long the DNS information should remain stored by a network node. It is set by
the system administrator of the node in question and varies wildly from one network member to
another. It can be seconds, or minutes, or even days, but to save cache and memory space, by an
unspoken rule, it’s usually around 24 hours for new domains and never longer than 72 hours for
existing domains.

PRABIN POUDEL 94
(HNDFourtSemester)
Client Server and Computing2017

Even the end-user’s browser stores DNS information after its first look-up of a website.

So, now, with all these factors included, the picture of a web-site look-up is as follows:

Now, for all this to take place, the name server information stored at the root servers must be correct,
thus:

 correct nameservers are indicated in the NS record of the domain’s DNS zone file
 name servers listed by a domain registrar match the ones in a DNS zone.

If there is a discrepancy between the name servers recorded at the root-servers, and those listed in the
domain’s DNS zone file, the domain name will not resolve properly.

PRABIN POUDEL 95
(HNDFourtSemester)
Client Server and Computing2017

Implementing the DNS (Domain Name System) in the Linux


So now we are familiar with DNS with its working mechanisms. So, now we are going to implement
the DNS in the Linux RHEL7 by following the above mention steps.

Check the current IP address of your machine.

As we can see in the above DHCP was enabled and distrubuted the IP address of DHCP now let we
change in to the static IP address. So type nmtui commands.

Click in edit a connection and press ok.

PRABIN POUDEL 96
(HNDFourtSemester)
Client Server and Computing2017

Click in <Add>.

Click in Ethernet and click in Create button.

PRABIN POUDEL 97
(HNDFourtSemester)
Client Server and Computing2017

As we say previously our device name was eno16777736

PRABIN POUDEL 98
(HNDFourtSemester)
Client Server and Computing2017

Now provide the relevant name and IP address and domain name and press ok.

PRABIN POUDEL 99
(HNDFourtSemester)
Client Server and Computing2017

It was sucessfully added.

PRABIN POUDEL 100


(HNDFourtSemester)
Client Server and Computing2017

Now reboot the system and go to the terminal and type nmtui.

Choose the Activate a connection option

PRABIN POUDEL 101


(HNDFourtSemester)
Client Server and Computing2017

Now connection of our created ethernet was activated let’s Quit the interface and check the Ip
address.

As defined similar IP address was show in the server.

PRABIN POUDEL 102


(HNDFourtSemester)
Client Server and Computing2017

Changing Host Name


Check the current hostname in your Linux system

PRABIN POUDEL 103


(HNDFourtSemester)
Client Server and Computing2017

Now change the hostname by executing the command hostnamectl set-hostname


www.nationalit.com and check the hostname by typing the command hostname as we can see it
was updated from local to www.nationalit.com.

Configuring the DNS


Now go to the terminal and install the bind packages by typing the yum install bind. You are installing
the packages you have in your current server.

PRABIN POUDEL 104


(HNDFourtSemester)
Client Server and Computing2017

Now after successfully installing the bind packages let’s go to the etc directory where already
named.conf file was created while installing the bind packges let’s open the file.

Provide the static IP you have craeted recently on your server.

PRABIN POUDEL 105


(HNDFourtSemester)
Client Server and Computing2017

Now after providing the static IP address let start the DNS server by typing the command:- systemctl
start named (In root users)

Enable the named server and check the status of the server as we can see it was satarted.

Now enable bot the UDP and TCP port in firewall and reload the firewall.

PRABIN POUDEL 106


(HNDFourtSemester)
Client Server and Computing2017

Now check the port number of TCP and UDP was applied or not.

Open again the file which is under the etc directory which name was named.conf.rpmnew

Open the file and go at the end of the file nad create the bothe reverse and forward zone as you see in
the follwing screen shots.

PRABIN POUDEL 107


(HNDFourtSemester)
Client Server and Computing2017

Now create the zone file inside the var directory where already the named directory was created while
installing bind packages. Now create the file forward.nationalit.com and copy the file named.localhost
And open the file forward.nationalit.com to update the zone.

Upadte the zone by providing the follwing description mention in the follwing screenshots

Now check the forwad.nationalit.com zone was created or not and see the access mode.

PRABIN POUDEL 108


(HNDFourtSemester)
Client Server and Computing2017

Now again create the reverse.nationalit.com zone and open the file.

Provide the hostname and IP address to the reverse zone like below done in the screen shots.

Check the file was created or not and check the permission allowed to the file.

PRABIN POUDEL 109


(HNDFourtSemester)
Client Server and Computing2017

Now change the permission by allowing the root user to execute the file. For both zone forwad and
reverse zone.

Check the configured file named.conf.rpmnew was running successfully or not. Here Service is
running sucessfully there is no error.

Check the both zone created in var directory. Be sure that the confuguration for both file was error
free. As you see in the screen it is actually error free.

PRABIN POUDEL 110


(HNDFourtSemester)
Client Server and Computing2017

Now restart the named server.

Sucessfully Configured DNS in the Linux System.

As you see in the upper steps bind packages are used to install the file of DNS and accordingly, I
configured the entire DNS by creating zones and giving permission to be executed the two most
useful file for the DNS reverse and forward zone and both are configured successfully without any
errors. At last the entire DNS system was restarted.

Setting breakpoints manually


I'm now going to show code that sets a breakpoint in a program. The target program I'm going to use
for this demonstration is the following:

section .text
; The _start symbol must be declared for the linker (ld)
global _start

_start:

; Prepare arguments for the sys_write system call:


;- eax: system call number (sys_write)

PRABIN POUDEL 111


(HNDFourtSemester)
Client Server and Computing2017

;- ebx: file descriptor (stdout)


;- ecx: pointer to string
;- edx: string length

mov edx, len1


mov ecx, msg1
mov ebx, 1
mov eax, 4

; Execute the sys_write system call


int 0x80

; Now print the other message


mov edx, len2
mov ecx, msg2
mov ebx, 1
mov eax, 4
int 0x80

; Execute sys_exit
mov eax, 1
int 0x80

section .data

msg1 db 'Hello,', 0xa


len1 equ $ - msg1
msg2 db 'world!', 0xa
len2 equ $ - msg2

I'm using assembly language for now, in order to keep us clear of compilation issues and symbols
that come up when we get into C code. What the program listed above does is simply print "Hello,"
on one line and then "world!" on the next line. It's very similar to the program demonstrated in the
previous article.

I want to set a breakpoint after the first printout, but before the second one. Let's say right after
the first int 0x80 , on the mov edx, len2 instruction. First, we need to know what address
this
PRABIN POUDEL 112
(HNDFourtSemester)
PRABIN POUDEL 113
(HNDFourtSemester)
Client Server and Computing2017

instruction maps to. Running objdump -d:

traced_printer2: file format elf32-i386

Sections:
Idx Name
Size VMA LMA File offAlgn
0 .text 000000330804808008048080000000802**4
CONTENTS, ALLOC, LOAD, READONLY, CODE

1 .data 0000000e080490b4080490b4000000b42**2
CONTENTS, ALLOC, LOAD, DATA

Disassembly of section .text:

08048080 <.text>:
8048080: ba 07 00 00 00 mov $0x7,%edx
8048085: b9 b4 90 04 08 mov $0x80490b4,%ecx
804808a: bb 01 00 00 00 mov $0x1,%ebx
804808f: b8 04 00 00 00 mov $0x4,%eax
8048094: cd 80 int $0x80
8048096: ba 07 00 00 00 mov $0x7,%edx
804809b: b9 bb 90 04 08 mov $0x80490bb,%ecx
80480a0: bb 01 00 00 00 mov $0x1,%ebx
80480a5: b8 04 00 00 00 mov $0x4,%eax
80480aa: cd 80 int $0x80
80480ac: b8 01 00 00 00 mov $0x1,%eax
80480b1: cd 80 int $0x80

So, the address we're going to set the breakpoint on is 0x8048096. Wait, this is not how real
debuggers work, right? Real debuggers set breakpoints on lines of code and on functions, not on
some bare memory addresses? Exactly right. But we're still far from there - to set breakpoints
like real debuggers we still have to cover symbols and debugging information first, and it will take
another part or two in the series to reach these topics. For now, we'll have to do with bare memory
addresses.

At this point I really want to digress again, so you have two choices. If it's really interesting for you
to know why the address is 0x8048096 and what does it mean, read the next section. If not, and you

PRABIN POUDEL 114


(HNDFourtSemester)
Client Server and Computing2017

just want to get on with the breakpoints, you can safely skip it.

Digression - process addresses and entry point


Frankly, 0x8048096 itself doesn't mean much, it's just a few bytes away from the beginning of the
text section of the executable. If you look carefully at the dump listing above, you'll see that the text
section starts at 0x08048080. This tells the OS to map the text section starting at this address in the
virtual address space given to the process. On Linux these addresses can be absolute (i.e. the
executable isn't being relocated when it's loaded into memory), because with the virtual memory
system each process gets its own chunk of memory and sees the whole 32-bit address space as its
own (called "linear" address).

If we examine the ELF header with readelf, we get:

$ readelf -h traced_printer2
ELF Header:
Magic:7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00

Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: Intel 80386
Version: 0x1
Entry point address: 0x8048080
Start of program headers: 52 (bytes into file)
Start of section headers: 220 (bytes into file)
Flags: 0x0
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 2
Size of section headers: 40 (bytes)
Number of section headers: 4
Section header string table index: 3

Note the "entry point address" section of the header, which also points to 0x8048080. So if we

PRABIN POUDEL 115


(HNDFourtSemester)
Client Server and Computing2017

interpret the directions encoded in the ELF file for the OS, it says:

 Map the text section (with given contents) to address 0x8048080


 Start executing at the entry point - address 0x8048080

But still, why 0x8048080? For historic reasons, it turns out. Some googling led me to a few sources
that claim that the first 128MB of each process's address space were reserved for the stack. 128MB
happens to be 0x8000000, which is where other sections of the executable may start. 0x8048080, in
particular, is the default entry point used by the Linux ld linker. This entry point can be modified by
passing the -Ttext argument to ld.

To conclude, there's nothing really special in this address and we can freely change it. As long as the
ELF executable is properly structured and the entry point address in the header matches the real
beginning of the program's code (text section), we're OK.

Setting breakpoints in the debugger with int 3


To set a breakpoint at some target address in the traced process, the debugger does the

following: Remember the data stored at the target address

Replace the first byte at the target address with the int 3 instruction

Then, when the debugger asks the OS to run the process, the process will run and eventually hit upon
the int 3, where it will stop and the OS will send it a signal. This is where the debugger comes in
again, receiving a signal that its child (or traced process) was stopped. It can then:

Replace the int 3 instruction at the target address with the original instruction

Roll the instruction pointer of the traced process back by one. This is needed because the
instruction pointer now points after the int 3, having already executed it.

Allow the user to interact with the process in some way, since the process is still halted at the desired
target address. This is the part where your debugger lets you peek at variable values, the call stack
and so on.

When the user wants to keep running, the debugger will take care of placing the breakpoint back
(since it was removed in step 1) at the target address, unless the user asked to cancel the breakpoint.

Let's see how some of these steps are translated into real code. We'll use the debugger "template"

PRABIN POUDEL 116


(HNDFourtSemester)
Client Server and Computing2017

presented in part 1 (forking a child process and tracing it). In any case, there's a link to the full source
code of this example at the end of the task.

Here the debugger fetches the instruction pointer from the traced process, as well as examines the
/* Obtain and show child's instruction pointer */
word currently present at 0x8048096.
ptrace(PTRACE_GETREGS, child_pid,When run tracing the assembly program listed in the beginning
0, &regs);
of the article, this started.
procmsg("Child prints: EIP = 0x%08x\n",
regs.eip);
So far, so good. Next:
[13028] Child started. EIP = 0x08048080 [13028]
Original
/* Look atdata at 0x08048096:
the word 0x000007ba
at the address we're interested in */
Note
/*
how int
Write addr
3 is inserted at the target address. This prints:
the trap instruction 'int 3' into the address */
unsigned = 0x8048096;
unsigned
unsigned data_with_trap = (data & 0xFFFFFF00)
data = ptrace(PTRACE_PEEKTEXT, | 0xCC;
child_pid, (void*)addr, 0);
Again, as expected - 0xba was replaced with 0xcc. The debugger now runs the child and waits for it
[13028] After trap, data at 0x08048096: 0x000007cc
ptrace(PTRACE_POKETEXT, child_pid,
procmsg("Original data at (void*)addr,
0x%08x: 0x%08x\n", (void*)data_with_trap);
addr, data);
to halt on the breakpoint:

/* See
/* Let the what's
child run there
to the again...
breakpoint*/and wait for it to
unsigned readback_data = ptrace(PTRACE_PEEKTEXT, child_pid, (void*)addr, 0);
procmsg("After trap, data at 0x%08x: 0x%08x\n", addr, readback_data);

PRABIN POUDEL 117


(HNDFourtSemester)
Client Server and Computing2017

** reach it
*/
ptrace(PTRACE_CONT, child_pid, 0, 0);

wait(&wait_status);
if (WIFSTOPPED(wait_status)) {
procmsg("Child got a signal: %s\n", strsignal(WSTOPSIG(wait_status)));
}
else {
perror("wait");
return;
}

/* See where the child is now */ ptrace(PTRACE_GETREGS, child_pid, 0, &regs); procmsg("Child stopped at EIP = 0x%

This prints:

Note the "Hello," that was printed before the breakpoint - exactly as we planned. Also note where the
Hello,
child stopped
[13028] Child- just
got aafter the single-byte
signal: trap instruction.
Trace/breakpoint trap
[13028] Child stopped at EIP = 0x08048097
Finally, as was explained earlier, to keep the child running we must do some work. We replace the
trap with the original instruction and let the process continue running from it.

/* Remove the breakpoint by restoring the previous data


** at the target address, and unwind the EIP back by 1 to
** let the CPU execute the original instruction that was
** there.
*/
ptrace(PTRACE_POKETEXT, child_pid, (void*)addr, (void*)data); regs.eip -= 1;
ptrace(PTRACE_SETREGS, child_pid, 0, &regs);

PRABIN POUDEL 118


(HNDFourtSemester)
Client Server and Computing2017

/* The child can continue running now */ ptrace(PTRACE_CONT, child_pid, 0, 0);

This makes the child print "world!" and exit, just as planned.

Note that we don't restore the breakpoint here. That can be done by executing the original instruction
in single-step mode, then placing the trap back and only then do PTRACE_CONT. The debug library
demonstrated later in the article implements this.

More on int 3
Now is a good time to come back and examine int 3 and that curious note from Intel's manual. Here
it is again:

This one byte form is valuable because it can be used to replace the first byte of any instruction with
a breakpoint, including other one byte instructions, without over-writing other code

int instructions on x86 occupy two bytes - 0xcd followed by the interrupt number. int 3 could've
been encoded as cd 03, but there's a special single-byte instruction reserved for it - 0xcc.

Why so? Because this allows us to insert a breakpoint without ever overwriting more than one
instruction. And this is important. Consider this sample code:

.. some code ..
jz foo
deceax
foo:
callbar
.. some code ..

Suppose we want to place a breakpoint on dec eax. This happens to be a single-byte


instruction (with the opcode 0x48). Had the replacement breakpoint instruction been longer
than 1 byte, we'd be forced to overwrite part of the next instruction (call), which would garble it
and probably produce something completely invalid. But what is the branch jz foo was taken?
Then, without stopping on dec eax, the CPU would go straight to execute the invalid
instruction after it.

Having a special 1-byte encoding for int 3 solves this problem. Since 1 byte is the shortest an

PRABIN POUDEL 119


(HNDFourtSemester)
PRABIN POUDEL 120
(HNDFourtSemester)
Client Server and Computing2017

instruction can get on x86, we guarantee than only the instruction we want to break on gets changed.

Encapsulating some gory details


Many of the low-level details shown in code samples of the previous section can be easily
encapsulated behind a convenient API. I've done some encapsulation into a small utility library
called debuglib - its code is available for download at the end of the article. Here I just
want to demonstrate an example of its usage, but with a twist. We're going to trace a program
written in C.

Tracing a C program
So far, for the sake of simplicity, I focused on assembly language targets. It's time to go one level up
and see how we can trace a program written in C.

It turns out things aren't very different - it's just a bit harder to find where to place the breakpoints.
Consider this simple program:

Suppose I want to place a breakpoint at the entrance to do_stuff. I'll use the old friend objdump to
#include <stdio.h>
disassemble the executable, but there's a lot in it. In particular, looking at the text section is a bit
useless since it contains a lot of C runtime initialization code I'm currently not interested in. So let's
just
voidlook for do_stuff in the dump:
do_stuff()
{
printf("Hello, ");
}

int main()
{
for (int i = 0; i < 4; +
+i) do_stuff();
printf("world!\n");
return 0;
}

PRABIN POUDEL 121


(HNDFourtSemester)
Client Server and Computing2017

080483e4 <do_stuff>:
80483e4: 55 push%ebp
80483e5: 89 e5 mov %esp,%ebp
80483e7: 83 ec 18 sub $0x18,%esp
80483ea: c7 04 24 f0 84 04 08 movl$0x80484f0,(%esp)
80483f1: e8 22 ff ff ff call8048318 <puts@plt>
80483f6: c9 leave
80483f7: c3 ret

Alright, so we'll place the breakpoint at 0x080483e4, which is the first instruction of
do_stuff. Moreover, since this function is called in a loop, we want to keep stopping at the
breakpoint until the loop ends. We're going to use the debuglib library to make this simple.
Here's the complete debugger function:

void run_debugger(pid_t child_pid)


{
procmsg("debugger started\n");

/* Wait for child to stop on its first instruction */ wait(0);


procmsg("child now at EIP = 0x%08x\n", get_child_eip(child_pid));

/* Create breakpoint and run to it*/


debug_breakpoint* bp = create_breakpoint(child_pid, (void*)0x080483e4); procmsg("breakpoint created\n");
ptrace(PTRACE_CONT, child_pid, 0, 0); wait(0);

/* Loop as long as the child didn't exit */


while (1) {
/* The child is stopped at a breakpoint here. Resume its
** execution until it either exits or hits the
** breakpoint again.
*/
procmsg("child stopped at breakpoint. EIP = 0x%08X\n", get_child_eip(child_pid));

PRABIN POUDEL 122


(HNDFourtSemester)
Client Server and Computing2017

procmsg("resuming\n");
int rc = resume_from_breakpoint(child_pid, bp);

if (rc == 0) {
procmsg("child exited\n");
break;
}
else if (rc == 1) {
continue;
}
else {
procmsg("unexpected: %d\n", rc);
break;
}
}

cleanup_breakpoint(bp);
}

Instead of getting our hands dirty modifying EIP and the target process's memory space, we just
use create_breakpoint, resume_from_breakpoint and cleanup_breakpoint. Let's see what this prints
when tracing the simple C code displayed above:

$ bp_use_lib traced_c_loop [13363] debugger started


[13364] target started. will run 'traced_c_loop' [13363] child now at EIP = 0x00a37850
[13363] breakpoint created
[13363] child stopped at breakpoint. EIP = 0x080483E5 [13363] resuming
Hello,
[13363] child stopped at breakpoint. EIP = 0x080483E5 [13363] resuming
Hello,

PRABIN POUDEL 123


(HNDFourtSemester)
Client Server and Computing2017

[13363] child stopped at breakpoint. EIP = 0x080483E5 [13363] resuming


Hello,
[13363] child stopped at breakpoint. EIP = 0x080483E5 [13363] resuming
Hello, world!
[13363] child exited

Just as expected!

The code
Here are the complete source code files for this part. In the archive you'll find:

 debuglib.h and debuglib.c - the simple library for encapsulating some of the inner workings
of a debugger
 bp_manual.c - the "manual" way of setting breakpoints presented first in this article. Uses the
debuglib library for some boilerplate code.
 bp_use_lib.c - uses debuglib for most of its code, as demonstrated in the second code
sample for tracing the loop in a C program.

Conclusion and next steps


We've covered how breakpoints are implemented in debuggers. While implementation details vary
between OS, when you're on x86 it's all basically variations on the same theme substituting int 3
for the instruction where we want the process to stop.

Conclusion
Here as required I have defined about the TCP and UDP and explain it in depth also show the
creation of TCP/UDP in the Linux with using socket programming after that I have defined the
building process of DNS step by step and defined it using the flowchart in depth. After that I have
implemented the DNS in the Linux system and showed some advanced functions such as breakpoint
resume using the C programming it’s main moto was how to stop the process running in the OS and
also mention how breakpoint and resume helps us to debugging.

PRABIN POUDEL 124


(HNDFourtSemester)
Client Server and Computing2017

PRABIN POUDEL 125


(HNDFourtSemester)
Client Server and Computing2017

Bibliography
Reavis, J., 2017. Client and Server Management, US: MIT SMR CUSTOM STUDIO.

Sadowski, R., 2017. Client and Server Management, s.l.: MIT SMR CUSTOM STUDIO.

Baranes, R., 2018. tutorialspoint. [Online]


Available at: https://www.tutorialspoint.com/process-vs-parent-process-vs-child-process
[Accessed 04 10 2019].

Rouse, M., 2018. techtarget. [Online]


Available at: https://searchnetworking.techtarget.com/definition/serverMangement
[Accessed 04 10 2019].

Rouse, M., 2018. techtarget. [Online]


Available at: https://searchnetworking.techtarget.com/definition/client-network
[Accessed 10 10 2019].

softwaretesting, 2019. softwaretestinghelp. [Online]


Available at: https://www.softwaretestinghelp.com/dns-ftp-smtp-mime-protocols/
[Accessed 27 10 2019].

PRABIN POUDEL 126


(HNDFourtSemester)
Client Server and Computing2017

PRABIN POUDEL 127


(HNDFourtSemester)

You might also like