Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Computer Networks Practical: S.Y.B.Sc. I.T. - SEM III

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 16

NARSEE MONJEE COLLEGE

OF COMMERCE & ECONOMICS


PRESENTS,

Computer Networks Practical

S.Y.B.Sc. I.T. – SEM III


Copyright © PROF. GUFRAN QURESHI
9029120671 / 7021047199

Mumbai University Course Code: USIT303


Copyright © PROF. GUFRAN QURESHI 9029120671 /
7021047199
Copyright © PROF. GUFRAN QURESHI
Introduction Copyright © PROF. GUFRAN QURESHI

Networking: Networking is a connection that has been established between devices through a transmission media, so that
they can communicate to each other to share information and resources.
Host: All devices to which IP address can be assign in networking.
Subnetting: Dividing a large network into a smaller network is known as subnetting i.e. taking bits from host portion to
the network portion. It is use to reduce the wastage of IP address. When we subnetted the given IP, it is called Classless IP
Address.
Copyright © PROF. GUFRAN QURESHI

Subnet Mask: To separate 32 bits IP address into the network prefix & the host number. It defines which portion is of
Network and which is of Host.
Subnet: A subnet (subnetwork) is an identifiably separate part of an organization’s network. Typically, a subnet may
represent all the machines at one geographic location, in one building, or on the same LAN.

Classes in IP Address:
Class IP Address Subnet
Class A 1 – 126* N-H-H-H
Class B 128 – 191 N-N-H-H
Class C 192 – 223 N-N-N-H
Class D 224 – 239 N-N-N-N (Multicasting)
Class E 240 – 255 H-H-H-H (R & D)

Note: 127.0.0.1 to 127.255.255.255 is used for self-pinging or loop-back testing. It used for testing purposes like client-
server architecture.
Copyright © PROF. GUFRAN QURESHI

Network Address: If all bits in the host portion is 0’s than it is known as Network Address.
For e.g. 172.45.84.15 (Belong to class B: 255.255.0.0); therefore Network Address is 172.45.0.0

Broadcast Address: If all bits in the host portion is 1’s than it is known as Broadcast Address
For e.g. 172.45.84.15 (Belong to class B: 255.255.0.0); therefore Broadcast Address is 172.45.255.255

Private IP Address / Un-registered Addresses / Free of Cost Addresses:


It is non-routable IP Addresses
Class A – 10.0.0.0 to 10.255.255.255 ( 1 Network free)
Class B – 172.16.0.0 to 172.31.255.255 ( 16 Network free)
Class C – 192.168.0.0 to 192.168.255.255 ( 256 Network free)

Calculation:
1. Class A (8 bit):
No. of Network = 27 – 2 = 128 – 2 = 126
No. of Host = 224 – 2 = (210 x 210 x 24) – 2 = 1024x1024x16 – 2 = 16777216 – 2 = 16777214
2. Class B (16 bit):
No. of Network = 214 – 2 = 16384 – 2 = 16382
No. of Host = 216 – 2 = 65536 – 2 = 65534
3. Class C (24 bit):
No. of Network = 221 – 2 = 2097152 – 2 = 2097150
No. of Host = 28 – 2 = 256 – 2 = 254
Practical 1 Copyright © PROF. GUFRAN QURESHI

AIM: IPv4 Addressing and Subnetting


a. Given an IP address and network mask, determine other information about the IP address such as:
1. Network address
2. Network broadcast address
3. Total number of host bits
4. Number of hosts
Given: IP address – 70.12.100.132
Network Mask – 255.255.255.192
Solution:
5. Network Address:
2. Network Broadcast Address:
First Address = (any address) AND (Network Mask)
Last Address = (any address) OR (NOT Network Mask)
= 70.12.100.132 AND 255.255.255.192
= 70.12.100.132 OR 0.0.0.63
01000110.00001100.01100100.10000100
01000110.00001100.01100100.10000100
AND 11111111 .11111111 . 11111111 .11000000 Complement’s
OR 00000000.00000000.00000000.00111111
= 01000110.00001100 .01100100.10000000
= 01000110.00001100 .01100100.10111111
= 70.12.100.128
= 70.12.100.191

3. Total Number of Host Bits = 32 – 26 = 6 bits


