Sunteți pe pagina 1din 35

INDORE INSTITUTE OF SCIENCE & TECHNOLOGY

DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING


Table of Experiments
Subject:- COMPUTER NETWORK
Class:- EC IV Year/ VIII Semester

S. No
1
2
3
4
5
6
7
8
9

Subject Code:- EC-803


Session:- 2015-2016

List of Experiments
To Study Stop n Wait ARQ with CRC-4 detection
To simulate pure Aloha protocol
To simulate slotted Aloha protocol
To simulate Ethernet protocol
To plot Channel Efficiency for Ethernet in MATLAB
To simulate CSMA/CD Protocol
To study Routing algorithm
To ISO OSI Model
To Study TCP/IP Protocol

INDORE INSTITUTE OF SCIENCE & TECHNOLOGY


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING
Subject:- COMPUTER NETWORK
Class:- EC IV Year/ VIII Semester

Subject Code:- EC-803


Session:- 2015-2016

EXPERIMENT- 1
__________________________________________________________________
Student Assessment Record
Name .
..
Class ..

Experiment Date
on..

Roll No.
Department
Submitted

Signature of student
Signature of
Professor
____________________________________________________________________________
AIM: - To Study Stop-and-Wait ARQ with CRC-4 detection
SOFTWARE REQUIRED: - MATLAB
THEORY:Stop-and-wait ARQ also can be referred as Alternating bit protocol is a method used
in telecommunications to send information between two connected devices. It ensures that
information is not lost due to dropped packets and that packets are received in the correct order.
It is the simplest kind of automatic repeat-request (ARQ) method. A stop-and-wait ARQ sender
sends one frame at a time; it is a special case of the general sliding window protocol with both
transmit and receive window sizes equal to 1 and more than one respectively .
After sending each frame, the sender doesn't send any
further frames until it receives an acknowledgement (ACK) signal. After receiving a good frame,
the receiver sends an ACK. If the ACK does not reach the sender before a certain time, known as
the timeout, the sender sends the same frame again.

PROGRAMMING:%stop n wait ARQ with CRC-4 detection

clc;

close all;

%exp=input('Enter the number of experiments');


%m=input('Enter no. of frames : ');
m=10;
%n=input('Enter frame length : ');
n=7;
%p=input('Enter probability of error of the tx channel');
%tpt=randi([0,1],m,n);
%delay=randi([0,1],m,n);
%p=input('Enter probability of error of the tx channel');
%timeout=input('Enter max no. of transmissions per frame:');
timeout=12;
%rtd=input('Enter round trip delay(in sec):');
rtd=.125;
%rate1=input('Enter data rate of transmission medium(in Mbps):');
rate1=2;
rate=rate1*1000000;

%fprintf('The message is:');msg;


exp=input('Enter the no. of times exp to be done: ');

error=0;

for x=1:200
p(x)=x*.0005;
msg=randi([0,1],m,n);
%Cyclic Redundancy Check coding of the data packets

div=[1 0 0 1];
for i=1:m

%predetermined divisor

[q,r]=deconv(msg(i,:),div);
y(i,:)=[msg(i,:),zeros(1,3)];
for k=1:n
r(k)=mod(r(k),2);
end
fcs=[zeros(1,3),r];

%frame check sequence

pac(i,:)=bitxor(y(i,:),fcs);
clear r;clear rem;
end

%fec encoding

%fprintf('The transmitted message with parity bits is:');msgtx


xtra=0;
for c=1:exp
%stop n wait protocol
extra=0;
pass=0;

%msgrx=msgtx;
j=1;
time=0;

while(j<=m)
pass=pass+1;

msgrx(j,:)=bsc(pac(j,:),p(x));
%fprintf('Pass %d :',pass);
%fprintf('Transmitted message:');msgtx(j,:)
%fprintf('Received message:');msgrx(j,:)

[q2,r2]=deconv(msgrx(j,:),div);
r2(1,:)=mod(r2(1,:),2);
if r2==0
temp1(1,j)=0;
else
temp1(1,j)=1;
end
if(temp1(1,j)==0)
j=j+1;
time=0;
elseif(time<timeout)
extra=extra+1;
time=time+1;
%else
%j=j+1;
%extra=1000;
end
end
xtra=xtra+extra;
%error calculation
for d=1:m
if(msgrx(d,:)==pac(d,:))
else
error=error+1;
end
end

