You are on page 1of 40

Practical File

Of
COMPUTER NETWORKS
(CSEN3102)

BACHELOR OF TECHNOLOGY
IN
COMPUTER SCIENCE AND INFORMATION TECHNOLOGY

Submitted By: Submitted To:


Muskan Chauhan Ms. Monika
CSE Gen.5TH Semester AP, CSE
Roll No. A40318075(g2) PDMU, Bahadurgarh

DEPARTMENT OF COMPUTER SCIENCE AND

ENGINEERING PDM UNIVERSITY, BAHADURGARH

Muskan Chauhan
(A40318075)
INDEX

S.No. Name of the Program Date Signature

1. Study of computer networks

2. Study of connecting devices (hubs,


switches, routers, repeaters, gateways, and
bridge)

3. Study of Netstat, IpConfig and Ping


command

4. Study of tracert command

5. Study of nsplookup command

6. Sharing a folder via LAN

7. Sharing a desktop via LAN

8. Study about IPv4 and IPv6

9. C++ program for encryption and decryption


of strings

10. Configure IP address system of a LAN


(TCP/IP configuration)
Program no. 1
AIM: Study of Computer Networks
Computer networks
A computer network is a set of computers connected together for the purpose of sharing
resources. The most common resource shared today is connection to the Internet. Other shared
resources can include a printer or a file server. The Internet itself can be considered a computer
network.

Characteristics of a Computer Network

 Share resources from one computer to another.


 Create files and store them in one computer, access those files from the other computer(s)
connected over the network.
 Connect a printer, scanner, or a fax machine to one computer within the network and let
other computers of the network use the machines available over the network.

A computer network can be categorized by their size. A computer network is


mainly of four types:

Muskan Chauhan(A40318075)
 LAN(Local Area Network) :-

A Local Area Network (LAN) is a group of computer and peripheral devices which are


connected in a limited area such as school, laboratory, home, and office building. It is a widely
useful network for sharing resources like files, printers, games, and other application. The
simplest type of LAN network is to connect computers and a printer in someone's home or
office. In general, LAN will be used as one type of transmission medium.

It is a network which consists of less than 5000 interconnected devices across several buildings.

Characteristics of LAN

Here are important characteristics of a LAN network:

 It is a private network, so an outside regulatory body never controls it.


 LAN operates at a relatively higher speed compared to other WAN systems.
 There are various kinds of media access control methods like token ring and ethernet.

Advantages of LAN

Here are pros/benefits of using LAN:

 Computer resources like hard-disks, DVD-ROM, and printers can share local area
networks. This significantly reduces the cost of hardware purchases.
 You can use the same software over the network instead of purchasing the licensed
software for each client in the network.
Muskan Chauhan(A40318075)
 Data of all network users can be stored on a single hard disk of the server computer.
 You can easily transfer data and messages over networked computers.
 It will be easy to manage data at only one place, which makes data more secure.
 Local Area Network offers the facility to share a single internet connection among all the
LAN users.

Disadvantages of LAN

Here are the important cons/ drawbacks of LAN:

 LAN will indeed save cost because of shared computer resources, but the initial cost of
installing Local Area Networks is quite high.
 The LAN admin can check personal data files of every LAN user, so it does not offer
good privacy.
 Unauthorized users can access critical data of an organization in case LAN admin is not
able to secure centralized data repository.
 Local Area Network requires a constant LAN administration as there are issues related to
software setup and hardware failures

 PAN(Personal Area Network) :-

PAN is a computer network formed around a person. It generally consists of a computer, mobile,
or personal digital assistant. PAN can be used for establishing communication among these
personal devices for connecting to a digital network and the internet.

Characteristics of PAN

 It is mostly personal devices network equipped within a limited area.


 Allows you to handle the interconnection of IT devices at the surrounding of a single
user.
 PAN includes mobile devices, tablet, and laptop.
 It can be wirelessly connected to the internet called WPAN.
 Appliances use for PAN: cordless mice, keyboards, and Bluetooth systems.
Muskan Chauhan(A40318075)
Advantages of PAN

Here, are important pros/benefits of using PAN network:

 PAN networks are relatively secure and safe


 It offers only short-range solution up to ten meters
 Strictly restricted to a small area