4. Number of Host = 232-n = 232-26 = 26 = 64 host
Copyright © PROF. GUFRAN QURESHI
b. Given an IP address and network mask, determine other information about the IP address such as:
1. The subnet address of this subnet
2. The broadcast address of this subnet
3. The range of host addresses for this subnet
4. The maximum number of subnets for this subnet mask
5. The number of hosts for each subnet
6. The number of subnet bits
7. The number of this subnet
Solution:
 Consider class A IP address 10.0.0.0. It’s default subnet mask is 255.0.0.0 which means we can represent it by
10.0.0.0/8. The “/” factor indicates the CIDR (Classless inter-domain routing) values.
 If we decide to block some of the bits to minimize number of host in any given subnet, then that technique is called as
variable length subnet masking (VLSM).
 Let us see the examples where we borrow some bits from host part and minimize the count to an extent and create
small independent networks of big network. Or even we can say that we want 8 network out of 1 big network then we
will observe the following network created with their VLSM 255.224.0.0. (11111111.11100000.00000000.00000000)

Number of Host per subnet =221 = (210 x 210 x 21) – 2 Block Size = 256 – Subnet mask = 256 – 224 = 32
= (1024 x 1024 x 2) – 2 OR 25 = 32
= 2097152 – 2
= 2097150
Copyright © PROF. GUFRAN QURESHI

ID Subnet Mask Broadcast First Host Last Host


1 10.0.0.0 10.31.255.255 10.0.0.1 10.31.255.254
2 10.32.0.0 10.63.255.255 10.32.0.1 10.63.255.254
3 10.64.0.0 10.95.255.255 10.64.0.1 10.95.255.254
4 10.96.0.0 10.127.255.255 10.96.0.1 10.127.255.254
5 10.128.0.0 10.159.255.255 10.128.0.1 10.154.255.254
6 10.160.0.0 10.191.255.255 10.160.0.1 10.191.255.254
7 10.192.0.0 10.223.255.255 10.192.0.1 10.223.255.254
8 10.224.0.0 10.255.255.255 10.224.0.1 10.255.255.254

Class Minimum Maximum Subnet Mask


A 0.0.0.0 127.255.255.255 255.0.0.0 (8 N, 24 H)
B 128.0.0.0 191.255.255.255 255.255.0.0 (16 N, 16 H)
C 192.0.0.0 223.255.255.255 255.255.255.0 (24 N, 8 H)
D Multicast Add (32 N)
E Future Reserve (R&D) (32 H)
Copyright © PROF. GUFRAN QURESHI

Class Octet 1 Octet 2 Octet 3 Octet 4


A Net ID (8 bit) Host ID (24 bit)
B Net ID (16 bit) Host ID (16 bit)
C Net ID (24 bit) Host ID (8 bit)

27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 128
1 1 0 0 0 0 0 0 192
1 1 1 0 0 0 0 0 224
1 1 1 1 0 0 0 0 240
1 1 1 1 1 0 0 0 248
1 1 1 1 1 1 0 0 252
1 1 1 1 1 1 1 0 254
1 1 1 1 1 1 1 1 255
Copyright © PROF. GUFRAN QURESHI

1. What is the subnet mask of:


a. 188.25.45.48 / 16
 The subnet mask is 255.255.0.0 because first 2 octet are Net ID
b. 188.25.24.48 / 20
 This address belongs to class B. The default subnet mask is 255.255.0.0 / 16
We borrow 4 bits from host portion & then the subnet mask will be
11111111. 11111111. 11110000.00000000
255 . 255 . (128+64+32+16) . 0
255 . 255 . 240 . 0

2. How many subnet does given subnet mask provide?


192.168.1.0 / 27
 To calculate subnet we use formula 2n, where n is the number of the bits borrowed from host bits to create subnet.
The default subnet of class C is 255.255.255.0 / 24
Hence we will borrow (27 – 24) = 3 bits
Therefore our subnet is 2n = 23 = 8 subnets
Copyright © PROF. GUFRAN QURESHI
3. What is the block size of subnet?
a. 188.25.40.1 / 20
 The subnet of the following block is 255.255.0.0 / 20
This address belongs to class B. The default subnet mask is 255.255.0.0 / 16
We borrow 4 bits from host portion & then the subnet mask will be
11111111. 11111111. 11110000.00000000
255 . 255 . 240 . 0
Formula for block size = 256 – Subnet mask = 256 – 240 = 16 OR 24 = 16

4. Calculate valid subnet of 192.168.1.0 / 26


 Total subnets = 2n = 22 (26-24) = 4
