0% found this document useful (0 votes)
138 views

Computer Networks

This document summarizes four types of computer networks: 1) Local Area Network (LAN) - Connects devices within a small geographic area like a home or office using technologies like Ethernet or WiFi. 2) Metropolitan Area Network (MAN) - Connects networks in a city or campus area between 5-50 km using technologies like DSL or cable. 3) Wide Area Network (WAN) - Connects LANs over large distances like countries using technologies like leased phone lines or satellites. The Internet is the most common example. 4) Personal Area Network (PAN) - Connects devices within a few meters of an individual like phones and PDAs using short-range wireless.

Uploaded by

Akshay Mehta
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
138 views

Computer Networks

This document summarizes four types of computer networks: 1) Local Area Network (LAN) - Connects devices within a small geographic area like a home or office using technologies like Ethernet or WiFi. 2) Metropolitan Area Network (MAN) - Connects networks in a city or campus area between 5-50 km using technologies like DSL or cable. 3) Wide Area Network (WAN) - Connects LANs over large distances like countries using technologies like leased phone lines or satellites. The Internet is the most common example. 4) Personal Area Network (PAN) - Connects devices within a few meters of an individual like phones and PDAs using short-range wireless.

Uploaded by

Akshay Mehta
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

Computer Networks Practical No: 01

Aim: Study of various types of Computer Networks


-------------------------------------------------------------------------------------------------------------

Local Area Network (LAN)


A LAN is a network that is used for communicating among Computer devices,
usually within an office building or home.
LANs enable the sharing of resources such as files or Hardware devices that
may be needed by multiple users.
Is limited in size, typically spanning a few hundred meters, And no more than
a mile.
Is fast, with speeds from 10 Mbps to 10 Gbps.
Requires little wiring, typically a single cable connecting to each device.
Has lower cost compared to MANs or WANs.
LANs can be either wired or wireless. Twisted pair, Coax or fiber optic cable
can be used in wired LANs.
Every LAN uses a protocol a set of rules that governs how packets are
configured and transmitted.
Nodes in a LAN are linked together with a certain Topology. These topologies
include:
1) Bus

2) Ring

3) Star

Metropolitan Area Network (MAN)


A metropolitan area network (MAN) is a large Computer network that usually
spans a city or a large campus.
A MAN is optimized for a larger geographical Area than a LAN, ranging from
several blocks of Buildings to entire cities.
A MAN might be owned and operated by a Single organization, but it usually
will be used by many individuals and organizations.
A MAN often acts as a high speed network to allow sharing of regional
resources.
A MAN typically covers an area of between 5 and 50 km diameter.
Examples of MAN: Telephone Company Network that provides a high speed
DSL to Customers and cable TV network.

Wide Area Network (WAN):


WAN covers a large geographic area such as country, continent or even whole
of the world.
A WAN is two or more LANs connected together. The LANs can be many miles
apart.
To cover great distances, WANs may transmit data over leased high-speed
phone lines or wireless links such as satellites.
Multiple LANs can be connected together using devices such as bridges,
routers, or gateways, which enable them to share data.
The world's most popular WAN is the Internet.

Personal Area Network (PAN):


A PAN is a network that is used for communicating among computers and
computer devices (including telephones) in close proximity of around a few
meters within a room
It can be used for communicating between the Devices themselves, or for
connecting to a larger network such as the internet.
PANs can be wired or wireless
A personal area network (PAN) is a computer network used for
communication among computer devices, including telephones and personal
digital assistants, in proximity to an individual's body.
The devices may or may not belong to the person in question. The reach of a
PAN is typically a few meters.

Computer Networks Practical No: 02


Aim: Study different types of Network Cables
-------------------------------------------------------------------------------------------------------------

Twisted-Pair Cable:
Twisted-pair cable is a type of cabling that is used for telephone
communications and most modern Ethernet networks. A pair of wires forms a
circuit that can transmit data. The pairs are twisted to provide protection
against crosstalk, the noise generated by adjacent pairs. When electrical current
flows through a wire, it creates a small, circular magnetic field around the wire.
When two wires in an electrical circuit are placed close together, their magnetic
fields are the exact opposite of each other. Thus, the two magnetic fields cancel
each other out. They also cancel out any outside magnetic fields. Twisting the
wires can enhance this cancellation effect. Using cancellation together with
twisting the wires, cable designers can effectively provide self-shielding for wire
pairs within the network media.
Two basic types of twisted-pair cable exist:
1) Unshielded Twisted Pair (UTP)
2) Shielded Twisted Pair (STP)