end
xtra1=xtra/exp;
%Throughput efficiency calculation based on extra

Tp=rtd/2;
Ts=(n+3)/rate;
pdr=Tp/Ts;
factor=1/(1+2*pdr);

tpt(x)=((m/(m+xtra1))*n*factor)/(n+3);
tpt1(x)=(((1-p(x))^n)*n*factor)/(n+1);
Tt=(2*Tp)+Ts;
delay(x)=((m+xtra1)/m)*Tt;
delay1(x)=Tt/((1-p(x))^n);

end

subplot(2,2,1)
plot(p,tpt)
xlabel('BER');
ylabel('Throughput');

subplot(2,2,2)
plot(p,tpt1)
xlabel('BER');
ylabel('Theoritical Throughput');

subplot(2,2,3)
plot(p,delay)
xlabel('BER');
ylabel('Delay');

subplot(2,2,4)
plot(p,delay1)
xlabel('BER');

ylabel('Theoritical Delay');
%fprintf('Frames erroneously received=%d/%d \n',error,exp*m);

INDORE INSTITUTE OF SCIENCE & TECHNOLOGY DEPARTMENT OF


ELECTRONICS & COMMUNICATION ENGINEERING
Subject:- COMPUTER NETWORK
Class:- EC IV Year/ VIII Semester

Subject Code:- EC-803


Session:- 2015-2016

EXPERIMENT- 2
__________________________________________________________________
Student Assessment Record
Name .
..
Class ..

Experiment Date
on..

Roll No.
Department
Submitted

Signature of student
Signature of
Professor
____________________________________________________________________________
Aim: - To Study Simulation for pure Aloha protocol.
SOFTWARE REQUIRED: - MATLAB
THEORY:In the ALOHA system, a node transmits whenever data is available to send. If another node
transmits at the same time, a collision occurs, and the frames that were transmitted are lost.
However, a node can listen to broadcasts on the medium, even its own, and determine whether
the frames were transmitted.
PURE ALOHA
In pure ALOHA, the stations transmit frames whenever they have data to send. When two or
more stations transmit simultaneously, there is collision and the frames are destroyed. In pure
ALOHA, whenever any station transmits a frame, it expects the acknowledgement from the
receiver. If acknowledgement is not received within specified time, the station assumes that the
frame (or acknowledgement) has been destroyed. If the frame is destroyed because of collision
the station waits for a random amount of time and sends it again. This waiting time must be
random otherwise same frames will collide again and again. Therefore pure ALOHA dictates
that when time-out period passes, each station must wait for a random amount of time before
resending its frame. This randomness will help avoid more collisions.
PROGRAMMING:%total simulation time in seconds

runtime=0.2;
%total number of stations
nstation=10;
%transmission throughput of the media in bits per second
netthrou=10e6;
%frame size in bits
fsize=8000;
%avarage frame arrival rate per second for each station
%frate=10;
for frate=1:5:150
%average frame arrival rate per simulation iteration
trh=frate/10000;
%random wait window in number of simulation iterations
wwind=100;
%EVENTS VARIABLES
%transmit active
tr=zeros(1,nstation);
%transmit queue
tq=zeros(1,nstation);
%transmit progress counter
tcnt=zeros(1,nstation);
%collision keeper
colis=zeros(1,10000*runtime);
%collision station index
colin=zeros(1,nstation);
%random wait after collision
rwait=zeros(1,nstation);
%transmit keeper
trkeep=zeros(nstation,10000*runtime);
%packet arrival keeper
pakeep=0;

for i=1:10000*runtime
for j=1:nstation
%check if the transmitter is active
if tr(j)==1
trkeep(j,i)=1;
end
%check if the packet has been sent
if tcnt(j)>0
tcnt(j)=tcnt(j)-1;
if tcnt(j)==0
tr(j)=0;
%check if the transmission is collision free
if colin(j)==1
rwait(j)=ceil(wwind*rand(1,1));
tq(j)=tq(j)+1;
colin(j)=0;
end
end
else
if tq(j)>0 & rwait(j)==0
tr(j)=1;
tcnt(j)=ceil(fsize/netthrou*10000);
tq(j)=tq(j)-1;
end
end
%check if a new packet has arrived
pa=rand(1,1);
if pa<trh
pakeep=pakeep+1;
%if the transmit is ready
if tr(j)==0 & rwait(j)==0

