Sunteți pe pagina 1din 18

Lab Manual

Solutions

by

ABDULLAH IMTIAZ
EXPERIMENT 1 – INTRODUCTION TO NETWORK DEVICES

Exercise 1.1 [3]


What is the difference between switch and router?

SWITCH ROUTER
A network switch or switching hub is a computer A router is an electronic device that interconnects
networking device that connects network segments. two or more computer networks, and selectively
It routes data at the data link layer (layer 2) of the interchanges packets of data between them. Each
OSI model. Switches that additionally process data data packet contains address information that a
at the network layer (layer 3 and above) are often router can use to determine if the source and
referred to as Layer 3 switches or multilayer destination are on the same network, or different
switches. network. Multiple routers are used in a large
collection of interconnected networks, the routers
exchange information about target system addresses,
so that each router can build up a table showing the
preferred paths between any two systems on the
interconnected networks.

Exercise 1.2 [2]


A router is used to connect different Computer Networks?

Exercise 1.3 [2]


Write the IP address of your computer.
192.168.174.24

Exercise 1.4 [3]


Which network device is used to connect the computers in LAB?
Switch to connect pcs to other pcs and to router .Router to connect to internet

1 Experiment 1 - Introduction to Network Devices


EXPERIMENT 2 – TRANSMISSION MEDIA

Exercise 2.1 [5]


Which type of cable will be used between switch and router?
Straight Through Cable

Exercise 2.2 [5]


Which device is used to connect two dissimilar type of network?
CrossOver Cable

2 Experiment 2 - Transmission Media


EXPERIMENT 3 – CLASSIFICATION OF IP

Exercise 3.1: [2]


What is the IP address of your computer, and to which class it belongs?
192.168.174.24 Class C

Exercise 3.2: [2]


What is the subnet mask for 3.1?
255.255.255.0

Exercise 3.3: [2]


What is the Network ID for 3.1?
192

Exercise 3.4: [2]


What is the subnet mask for 3.3?
255.255.255

Exercise 3.5 [2]


Write the address class next to each IP address.

Address Class
131.107.2.89 B
3.3.57.0 A
200.200.5.2 C
191.107.2.10 B
127.0.0.1 A

3 Experiment 3 – Classification of IP
EXPERIMENT4 – ETHEREAL

Exercise 4.1: View packet of size greater than 40 bytes. Show result [4]

ANS :- Frame.pkt._len > 40

Exercise 4.2: Discuss the importance of packet colorization. [3]

ANS :- A very useful mechanism available in Ethereal is packet colorization. You can set-up Ethereal so that
it will colorize packets according to a filter. This allows you to emphasize the packets you are (usually)
interested in .This make software more user friendly.

Exercise 4.3: View packet of size smaller than 89 bytes. Show result: [3]

ANS :- Frame.pkt._len < 89

4 Experiment 3 – Classification of IP
EXPERIMENT 5- BASIC NETWORKING COMMANDS IN MSDOS

Exercise 5.1: [2]


Test the reach ability towards a PC [192.168.230.4].
Ping 192.168.230.4

Exercise 5.2: [2]


Find the route from your PC to MIMS Server
Tracert MIMS

Exercise 5.3: [2]


Open a browser connection to http server [www.mcs.edu.pk] and write down the outcome of the command
'netstat -an'.
netstat -an

Exercise 5.4: [2]


Create a route entry in the routing table for a network 210.20.23.0 with the gateway 172.23.19.250 metric of
5.
route add 210.20.23.0 mask 255.255.255.0 172.23.19.250 metric 5

Exercise 5.5: [1]


Remove all the entries in the ARP cache and then generate a PING command to a specific PC
[192.168.50.203]. Then, display all the entries in the ARP cache.
arp –d *
ping 192.168.50.203
arp -a

Exercise 5.6: [1]


Get to know about the TCP/IP configuration on your PC using
ipconfig /all
ipconfig /all
Done.

5 Experiment 5 – Basic Networking Commands in MSDOS


EXPERIMENT 6- CONFIGURING DHCP AND DNS

Exercise 6.1: [1]


Run nslookup to obtain the IP address of a Web server in Asia.

nslookup 172.24.0.100 //university server

Exercise 6.2: [1]


Run nslookup to determine the authoritative DNS servers for a university in Europe.

nslookup –type=NS uoi.gr

Exercise 6.3: [1]


Run nslookup so that one of the DNS servers obtained in Question 2 is queried for the mail servers for
Yahoo! mail
nslookup –type=MX www.yahoo.com bitsy.mit.edu

Exercise 6.4: [1]


What is the use of physical address in DHCP?
Every network interface has a MAC address (Media Access Controller) also known as the physical
address. This is the actual hardware address that the lowest level of the network uses to communicate.
The MAC address is used to assign the TCP/IP address by means of DHCP