Disadvantages of PAN

Here are important cons/ drawback of using PAN network:

 It may establish a bad connection to other networks at the same radio bands.
 Distance limits.

 MAN(Metropolitan Area Network) :-

A Metropolitan Area Network or MAN is consisting of a computer network across an entire city,
college campus, or a small region. This type of network is large than a LAN, which is mostly
limited to a single building or site. Depending upon the type of configuration, this type of
network allows you to cover an area from several miles to tens of miles.

Characteristics of MAN

Here are important characteristics of the MAN network:

 It mostly covers towns and cities in a maximum 50 km range


 Mostly used medium is optical fibers, cables
 Data rates adequate for distributed computing applications.

Advantages of MAN

Here are pros/benefits of using MAN system:

Muskan Chauhan(A40318075)
 It offers fast communication using high-speed carriers, like fiber optic cables.
 It provides excellent support for an extensive size network and greater access to WANs.
 The dual bus in MAN network provides support to transmit data in both directions
concurrently.
 A MAN network mostly includes some areas of a city or an entire city.

Disadvantages of MAN

Here are drawbacks/ cons of using the MAN network:

 You need more cable to establish MAN connection from one place to another.
 In MAN network it is tough to make the system secure from hackers

 WAN(Wide Area Network) :-

WAN (Wide Area Network) is another important computer network that which is spread across a
large geographical area. WAN network system could be a connection of a LAN which connects
with other LAN's using telephone lines and radio waves. It is mostly limited to an enterprise or
an organization.

Characteristics of LAN:

 The software files will be shared among all the users; therefore, all can access to the
latest files.
 Any organization can form its global integrated network using WAN.
Muskan Chauhan(A40318075)
Advantages of WAN

Here are the benefits/ pros of using WAN:

 WAN helps you to cover a larger geographical area. Therefore business offices situated at
longer distances can easily communicate.
 Contains devices like mobile phones, laptop, tablet, computers, gaming consoles, etc.
 WLAN connections work using radio transmitters and receivers built into client devices.

Disadvantage of WAN

Here are drawbacks/cons of using WAN:

 The initial setup cost of investment is very high.


 It is difficult to maintain the WAN network. You need skilled technicians and network
administrators.
 There are more errors and issues because of the wide coverage and the use of different
technologies.
 It requires more time to resolve issues because of the involvement of multiple wired and
wireless technologies.
 Offers lower security compared to other types of networks.

Types of Network Connections


Computer networks can be broken down historically into topologies, which is a technique of
connecting computers. The most common topology today is a star topology.
Star Topology

A star topology is a design of a network where a central node extends a cable (or wireless) to
each computer on the network. On a star network, computers are connected independently to the
center of the network.
A star topology allows straightforward management of the entire network from one place. Since
each node has its own connection, the loss of one node won't break the whole thing. If you need
to add a device to the network, it plugs right in, without additional extra effort.
The only problem is that there is a single point of failure in the star network. If there's only one
hub, the whole thing goes down. However, networking professionals will often have fail-over
servers--backups--that keep things running while they fix the main server.
Muskan Chauhan(A40318075)
Bus Topology

A bus topology is another type of design where a single cable connects all computers and the
information intended for the last node on the network must run through each connected
computer. If a cable is broken, all computers connected down the line cannot reach the network.
The benefit of a bus topology is a minimal use of cabling.
Ring Topology

A similar topology is called a ring. In this design, computers are connected via a single cable,
but the end nodes also are connected to each other. In this design, the signal circulates through
the network until it finds the intended recipient. If a network node is not configured properly, or
it is down temporarily for another reason, the signal will make a number of attempts to find its
destination.
A collapsed ring is a topology where the central node is a network device called a hub, a router,
or a switch. This device runs a ring topology internally and features plugins for cables. Next,
each computer has an independent cable, which plugs into the device. In offices that have the
collapsed ring, there will be a cabling closet, or a space containing a switch device that connects
the network. All computers in the office connect to the cabling closet and the switch. Even if a
network plug is near a desk, the plug is connected via a cable to the cabling closet.
With the increase of wireless technology, many nodes on the network will connect to a wireless
access point. This then connects to the main server(s)--the hubs--of a star network. Still, many
business are set up with Ethernet cables connecting computers to a type of ring network.
Muskan Chauhan(A40318075)
Mesh Topology