Subnet mask = 255.255.255.192 (11111111.11111111.11111111.11000000)
Block Size = 256 – 192 = 64
0, 64, 128, 192

5. How many valid hosts are available per subnet?


 Valid host = Total host – 2 (Net ID i.e. all 0’s and Broadcast i.e. all 1’s)
If 64 host are their then 62 host (64 – 2) are valid host.
Practical 2 Copyright © PROF. GUFRAN QURESHI

AIM: Use of ping & tracert/traceroute, ipconfig/ifconfig, route & arp utilities

Tools like ping, traceroute, lookup, whois, finger,


netstat, ipconfig, and port scanners are available on
nearly every operating system you can get your hands
on. They’re used for everything from troubleshooting a
connection to looking up information.

1. Ping
The ping command sends ICMP echo request packets to
a destination. For example, you could run ping
google.com or ping 172.217.26.206 to ping a domain
name or IP address.
These packets ask the remote destination to reply. If the
remote destination is configured to reply, it will respond
with packets of its own. You’ll be able to see how long
the round-trip time is between your computer and the
destination. You’ll see a “request timed out” message if
packet loss is occurring, and you’ll see an error message
if your computer can’t communicate with the remote
host at all.
2. traceroute / tracert / tracepath Copyright © PROF. GUFRAN QURESHI
The traceroute, tracert, or tracepath command is similar to
ping, but provides information about the path a packet takes.
traceroute sends packets to a destination, asking each
Internet router along the way to reply when it passes on the
packet. This will show you the path packets take when you
send them between your location and a destination.
3. ipconfig / ifconfig
• The ipconfig command is used on Windows, while the
ifconfig command is used on Linux, Mac OS X, and other
Unix-like operating systems. These commands allow you
to configure your network interfaces and view
information about them.
• For example, you can use the ipconfig /all command on
Windows to view all your configured network interfaces,
their IP addresses, DNS servers, and other information.
Or, you can use the ipconfig /flushdns command to flush
your DNS cache, forcing Windows to get new addresses
from its DNS servers every time you contact a new
hostname. Other commands can force your computer to
release its IP address and get a new one from its DHCP
server. This utility can quickly display your computer’s IP
address or help you troubleshoot problems.
4. route: This diagnostic command manipulates network Copyright © PROF. GUFRAN QURESHI
routing tables.
Syntax:
• route [-f] [command [destination] [MASK netmask]
[gateway] [METRIC metric]]
Parameters:
• -f – Clears the routing tables of all gateway entries. If this
parameter is used in conjunction with one of the commands,
the tables are cleared prior to running the command. 
command – Specifies one of four commands below:
• print: Prints a route.
• add: Adds a route.
• delete: Deletes a route.
• change: Modifies an existing route.
destination – Specifies the host to send command.
MASK – Specifies, if present, that the next parameter be
interpreted as the netmask parameter.
netmask – Specifies, if present, the subnet mask value to be
associated with this route entry. If not present, this parameter
defaults to 255.255.255.255.
gateway – Specifies the gateway.
METRIC – Specifies the route metric (cost) for the destination.
5. arp: This diagnostic command displays and modifies the IP-to- Copyright © PROF. GUFRAN QURESHI
Ethernet or Token Ring physical address translation tables used by
the Address Resolution Protocol (ARP).
Syntax:
• arp -a [inet_addr] [-N [if_addr]] arp -dinet_addr [if_addr]
• arp -sinet_addrether_addr [if_addr]
Parameters:
• -a – Displays current ARP entries by querying TCP/IP. If inet_addr
is specified, only the IP and physical addresses for the specified host
are displayed.
• -d – Deletes the entry specified by inet_addr
• -s – Adds an entry in the ARP cache to associate the IP address
inet_addrwith the physical address ether_addr. The physical address
is given as 6 hexadecimal bytes separated by hyphens. The IP
address is specified using dotted decimal notation. The entry is
static. It will not be automatically removed from the cache after the
timeout expires and will not exist after a reboot of your computer.
• -N [if_addr] – Displays the ARP entries for the network interface
specified by if_addr. ether_addr Specifies a physical address.
if_addr Specifies, if present, the IP address of the interface whose
address translation table should be modified. If not present, the first
applicable interface will be used. inet_addr Specifies an IP address
in dotted decimal notation.

You might also like