Sunteți pe pagina 1din 14

Computer Networks Lab (BCS3)

List of Assignments :

Assignment 1: (Network Basics)


a) Design a network diagram using a star topology and mention the requirement of the devices to set
up a LAN. (as per your visit of Server Room)
b) With suitable block diagram mention the scope of following network devices:
i) Hub, ii) Repeaters, iii) Bridge, iv) Switch, v) Router
c) Transmission Media:
Draw the rough schematic diagram of following Transmission Media and mention some of its
specifications (where relevant)
i) Twisted Pair Cable, ii) UTP and STP cable, iii) UTP Connectors (RJ 45), iv) Coaxial Cable,
v) Optical Fibre Cable

Assignment 2: Cisco Packet Tracer


Experiment-1 (Cisco Packet Tracer)

Step 1: Create a logical network diagram with two PCs and a hub

The bottom left-hand corner of the Packet Tracer screen displays eight icons that represent device categories or
groups, such as Routers, Switches, or End Devices.Moving the cursor over the device categories will show the name
of the category in the box. To select a device,first select the device category. Once the device category is selected,
the options within that category appear in the box next to the category listings. Select the device option that is
required.

a) Select End Devices from the options in the bottom left-hand corner. Drag and drop two generic PCs onto your
design area.

b) Select Hubs from the options in the bottom left-hand corner. Add a hub to the prototype network by
dragging and dropping a generic hub onto the design area.

c) Select Connections from the bottom left-hand corner. Choose a Copper Straight-through cable type.
Click the first host, PC0, and assign the cable to the FastEthernet connector. Click the hub, Hub0, and
select a connection port, Port 0, to connect to PC0.

d) Repeat Step c for the second PC, PC1, to connect the PC to Port 1 on the hub.
*There should be green dots at both ends of each cable connection. If not, check the cable type selected.

Step 2: Configure host names and IP addresses on the PCs

a) Click PC0. A PC0 window will appear.

b) From the PC0 window, select the Config tab. Change the PC Display Name to PC-A. (An error message window
will appear warning that changing the device name may affect scoring of the activity. Ignore this error message.)
Select the FastEthernet tab on the left and add the IP address of 192.168.1.1 and subnet mask of 255.255.255.0.
Close the PC-A configuration window by selecting the x in the upper righthand corner.
c) Click PC1.

d) Select the Config tab. Change the PC Display Name to PC-B. Select the FastEthernet tab on the left
and add the IP address of 192.168.1.2 and subnet mask of 255.255.255.0. Close the PC-B configuration
window.

Step 3: Observe the flow of data from PC-A to PC-B by creating network traffic

a) Switch to Simulation mode by selecting the tab that is partially hidden behind the Realtime tab in the
bottom right-hand corner. The tab has the icon of a stopwatch on it.

b) Click the Edit Filters button in the Edit List Filters area. Clicking the Edit Filters button will create a
pop-up window. In the pop-up window, click the Show All/None box to deselect every filter. Select just
the ARP and ICMP filters.

c) Select a Simple PDU by clicking the closed envelope on the right vertical toolbar. Move your cursor to the
display area of your screen. Click PC-A to establish the source. Move your cursor to PC-B and click to
establish the destination.

**Notice that two envelopes are now positioned beside PC-A. One envelope is ICMP, while the other is
ARP. The Event List in the Simulation Panel will identify exactly which envelope represents ICMP and
which represents ARP.

d) Select Auto Capture / Play from the Play Controls area of the Simulation Panel. Below the Auto
Capture / Play button is a horizontal bar, with a vertical button that controls the speed of the simulation.
Dragging the button to the right will speed up the simulation, while dragging is to the left will slow down
the simulation.

e) The animation will run until the message window No More Events appears. All requested events have
been completed. Select OK to close the message box.

f) Choose the Reset Simulation button in the Simulation Panel. Notice that the ARP envelope is no longer present.
This has reset the simulation but has not cleared any configuration changes or dynamic table entries, such as ARP
table entries. The ARP request is not necessary to complete the ping command because PC-A already has the MAC
address in the ARP table.