A mesh topology is a network setup where each computer and network device is interconnected
with one another. This topology setup allows for most transmissions to be distributed even if one
of the connections goes down. It is a topology commonly used for wireless networks. Below is a
visual example of a simple computer setup on a network using a mesh topology.

Muskan Chauhan(A40318075)
Muskan Chauhan(A40318075)
Program No.: 2
AIM: Study of connecting devices (Hubs, switches, routers, repeaters,
gateway, and bridge).

HUBS

Figure 1: Network Hub


A hub is basically a multiport repeater. A hub connects multiple wires coming from different
branches, for example, the connector in star topology which connects different stations. Hubs
cannot filter data, so data packets are sent to all connected devices. In other words, collision
domain of all hosts connected through Hub remains one. Also, they do not have intelligence
to find out best path for data packets which leads to inefficiencies and wastage.
1. A hub has a number of input lines that it joins electrically. Active hub and passive hub
are two types of hubs.
2. Frames arriving on any of the lines are sent out on all the others. It is broadcast
device. If two frames arrive at the same time, they will collide, just as on a coaxial
cable.
3. All the lines coming into a hub must operate at the same speed. Hubs differ from
repeaters in that they do not boost the incoming signals and are designed for multiple
input lines, but the differences are slight.
4. Like repeaters, hubs are physical layer devices that do not examine the link layer
addresses or use them in any way. It is not an intelligent device.
Types of Hubs
Active Hub: - These are the hubs which have their own power supply and can clean, boost
and relay the signal along the network. It serves both as a repeater as well as wiring centre.
These are used to extend maximum distance between nodes.
Passive Hub: - These are the hubs which collect wiring from nodes and power supply from
active hub. These hubs relay signals onto the network without cleaning and boosting them
and can’t be used to extend distance between nodes.

Muskan Chauhan(A40318075)
SWITCHES

Figure 2: Switch
A switch is a device in a computer network that connects other devices together. Multiple
data cables are plugged into a switch to enable communication between different networked
devices. Switches manage the flow of data across a network by transmitting a received
network packet only to the one or more devices for which the packet is intended. Each
networked device connected to a switch can be identified by its network address, allowing the
switch to direct the flow of traffic maximizing the security and efficiency of the network.
A switch is more intelligent than an Ethernet hub, which simply retransmits packets out of
every port of the hub except the port on which the packet was received, unable to distinguish
different recipients, and achieving an overall lower network efficiency.
An Ethernet switch operates at the data link layer (layer 2) of the OSI model to create a
separate collision domain for each switch port. Each device connected to a switch port can
transfer data to any of the other ports at any time and the transmissions will not interfere.
Because broadcasts are still being forwarded to all connected devices by the switch, the
newly formed network segment continues to be a broadcast domain. Switches may also
operate at higher layers of the OSI model, including the network layer and above. A device
that also operates at these higher layers is known as a multilayer switch.
1. Switches are modern bridges by another name. It acts as multiport bridge to connect
devices or segments in a LAN. It operates at data link layer.
2. It is point to point device.
3. It is an intelligent device. It uses switching table to find the correct destination.
4. Also there are layer 2 (bridge) and layer 3 switches (kind of router). It is sophisticated
and expensive device.
5. Switches are of two types:
a) Store-and-forward switch: It stores the frame in the input buffer until the whole
packet has arrived.
b) Cut-through switch: It forwards the packet to the output buffer as soon as the
destination address is received.

Muskan Chauhan(A40318075)
ROUTER