tr(j)=1;
tcnt(j)=ceil(fsize/netthrou*10000);
else
tq(j)=tq(j)+1;
end
end
%decreaserandom waiting count
if rwait(j)>0
rwait(j)=rwait(j)-1;
end
end
%check for collision
if sum(tr)>1
colis(i)=1;
for k=1:nstation
if tr(k)==1
colin(k)=1;
end
end
end
end
px1(frate)=(pakeep-sum(tq));
py1(frate)=pakeep;
end
g1=[0:0.01:1.2];
s1=g1.*exp(-2*g1);
figure(1)
plot(px1*8000/runtime,py1*8000/runtime,'x',s1*1e7,g1*1e7,'-')
grid
xlabel('Throughput (bps)')
ylabel('Arrival Rate (bps)')

INDORE INSTITUTE OF SCIENCE & TECHNOLOGY


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING
Subject:- COMPUTER NETWORK
Class:- EC IV Year/ VIII Semester

Subject Code:- EC-803


Session:- 2015-2016

EXPERIMENT- 3
__________________________________________________________________
Student Assessment Record
Name .
..
Class ..

Experiment Date
on..

Roll No.
Department
Submitted

Signature of student
Signature of
Professor
____________________________________________________________________________
AIM: - To Study Simulation for slotted Aloha protocol.
SOFTWARE REQUIRED: - MATLAB
THEORY:In the ALOHA system, a node transmits whenever data is available to send. If another node
transmits at the same time, a collision occurs, and the frames that were transmitted are lost.
However, a node can listen to broadcasts on the medium, even its own, and determine whether
the frames were transmitted.
SLOTTED ALOHA
Slotted ALOHA was invented to improve the efficiency of pure ALOHA as chances of
collision in pure ALOHA are very high. In slotted ALOHA, the time of the shared channel
is divided into discrete intervals called slots. The stations can send a frame only at the
beginning of the slot and only one frame is sent in each slot. In slotted ALOHA, if any
station is not able to place the frame onto the channel at the beginning of the slot i.e. it
misses the time slot then the station has to wait until the beginning of the next time slot.
In slotted ALOHA, there is still a possibility of collision if two stations try to send at the
beginning of the same time slot .Slotted ALOHA still has an edge over pure ALOHA as
chances of collision are reduced to one-half.
PROGRAMMING:%total simulation time in seconds

runtime=0.2;
%total number of stations
nstation=10;
%transmission throughput of the media in bits per second
netthrou=10e6;
%frame size in bits
fsize=8000;
%avarage frame arrival rate per second for each station
%frate=10;
for frate=1:5:150
%average frame arrival rate per simulation iteration
trh=frate/10000;
%random wait window
wwind=100;
%EVENTS VARIABLES
%transmit active
tr=zeros(1,nstation);
%transmit queue
tq=zeros(1,nstation);
%transmit progress counter
tcnt=zeros(1,nstation);
%collision keeper
colis=zeros(1,10000*runtime);
%collision station index
colin=zeros(1,nstation);
%random wait after collision
rwait=zeros(1,nstation);
%transmit keeper
trkeep=zeros(nstation,10000*runtime);
%packet arrival keeper
pakeep=0;
for i=1:10000*runtime
for j=1:nstation
%check if the transmitter is active

if tr(j)==1
trkeep(j,i)=1;
end
%check if the packet has been sent
if tcnt(j)>0
tcnt(j)=tcnt(j)-1;
if tcnt(j)==0
tr(j)=0;
%check if the transmission is collision free
if colin(j)==1
rwait(j)=ceil(wwind*rand(1,1));
tq(j)=tq(j)+1;
colin(j)=0;
end
end
else
if tq(j)>0 & rwait(j)==0 & mod(i,8)==0
tr(j)=1;
tcnt(j)=ceil(fsize/netthrou*10000);
tq(j)=tq(j)-1;
end
end
%check if a new packet has arrived
pa=rand(1,1);
if pa<trh
pakeep=pakeep+1;
%if the transmit is ready
if tr(j)==0 & rwait(j)==0 & mod(i,8)==0
tr(j)=1;
tcnt(j)=ceil(fsize/netthrou*10000);
else
tq(j)=tq(j)+1;
end
end