g) Choose the Capture / Forward button. The ICMP envelope will move from the source to the hub and
stop. The Capture / Forward button allows you to run the simulation one step at a time. Continue
selecting the Capture / Forward button until you complete the event.

h) Choose the Power Cycle Devices button on the bottom left, above the device icons.

i) An error message will appear asking you to confirm reset. Choose Yes. Now both the ICMP and ARP
envelops are present again. The Reset Network button will clear any configuration changes not saved
and will clear all dynamic table entries, such as the ARP and MAC table entries.
Experiment-2 (Cisco Packet Tracer)

Prototyping a Network
Objectives
Prototype a network using Packet Tracer

Background
A client has requested that you set up a simple network with two PCs connected to a switch. Verify that the
hardware, along with the given configurations, meet the requirements of the client.

Step 1: Set up the network topology


a) Add two PCs and a Cisco 2950T switch.
b) Using straight-through cables, connect PC0 to interface Fa0/1 on Switch0 and PC1 to interface Fa0/2 on
Switch0.

c) Configure PC0 using the Config tab in the PC0 configuration window:
1. IP address: 192.168.10.10
2. Subnet Mask 255.255.255.0

d) Configure PC1 using the Config tab in the PC1 configuration window:
1. IP address: 192.168.10.11
2. Subnet Mask 255.255.255.0

Step 2: Test connectivity from PC0 to PC1

a) Use the ping command to test connectivity.


1. Click PC0.
2. Choose the Desktop tab.
3. Choose Command Prompt.
4. Type: ping 192.168.10.11 and press enter.

b) A successful ping indicates the network was configured correctly and the prototype validates the
hardware and software configurations. A successful ping should resemble the output:
Experiment-3 (Cisco Packet Tracer)

Packet Tracer Configuring Wireless LAN Access

Objectives
Part 1: Configure a Wireless Router
Part 2: Configure a Wireless Client
Part 3: Verify Connectivity

Part 1: Configure a Wireless Router


Step 1: Connect the Internet interface of WRS2 to S1. Connect the WRS2 Internet interface to the
S1 F0/7 interface.
Step 2: Configure the Internet connection type.
a. Click WRS2 > GUI tab.
b. Set the Internet Connection type to Static IP.
c. Configure the IP addressing according to the Addressing Table.

Step 3: Configure the network setup.


a. Scroll down to Network Setup. For the Router IP option, set the IP address to 172.17.40.1 and the
subnet mask to 255.255.255.0.
b. Enable the DHCP server.
c. Scroll to the bottom of the page and click Save Settings.

Step 4: Configure wireless access and security.

a. At the top of the window, click Wireless. Set the Network Mode to Wireless-N Only and change the
SSID to WRS_LAN.
b. Disable SSID Broadcast and click Save Settings.
c. Click the Wireless Security option.
d. Change the Security Mode from Disabled to WPA2 Personal.
e. Configure cisco123 as the passphrase.
f. Scroll to the bottom of the page and click Save Settings.

Part 2: Configure a Wireless Client


Step 1: Configure PC3 for wireless connectivity. Because SSID broadcast is disabled, you must manually
configure PC3 with the correct SSID and passphrase to establish a connection with the router.

a. Click PC3 > Desktop > PC Wireless.


b. Click the Profiles tab.
c. Click New.
d. Name the new profile Wireless Access.
e. On the next screen, click Advanced Setup. Then manually enter the SSID of WRS_LAN on Wireless
Network Name. Click Next.
f. Choose Obtain network settings automatically (DHCP) as the network settings, and then click Next.
g. On Wireless Security, choose WPA2-Personal as the method of encryption and click Next.
h. Enter the passphrase cisco123 and click Next.
i. Click Save and then click Connect to Network.

Scenario In this activity, you will configure a Linksys wireless router, allowing for remote access from
PCs as well as wireless connectivity with WPA2 security. You will manually configure PC wireless
connectivity by entering the Linksys router SSID and password.

Step 2: Verify PC3 wireless connectivity and IP addressing configuration.