1) Unshielded Twisted Pair (UTP)


UTP cable is a medium that is composed of pairs of wires UTP cable is
used in a variety of networks. Each of the eight individual copper wires in UTP
cable is covered by an insulating material. In addition, the wires in each pair are
twisted around each other. UTP cable relies solely on the cancellation effect
produced by the twisted wire pairs to limit signal degradation caused by
electromagnetic interference (EMI) and radio frequency interference (RFI). To
further reduce crosstalk between the pairs in UTP cable, the number of twists in
the wire pairs varies.

2) Shielded Twisted Pair (STP)


Shielded twisted-pair (STP) cable combines the techniques of shielding,
cancellation, and wire twisting. Each pair of wires is wrapped in a metallic foil the
four pairs of wires then are wrapped in an overall metallic braid or foil, usually
150-ohm cable. As specified for use in Ethernet network installations, STP
reduces electrical noise both within the cable (pair-to-pair coupling, or crosstalk)
and from outside the cable (EMI and RFI).

Coaxial Cable:
Coaxial cable consists of a hollow outer cylindrical conductor that
surrounds a single inner wire made of two conducting elements. One of these
elements, located in the center of the cable, is a copper conductor. Surrounding
the copper conductor is a layer of flexible insulation. Over this insulating material
is a woven copper braid or metallic foil that acts both as the second wire in the
circuit and as a shield for the inner conductor. This second layer, or shield, can
help reduce the amount of outside interference. Covering this shield is the cable
jacket.
Coaxial cable supports 10 to 100 Mbps and is relatively inexpensive,
although it is more costly than UTP on a per-unit length. However, coaxial cable
can be cheaper for a physical bus topology because less cable will be needed.
Coaxial cable can be cabled over longer distances than twisted-pair cable. For
example, Ethernet can run approximately 100 meters (328 feet) using twisted-pair
cabling. Using coaxial cable increases this distance to 500m (1640.4 feet).

Optical Fiber:
Optical Fiber cables use optical fibers that carry digital data signals in the
form of modulated pulses of light. An optical fiber consists of an extremely thin
cylinder of glass, called the core, surrounded by a concentric layer of glass,
known as the cladding. There are two fibers per cableone to transmit and one
to receive. The core also can be an optical-quality clear plastic, and the cladding
can be made up of gel that reflects signals back into the fiber to reduce signal
loss.

Computer Networks Practical No: 04


Aim: Study of Different Network Devices

HUB:
A hub works in the physical layer of the OSI model. It is basically a nonintelligent device, and has no decision making capability. What a Hub basically
does is take the input data from one of the ports and broadcast the information
to all the other ports connected to the network. Due to their design, they
increase the chances for collisions. Hubs flood incoming packets to all ports all
the time. Hubs pose a security risk since all packets are flooded to all ports all
the time. If a user has packet sniffing software, they can extract data from the
network and potentially decode it and use it. Hubs make it easy to "spy" on
users on the same LAN as you.

SWITCHES:
A switch is an intelligent device that works in the data link layer. The term
intelligent refers to the decision making capacity of the Switch. Since it works in
the Data link layer, it has knowledge of the MAC addresses of the ports in the
network.

If data has to be sent from Computer A to Computer B, then, the data is


transferred to the Computer B only, and not to any other computers connected
on the network. Hence, it establishes a link between the sender and the
receiver based on the MAC addresses. This also means that when data is being

sent from A to B, Computer C can establish a link with Computer D and


communication can take place between them. So, simultaneous data transfer is
possible in a switch. Also, Hub divides bandwidth, but a Switch does not.
It is also to be noted that a switch is a secure device, because it sends
information only to the desired destinations, and also certain security features
such as firewalls can be implemented in the Switches.