%decreaserandom waiting count


if rwait(j)>0
rwait(j)=rwait(j)-1;
end
end
%check for collision
if sum(tr)>1
colis(i)=1;
for k=1:nstation
if tr(k)==1
colin(k)=1;
end
end
end
end
px2(frate)=(pakeep-sum(tq));
py2(frate)=pakeep;
end
g2=[0:0.01:1.2];
s2=g2.*exp(-g2);
figure(2)
plot(px2*8000/runtime,py2*8000/runtime,'x',s2*1e7,g2*1e7,'-')
grid
xlabel('Throughput (bps)')
ylabel('Arrival Rate (bps)')

INDORE INSTITUTE OF SCIENCE & TECHNOLOGY


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING
Subject:- COMPUTER NETWORK
Class:- EC IV Year/ VIII Semester

Subject Code:- EC-803


Session:- 2015-2016

EXPERIMENT- 4
__________________________________________________________________
Student Assessment Record
Name .
Roll No.
..
Class ..
Department

Experiment Date
Submitted
on..
Signature of student
Signature of
Professor
____________________________________________________________________________
AIM: - To Study Simulation for Ethernet protocol.
SOFTWARE REQUIRED: - MATLAB
THEORY:The Ethernet protocol has a minimum and maximum restriction on the size of data that can be
encapsulated in a frame (46 to 1500 bytes). If the size of an IPv4 datagram is less than 46 bytes,
some padding will be added to meet this requirement. In this case, when a machine decapsulates
the datagram, it needs to check the total length field to determine how much are really data and
how much is padding
PROGRAMMING:%total simulation time in seconds
runtime=0.2;
%total number of stations
nstation=10;
%transmission throughput of the media in bits per second
netthrou=10e6;
%frame size in bits
fsize=8000;
%avarage frame arrival rate per second for each station
%frate=10;
for frate=1:5:150
%average frame arrival rate per simulation iteration
trh=frate/10000;
%random wait window

wwind=100;
%EVENTS VARIABLES
%transmit active
tr=zeros(1,nstation);
%transmit active at previous iteration
trp=zeros(1,nstation);
%transmit queue
tq=zeros(1,nstation);
%transmit progress counter
tcnt=zeros(1,nstation);
%collision keeper
colis=zeros(1,10000*runtime);
%collision station index
colin=zeros(1,nstation);
%random wait after collision
rwait=zeros(1,nstation);
%transmit keeper
trkeep=zeros(nstation,10000*runtime);
%packet arrival keeper
pakeep=0;
for i=1:10000*runtime
%save the media status
trp=tr;
for j=1:nstation
%check if the transmitter is active
if tr(j)==1
trkeep(j,i)=1;
end
%check if the packet has been sent
if tcnt(j)>0
%check if the transmission is collision free

if colin(j)==1
rwait(j)=ceil(wwind*rand(1,1));
tq(j)=tq(j)+1;
colin(j)=0;
tcnt(j)=0;
else
tcnt(j)=tcnt(j)-1;
end
if tcnt(j)==0
tr(j)=0;
end
else
if tq(j)>0 & rwait(j)==0 & sum(trp)==0
tr(j)=1;
tcnt(j)=ceil(fsize/netthrou*10000);
tq(j)=tq(j)-1;
end
end
%check if a new packet has arrived
pa=rand(1,1);
if pa<trh
pakeep=pakeep+1;
%if the transmit is ready
if tr(j)==0 & rwait(j)==0 & sum(trp)==0
tr(j)=1;
tcnt(j)=ceil(fsize/netthrou*10000);
else
tq(j)=tq(j)+1;
end
end
%decreaserandom waiting count

if rwait(j)>0
rwait(j)=rwait(j)-1;
end
end
%check for collision
%sum(tr)
if sum(tr)>1
colis(i)=1;
for k=1:nstation
if tr(k)==1
colin(k)=1;
end
end
end
end
px2(frate)=(pakeep-sum(tq));
py2(frate)=pakeep;
end
figure(1)
plot(px2*8000/runtime,py2*8000/runtime,'x')
grid
xlabel('Throughput (bps)')
ylabel('Arrival Rate (bps)')