The Signal Strength and Link Quality indicators should show that you have a strong signal. Click More
Information to see details of the connection including IP addressing information. Close the PC Wireless
configuration window.

Part 3: Verify Connectivity All the PCs should have connectivity with one another.

Assignment 3

Designing Simple Parity Check Encoder and Decoder

Design an encoder and corresponding decoder for simple parity check code. Now introduce a single bit
error in the codeword and detect that error using that decoder. Write down the necessary steps in
algorithmic form for design the encoder and decoder.

Assignment - 4
Find out minimal Hamming Distance for Error Detection and Error Correction

Let consider a set of four bit code words as input parameters. Now programmatically find the minimal
Hamming Distance from the set of code words. Finally find the number of errors detected and corrected.
Write down the necessary steps in algorithmic form.

Assignment - 5
NAME OF THE EXPERIMENT: Bit Stuffing.

HARDWARE REQUIREMENTS: Intel based Desktop PC:- RAM of 512 MB

SOFTWARE REQUIREMENTS: Turbo C / Borland C.


THEORY: The new technique allows data frames to contain an arbitrary number if bits and
allows character codes with an arbitrary no of bits per character. Each frame begins and ends
with special bit pattern, 01111110, called a flag byte. When ever the senders data link layer
encounters five consecutive ones in the data, it automatically stuffs a 0 bit into the out going bit
stream. This bit stuffing is analogous to character stuffing, in which a DLE is stuffed into the out
going character stream before DLE in the data