Figure 3: Router
A router is a networking device that forwards data packets between computer networks.
Routers perform the traffic directing functions on the Internet. Data sent through the internet,
such as a web page or email, is in the form of data packets. A packet is typically forwarded
from one router to another router through the networks that constitute an internetwork (e.g.
the Internet) until it reaches its destination node.
A router is connected to two or more data lines from different networks. When a data packet
comes in on one of the lines, the router reads the network address information in the packet to
determine the ultimate destination. Then, using information in its routing table or routing
policy, it directs the packet to the next network on its journey.
The most familiar type of routers are home and small office routers that simply forward IP
packets between the home computers and the Internet. An example of a router would be the
owner's cable or DSL router, which connects to the Internet through an Internet service
provider (ISP). More sophisticated routers, such as enterprise routers, connect large business
or ISP networks up to the powerful core routers that forward data at high speed along the
optical fibre lines of the Internet backbone. Though routers are typically dedicated hardware
devices, software-based routers also exist.
1. Routers are devices that connect two or more networks. It operates at network layer.
2. They consist of a combination of hardware and software.
3. The hardware can be a network server, a separate computer or a special device. The
hardware includes the physical interfaces to the various networks in the internetwork.
4. These interfaces can be Token Ring, Ethernet, T1, Frame Relay, ATM or any other
technology.
5. The software in a router are the operating system and the routing protocol.
Management software can also be used.
6. Routers use logical and physical addressing to connect two or more logically separate
networks.
7. The network address allows routers to calculate the optimal path to a workstation or
computer.
8. The two methods of route discovery are Distance vector routing and Link state routing.

Muskan Chauhan(A40318075)
REPEATERS

Figure 4: Repeaters
A repeater is an electronic device that receives a signal and retransmits it. Repeaters are used
to extend transmissions so that the signal can cover longer distances or be received on the
other side of an obstruction.
Some types of repeaters broadcast an identical signal, but alter its method of transmission, for
example, on another frequency or baud rate.
There are several different types of repeaters; a telephone repeater is an amplifier in a
telephone line, an optical repeater is an optoelectronic circuit that amplifies the light beam in
an optical fibre cable; and a radio repeater is a radio receiver and transmitter that retransmits
a radio signal.
A broadcast relay station is a repeater used in broadcast radio and television.
1. The repeater operates in the physical layer.
2. These are analogy devices that work with signals on the cables to which they are
connected.
3. A signal appearing on one cable is regenerated and put out on another cable. Hence it
extends the physical length of LAN.
4. Repeaters do not understand frames, packets or headers. They understand the symbols
that encode bit as volts.
5. Classic Ethernet, for example, was designed to allow four repeaters that would boost
the signal to extend the maximum cable length from 500 meters to 2500 meters.
GATEWAYS