INDORE INSTITUTE OF SCIENCE & TECHNOLOGY


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING
Subject:- COMPUTER NETWORK
Class:- EC IV Year/ VIII Semester

Subject Code:- EC-803


Session:- 2015-2016

EXPERIMENT- 5
__________________________________________________________________
Student Assessment Record
Name .
Roll No.
..
Class ..
Department

Experiment Date
Submitted
on..
Signature of student
Signature of
Professor
____________________________________________________________________________
AIM: - To plot Channel Efficiency for Ethernet in MATLAB.
SOFTWARE REQUIRED: - MATLAB
PROGRAMMING:clc;
b=input('enter the b.w.');
l=input('enter the input length');
c=input('enter the input capacity');
k=1:256;
f1=64*8;
f2=128*8;
f3=256*8; p=((k-1)/k).^(k-1);
x=(2*b*l)./(c.*p);
a1=x./f1;
a2=x./f2;
a3=x./f3;
n1=1./(1+a1);

n2=1./(1+a2);
n3=1./(1+a3);
plot(k,n1,'rd:');
hold on;
plot(k,n2,'gp:');
hold on;
plot(k,n3,'bh:');
xlabel('no of attempts');
ylabel('efficiency');
title('channel efficiency');
legend('64*a','128*8','256*8','location','northeastoutside');
Result:- the b.w.:20000000
enter the input length:2500
enter the input capacity:1000000

RESULT:-

INDORE INSTITUTE OF SCIENCE & TECHNOLOGY


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

Subject:- COMPUTER NETWORK


Class:- EC IV Year/ VIII Semester

Subject Code:- EC-803


Session:- 2015-2016

EXPERIMENT- 6
__________________________________________________________________
Student Assessment Record
Name .
Roll No.
..
Class ..
Department

Experiment Date
Submitted
on..
Signature of student
Signature of
Professor
____________________________________________________________________________
AIM: - TO STUDY CSMA/CD.
SOFTWARE REQUIRED: - MATLAB
THEORY:The basic idea behind CSMA/CD is that a station needs to be able to receive while transmitting
to detect a collision. When there is no collision, the station receives one signal: its own signal.
When there is a collision, the station receives two signals: its own signal and the signal
transmitted by a second station. To distinguish between these two cases, the received signals in
these two cases must be significantly different. In other words, the signal from the second station
needs to add a significant amount of energy to the one created by the first station
Carriers sense multiple access with collision detection (CSMA/CD)
augments the algorithm to handle the collision. In this method, a station monitors the medium
after it sends a frame to see if the transmission was successful. If so, the station is finished. If,
however, there is a collision, the frame is sent again. For CSMA/CD to work, we need a
restriction on the frame size. Before sending the last bit of the frame, the sending station must
detect a collision, if any, and abort the transmission. This is so because the station, once the
entire frame is sent, does not keep a copy of the frame and does not monitor the line for collision
detection. Therefore, the frame transmission time (Tfr) must be at least two times the maximum
propagation time (Tp)
PROGRAMMING;F=findobj('Tag','Fig1');
A=findobj('Tag','Axes2');
xyEn=findobj('Tag','xyEnable');
hold=findobj('Tag','holdon');
ym=findobj('Tag','yMin');

y=findobj('Tag','yMax');
x=findobj('Tag','xMax');
x_range=str2double(get(x,'String'));
Tau=findobj('Tag','Tau');
mtau=str2double(get(Tau,'String'));
cc=findobj('Tag','FreqCifra');
c=str2double(get(cc,'String'));
l=findobj('Tag','LengthFrame');
L=str2double(get(l,'String'));
S=findobj('Tag','Step');
Step=str2double(get(S,'String'));
%
%%% Inizio codice
%
C=c*1000;
tau=mtau/1000;
a=tau*C/L;
Text1=sprintf('a = %g',a);
G=0:1/Step:x_range;
C=zeros(size(G));
C=(G.*(1+G+a.*G.*(1+G+a.*G./2)).*exp(-G.*(1+2*a)))./(G.*(1+2*a)-(1-exp(a.*G))+(1+a.*G).*exp(-G.*(1+a)));
% Se spuntato "Hold on"
if get(hold,'value')
C=(G.*(1+G+a.*G.*(1+G+a.*G./2)).*exp(-G.*(1+2*a)))./(G.*(1+2*a)-(1-exp(a.*G))+(1+a.*G).*exp(-G.*(1+a)));
set(F,'CurrentAxes',A);
set(A,'NextPlot','add');
hold on;
xl='Offered load, G';
yl='Throughput, S';

