Professional Documents
Culture Documents
Theory:
Transmission medium:In a data transmission system, the transmission medium is the physical path
between transmitter and receiver. The transmission media that are used to convey information can be
classified as guided or unguided. Guided media provide a physical path along which the signals are
propagated; these include twisted pair, coaxial cable, and optical fiber. Unguided media employ an
antenna for transmitting through air, vacuum, or water. In considering the design of data transmission
systems, key concerns are data rate and distance: the greater the data rate and distance the better.A
number of design factors relating to the transmission medium and the signal determine the data rate and
distance:
• Bandwidth: All other factors remaining constant, the greater the bandwidth of a signal, the
higher the data rate that can beachieved.
• Transmission impairments: Impairments, such as attenuation, limit the distance. For guided
media, twisted pair generally suffers more impairment than coaxial cable, which in turn suffers
morethan opticalfiber.
• Interference: Interference from competing signals in overlapping frequency bands can distort
or wipe out a signal. Interference is of particular concern for unguided media but is also a problem with
guided media. For guided media, interference can be caused by emanations from nearby cables. For
example, twisted pairs are often bundled together and conduits often carry multiple cables. Interference
can also be experienced from unguided transmissions.Proper shielding of a guided medium can
minimize thisproblem.
Networking Devices:
HUB
Hub is one of the basic icons of networking devices which works at physical layer and hence connect
networkingdevicesphysicallytogether.Hubsarefundamentallyusedinnetworksthatusetwistedpair
cabling to connect devices. They are designed to transmit the packets to the other appended devices
without altering any of the transmitted packets received. They act as pathways to direct electrical
signals to travel along. They transmit the information regardless of the fact if data packet is destined for
the device connected ornot.
Ethernet Hubs
It is a device connecting multiple Ethernet devices together and makes them perform the functions as a
single unit. They vary in speed in terms of data transfer rate. Ether utilizes Carrier Sense
MultipleAccess with CollisionDetect (CSMA/CD) to control Media access. Ethernet hub
communicates inhalfduplexmodewherethechancesofdatacollisionareinevitableatmostofthetimes.
Switches
Switches are the linkage points of an Ethernet network. Just as in hub, devices in switches are
connected to them through twisted pair cabling. But the difference shows up in the manner both the
devices; hub and a switch treat the data they receive. Hub works by sending the data to all the ports on
the device whereas a switch transfers it only to that port which is connected to the destination device.
A switch does so by having an inbuilt learning of the MAC address of the devices connected to it. Since
the transmission of data signals are well defined in a switch hence the network performance is
consequently enhanced. Switches operate in fullduplexmode where devices can send and receivedata
from the switch at the simultaneously unlike in halfduplex mode. The transmission speed in switches is
double than in Ethernet hub transferring a 20Mbps connection into 30Mbps and a 200Mbps connection
to become 300Mbps. Performance improvements are observed in networking with the extensive usage
of switches in the moderndays.
Types of Bridges:
There are mainly three types in which bridges can be characterized:
Transparent Bridge: As the name signifies, it appears to be transparent for the other devices
on the network. The other devices are ignorant of its existence. It only blocks or forwards the data as
per the MACaddress.
Source Route Bridge: It derives its name from the fact that the path which packet takes
through the network is implanted within the packet. It is mainly used in Token ringnetworks.
Translational Bridge: The process of conversion takes place via Translational Bridge. It
converts the data format of one networking to another. For instance Token ring to Ethernet and vice
versa.
Routers
Routers are network layer devices and are particularly identified as Layer 3 devices of the OSI Model.
They process logical addressing information in the Network header of a packet such as IP Addresses.
Router is used to create larger complex networks by complex traffic routing. It has the ability to
connect dissimilar LANs on the same protocol. It also has the ability to limit the flow of broadcasts. A
router primarily comprises of a hardware device or a system of the computer which has more than one
network interface and routingsoftware.
Functionality:
When a router receives the data, it determines the destination address by reading the header of the
packet. Once the address is determined, it searches in its routing table to get know how to reach the
destination and then forwards the packet to the higher hop on the route. The hop could be the final
destination or another router.
Routing tables play a very pivotal role in letting the router makes a decision. Thus a routing table is
ought to be updated and complete. The two ways through which a router can receive information are:
StaticRouting:Instaticrouting,theroutinginformationisfedintotheroutingtablesmanually. It does
not only become a timetaking task but gets prone to errors as well. The manual updating isalso
Gateways
Gateway is a device which is used to connect multiple networks and passes packets from one packet to
the other network. Acting as the ‘gateway’ between different networking systems or computer
programs, a gateway is a device which forms a link between them. It allows the computer programs,
either on the same computer or on different computers to share information across the network through
protocols. A router is also a gateway, since it interprets data from one network protocol to another.
Others such as bridge converts the data into different forms between two networking systems. Then a
software application converts the data from one format into another. Gateway is a viable tool totranslate
the data format, although the data itself remains unchanged. Gateway might be installed in some other
device to add its functionality intoanother.
Conclusion: Thus we have studied transmission media used in computer network as well as different
hardware devices used in network.
EXPERIMENT NO. 02
Aim: Write a program to implement error detection using
CRC .Theory:
Cyclic Redundancy Check (CRC) An error detection mechanism in which a parity bits are appended to a blo
A CRC is derived using a more complex algorithm than the simple CHECKSUM, involving MODULO ARITH
Requirements of CRC :
A CRC will be valid if and only if it satisfies the following requirements:
1. It should have exactly one less bit thandivisor.
2. Appending the CRC to the end of the data unit should result in the bit sequence which isexactly
divisible by thedivisor.
The various steps followed in the CRC method are:
1. A string of n as is appended to the data unit. The length of predetermined divisor is n+1.
2. The newly formed data unit i.e. original data + string of n as are divided by the divisor using binary
division and remainder is obtained. This remainder is calledCRC.
Now, string of n Os appended to data unit is replaced by the CRC remainder (which is also of n bit).
4. The data unit + CRC is then transmitted toreceiver.
5. The receiver on receiving it divides data unit + CRC by the same divisor & checks theremainder.
6. If the remainder of division is zero, receiver assumes that there is no error in data and it acceptsit.
7. If remainder is nonzero then there is an error in data and receiver rejectsit.
For example, if data to be transmitted is 1001 and predetermined divisor is 1011. The procedure given below is u
1. String of 3 zeroes is appended to 1011 as divisor is of 4 bits. Now newly formed data is
1011000.
2. Data unit 1011000 is divided by 1011.
During this process of division, whenever the leftmost bit of dividend or remainder is 0, we usea string of Os of s
At the receiver side, data received is1001110.
This data is again divided by a divisor1011.
The remainder obtained is 000; it means there is noerror.
Conclusion:ThuswehavestudiedandimplementedCRCsuccessfully
CRC can detect all the burst errors that affect an odd number ofbits.
The probability of error detection and the types of detectable errors depends on the choice ofdivisor.
#include<conio.h>
#include<stdio.h>
void main()
inti,j,n,g,a,arr[20],gen[20],b[20],q[20],s;
clrscr();
printf("Transmitter side:");
scanf("%d",&n);
printf("Enter data:");
for(i=0;i<n;i++)
scanf("%d",&arr[i]);
scanf("%d",&g);
printf("Enter generator:");
for(j=0;j<g;j++)
scanf("%d",&gen[j]); printf("\n\
tThegenerator matrix:");
for(j=0;j<g;j++)
printf("%d",gen[j]);
a=n+(g-1);
for(i=0;i< g;++i)
arr[n+i]=0;
for(i=0;i< a;++i)
printf("%d",arr[i]);
for(i=0;i< n;++i)
q[i]= arr[i];
Computer Communication and NetworkingPage 8
Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering
for(i=0;i< n;++i)
if(arr[i]==0)
for(j=i;j<g+i;++j)
arr[j] = arr[j]^0;
else
arr[i] = arr[i]^gen[0];
arr[i+1]=arr[i+1]^gen[1];
arr[i+2]=arr[i+2]^gen[2];
arr[i+3]=arr[i+3]^gen[3];
printf("\n\tTheCRC is :");
for(i=n;i<a;++i)
printf("%d",arr[i]);
s=n+a;
for(i=n;i<s;i++)
q[i]=arr[i];
printf("\n\n");
for(i=0;i<a;i++)
printf("%d",q[i]);
getch();
Transmitter side:
Enter data:1 0 1 0 0 0 0 1
Enter generator:1 0 0 1
.EXPERIMENT NO. 3
AIM: To study basic networking commands using command prompt: hostname, getmac, arp, ipconfig,
ping, tracert and netstat.
THEORY:
1. hostname:
The hostname command displays the hostname of the computer currently logged in.
Syntax: hostname
2. getmac:
Each device on an Ethernet network has its own Network Interface Card (NIC) and this NIC provides
the device with a link layer address (MAC address). It is a 6 byte (48 bits) address, normally written in
hexadecimal notation with colon between the bytes. The getmac command displays the MAC address
of the computer currently logged in.
Eg: 8C:89:A5:3C:9E:EC
Syntax: getmac
3. arp:
ARP (Address Resolution Protocol) is a network layer protocol and it helps IP to find the MAC address
of the destination host or a router when its IP address is known.
Syntax: arp –a 192.168.5.247 (provides the MAC address of gateway router)
arp –a (provides the arp table of the device)
4. ipconfig:
The ipconfig command is utilized to verify network connection and network settings. This command
displays all current TCP/IP network configuration values such as:
1) Connectionspecific DNS suffix: It is the suffix name of the network to which the NIC is
connected to.
2) IPv4: IPv4 uses 4 byte (32 bit) address written in decimal notation which consists of four 8 bit
of address separated by decimalpoint.
Eg: 192.168.3.72
3) Subnet mask: It is a 32 bit address that masks an IPaddress.
4) Default Gateway: Provides the IP address of a router that serves as an entrance to another
network.
Syntax: ipconfig
ipconfig /all (Provides detailed network configuration values)
ping uses ICMP (Internet Control Message Protocol) packet to send out an ‘echo request’ to the
destination device and gets back an ‘echo response’ if the receiving device is active.
Syntax: ping www.google.com(DNS)
ping 192.168.5.247 (Gateway Router)
ping (options)
ping –twww.google.com(continous ping)
ping –n 2www.google.com(number of ping =2)
ping –l 20www.google.com(defines buffer size i.e. no. of bytes for pinging i.e. Bytes =20)
6. tracert:
The tracert command is used to show several details about the path that a packet takes from sender to
destination. It shows the IP address of each hop between source and destination. This command is
mainly used for troubleshooting network problems.
Syntax:
tracertwww.google.comt
racertwww.yahoo.com
7. netstat:
The netstat command is used to display the TCP/IP network protocol statistics and information. It
provides very detailed information about how computer is communicating with other computers. It
provides the following information:
1. Protocol: The name of the protocol used (TCP orUDP).
2. Local Address: Provides the IP address of the local computer and the port number being used.
3. Foreign Address: Provides the IP address and the port number of devices in path.
4. State: Indicates the state of a TCPconnection.
Syntax:netstat
netstat (options)
netstat –e (number of bytes sent/received)
netstat –n (Display active TCP connection and address and Port no. are expressed in numbers)
Conclusion: Thus we have studied about different networking commands used in computer networks:
hostname, getmac, arp, ipconfig, ping, tracert and netstat
Computer Communication and NetworkingPage 12
Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering
Syntax:hostname
Syntax:getmac
Syntax:ipconfig
Syntax: tracertwww.google.com
Syntax:netstat
Experiment No 4
AIM: To study network simulator NS2 basic commands and Implementing Simple topology by creating no
THEORY:
The network simulator is discrete event packet level simulator. The network simulator covers a very
large number of applications of different kind of protocols of different network types consisting of
different network elements and traffic models. Network simulator is a package of tools that simulates
behavior of networks such as creating network topologies, log events that happen under any
load,analyze the events and understand the network. The main aim of our first experiment is to learn
how to use network simulator and to get acquainted with the simulated objects and understand the
operations of network simulation and we also need to analyze the behavior of the simulation object
using network simulation.
Backend Environment of Network Simulator
Network Simulator is mainly based on two languages. They are C++ and Tcl. Tcl is the object oriented
version of Tool Command language. The network simulator is a bank of different network and protocol
objects. C++ helps in the following way:
It helps to increase the efficiency of simulation.
It is used to provide details of the protocols and their operation.
It is used to reduce packet and event processing time.
Tcl helps in the followingway:
With the help of Tcl we can describe different network topologies
It helps us to specify the protocols and their applications
It allows fast development
Tcl is compatible with many platforms and it is flexible for integration
Tcl is very easy to use and it is available in free
To start a new simulator we write
set ns [new Simulator]
From the above command we get that a variable ns is being initialized by using the set command. Here the code [
proc finish {} {
global ns namfile
$ns flushtrace
close $namfile
Computer Communication and NetworkingPage 20
Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering
execnamout.nam&
exit 0
}
In the above the word 'proc' is used to declare a procedure called 'finish'.The word 'global' is used to tell
what variables are being used outside the procedure.
'flushtrace' is a simulator method that dumps the traces on the respective files.the command 'close' is
used to close the trace files and the command 'exec' is used to execute the namvisualization.The
command 'exit' closes the application and returns 0 as zero(0) is default for clean exit.
In ns we end the program by calling the ' finish' procedure
$ns at 5 "finish"
Thus the entire operation ends at 5 seconds.
CONCLUSION: Thus, we have studied network stimulation and implemented the given topology.
EXPERIMENT NO. 5
AIM: To configure routers using static routing using GNS3 simulation tool.
THEORY:
Routers can forward packets over static routes or dynamic routes based on the router configuration.
Two ways to tell the router where to forward the packets that are not directly connected are as follows:
StaticRoutes: The router uses a route that a network administrator enters into the router manually.
The administrator must manually update this static route entry whenever an internetwork topology
change requires an update. Static routes are userdefined routes that specify the path that packets moving
between a source and destination take. These administratordefined routes allow very precise control
over the routing behaviour of the IP internetwork.
Disadvantage: 1) Infrastructure changes must be manually adjusted
2) Impractical on large network.
PROCEDURE:
1) Create a simulation network by connecting all the routers using fast Ethernetlinks.
2) Configure each router using their respective console port and initially reset all the port
(interface) configuration status to down.
3) Assign IP address to each of the interface of respective router and change its status to up.
4) Apply static routing for end to end connectivity.
5) Ping the destination router to check its end to end connectivity.
COMMANDS:
1) enable
2) config tto configure the router
3) hostname{any name to assign that particular router}configuration mode
4) interface{specific interface number}to configure that particular interface of the router
5) ip addr{ipaddress}{subnetmask}assigning IPaddress to that particular interface
6) no shutto change the status of that interface to up
7) show ip int briefto check interface configuration in enable mode
8) static routing: configuration mode
a) ip route {destination network}{subnet mask}{ip address of next hop}
9) ping{destination address}enable mode
CONCLUSION:
Thus we have configured routers using static and dynamic routing using GNS3 simulation tool
THEORY:
Routers can forward packets over static routes or dynamic routes based on the router configuration.
Two ways to tell the router where to forward the packets that are not directly connected are as
follows:
Dynamic Routes: The router dynamically learns after an administrator configures routing protocol
that helps determine routes. Unlike the situation with static routes, after the network administrator
enables dynamic routing, the routing process automatically updates route knowledge whenever new
topology information is received. The routers learn and maintain routes to the remote destination by
exchanging routing updates with other routers in the internetwork. Example: RIP and OSPF routing
protocol.
Advantage: 1) Simple to configure on larger networks
2) Will dynamically choose a different route if a link goes down
Disadvantage: 1) The choice of the “best route” is in the hands of the routing protocol, and not the
network administrator.
PROCEDURE:
1) Create a simulation network by connecting all the routers using fast Ethernet links.
2) Configure each router using their respective console port and initially reset all the port (interface)
configuration status to down.
3) Assign IP address to each of the interface of respective router and change its status to up.
4) Apply static/dynamic routing for end to end connectivity.
5) Ping the destination router to check its end to end connectivity.
COMMANDS:
1) Enable
2) Config tto configure the router
3) hostname{any name to assign that particular router}configuration mode
4) interface{specific interface number}to configure that particular interface of the router
5) ip addr{ip address}{subnet mask}assigning IP address to that particular interface
6) no shutto change the status of that interface to up
7) show ip int briefto check interface configuration in enable mode
8) dynamic routing: configuration mode
a) router ospf 100initiates dynamic routing using ospf routing protocol
b) network{current network}{wildcard mask}area0creating and sharing its routing table
9) ping{destination address}enable mode
Example:
Device# configure terminal
CONCLUSION:
Thus we have configured routers using static and dynamic routing using GNS3 simulation tool
The command menus are standard pull down menus located at the top of the window of interest
for now is the File and Capture menu. The File menu allows saying captured packet data or opening a file
containing previously captured packet data, and exiting the Wireshark application. The capture menu
allows beginning packetcapture.
The packetlisting window displays aoneline summary for each packet captured, including the
packet number (assigned by Wireshark), the time at which the packet was captured, the packet’s source
and destination address, the protocol type and protocol specific information contained in thepacket.
The packetheader detail window provides detailed information about the packet selected
(highlighted) in the packetlisting window. These details include information about different layers of
TCP/IP with which packet isinvolved.
The packetcontent window displays the entire contents of each layers of TCP/IP for each captured
frame in both ASCII and hexadecimalformat.
Towards the top of the Wireshark graphical user interface is the packet display filter field into
which a protocol name or other information can be entered in order to filter the information displayed in
the packetlisting window (and hence the packetheader and packetcontentswindows).
Procedure:
1) Start up the web browser which will display selected homepage.
2) Start up the Wireshark software, Initially can see a window similar to that shown in figure 1,
Wireshark has not yet begun capturingpackets.
3) To begin packet capture, select the capture pull down menu and select Interfaces, this will cause
the “Wireshark: Capture Interfaces” window to bedisplayed.
4) A list of the interface on the computer as well as a count of the packets that have been observed
onthatinterfacesofarisdisplayed.Clickonstartfortheinterfaceonwhichyouwanttobeginpacket
5) After starting packet capture, a window similar will appear. This window shows the packets being
captured which are generated by some network traffic using a web browser, which will use the HTTP
protocol. Packet capture can be traffic using a web browsers can be stop by selecting capture pull down
and selectingstop.
7) After the browser has displayed the webpage, stop Wireshark packet capture by selecting stop in
the Wireshark capture window. The main Wireshark window should niow look similar to figure
4consisting live packet data that contains all protocol messages exchanged between user computer and
other network entities.The HTTP messaged exchanged with the shahandanchor.com webserver should
appear somewhere in the listing of packets captured. Even though only a webpage of shahandanchor.com
was opened, there are evidently many other protocols running on the computer that are unseen by the
user(e.g. the many different protocol types shown in the protocol columns in figure4).
8) Type in “http”(without the quotes, and in lower case all protocol names are in lower case in
Wireshark) into the display filter specification window at the top of the main Wireshark window. Then
select Apply (to the right of where you eentered “http”). This will cause only HTTP message to be
displayed in the packet listingwindow.
9) Find the HTTP GET message that was sent from user computer to the shahandanchor.com HTTP
server. Look for an HTTP GET message in the “Listing of captured packets” portion of the Wireshark
window that shows “GET” followed by the URL entered. When the HTTP GET message is selected,
detailed information about the Ethernet frame, IP datagram, TCP segment, and HTTP message header
information is displayed in the packetheader window, corresponding information content in ASCII and
Hexadecimal format is provided in packet contentwindow.
10) The File menu allows saving this captured packet data and exitWireshark.
Conclusion:
Thus we have studied different layers of TCP/IP protocol involved in data packets using Wireshark.