ALGORITHM:
Begin
Step 1: Read frame length n
Step 2: Repeat step (3 to 4) until i<n(: Read values in to the input frame (0s and
1s) i.e.
Step 3: initialize I i=0;
Step 4: read a[i] and increment i
Step 5: Initialize i=0, j=0,count =0
Step 6: repeat step (7 to 22) until i<n
Step 7: If a[i] == 1 then
Step 8: b[j] = a[i]
Step 9: Repeat step (10 to 18) until (a[k] =1 and k<n and count <5)
Step 10: Initialize k=i+1;
Step 11: Increment j and b[j]= a[k];
Step 12: Increment count ;
Step 13: if count =5 then
Step 14: increment j,
Step 15: b[j] =0
Step 16: end if
Step 17: i=k;
Step 18: increment k
Step 19: else
Step 20: b[j] = a[i]
Step 21: end if
Step 22: increment I and j
Step 23: print the frame after bit stuffing
Step 24: repeat step (25 to 26) until i< j
Step 25: print b[i]
Step 26: increment i
End
Assignment - 6
NAME OF THE EXPERIMENT: Character Stuffing.

AIM: Implement the data link layer framing methods such as character, character stuffing.

HARDWARE REQUIREMENTS: Intel based Desktop PC:-RAM of 512 MB

SOFTWARE REQUIREMENTS: Turbo C / Borland C.

THEORY:

The framing method gets around the problem of resynchronization after an error by having each
frame start with the ASCII character sequence DLE STX and the sequence DLE ETX. If the
destination ever losses the track of the frame boundaries all it has to do is look for DLE STX or
DLE ETX characters to figure out. The data link layer on the receiving end removes the DLE
before the data are given to the network layer. This technique is called character stuffing

ALGORITHM:
Begin
Step 1: Initialize I and j as 0
Step 2: Declare n and pos as integer and a[20],b[50],ch as character
Step 3: read the string a
Step 4: find the length of the string n, i.e n-strlen(a)
Step 5: read the position, pos
Step 6: if pos > n then
Step 7: print invalid position and read again the position, pos
Step 8: end if
Step 9: read the character, ch
Step 10: Initialize the array b , b[05] as d, l, e, s ,t ,x
respectively
Step 11: j=6;
Step 12: Repeat step[(13 to 22) until I < n
Step 13: if i = pos-1 then
Step 14: initialize b array, b[j], b[j+1] b[j+6] as d, l, e ,ch, d, l,e
Respectively
Step 15: increment j by 7, i.e j=j+7
Step 16: end if
Step 17: if a[i]=d and a[i+1]=l and a[i+2]=e then
Step 18: initialize array b, b[1315]=d, l, e respectively
Step 19: increment j by 3, i.e j=j+3
Step 20: end if
Step 21: b[j]=a[i]
Step 22: increment i and j;
Step 23: initialize b array,b[j],b[j+1]b[j+6] asd, l,e ,e,t, x,\0 respectively
Step 24: print frame after stiuffing
Step 25: print b
End
Assignment - 7

NAME OF THE EXPERIMENT: Cyclic Redundancy Check.

Design a 4B/7B CRC encoder using a suitable divisor. Now using that same divisor design the decoder
and check the correctness of this code word. Now introduce an arbitrary error in the codeword and verify.
Write down the necessary steps in algorithmic form for design the encoder and decoder.

AIM: Implement on a data set of characters the three CRC polynomials CRC 12,
CRC 16 and CRC CCIP.
HARDWARE REQUIREMENTS: Intel based Desktop PC:- RAM of 512 MB

SOFTWARE REQUIREMENTS: Turbo C / Borland C.

THEORY:
CRC method can detect a single burst of length n, since only one bit per column will be
changed,a burst of length n+1 will pass undetected, if the first bit is inverted, the last bit is
inverted and all other bits are correct. If the block is badly garbled by a long burst or by multiple
shorter burst, the probability that any of the n columns will have the correct parity that is 0.5. so
the probability of a bad block being expected when it should not be 2 power(-n). This scheme
some times known as Cyclic Redundany Code.

ALGORITHM/FLOWCHART:

Begin

Step 1: Declare I,j,fr[8],dupfr[11],recfr[11],tlen,flag,gen[4],genl,frl,


rem[4] as integer
Step 2: initialize frl=8 and genl=4
Step 3: initialize i=0
Step 4: Repeat step(5to7) until i<frl
Step 5: read fr[i]
Step 6: dupfr[i]=fr[i]
Step 7: increment i
Step 8: initialize i=0
Step 9: repeat step(10to11) until i<genl
Step 10: read gen[i]
Step 11: increment i
Step 12: tlen=frl+genl-1
Step 13: initialize i=frl
Step 14: Repeat step(15to16) until i<tlen
Step 15: dupfr[i]=0
Step 16: increment i
Step 17: call the function remainder(dupfr)
Step 18: initialize i=0
Step 19: repeat step(20 to 21) until j<genl
Step 20: recfr[i]=rem[j]
Step 21: increment I and j
Step 22: call the function remainder(dupfr)
Step 23: initialize flag=0 and i=0
Step 24: Repeat step(25to28) until i<4
Step 25: if rem[i]!=0 then
Step 26: increment flag
Step 27: end if
Step 28: increment i
Step 29: if flag=0 then
Step 25: print frame received correctly
Step 25: else
Step 25: print the received frame is wrong
End

Function: Remainder(int fr[])


Begin
Step 1: Declare k,k1,i,j as integer
Step 2: initialize k=0;
Step 3: repeat step(4 to 14) until k< frl
Step 4: if ((fr[k] == 1) then
Step 5: k1=k
Step 6: initialize i=0, j=k
Step 7: repeat step(8 to 9) until i< genl
Step 8: rem[i] =fr[j] exponential gen[i]
Step 9: increment I and j
Step 10: initialize I = 0
Step 11: repeat step(12to13) until I <genl
Step 12: fr[k1] = rem[i]
Step 13: increment k1 and i
Step 14: end if
End
Assignment - 8
NAME OF THE EXPERIMENT: Distance Vector Routing.
AIM: Obtain Routing table at each node using distance vector routing algorithm for a
given subnet.

DESCRIPTION: Implement the Distance Vector Routing (DVR) protocol using shortest path
algorithm (e.g., Bellman Ford). Write down all the necessary steps in algorithmic form.

HARDWARE REQUIREMENTS: Intel based Desktop PC:- RAM of 512 MB


SOFTWARE REQUIREMENTS: Turbo C / Borland C.

THEORY:

Distance Vector Routing algorithms calculate a best route to reach a destination based solely on
distance. E.g. RIP. RIP calculates the reach ability based on hop count. Its different from
linkstate algorithms which consider some other factors like bandwidth and other metrics to reach
a destination. Distance vector routing algorithms are not preferable for complex networks and
take longer to converge

ALGORITHM:

Begin
Step1: Create struct node unsigned dist[20],unsigned from[20],rt[10]
Step2: initialize int dmat[20][20], n,i,j,k,count=0,
Step3: write "the number of nodes "
Step4: read the number of nodes "n"
Step5: write" the cost matrix :"
Step6: intialize i=0
Step7: repeat until i<n
Step8: increment i
Step9: initialize j=0
Step10: repeat Step(10-16)until j<n
Step11: increment j
Step12:read dmat[i][j]
Step13:intialize dmat[i][j]=0
Step14:intialize rt[i].dist[j]=dmat[i][j]
Step15:intialize rt[i].from[j]=j
Step16:end
Step17:start do loop Step (17-33)until
Step18:intilialize count =0
Step19:initialize i=0
Step20:repeat until i<n
Step21:increment i
Step22:initialize j=0
Step23:repeat until j<n
Step24:increment j
Step25:initialize k=0
Step26:repeat until k<n
Step27:increment k
Step28:if repeat Step(28-32) until rt[i].dist[j]>dmat[i][k]+rt[k].dist[j]
Step29:intialize rt[i].dist[j]=rt[i].dist[k]+rt[k].dist[j]
Step30:intialize rt[i].from[j]=k;
Step31:increment count
Step32:end if
Step33:end do stmt
Step34:while (count!=0)
Step35:initialize i=0
Step36:repeat Steps(36-44)until i<n
Step37:increment i
Step38:write ' state values for router',i+1
Step39:initialize j=0
Step40:repeat Steps ( 40-43)until j<n
Step41:increment j
Step42:write 'node %d via %d distance % ',j+1,rt[i].from[j]+1,rt[i].dist[j]
Step43:end
Step44:end
End
Assignment - 9

NAME OF THE EXPERIMENT: Encrypting DES.

AIM: Take a 64 bit playing text and encrypt the same using DES algorithm.

HARDWARE REQUIREMENTS: Intel based Desktop PC:- RAM of 512 MB

SOFTWARE REQUIREMENTS: Turbo C / Borland C.

THEORY:
Data encryption standard was widely adopted by the industry in security products. Plain text is
encrypted in blocks of 64 bits yielding 64 bits of cipher text. The algorithm which is
parameterized by a 56 bit key has 19 distinct stages. The first stage is a key independent
transposition and the last stage is exactly inverse of the transposition. The remaining stages are
functionally identical but are parameterized by different functions of the key. The algorithm has
been designed to allow decryption to be done with the same key as encryption

ALGORITHM/FLOW-CHART:

Begin
Step1: Initialize as int i,ch,lp;
Step2: Initialize as char cipher[50],plain[50];
Step3: Initialize as char key[50];
Step4: while(1) repeat steps(4-36)
Step5: write "\n-----MENU-----\n"
Step6: write "\n1:Data Encryption\t\n\n2:Data Decryption\t\n\n3:Exit"
Step7: write ("\n\nEnter your choice:"
Step8: read"%d",&ch
Step9: stament switch(ch) repeat steps(9-35)
case 1:

step10: read "\nData Encryption"


step11:read ("\nEnter the plain text:"
step12: fflush(stdin)
step13 : gets(plain)
step14: write "\nEnter the encryption key:"
step15: gets(key)
step16: lp=strlen(key)
step17: Initialize i=0
step18: repeat until plain[i]!='\0'
step19: increment i
step20: initialize cipher[i]=plain[i]^lp
step21: initialize cipher[i]='\0';
step22: write "\nThe encrypted text is:"
step23: puts(cipher)
step24: break
case 2:
step25: write"\nData decryption"
step26: Initialize i=0
step27: repeat until plain[i]!='\0'
step28: increment i
step29: initialize plain[i]=cipher[i]^lp
step30:write"\nDecrypted text is:"
step32: puts(plain)
step33:break
case 3:
step34:exit(0);
step35: end switch stmt
step36: end while(1)stmt
End

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