tit='CSMA & CSMA/CD';


plot2(G,C,'b:',xl,yl,tit,Text1);
if get(xyEn,'value')
axis([0 x_range str2double(get(ym,'String')) str2double(get(y,'String'))]);
end
else set(A,'NextPlot','replace');
set(F,'CurrentAxes',A);
reset(A);
cla reset
set(A,'Box','on');
Text=sprintf('CSMA 1-persistent

%s = %g[ms], C = %d[kbit/s], L_f = %d[bit], a =

%g','\tau',mtau,c,L,a);
xl='Offered load, G';
yl='Throughput, S';
plot2(G,C,'b:',xl,yl,Text,Text1);
if get(xyEn,'value')
axis([0 x_range str2double(get(ym,'String')) str2double(get(y,'String'))]);
end
end
if get(findobj('Tag','Grid'),'Value')
grid on;
else grid off;
end
if get(findobj('Tag','CoordEnable'),'Value')
cox1=findobj('Tag','xCoord');
cox=str2double(get(cox1,'String'));
coyres=(cox*(1+cox+a*cox*(1+cox+a*cox/2))*exp(-cox*(1+2*a)))/(cox*(1+2*a)-(1-exp(a*cox))+(1+a*cox)*exp(-cox*(1+a)));
coy1=findobj('Tag','yCoord');
coy=str2double(get(coy1,'String'));
if coy > max(C) | coy < min(C)

testo1=sprintf('Coordinate Y must be: %g < Y < %g',min(C),max(C));


msgbox(testo1,'Limit Violation','warn','modal');
return
elseif cox < 0
testo=sprintf('Coordinate x must be: %g < X < %g',min(G),max(G));
msgbox(testo,'Limit Violation','warn','modal');
return
elseif get(coy1,'String')==''
coordx(cox,coyres);
return
end
I=find(C>=coy);
coxres=G(I(1));
coxres2=G(I(end));
coord2(cox,coyres,coy,coxres,coxres2);
end

INDORE INSTITUTE OF SCIENCE & TECHNOLOGY


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

Subject:- COMPUTER NETWORK


Class:- EC IV Year/ VIII Semester

Subject Code:- EC-803


Session:- 2015-2016

EXPERIMENT- 7
__________________________________________________________________
Student Assessment Record
Name .
..
Class ..

Experiment Date
on..

Roll No.
Department
Submitted

Signature of student
Signature of
Professor
____________________________________________________________________________
AIM: - TO STUDY ISO-OSI MODEL.
THEORY:The International Standards Organization (ISO) is a multinational body dedicated to worldwide
agreement on international standards. An ISO standard that covers all aspects of network
communications is the Open Systems Interconnection model. An open system is a set of
protocols that allows any two different systems to communicate regardless of their underlying
architecture. The purpose of the OSI model is to show how to facilitate communication between
different systems without requiring changes to the logic of the underlying hardware and
software. The OSI model is not a protocol; it is a model for understanding and designing a
network architecture that is flexible, robust, and interoperable.
The OSI model is a layered framework for the design of network systems that
allows communication between all types of computer systems. It consists of seven separate but
related layers, each of which defines a part of the process of moving information across a
network.

1) Physical Layer
The physical layer coordinates the functions required to carry a bit stream over a physical
medium. It deals with the mechanical and electrical specifications of the interface and
transmission medium. It also defines the procedures and functions that physical devices and
interfaces have to perform for transmission to Occur. The physical layer is responsible for
movements of individual bits from one hop (node) to the next. The physical layer defines the
characteristics of the interface between the devices and the transmission medium. It also defines
the type of transmission medium.

2) Data Link Layer


The data link layer transforms the physical layer, a raw transmission facility, to a reliable link. It
makes the physical layer appear error-free to the upper layer (network layer). The data link layer
is responsible for moving frames from one hop (node) to the next data link layer divides the
stream of bits received from the network layer into manageable data units called frames. If
frames are to be distributed to different systems on the network, the data link layer adds a header
to the frame to define the sender and/or receiver of the frame. If the frame is intended for a
system outside the sender's network, the receiver address is the address of the device that
connects the network to the next one.
The data link layer imposes a flow control mechanism to avoid
overwhelming the receiver. The data link layer adds reliability to the physical layer by adding
mechanisms to detect and retransmit damaged or lost frames. It also uses a mechanism to
recognize duplicate frames.