Figure 5: Gateways
Muskan Chauhan(A40318075)
A gateway is a node in a computer network, a key stopping point for data on its way to or
from other networks. Thanks to gateways, we are able to communicate and send data back
and forth. The Internet wouldn't be any use to us without gateways (as well as a lot of other
hardware and software).
In a workplace, the gateway is the computer that routes traffic from a workstation to the
outside network that is serving up the Web pages. For basic Internet connections at home, the
gateway is the Internet Service Provider that gives you access to the entire Internet.
A node is simply a physical place where the data stops for either transporting or
reading/using. (A computer or modem is a node; a computer cable isn't.)
A gateway is one of the many ways our data is moved over the Web for us. The gateway
gives us entry into different networks so we can send email, look at Web pages, buy things
online, and more. You can easily say that gateways deliver the freedom, information and
convenience we enjoy online.
Gateways, also called protocol converters, can operate at any network layer. The activities of
a gateway are more complex than that of the router or switch as it communicates using more
than one protocol.
Both the computers of internet users and the computers that serve pages to users are host
nodes. The nodes that connect the networks in between are gateways. These are gateway
nodes:
1. the computers that control traffic between company networks
2. the computers used by internet service providers (ISPs) to connect users to the
internet Gateway must be implied on larger networks to interconnect them.
BRIDGE

Figure 6: Network Bridge


A bridge is a type of computer network device that provides interconnection with other
bridge networks that use the same protocol.
Bridge devices work at the data link layer of the Open System Interconnect (OSI) model,
connecting two different networks together and providing communication between them.
Bridges are similar to repeaters and hubs in that they broadcast data to every node. However,
bridges maintain the media access control (MAC) address table as soon as they discover new
segments, so subsequent transmissions are sent to only to the desired recipient.
Bridges are also known as Layer 2 switches.

Muskan Chauhan(A40318075)
1. If the frame received by the bridge is meant for a segment that resides on the same
host network, it will pass the frame to that node and the receiving bridge will then
discard it.
2. If the bridge receives a frame whose node MAC address is of the connected network,
it will forward the frame toward it.
3. A bridge connects two or more LANs. It operates at data link layer.
4. Like a hub, a modern bridge has multiple ports, usually enough for 4 to 48 input lines
of a certain type. Unlike in a hub, each port is isolated to be its own collision domain.
5. When a frame arrives, the bridge extracts the destination address (for Ethernet, it is 48
bit) from the frame header and looks it up in a table to see where to send the frame.
6. The bridge only outputs the frame on the port where it is needed and can forward
multiple frames at the same time.
7. Filtering, forwarding and blocking of frames are functions of bridges.
8. Bridges offer much better performance than hubs and the isolation between bridge
ports also means that the input lines may run at different speeds, possibly even with
different network types. A common example is a bridge with ports that connect to 10-,
100-, and 1000-Mbps Ethernet.
9. Buffering within the bridge is needed to accept a frame on one port and transmit the
frame out on a different port.
10. Bridges were originally intended to be able to join different kinds of LANs, for
example, an Ethernet and a Token Ring LAN. However, this never worked well
because of differences between the LANs such as frame formats, maximum frame
lengths, security and Quality of service.

Muskan Chauhan(A40318075)
Program 3
AIM: Study of Netstat, IpConfig and Ping command.

‘Netstat’ command
‘netstat’ (network statistics) is a command line tool for monitoring network connections both
incoming and outgoing as well as viewing routing tables, interface statistics etc. netstat is
available on all Unix-like Operating Systems and also available on Windows OS as well. It is
very useful in terms of network troubleshooting and performance measurement. netstat is one
of the most basic network service debugging tools, telling you what ports are open and
whether any programs are listening on ports.

OPTION DESCREPTION
‘netstat -a’ Shows active TCP connections

Muskan Chauhan(A40318075)
‘netstat -r’ Shows IP routing table
‘netstat -n’ Displays active TCP connections without the names
‘netstat -s’ Displays statistics by protocol. By default, statistics are shown for the TCP,
UDP, ICMP, and IP protocols

Muskan Chauhan(A40318075)
1.‘netstat -a’ command
This switch displays active TCP connections, TCP connections with the listening
state, as well as UDP ports that are being listened to.

1. ‘netstat -r’ command


Execute netstat with -r to show the IP routing table. This is the same as using the route
command to execute route print.

Muskan Chauhan(A40318075)
2. ‘netstat -n’ command
Use the -n switch to prevent netstat from attempting to determine host names for
foreign IP addresses. Depending on your current network connections, using this
switch could considerably reduce the time it takes for netstat to fully execute.

Muskan Chauhan(A40318075)
3. ‘netstat -s’ command
The -s option can be used with the netstat command to show detailed statistics by
protocol. You can limit the statistics shown to a particular protocol by using the –s
option and specifying that protocol, but be sure to use -s before -p protocol when
using the switches together.

IPCONFIG command
‘ipconfig’ is a console application designed to run from the Windows command prompt. This
utility allows you to get the IP address information of a Windows computer. It also allows
some control over active TCP/IP connections. Ipconfig replaced the older ‘winipcfg’ utility.

Muskan Chauhan(A40318075)
OPTION DESCREPTION

‘/all’ Ipconfig displays all current TCP/IP network configuration values

‘/flushdns’ Flushes the DNS cache, and deletes invalid records

‘/displaydns’ Displays the content of DNS

Muskan Chauhan(A40318075)
1. ‘ipconfig /all’ command
‘ipconfig /all’ displays all configuration information for each adapter bound to TCP/IP. This
activity will show you how to use ipconfig /all.

2. ‘ipconfig /flushdns’ command


Clearing the DNS cache removes all the entries, it deletes any invalid records too and forces
your computer to repopulate those addresses the next time you try accessing those websites.
These new addresses are taken from the DNS server your network is set up to use.

3. ‘ipconfig /displaydns’
‘ipconfig /displaydns’ displays the contents of the Domain Name System (DNS) resolver
cache. ipconfig /flushdns purges the DNS resolver cache.

Muskan Chauhan(A40318075)
Muskan Chauhan(A40318075)
‘PING’ command
The ping command is a Command Prompt command used to test the ability of the source
computer to reach a specified destination computer. The ping command is usually used as a
simple way to verify that a computer can communicate over the network with another
computer or network device.

Example:
‘ping pdm.ac.in’

Muskan Chauhan(A40318075)
Program 4
AIM: Study of ‘tracert’ (trace route) command.
Trace Command

The tracert (which is short for trace route) is a Windows network command-line utility used to help diagnose
network routing issues. If you are familiar with Linux, this tool is similar to traceroute. With tracert, you can
learn details about each router (hop) that make up your network connection pathway to a remote device. It
can help to determine why your connections may be poor and can help you identify where exactly the
problem is.

Example:

Muskan Chauhan(A40318075)
Program 5
AIM: Study of ‘nslookup’ command.

‘nslookup command’:
Nslookup (stands for “Name Server Lookup”) is a useful command for getting information from DNS server.
It is a network administration tool for querying the Domain Name System (DNS) to obtain domain name or
IP address mapping or any other specific DNS record. It is also used to troubleshoot DNS related problems.

Uses of nslookup command

There are different scenarios in which the use of nslookup is appropriate. In this way, the command-line
program is an especially crucial tool when resolving DNS issues. First and foremost, a data query helps find
the cause of the problem at hand. For example, those who use Windows and experience an issue with the
active directory can use nslookup to quickly and easily check whether all involved servers are converted in
the domain name system as planned. Generally, this program shows its strengths when
various subdomains are involved – not only when it is simply a matter of checking them, but also when there
are connection problems.

Example:

Muskan Chauhan(A40318075)
Program 6
AIM: Sharing a folder via LAN.
File sharing
File sharing is the public or private sharing of computer data or space in a network with
various levels of access privilege. FTP can be used to access (read and possibly write to) files
shared among a set of users with a password to gain access to files shared from an FTP server
site.
Step 1: Open the PROPERTIES of the folder that you want to share.

Figure 1: Properties of folder


Step 2: Go to SHARING tab to open ADVANCED SHARING options and tick ‘share this
folder’.

Step 3: Head to PERMISSIONS tab and allow the users to have full control by ticking the
‘full control’ check box.

Step 4: Apply the settings and open ‘network and sharing centre’.
v

Step 5: Click on ‘local area connection’ to open LAN status.

Step 6: Click on ‘Details’ tab to see the IPv4 address

Step 7: On the desktop screen press ‘Windows + R’ to open the ‘RUN’ window, and enter
the IPv4 address to open the shared folders.

Step 8: On entering the IPv4 a new window appers where we can see the shared folder
‘Shalu’.

Muskan Chauhan(A40318075)
Program 7
AIM: Sharing Desktop via LAN.

Desktop sharing
Windows Desktop Sharing is used by software developers to create applications that use
multiple-party screen-sharing technology. Key scenarios include remote assistance, real-time
collaboration and conferencing, and video communication. With Remote Desktop Services, a
session is always created when a user connects remotely through Remote Desktop Protocol
(RDP). With Windows Desktop Sharing, a local desktop can be transmitted over an RDP
connection without creating an additional session.
Steps involved in Desktop sharing:
Step 1: Open the PROPERTIES of the desktop that you want to share.(in this case ‘aryan’ is
the folder name).

Step 2: Go to SHARING tab to open ADVANCED SHARING options and tick ‘share
this folder’.

Figure 2: Advanced Sharing

Step 3: Head to PERMISSIONS tab and allow the users to have full control by ticking the
‘full control’ check box.

Step 4: Apply the settings and open ‘network and sharing centre’.

Step 5: Click on ‘local area connection’ to open LAN status.

Step 6: Click on ‘Details’ tab to see the IPv4 address.

Step 7: On the desktop screen press ‘Windows + R’ to open the ‘RUN’ window, and enter
the IPv4 address to open the shared folders.

Step 8: On entering the IPv4 a new window appers where we can see the shared folder
‘Desktop’.

Muskan Chauhan(A40318075)
PROGRAM No. 8
AIM: Study about Iv4 and IPv6.
(i) Internet protocol version 4 (IPV4)
Internet protocol version 4 (IPV4) was first published in 1981, it is the fourth version of
internet protocol, and it is the first version of the protocol to be widely deployed in
TCP/IP.
The main function of protocol is to identify host on the network by their logical address in
other to established communication between them on the network. The IPV4 is a
connectionless protocol for use in packet switched network, meaning that it does not reserve
resources (bandwidth for link and schedule process time for the package) to be used during
communication. It does not request connect when sending data and it know the destination
address through routing table. The resources are allocated whenever the need arise IPV4 are
basically categories into five classes, Classes A, B and C varied in bit length for
addressing a network host while Class D is reserve for multicast and the last class which is E
is for purposely for experimental and study purpose. This can be seen in the table below.

Fig. 1: Network class and Network per host

IPv4 ADDRESS SPACE AND FORMAT


IPv4 architecture design use 32-bit (4-byte) address space which accommodate 4.3
billion unique addresses. IPv4 use dotted decimal notation address format, an example
of IPv4 addresses are as follow: 198.122.212. 12, this will also represent in binary form:
11000111.01111010.11010100.00001100. The IPv4 uses 0.0.0.0 as unknown address
127.0.0.1 as loopback address.
IPV4 INTERNET SECURITY
During the architecture time of IPV4, internet are very friendly to it client because there is
no adequate security, but now is said hostile because of high level of security. When we
are talking about communication, security is one of the major concerned to protect data being
send from interception or view by the third party on the network, we protect our data by
encrypting and authenticate packet been send on the network or by using shift key. A
standard security for IPv4 package is implement knows as internet security but is optional in
Muskan Chauhan(A40318075)
IPv4

Muskan Chauhan(A40318075)
IPV4 PACKET LOSE AND RECOVERY
Any packets sent on the network go along header which guides the packet to reach
the destination. When a packet lose it destination as a result of routing error, the IPv4 use
Time- to-Live (TTL) field which contain a detail on how long a packet can live and navigate
on a network. It prevent packet from infinite looping, which allow a packet to navigate on
network 255 times. After the packet elapse the time, the packet is discard and send
internet control message protocol (ICMP) message to the original host to resend the package.
LIMITATION OF IPv4
The limitation of IPv4 arouse the idea of IPv6, some of the IPv4 limitation are
inadequate address, insufficient security and mobile device compatibility. Since it has been
notice that this limitation will affect the future internet, this was the driving factor for the
introduction of some techniques that will reduce the rapid exhaustion of the address.
These two techniques are Classless Internet Domain Router (CIDR) and Network Address
Transition (NAT. 3. IPv4 NETWORK ADDRESS TRANSLATION (NAT) Network address
translation (NAT): This is another technique help to minimize the depletion of IP address
space by combining several IP address into a single IP address, the single IP address serve as
an agent between the multiple hosts. NAT align private address to public address to
communicate on the internet. When clients with private address want to share a file with
public address on the network, normally the packets contain both the physical and logical
address of the destination. NAT take the IP address and TCP which is from private network
and modify it to appear like public IP address, so that the communication will not be intercept
by the internet security. NAT can also perform public-to-public address translation, as well as
private-to-private address translation. Therefor the introduction of Classless internet Domain
Router (CIDR) and Network Translation Address (NAT) minimize the rapid exhaustion of
IPV4 address space, still IPv4 will not serve the purpose for the future internet, the solution is
IPv6 .

(ii) INTERNET PROTOCOL VERSION SIX (IPv6)


Internet Protocol version 6 (IPv6) is the second and recent version of the Internet Protocol
(IP) design to tackle the problem of the existing protocol (IPV4) which is the dominant IP
address presently. The IPV6 upon called IPng (Next generation), the idea of IPv6 was
brought up in early 1990s by Internet Engineering Task Force (IETF) when notice the
current used internet protocol IPv4 address space almost depleted. It also aims to minimize
the time and cost people spend while configure new devices, it use auto configuration when
new device is to be configured. Another goal of IPv6 is IPsec to prevent unauthorized user
and transmission interception.
Internet Protocol version 6 (IPv6) is the most recent version of the Internet Protocol (IP), the
communications protocol that provides an identification and location system for computers
on networks and routes traffic across the Internet.IPv6 is intended to replace IPv4.
IPv6 ADDRESS SPACE AND FORMAT
The IPV6 technology use 128-bit (16 bytes) address space provided the IP address
which permit 2128 equivalent to 3.4*1038 or 340 Trillion. The current version of internet
Muskan Chauhan(A40318075)
protocol use string notation format, eight sets of four hexadecimal addresses separate by a
colon. Example of IPv6 address are: ABC: 345:123:756:1122:00. If two fields appear to be
zeros in IPV6 address, you can replace them with (::).
IPV6 PACKET LOSE AND RECOVERY (Ipv6)
Time-to-live field to Hop limit field (8-bits) for packet loss and recovery, which restrict
packet from unlimited loop on the network due to routing error, each hop limit field reduce
by one, when node send packet, when it reach zero, the packet drop from network and send
internet control message protocol (ICMP) message to source to resend the packet. IPv6
INTERNET SECURITY (IPSEC)
The internet security (IP) is one of significant enhancement of over IPv4, it is optional in
IPv4. IPV6 has embedded IPsec for cryptography and authentication service to secured
datagram or packet IP in other to have end to end communication without the interference of
other entity. IPsec in this version of internet protocol is not optional is required.

Muskan Chauhan(A40318075)
PROGRAM No. 9
AIM: C++ Program for encryption and decryption of strings

Source code:
#include <bits/stdc++.h>
using namespace std;
string encryption(string s)
{
    int l = s.length();
    int b = ceil(sqrt(l));
    int a = floor(sqrt(l));
    string encrypted;
    if (b * a < l) {
        if (min(b, a) == b) {
            b = b + 1;
        }
        else {
            a = a + 1;
        }
    }
  
     char arr[a][b];
    memset(arr, ' ', sizeof(arr));
    int k = 0;
     for (int j = 0; j < a; j++) {
        for (int i = 0; i < b; i++) {
            if (k < l){
                arr[j][i] = s[k];
            }
            k++;
        }
    }
  for (int j = 0; j < b; j++) {
        for (int i = 0; i < a; i++) {
            encrypted = encrypted + 
                         arr[i][j];
        }
    }
    return encrypted;
}
  string decryption(string s){
    int l = s.length();
    int b = ceil(sqrt(l));
    int a = floor(sqrt(l));
    string decrypted;
    char arr[a][b];
    memset(arr, ' ', sizeof(arr));
    int k = 0;
        for (int j = 0; j < b; j++) {
        for (int i = 0; i < a; i++) {
            if (k < l){
                arr[j][i] = s[k];
            }
            k++;
Muskan Chauhan(A40318075)
        }
    }
 for (int j = 0; j < a; j++) {
        for (int i = 0; i < b; i++) {
            decrypted = decrypted + 
                         arr[i][j];
        }
    }
    return decrypted;
}
  int main()
{
    string s = "pdm university";
    string encrypted;
    string decrypted;
        encrypted = encryption(s);
    cout << encrypted << endl;
      decrypted = decryption(encrypted);
    cout << decrypted;
    return 0;
}

OUTPUT:

Muskan Chauhan(A40318075)
PROGRAM NO. 10
AIM: Configure IP address in a system of a LAN (TCP/IP configuration)
Step 1: Select Start, then select Settings, Network & Internet

Muskan Chauhan(A40318075)
Step 2: For a Wi-Fi network, select Wi-Fi then Manage known networks. Choose the network you want to
change the settings for, then select Properties.

Muskan Chauhan(A40318075)
Step 3: Under Edit IP settings, select Automatic (DHCP) or Manual. When you select Automatic (DHCP), the
IP address settings and DNS server address setting are set automatically by your router or other access point
(recommended).

Muskan Chauhan(A40318075)
Step 4: (For manual) When you select Manual, you can manually set your IP address settings and DNS server
address.

To specify lPv4 settings manually choose IPv4, or IPv6 to specify IPv6.

Step 5: When you're done. select Save.

Muskan Chauhan(A40318075)

You might also like