BRIDGE:
A bridge is a computer networking device that builds the connection with
the other bridge networks which use the same protocol. It works at the Data
Link layer of the OSI Model and connects the different networks together and
develops communication between them. It connects two local-area networks;
two physical LANs into larger logical LAN or two segments of the same LAN that
use the same protocol.
Apart from building up larger networks, bridges are also used to segment
larger networks into smaller portions. The bridge does so by placing itself
between the two portions of two physical networks and controlling the flow of
the data between them.

ROUTER:
Routers are network layer devices and are particularly identified as Layer3 devices of the OSI Model. They process logical addressing information in the
Network header of a packet such as IP Addresses. Router is used to create larger
complex networks by complex traffic routing. It has the ability to connect
dissimilar LANs on the same protocol. It also has the ability to limit the flow of
broadcasts. A router primarily comprises of a hardware device or a system of
the computer which has more than one network interface and routing software.
When a router receives the data, it determines the destination address by
reading the header of the packet. Once the address is determined, it searches in
its routing table to get know how to reach the destination and then forwards
the packet to the higher hop on the route. The hop could be the final
destination or another router.
Routing tables play a very pivotal role in letting the router makes a
decision. Thus a routing table is ought to be updated and complete.

BROUTER:
Brouter (Bridging Router) is a device which has two functions.
Brouter acts as a router for known protocols (known by the router and those on
the network) and hence works in the network layer. For data packets with
unknown protocols, it acts as a bridge by connecting two different networks
which is the function of a bridge - and this works in the data-link layer.

MODEM:
A modem is a device that makes it possible for computers to
communicate over telephone lines. The word modem comes from Modulate
and Demodulate. Because standard telephone lines use analog signals, and
computers digital signals, a sending modem must modulate its digital signals
into analog signals. The computers modem on the receiving end must then
demodulate the analog signals into digital signals.

Computer Networks Practical No: 05


Aim: Study of Different Network Addresses
There are TWO different types of network addresses
1) MAC (Media Access Control) address
2) IP (Internet Protocol) address
The MAC address is a physical address and it exists on the Layer 2 (Data
Link) of the OSI (Open Systems Interconnection). Layer 2 is also known as the
Data Link Layer.
The IP address is a virtual address and it operates on Layer 3 (Network).
MAC addresses are unique address it is burnt into the hardware by the
manufacture at the time it is made. MAC addresses are also known as Burned in
Addresses (BIA). MAC address are used by many different Layer 2 devices some
are Ethernet, Token Ring, Bluetooth, and Fiber Channel.
MAC address is 48 bits in length and there are 281,474,976,710,656
possible addresses. A MAC address would look like this 00-23-4E-47-21-01. The
first three bytes of any MAC address will tell you who the manufacture of that
device is. The manufacture of this address 00-23-4E is Hon Hai Precision Inc.
The first three bytes of a MAC address are assigned by the IEEE Standards
Association to a company
IP address is an Internet Protocol address. The IP address is used to identify the
different computers and websites on the internet or intranet. Each device must
have a unique IP address. If not it will cause problem on your network. The IP
address allows you chat, send email, and it allows you to use the internet
An IP address is made up of 4 separate numbers, each between 0 and 255,
and arranged with dots in between them. All websites have an IP address. It is
easier for humans to remember a name instead of an IP, so a DNS (Domain Name
System) matches the name with an IP address. One of Yahoo.coms IP addresses is
209.161.122.70. IP address is controlled by ICANN (Internet Corporation for
Assigned Names and Numbers).
The internet is growing so fast that we are running out of IPv4 address.
Soon we will be out of IP and we will need to use IPv6.

Computer Networks Practical No: 08


Aim: Study of Client Server programming using Java
-------------------------------------------------------------------------------------------------------------

Java program for Server:


import
import
import
import
import
import
import
import

java.io.BufferedReader;
java.io.BufferedWriter;
java.io.InputStream;
java.io.InputStreamReader;
java.io.OutputStream;
java.io.OutputStreamWriter;
java.net.ServerSocket;
java.net.Socket;

public class MyServer