3) Network Layer
The network layer is responsible for the source-to-destination delivery of a packet, possibly
across multiple networks (links). Whereas the data link layer oversees the delivery of the packet
between two systems on the same network (links), the network layer ensures that each packet
gets from its point of origin to its final destination. If two systems are connected to the same link,
there is usually no need for a network layer. However, if the two systems are attached to
different networks (links) with connecting devices between the networks (links), there is often a
need for the network layer to accomplish source-to-destination delivery.
The network layer is responsible for the delivery of individual packets from the
source host to the destination host. . The network layer adds a header to the packet coming from
the upper layer that, among other things, includes the logical addresses of the sender and
receiver. One of the functions of the network layer is to provide this mechanism.

4) Transport Layer
The transport layer is responsible for process-to-process delivery of the entire message. A
process is an application program running on a host. Whereas the network layer oversees sourceto-destination delivery of individual packets, it does not recognize any relationship between
those packets. It treats each one independently, as though each piece belonged to a separate
message, whether or not it does. The transport layer, on the other hand, ensures that the whole
message arrives intact and in order, overseeing both error control and flow control at the sourceto-destination level. The transport layer is responsible for the delivery of a message from one
process to another.
The transport layer gets the entire message to the correct process on that computer.
The transport layer can be either connectionless or connection oriented. A connectionless
transport layer treats each segment as an independent packet and delivers it to the transport layer
at the destination machine. A connection oriented transport layer makes a connection with the
transport layer at the destination machine first before delivering the packets. After all the data are
transferred, the connection is terminated

5) Session Layer

The services provided by the first three layers (physical, data link, and network) are not
sufficient for some processes. The session layer is the network dialog controller. It establishes,
maintains, and synchronizes the interaction among communicating systems. The session layer is
responsible for dialog control and synchronization. The session layer allows two systems to enter
into a dialog. It allows the communication between two processes to take place in either half
duplex (one way at a time) or full-duplex (two ways at a time) mode. The session layer allows a
process to add checkpoints, or synchronization points, to a stream of data

6) Presentation Layer
The presentation layer is concerned with the syntax and semantics of the information exchanged
between two systems the presentation layer is responsible for interoperability between these
different encoding methods. Presentation layer at the sender changes the information from its
sender-dependent format into a common format. Presentation layer at the receiving machine
changes the common format into its receiver-dependent format. The presentation layer is
responsible for translation, compression, and encryption.

7) Application Layer
The application layer enables the user, whether human or software, to access the network. It
provides user interfaces and support for services such as electronic mail, remote file access and
transfer, shared database management, and other types of distributed information services.

The application layer is responsible for providing services to the


user. The application Layer allows a user to access files in a remote host (to make changes or
read data), to retrieve files from a remote computer for use in the local computer, and to manage
or control files in a remote computer locally. XAOO (message-handling services), X.500
(directory services), and file transfer, access, and management (FTAM).

INDORE INSTITUTE OF SCIENCE & TECHNOLOGY


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING
Subject:- COMPUTER NETWORK
Class:- EC IV Year/ VIII Semester

Subject Code:- EC-803


Session:- 2015-2016

EXPERIMENT- 8
__________________________________________________________________
Student Assessment Record
Name .
Roll No.
..
Class ..
Department