Exercise 6.5: [1]


Locate the DNS query and response messages. Are then sent over UDP or TCP?
They are sent over UDP

Exercise 6.6: [1]


What is the destination port for the DNS query message? What is the source port of DNS response message?
The destination port for the DNS query is 53 and the source port of the DNS response is 53.

Exercise 6.7: [1]


To what IP address is the DNS query message sent? This is the IP address of a local DNS server.
It’s sent to 128.238.2.38 which is the IP address of one of my local DNS servers.

Exercise 6.8: [1]


Examine the DNS query message. What “Type” of DNS query is it? Does the query message contain any
“answers”?
It’s a type A Standard Query and it doesn’t contain any answers

Exercise 6.9: [1]


Examine the DNS response message. How many “answers” are provided? What do each of these answers
contain?
There were 2 answers containing information about the name of the host, the type of address, class,
the TTL, the data length and the IP address.

www.ietf.org: type A, class inet, addr 65.246.255.51


Name: www.ietf.org
6 `Experiment 6 – Configuring DHCP and DNS
Type: Host address
Class: inet
Time to live: 1 hour
Data length: 4
Addr: 65.246.255.51

www.ietf.org: type A, class inet, addr 132.151.6.75


Name: www.ietf.org
Type: Host address
Class: inet
Time to live: 1 hour
Data length: 4
Addr: 132.151.6.75

Exercise 6.10: [1]


Consider the subsequent TCP SYN packet sent by the host. Does the destination IP address of the SYN
packet correspond to any of the IP addresses provided in the DNS response message?
The first SYN packet was sent to 65.246.255.51 which corresponds to the first IP address provided in
the DNS response message

7 `Experiment 6 – Configuring DHCP and DNS


EXPERIMENT 7-SUBNETTING
Exercise 7.1: [2]
Consider the following IP address 204.17.5.0. Convert into binary and calculate network id and
host id.
Binary 11001100.00010001.00000101.000000000
Network id :-11001100
Host id :-00010001.00000101.00000000

Exercise 7.2: [8]


Consider the Class C mask 255.255.255.192. Answer the following:

Q How many subnet bits are used in this mask?


2 bits

Q How many host bits are available per subnet?


62 bits

Q What are the subnet addresses?


64 first subnet
128 second subnet

Q What is the broadcast address of each subnet?


127 for first subnet
191 for second subnet

Q What is the valid host range of each subnet?


64 to 127 for first subnet //excluding 64 and 127
128 to 191 second subnet
EXPERIMENT 8 – SUBNETTING CLASS A AND B

Exercise 8.1: [10] Consider


the following IP addresses; write network address, broadcast address, first usable and last usable
address. Also indicate the magic number.
1) 172.18.3.1 /7
Subnet mask = 11111110.00000000.00000000.00000000 0.0.0.0
Its subnet mask found to be =254.0.0.0 2.0.0 .0
Magic number is = 2 and found in first octet 4.0.0 .0
Network Address = 172.0.0.0 ………….
Broadcast Address = 173.255.255.255 172.0.0.0
First Usable Address = 172.0.0.1 174.0.0.0
Last Usable Address = 172.255.255.254

1) 172.18.3.1 /24
Subnet mask = 11111111.11111111.11111111.00000000 172.18.0.0
Its subnet mask found to be =255.255.255.0
172.18.1.0
Magic number is = 1 and found in third octet
172.18.2.0
Network Address = 172.18.3.0
172.18.3.0
Broadcast Address = 172.18.3.255
172.18.4.0
First Usable Address = 172.18.3.1
Last Usable Address = 172.18.3.254

1) 192.168.3.55 /28
Subnet mask = 11111111.11111111.11111111.11110000 192.168.3.0
Its subnet mask found to be =255.255.255.240
192.168.3.16
Magic number is = 16 and found in fourth octet
192.168.3.32
Network Address = 192.168.3.48
192.168.3.48
Broadcast Address = 192.168.3.63
192.168.3.64
First Usable Address = 192.168.3.49
Last Usable Address = 192.168.3.62

1) 172.18.3.1 /15
Subnet mask = 172.0.0.0
11111111.11111110.00000000.00000000 172.2.0 .0
Its subnet mask found to be =255.254.0.0 172.4.0 .0
Magic number is = 2 and found in second octet ………….
Network Address = 172.18.0.0 172.18.0.0
Broadcast Address = 172.19.255.255 172.20.0.0
First Usable Address = 172.18.0.1
Last Usable Address = 172.19.255.254

1) 110.8.67.101 /24
Subnet mask = 11111111.11111111.11111111.00000000 110.8.0.0
Its subnet mask found to be =255.255.255.0
110.8.1 .0
Magic number is = 1 and found in third octet
110.8.2 .0
Network Address = 110.8.67.0
………….
Broadcast Address = 110.8.67.255
110.8.67.0
First Usable Address = 110.8.67.1
110.8.68.0
Last Usable Address = 110.8.67.254
EXPERIMENT 9 –PACKET TRACER AND DESIGNING TOPOLOG