{
private static Socket socket;
public static void main(String[] args)
{
try
{
int port = 1234;
ServerSocket serverSocket = new ServerSocket(port);
System.out.println("Server Started and listening to the port
1234");
//Server is running always. This is done using this while(true) loop
while(true)
{
//Reading the message from the client
socket = serverSocket.accept();
InputStream is = socket.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String number = br.readLine();
System.out.println("Message received from client is
"+number);
//Multiplying the number by 2 and forming the return message
String returnMessage;
try

{
int numberInIntFormat = Integer.parseInt(number);
int returnValue = numberInIntFormat*2;
returnMessage = String.valueOf(returnValue) + "\n";
}
catch(NumberFormatException e)
{
//Input was not a number. Sending proper message back to client.
returnMessage = "Please send a proper number\n";
}

//Sending the response back to the client.


OutputStream os = socket.getOutputStream();
OutputStreamWriter osw = new OutputStreamWriter(os);
BufferedWriter bw = new BufferedWriter(osw);
bw.write(returnMessage);
System.out.println("Message sent to the client is
"+returnMessage);
bw.flush();
}
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
try
{
socket.close();
}
catch(Exception e){}
}
}
}

Java Program for Client:


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.InetAddress;
import java.net.Socket;

public class MyClient


{

private static Socket socket;

public static void main(String args[])


{
try
{
String host = "localhost";
int port = 1234;
InetAddress address = InetAddress.getByName(host);
socket = new Socket(address, port);

//Send the message to the server


OutputStream os = socket.getOutputStream();
OutputStreamWriter osw = new OutputStreamWriter(os);
BufferedWriter bw = new BufferedWriter(osw);

String number = "99";


String sendMessage = number + "\n";
bw.write(sendMessage);
bw.flush();
System.out.println("Message sent to the server : "+sendMessage);
//Get the return message from the server
InputStream is = socket.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String message = br.readLine();
System.out.println("Message received from the server : "
+message);
}
catch (Exception exception)
{
exception.printStackTrace();
}
finally
{
//Closing the socket
try
{
socket.close();
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
}

Outputs:

Computer Networks Practical No: 03


Aim: Study of Datalink Layer Protocol
------------------------------------------------------------------------------------------------------------Theory:
Data Link Layer Protocols:
The data link layer provides service to the Network Layer above it:
1. The network layer is interested in getting messages to the corresponding
network layer module on an adjacent machine.
2. The remote Network Layer peer should receive the identical message
generated by the sender (e.g., if the data link layer adds control information,
the header information must be removed before the message is passed to the
Network Layer).
3. The Network Layer wants to be sure that all messages it sends, will be
delivered
correctly (e.g., none lost, no corruption). Note that arbitrary errors may result in
the loss of both data and control frames.
4. The Network Layer wants messages to be delivered to the remote peer in the
exact same order as they are sent.
Simplex Stop-and-Wait Protocol
Drop assumption that receiver can process incoming data in_nitely fast
Stop and wait protocols where the sender sends one frame and then waits for
acknowledgement. In this protocol, the contents of the acknowledgement
frame are unimportant. Data transmission is one directional, but must have
bidirectional line. Could have a half-duplex (one direction at a time) physical
channel.

One Bit Sliding Window Protocol


Two-way communication. One-way is not realistic. Have two kinds of frames
1. Data
2. Ack (sequence number of last correctly received frame)
Piggybacking
Add acknowledgement to data frames going in reverse direction.
For better use of bandwidth. How long to wait for outgoing data frame before
sending the ACK on its own.
Example of a sliding window protocol. Contains a sequence number whose
maximum value
MaxSeq is 2n
1. For stop-and-wait sliding window protocol n = 1.
2. Essentially protocol 3, except ACKs are numbered, which solves early time
out problem.
3. Protocol works, all frames delivered in correct order
4. Requires little bu_er space
5. Poor line utilization (next page) One Bit Sliding Window Protocol

Computer Networks Practical No: 06


Aim: Connect computers in LAN
------------------------------------------------------------------------------------------------------------Theory:
On the host computer
On the host computer, follow these steps to share the Internet connection:
1. Log on to the host computer as Administrator or as Owner.
2. Click Start, and then click Control Panel.
3. Click Network and Internet Connections.
4. Click Network Connections.
5. Right-click the connection that you use to connect to the Internet. For example, if
you connect to the Internet by using a modem, right-click the connection that you
want under Dial-up / other network available.
6. Click Properties.
7. Click the Advanced tab.
8. Under Internet Connection Sharing, select the Allow other network users to
connect through this computer's Internet connection check box.
9. If you are sharing a dial-up Internet connection, select the Establish a dial-up
connection whenever a computer on my network attempts to access the Internet
check box if you want to permit your computer to automatically connect to the
Internet.
10. Click OK. You receive the following message:
When Internet Connection Sharing is enabled, your LAN adapter will be set to use
IP address 192.168.0.1. Your computer may lose connectivity with other computers
on your network. If these other computers have static IP addresses, it is a good idea

to set them to obtain their IP addresses automatically. Are you sure you want to
enable Internet Connection Sharing?
11. Click Yes.
The connection to the Internet is shared to other computers on the local area network
(LAN).
The network adapter that is connected to the LAN is configured with a static IP
address of 192.168.0.1 and a subnet mask of 255.255.255.0
On the client computer
To connect to the Internet by using the shared connection, you must confirm the
LAN adapter IP configuration, and then configure the client computer. To confirm
the LAN adapter IP configuration, follow these steps:
1. Log on to the client computer as Administrator or as Owner.
2. Click Start, and then click Control Panel.
3. Click Network and Internet Connections.
4. Click Network Connections.
5. Right-click Local Area Connection and then click Properties.
6. Click the General tab, click Internet Protocol (TCP/IP) in the connection uses
the following items list, and then click Properties.
7. In the Internet Protocol (TCP/IP) Properties dialog box, click Obtain an IP
address automatically (if it is not already selected), and then click OK.
Note: You can also assign a unique static IP address in the range of 192.168.0.2 to
192.168.0.254. For example, you can assign the following static IP address, subnet
mask, and default gateway:
8. IP Address 192.168.31.202
9. Subnet mask 255.255.255.0
10. Default gateway 192.168.31.1
11. In the Local Area Connection Properties dialog box, click OK.

Computer Networks Practical No: 07


Aim: Study of Basic Network Commands.
------------------------------------------------------------------------------------------------------------Theory:
All commands related to Network configuration which includes how to switch to
privilege mode and normal mode and how to configure router interface and how to
save this configuration to flash memory or permanent memory.
This commands includes
1. Configuring the Router commands
2. General Commands to configure network
3. Privileged Mode commands of a router
4. Router Processes & Statistics
5. IP Commands
6. Other IP Commands e.g. show ip route etc.

ping:
ping sends an ICMP ECHO_REQUEST packet to the specified host. If the host
responds, you get an ICMP packet back. Sound strange? Well, you can ping an IP
address to see if a machine is alive. If there is no response, you know something is
wrong.
traceroute:
Tracert is a command which can show you the path a packet of information takes
from your computer to one you specify. It will list all the routers it passes through
until it reaches its destination, or fails to and is discarded. In addition to this, it will
tell you how long each 'hop' from router to router takes.

nslookup:
Displays information from Domain Name System (DNS) name servers.
NOTE :If you write the command as above it shows as default your pc's server name
firstly.

Computer Networks Practical No: 09


Aim: Study of Network Simulator(NS2)
------------------------------------------------------------------------------------------------------------Theory:
Network simulation is used widely in network research to test new protocols,
modifications to existing protocols and new ideas. The tools used in many cases is
ns-2.The nature of the ns-2 protocols means that they are often based on presents the
network simulation cradle which allows real world network stacks to be simulator.
The network stacks from the open source operating systems Linux, designed for
embedded systems, lwIP.Our results show that ns-2s TCP implementations do not
match observed.
Simulator: A device that enables the operator to reproduce or represent under
test conditions phenomena likely to occur in actual performance.
Simulation: is an imitation of some real thing, state of affairs, or process. The
act of simulating something generally entails representing certain key characteristics
or behaviors of a selected physical or abstract system. NS: The Network Simulator
ns-2 is a discrete event simulator, which means it simulates such events as sending,
receiving, forwarding and dropping packets. The events are sorted by time (seconds)
in ascending order.
NS-2 AN OVERVIEW:NS-2 is an event driven network simulator that
simulates variety of networks. It implements network protocols such as TCP and
UDP, traffic source mechanism such as FTP, telnet, web, CBR and VBR, router
queue management mechanism such as drop tail, RED and CBQ, routing algorithms
such as Dijkstra and more.NS also implements multicasting and some of the MAC
layer protocols of the LAN simulations.

DESIGN: NS is object oriented Tcl (OTcl) script interpreter that has a


simulation event schedule and network component object libraries and
network setup (PLUMBING) module libraries. To setup and run a simulation
network, user should write an OTcl script that initiates an event scheduler,
sets up the network topology using the network objects and the plumbing
functions in the library, and tell the traffic sources when to start and stop the
transmitting packets through the event scheduler. The term plumbing is
used for network setup, because setting up network is plumbing data paths
among objects by setting the neighbors pointer of an object to the address
of an appropriate object.
WHAT IS NS-2?

machines in some respects and using the network simulation cradle produces
results closer to real world network stacks
icast.) over networks
(wireless, wireline, satellite)

through NSF with CONSER, in collaboration with ACIRI.

NS-2 COMPONENTS:
The tclobject is considered as the ancestor class of the ns-2components, ns object is
the super class of all basic network comp

3onents such as nodes and links. The basic network component such as nodes and
links. The basic networks components are further divided into two subclasses,
connector and classifier, based on the possible output data paths. The basic network

objects that have only one output data path are under the connector class, and
switching objects that have possible multiple output data paths are under the
classifier class.

EVENTS SCHEDULER:
In NS, an event scheduler keeps track of simulation time and fires all the events in
the scheduled for the current time by invoking appropriate network components.
Network components communicate with one another passing packet; however this
does not consume actual simulation time.All the network components that need to
spend some simulation time handling a packets i.e., need a delay use the events
scheduler by issuing an event for the packet and waiting for the events to be forced
to itself before doing further action handling a packet.
NODE AND ROUTING:
Node is a compound object composed of a node entry object and classifiers. There
are types of nodes in NS.A unicast node has an
address classifier that does explicitly notified in the input of the OTcl script, right
after creating a scheduler object, that all the nodes that will be created are multicast
nodes. After specifying the node the user an also select a specific routing protocol
other than using a default one.
LINK:
A link is another major compound object in NS.when a user creates a link using a
duplex-link member function of the simulator object; simplex links in both
directions are created. One thing to note is that output queue of a node is actually
implemented as a part of simplex link object.packets
TRACING:
In TS, network activities traced around simplex links if the simulator is directed to
trace network activities, the links created after the command will have the following

trace objects inserted. When each trace object receives a packet, it writes to the
specified trace file without consuming any simulation time, and passes the packet to
the next network object.
QUEUE MONITOR:
Basically, tracing objects are designed to record packet arrival time at which they
are located although user gets enough information from the trace, they might be
interested in what is going on inside a specific output queue. When a packet arrives,
snoop queue .object notifies the queue monitor object of this event the queue monitor
using this information monitors the queue.
ADVANTAGES:
-2 is originally based on the source code of the BSD kernel.
vents,

CONCLUSION:
Ns-2 provides a very convenient platform for testing different TCP congestion
control protocols in many scenarios. It is a good foundation towards an
implementation for TCP congestion control algorithms.
19. NS-2 Code to Printing Message set sim [new Simulator] $sim at 1 puts
\Hello World!\ $sim at 1.5 exit $sim run 20. NS-2 OTCL Code

o set a 5
o set b $a
o set c [expr $a + $b]
o set d [expr [expr $a - $b] * $c]
o incr x

o incr x -1
o set y [pow x 2]
o set y [expr x*x]
o int: set c [expr 1/6]
o float: set c [expr 1.0 / 6.0 ]
o Display: puts "Must enter atleast one Arguments"
o Control structures: if {$x > 0} {
return $x } else { return [expr -$x] } Open file for NS tracing set f [open out.tr w]
$ns trace-all $f

Computer Networks Practical No: 10


Aim: Study of Application Layer Protocol
-------------------------------------------------------------------------------------------------------------

Theory:
The world experiences the Internet through the use of the World Wide Web, e-mail,
and file-sharing programs. These applications, as well as others, provide the human
interface to the underlying network, allowing you to send and receive information
with relative ease. Most of the applications are intuitive; they can be accessed and
used without the need to know how they work. As you continue to study the world
of networking, it becomes more important to know how an application is able to
format, transmit, and interpret messages that are sent and received across the
network.
Application Layer Protocol Functions
Both the source and destination devices use application layer protocols during a
communication session. For the communications to be successful, the application
layer protocols implemented on the source and destination host must match.
Protocols perform the following tasks:
Establish consistent rules for exchanging data between applications and services
loaded on the participating devices.
Specify how data inside the messages is structured and the types of messages that
are sent between source and destination. These messages can be requests for
services, acknowledgments, data messages, status messages, or error messages.
Define message dialogues, ensuring that a message being sent is met by the
expected response and that the correct services are invoked when data transfer
occurs. Many different types of applications communicate across data networks.

Therefore, application layer services must implement multiple protocols to provide


the desired range of communication experiences. Each protocol has a specific
purpose and contains the characteristics required to meet that purpose. The right
protocol details in each layer must be followed so that the functions at one layer
interface properly with the services in the lower layer. Applications and services can
also use multiple protocols in the course of a single conversation.
One protocol might specify how to establish the network connection, and another
might describe the process for the data transfer when the message is passed to the
next lower layer.

Application layer protocols:

1. FTP
2. Telnet
FTP
FTP is another commonly used application layer protocol. FTP was developed to
allow file transfers between a client and a server. An FTP client is an application
that runs on a computer that is used to push and pull files from a server running the
FTP daemon (FTPd). To successfully transfer files, FTP requires two connections
between the client and the server: one for commands and replies, and the other for
the actual file transfer. The client establishes the first connection to the server on
TCP port 21. This connection is used for control traffic, consisting of client
commands and server replies. The client establishes the second connection to the
server over TCP port 20. This connection is for the actual file transfer and is created
every time a file is transferred. The file transfer can happen in either direction, as
shown in . The client can download (pull) a file from the server or upload (push) a
file to the server.

FTP Process
Telnet Services and Protocol
Long before desktop computers with sophisticated graphical interfaces existed,
people used text-based systems that were often just display terminals physically
attached to a central computer. After networks were available, people needed a way
to remotely access the computer systems in the same manner that they did with the
directly attached terminals. Telnet was developed to meet that need. It dates back to
the early 1970s and is among the oldest of the application layer protocols and
services in the TCP/IP suite. Telnet is a client/server protocol that provides a
standard method of emulating text-based terminal devices over the data network.
Both the protocol itself and the client software that implements
the protocol are commonly referred to as Telnet.

Telnet Service
Appropriately enough, a connection using Telnet is called a VTY (Virtual Terminal)
session, or connection. Telnet specifies how a VTY session is established and
terminated. It also provides the syntax and order of the commands used to initiate
the Telnet session, and it provides control commands that can be issued during a
session. Each Telnet command consists of at least 2 bytes. The first byte is a special
character called the Interpret as Command (IAC) character. As its name implies,
the IAC character defines the next byte as a command rather than text. Rather than
using a physical device to connect to the server, Telnet uses software to create a
virtual device that provides the same features of a terminal
session with access to the server command-line interface (CLI).
To support Telnet client connections, the server runs a service called the Telnet
daemon. A virtual terminal connection is established from an end device using a
Telnet client application. Most operating systems include an application layer Telnet
client. On a Microsoft Windows PC, Telnet can be run from the command prompt.
Other common terminal applications that run as Telnet clients are HyperTerminal,
Minicom, and TeraTerm. When a Telnet connection is established, users can
perform any authorized function on the server, just as if they were using a commandline session on the server itself. If authorized, they can start and stop processes,
configure the device, and even shut down the system.

The following are some sample Telnet protocol commands:


Are You There (AYT): Enables the user to request that a response, usually a
prompt icon, appear on the terminal screen to indicate that the VTY session is active.
Erase Line (EL): Deletes all text from the current line.
Interrupt Process (IP): Suspends, interrupts, aborts, or terminates the process to
which the virtual terminal is connected. For example, if a user started a program on
the Telnet server through the VTY, he or she could send an IP command to stop the
program.

You might also like