Experiment Date
Submitted
on..
Signature of student
Signature of
Professor
____________________________________________________________________________
AIM: - To Study of TCP/IP Reference Model.
THEORY: The Transmission Control Protocol (TCP) and the Internet Protocol (IP) are two of the network
standards that define the Internet. IP defines how computers can get data to each other over a
routed, interconnected set of networks. TCP defines how applications can create reliable
channels of communication across such a network. Basically, IP defines addressing and routing,
while TCP defines how to have a conversation across the link without garbling or losing data.
TCP/IP grew out of research by the U.S. Dept. of Defense and is based on a loose rather than a
strict approach to layering. Many other key Internet protocols, such as the Hypertext Transfer
Protocol (HTTP), the basic protocol of the Web, and the Simple Mail Transfer Protocol (SMTP),
the core email transfer protocol, are built on top of TCP. The User Datagram Protocol (UDP), a
companion to TCP, sacrifices the guarantees of reliability that TCP makes in return for faster
communications.
TCP/IP doesn't map cleanly to the OSI model, since it was developed before the OSI
model and was designed to solve a specific set of problems, not to be a general description for all
network communications
The TCP/IP protocol suite was developed prior to the OSI model. Therefore, the layers
in the TCP/IP protocol suite do not exactly match those in the OSI model. The original TCP/IP
protocol suite was defined as having four layers: host-to-network, internet, transport, and
application. However, when TCP/IP is compared to OSI, we can say that the host-to-network
layer is equivalent to the combination of the physical and data link layers. The internet layer is
equivalent to the network layer, and the application layer is roughly doing the job of the session,

presentation, and application layers with the transport layer in TCP/IP taking care of part of the
duties of the session layer.

TCP/IP LAYER:Layer 1. Network Access Layer


Network Access Layer is the first layer of the four layer TCP/IP model. Network Access
Layer defines details of how data is physically sent through the network, including how bits are
electrically or optically signaled by hardware devices that interface directly with a network
medium, such as coaxial cable, optical fiber, or twisted pair copper wire.
The protocols included in Network Access Layer are Ethernet, Token Ring, FDDI, X.25, Frame
Relay etc.
The most popular LAN architecture among those listed above is Ethernet. Ethernet uses
an Access Method called CSMA/CD (Carrier Sense Multiple Access/Collision Detection) to
access the media, when Ethernet operates in a shared media. An Access Method determines how
a host will place data on the medium.
IN CSMA/CD Access Method, every host has equal access to the medium and can place data on
the wire when the wire is free from network traffic. When a host wants to place data on the wire,
it will check the wire to find whether another host is already using the medium. If there is traffic
already in the medium, the host will wait and if there is no traffic, it will place the data in the
medium. But, if two systems place data on the medium at the same instance, they will collide
with each other, destroying the data. If the data is destroyed during transmission, the data will
need to be retransmitted. After collision, each host will wait for a small interval of time and
again the data will be retransmitted

Layer 2. Internet Layer


Internet Layer is the second layer of the four layer TCP/IP model. The position
of Internet layer is between Network Access Layer and Transport layer. Internet layer pack data
into data packets known as IP datagrams, which contain source and destination address (logical

address or IP address) information that is used to forward the datagrams between hosts and
across networks. The Internet layer is also responsible for routing of IP datagrams.
Packet switching network depends upon a connectionless internetwork layer. This layer is known
as Internet layer. Its job is to allow hosts to insert packets into any network and have them to
deliver independently to the destination. At the destination side data packets may appear in a
different order than they were sent. It is the job of the higher layers to rearrange them in order to
deliver them to proper network applications operating at the Application layer.
The main protocols included at Internet layer are IP (Internet Protocol), ICMP (Internet Control
Message Protocol), ARP (Address Resolution Protocol), RARP (Reverse Address Resolution
Protocol) and IGMP (Internet Group Management Protocol).
Layer 3. Transport Layer
Transport Layer is the third layer of the four layer TCP/IP model. The position of
the Transport layer is between Application and Internet layer. The purpose of Transport layer is
to permit devices on the source and destination hosts to carry on a conversation. Transport
layer defines the level of service and status of the connection used when transporting data.
The main protocols included at Transport layer are TCP (Transmission Control
Protocol) and UDP (User Datagram Protocol).
Layer 4. Application Layer
Application layer is the top most layer of four layer TCP/IP model. Application layer is
present on the top of the Transport. Application layer defines TCP/IP application protocols and
how host programs interface with Transport services to use the network.
Application layer includes all the higher-level protocols like DNS (Domain Naming
System), HTTP (Hypertext Transfer Protocol), Telnet, SSH, FTP (File Transfer Protocol), TFTP
(Trivial File Transfer Protocol), SNMP (Simple Network Management Protocol), SMTP (Simple
Mail Transfer Protocol) , DHCP (Dynamic Host Configuration Protocol), X Windows, RDP
(Remote Desktop Protocol) etc.

S-ar putea să vă placă și