Build your own topology as discussed in lab. The topology comprise of two routers and two
switches. Each switch has four PCs. Send packets from PC1 to PC4 using PDU tool. Show the
topology and output here [10]
EXPERIMENT 10 –ROUTER CONFIGURATION

Exercise 10.1) Implement the concept of router configuration on


Router1 for the givendiagram in LAB 10. Show the code here. [10]

Router> enable (enter) Router#


For Router1:
Router#configure terminal
Router(config)#interface serial0/0/0
Router(config-if)#ip address 192.168.20.2 255.255.255.0
Router(config-if)#no shut down
Router(config-if)#exit
Router(config)#interface fastethernet0/1
Router(config-if)#ip address 192.168.30.1 255.255.255.0
Router(config-if)#no shut down
Router(config-if)#exit
Router(config)#exit
Router#copy running-config startup-config
EXPERIMENT 11 – STATIC ROUTING

Exercise 11.1) Implement the concept of static routing for the given diagram in LAB 10. [10]
We have given router 1 hostname R1 and router 2 hostname R2
R1(config)#interface e 0
R1(config-if)#ip address 192.168.10.1 255.0.0.0
R1(config-if)#no shutdown //exit
R1(config)#interface s 0
R1(config-if)#ip address 192.168.20.1 255.255.255.0
R1(config-if)#no shutdown //exit
R1(config)#ip route 20.0.0.1 255.0.0.0 20.0.0.2
R2(config)#interface e 0
R2(config-if)#ip address 192.168.30.1 255.0.0.0
R2(config-if)#no shutdown //exit
R2(config)#interface s 0
R2(config-if)#ip address 192.168.20.2 255.255.255.0
R2(config-if)#no shutdown //exit
R2(config)#ip route 20.0.0.2 255.0.0.0 20.0.0.1
EXPERIMENT 12 – DYNAMIC ROUTING

Exercise 12.1. Implement the concept of dynamic routing for the given diagram in LAB 10. [10]

USING RIP

R1(config)#router RIP R2(config)#router RIP

R1(config-router)#network 192.168.10.1 R2(config-router)# network 192.168.30.1

R1(config-router)#network 192.168.20.1 R2(config-router)# network 192.168.20.2

USING IGRP

R1(config)#router IGRP 123 R2(config)#router IGRP 123

R1(config-router)#network 192.168.10.1 R2(config-router)# network 192.168.30.1

R1(config-router)#network 192.168.20.1 R2(config-router)# network 192.168.20.2


EXPERIMENT 13 – ACCESS CONTROL LIST IN ROUTER

Exercise 13.1. Implement all the concepts of ACL covered in Lab. [10]

STANDARD ACL
R1(config)#Access-list 2 deny 192.160.3.10 0.0.0.0
R1(config)#Access-list 4 permit 230.10.40.15 0.0.0.0
R1(config-if)#ip Access-group 2 in
R1(config-if)#ip Access-group 5 out
Extended ACL
R1(config)#Access-list 101 deny TCP 190.80.2.1 0.0.0.0 190.4.8.2 0.0.0.0 eq 60
R1(config)#Access-list 102 permit TCP 194.20.30.11 0.0.0.0 230.5.99.1 0.0.0.0 eq 43
R1(config)#Access-list 104 deny TCP 223.5.9.1 0.0.0.0 193.4.55.1 0.0.0.0 eq ftp log
R1(config)#Access-list 101 deny ICMP any
R1(config)#Access-list 102 permit ICMP any
R1(config)#Access-list 103 deny ICMP any
EXPERIMENT 14 – CLIENT AND SERVER SOCKET PROGRAMMING

Exercise 14.1. Discuss the client-server interaction in socket programming. [10]

A socket basically establishes the connecting endpoints between two hosts.The basic operations of
socket programing is as follows:
 Connect to remote host.
 Send and receive data.
 Close a connection.
 Bind to a port.
 Listen to incoming data.
 Accept remote connections on the bounded port.
The last three operations are specific to servers only. They are implemented by the Server-
Socket created by server.
The client program work flow occurs in the following manner:
i. Create a new socket object.
ii. Attempt to connect to the remote host
iii. Once connection has succeeded, the local and remote hosts get hold of the input and
output streams and can work in full duplex mode. The data received and sent can mean
different things, depending on the protocol used .Generally, there is some kind of
agreement established followed by data transmission.
iv. Sockets must be closed at both ends after transmission is completed. Some protocols,
such as HTTP, make sure that the connection is closed upon each request service. FTP, on
the other hands, allows multiple requests to process before closing the connection

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