Sie sind auf Seite 1von 62

EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

Experiment No: 1
Aim: INTRODUCTION TO RS-232 COMMUNICATION AND BIOSCOM FUNCTION

Theory:

 What is serial and parallel communication?


 In telecommunication, the process of sending data sequentially over a computer bus is
called as serial communication, which means the data will be transmitted bit by bit.

(SERIAL CCOMMUNICATION)

 While in parallel communication the data is transmitted in a byte (8 bit) or character


on several data lines or buses at a time. Serial communication is slower than parallel
communication but used for long data transmission due to lower cost and practical
reasons.

(PARALLEL CCOMMUNICATION)

1
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

 Modes of Data Transfer in Serial Communication

 Baud rate is used to measure the speed of transmission. It is described as the number
of bits passing in one second. For example, if the baud rate is 200 then 200 bits per
Sec passed. In telephone lines, the baud rates will be 14400, 28800 and 33600.
 Stop Bits are used for a single packet to stop the transmission which is denoted as “T”.
Some typical values are 1, 1.5 & 2 bits.
 Parity Bit is the simplest form of checking the errors. There are of four kinds, i.e.,
even, odd, marked and spaced. For example, If 011 is a number the parity bit=0, i.e.,
even parity and the parity=1, i.e., odd parity.

 What is RS-232?
 RS232 is a standard protocol used for serial communication, it is used for connecting
computer and its peripheral devices to allow serial data exchange between them.
 In other words, RS-232 is a long-established standard that describes the physical
interface and protocol for relatively low-speed serial data communication between
computers and related devices.
 As it obtains the voltage for the path used for the data exchange between the devices.
It is used in serial communication up to 50 feet with the rate of 1.492kbps.
 RS-232 was first introduced in 1960 by the ELECTRONIC INDUSTRIES
ASSOCIATION (EIA) as a Recommended Standard.
 Information being transferred between data processing equipment and peripherals is in
the form of digital data which is transmitted in either a serial or parallel mode.
 Parallel communications are used mainly for connections between test instruments or
computers and printers, while serial is often used between computers and other
peripherals.
 It formally defines signals connecting between a DTE (data terminal equipment)
such as a computer terminal, and a DCE (data circuit-terminating equipment) such
as a modem. The standard defines the electrical characteristics and timing of signals,
the meaning of signals, and the physical size and pin out of connectors

2
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

 Universal Asynchronous Data Receiver &Transmitter (UART) used in connection


with RS232 for transferring data between printer and computer.
The microcontrollers are not able to handle such kind of voltage levels, connectors are
connected between RS232 signals.
These connectors are known as the DB-9 Connector as a serial port and they are of
two type’s Male connector (DTE) & Female connector (DCE).

 DB-9 & DB-25:

PIN NOS. PIN NAME DESCRIPTION


1 CD(Carrier Detect) Incoming signal from DCE
2 RD(Receive Detect) Receives incoming data from
DTE
3 TD(Transmit Data) Send outgoing data to DCE
4 DTR(Data Terminal Ready) Outgoing handshaking signal
5 GND(Signal ground) Common reference voltage
6 DSR(Data Set Ready) Incoming handshaking signal

3
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

7 RTS(Request to send) Outgoing signal for


controlling flow
8 CTS(Clear to send) Incoming signal for
controlling flow
9 RI(Ring Indicator) Incoming signal from DCE

Handshaking is the process which is used to transfer the signal from DTE to DCE to make the
connection before the actual transfer of data. The messaging between transmitter & receiver can
be done by handshaking.
 DB-9 MALE

 DB-9 FEMALE

4
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

 DB-25

 How RS-232 works?


RS232 works on the two-way communication that exchanges data to one another.
There are two devices connected to each other, (DTE) Data Transmission Equipment &
(DCE) Data Communication Equipment which has the pins like TXD, RXD, and RTS&
CTS.
1. Now, from DTE source, the RTS generates the request to send the data.
2. Then from the other side DCE, the CTS, clears the path for receiving the data.
3. After clearing a path, it will give a signal to RTS of the DTE source to send the signal.
Then the bits are transmitted from DTE to DCE.
4. Now from DCE source, the request can be generated by RTS and CTS of DTE sources
clears the path for receiving the data and gives a signal to send the data.
5. This is the whole process through which data transmission takes place.

For example: The signals set to logic 1, i.e., -12V. The data transmission starts from next bit and
to inform this, DTE sends start bit to DCE. The start bit is always ‘0’, i.e., +12 V & next 5 to 9
characters is data bits. If we use parity bit, then 8 bits data can be transmitted whereas if parity
doesn’t use, then 9 bits are being transmitted. The stop bits are sent by the transmitter whose
values are 1, 1.5 or 2 bits after the data transmission.

5
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

 BIOSCOM () AND FUNCTION _BIOS_SERIALCOM()


The macro bioscom () and function _bios_serialcom() are used in this method in the serial
communication using RS-232 connecter. First we have to set the port with the settings depending
on our need and availability.

In this method, same function is used to make the settings using control word, to send data to the
port and check the status of the port. These actions are distinguished using the first parameter of
the function. Along with that we are sending data and the port to be used to communicate.

 Declaration:
BIOSCOM int bioscom (int cmd, char abyte, int port)
BIOS SERIALCOM Unsigned _bios_serialcom (int cmd, int port, char abyte)

 Remarks:
Both bioscom and _bios_serialcom use BIOS interrupt 0x14 to perform various RS-232
communications over the I/O port given in port.
ARG WHAT IT IS/DOES
Abyte OR combination of bits that specifies COM port settings (ignored if cmd =2 or 3)
Cmd Specifies the I/O operation to perform
Port Identifies the I/O port; 0 = COM1, 1 – COM2, etc.

CMD argument of bioscom and _bios_serialcom can be one of the following as defined in
BIOS.H: -
BIOSCOM _BIOS_SERIALCOM What function it does
0 _COM_INIT Sets the communications parameters to the value in
abyte
1 _COM_SEND Sends the character in abyte out over the
communications line
2 _COM_RECEIVE Receives a character from the communications line

6
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

3 _COM_STATUS Returns current status of the communication port

Significance of CMD values is given below: -

 When CMD is equal to 2 or 3 (i.e _COM_RECEIVE or _COM_STATUS), the abyte


argument is ignored.
 When CMD is equal to 0 (_COM_INIT), abyte is an OR combination of the following
bits

BIOSCOM _BIOS_SERIALCOM MEANING


0X02 _COM_CHR7 7 DATA BITS
0X03 _COM_CHR8 8 DATA BITS

0X00 _COM_STOP1 1 STOP BIT


0X04 _COM_STOP2 2 STOP BITS

0X00 _COM_NOPARITY NO PARITY


0X08 _COM_ODDPARITY ODD PARITY
0X18 _COM_EVENPARITY EVEN PARITY

0X00 _COM_110 110 BAUD


0X20 _COM_150 150 BAUD
0X40 _COM_300 300 BAUD
0X60 _COM_600 600 BAUD
0X80 _COM_1200 1200 BAUD
0XA0 _COM_2400 2400 BAUD
0XC0 _COM_4800 4800 BAUD
OXE0 _COM_9600 9600 BAUD

For example, if
abyte = (0xE0 | 0x08 | 0x00 | 0x03), the communication port is set to
 9600 BAUD RATE
 ODD PARITY
 1 STOP BIT
 8 DATA BIT

 Return value:
For all values of cmd, both functions return a 16-bit integer.
The upper 8 bits of the return value are status bits.

7
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

 If one or more status bits is set to 1, an error has occurred.


 If no status bits are set to 1, the byte was received without error.

The lower 8 bits of the return value depend on the value of cmd specified:
Value of cmd The lower 8 bits of return value
0 (_COM_INIT) The lower bits are defined as shown in the preceding diagram.
OR
3
(_COM_STATUS)
1 (_COM_SEND)
2 The byte read is in the lower bits of the return value, if there is no error
(_COM_RECEIVE) (no upper bits are set to 1).

Conclusion: By this practical we learned about RS-232 serial communication port and how to
use function of BIOSCOM with the help of example.

8
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

Experiment No: 2
Aim: IMPLEMENTATION OF FULL DUPLEX COMMUNICATION BETWEEN TWO PCS
USING C- CODE.
Theory:
 What do we mean by duplex?
A duplex communication system is a point-to-point system composed of two or more connected
parties or devices that can communicate with one another in both directions.
Duplex systems are employed in many communications networks, either to allow for
simultaneous communication in both directions between two connected parties or to provide a
reverse path for the monitoring and remote adjustment of equipment in the field.

There are two types of duplex communication systems: full-duplex (FDX) and half-duplex
(HDX).
 Full Duplex(FDX)
In a full-duplex system, both parties can communicate with each other simultaneously.
An example of a full-duplex device is a telephone; the parties at both ends of a call can speak
and be heard by the other party simultaneously. The earphone reproduces the speech of the
remote party as the microphone transmits the speech of the local party, because there is a two-
way communication channel between them, or more strictly speaking, because there are two
communication channels between them.

The Full Duplex PC to PC communication (Chatting) via RS-232 serial port is done using 'C'
language.

A PC can accommodate at most four serial ports but usually a PC has two RS- 232 serial ports,
viz, COM1 and COM2. Any one of the serial ports can be used in each PC for linking them
together. A serial port at the back of a PC is in the form of 9-pin (or some-times 25-pin) D-type
male connector.

9
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

 Steps to be followed for establishing connection between two PCs


1. Connection diagram

Null modem is a communication method to directly connect two DTEs (computer, terminal,
printer, etc.) using an RS-232 serial cable.

Wire Configuration

a) The connection diagram shows the wiring of the null-modem that is intended for
PC terminal feels as if some modem is connected to it rather than the other PC.
The two PC terminals are connected through TxD, RxD and GND pins.
b) The Data Terminal Ready (DTR, pin4) is looped back to Data Set Ready (DSR,
pin 6) and Data Carrier Detect (DCD, pin 1) on both the PCs.
c) When DTR is asserted active, then the DSR and DCD immediately become
active. At this moment, the computer thinks the virtual modem to which it is
connected is ready and has detected the carrier of the other modem.
d) The lines Request to Send (RTS, pin7) and clear to send (CTS, pin8) have been
linked together. When the computer wishes to send data, it asserts RTS high
which in turn asserts CTS high meaning thereby that the virtual modem has the
room for storing the data and the computer can send data.

2. Connect the two PCs together using the 3-wire link.


3. Run the program given in the source code on both the PCs.
4. Before sending the data, set both the sending and receiving PC terminals to the
same baud rate, and same format of data bits, parity bits & stop bits using the
macro(pre-processor directive) 'SETTINGS' in the source code.
5. When the source code is compiled and run on both the PCs, the character strings
(whose termination is indicated by pressing ENTER key) typed in the text entry
window of one PC should appear in the communication display window of both
the PCs.

10
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

 Declaration
Both bioscom and _bios_serialcom use BIOS interrupt 0x14 to perform various RS-232
communications over the I/O port given in port.
BIOSCOM int bioscom (int cmd, char abyte, int port)
BIOS SERIALCOM Unsigned _bios_serialcom (int cmd, int port, char abyte)

CMD argument of bioscom and _bios_serialcom can be one of the following as defined in
BIOS.H: -
BIOSCOM _BIOS_SERIALCOM What function it does
0 _COM_INIT Sets the communications parameters to the value in
abyte
1 _COM_SEND Sends the character in abyte out over the
communications line
2 _COM_RECEIVE Receives a character from the communications line

3 _COM_STATUS Returns current status of the communication port

Significance of CMD values is given below: -

 When CMD is equal to 2 or 3 (i.e _COM_RECEIVE or _COM_STATUS), the abyte


argument is ignored.
 When CMD is equal to 0 (_COM_INIT), abyte is an OR combination of the following
bits

BIOSCOM _BIOS_SERIALCOM MEANING


0X02 _COM_CHR7 7 DATA BITS
0X03 _COM_CHR8 8 DATA BITS

0X00 _COM_STOP1 1 STOP BIT


0X04 _COM_STOP2 2 STOP BITS

0X00 _COM_NOPARITY NO PARITY


0X08 _COM_ODDPARITY ODD PARITY
0X18 _COM_EVENPARITY EVEN PARITY

0X00 _COM_110 110 BAUD


0X20 _COM_150 150 BAUD
0X40 _COM_300 300 BAUD
0X60 _COM_600 600 BAUD
0X80 _COM_1200 1200 BAUD
0XA0 _COM_2400 2400 BAUD
0XC0 _COM_4800 4800 BAUD
OXE0 _COM_9600 9600 BAUD

11
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

 Code
#include <bios.h>
#include <conio.h>
#define COM1 0
#define DATA_READY 0x100
#define TRUE 1
#define FALSE 0
#define SETTINGS ( 0x80 | 0x02 | 0x00 | 0x00)
int main(void)
{
int in, out, status, DONE = FALSE;
bioscom(0, SETTINGS, COM1); /* Initialize bioscom
cprintf("... BIOSCOM [ESC] to exit ...\n"); /* Transmitter bioscom initialization
while (!DONE)
{
status = bioscom(3, 0, COM1); /* Condition initialization for data transmission if
(status & DATA_READY)
if ((out = bioscom(2, 0, COM1) & 0x7F) != 0) putch(out);
if (kbhit())
{
if ((in = getch()) == '\x1B') /* Check the input sequence
DONE = TRUE;
bioscom(1, in, COM1); /* Define bioscom
}
}
return 0; /* Return the value
}

 Output

12
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

Conclusion: By this practical we implemented full duplex communication between two PCs
using C code.

13
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

Experiment No: 3
Aim: INTRODUCTION TO CISCO PACKET TRACER.

Theory:

 What is a packet tracer?


 Packet Tracer is a protocol simulator developed by Dennis Frezzo and his team
at Cisco Systems.
 Packet Tracer (PT) is a powerful and dynamic tool that displays the
various protocols used in networking, in either Real Time or Simulation
mode.
 This includes layer 2 protocols such as Ethernet and PPP, layer 3 protocols
such as IP, ICMP, and ARP, and layer 4 protocols such as TCP and UDP.
Routing protocols can also be traced.

 Introduction to the Packet Tracer Interface using a Hub Topology


1. Start Packet Tracer and Entering Simulation Mode

2. We will begin building our network topology by selecting devices and the media in
which to connect them. Several types of devices and network connections can be used.

14
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

3. Building the Topology – Adding Hosts .Single click on the End Devices.

Move the cursor into topology area. You will notice it turns into a plus “+” sign. Single click in
the topology area and it copies the device.

15
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

Add three more hosts.

16
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

4. Building the Topology – Connecting the Hosts to Hubs and Switches

Adding a Hub Select a hub, by clicking once on Hubs and once on a Generic hub.

Perform the following steps to connect PC0 to Hub0:

a) Click once on PC0


b) Choose Fast Ethernet

17
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

c) Drag the cursor to Hub0


d) Click once on Hub0 and choose Port 0 4
e) Notice the green link lights on both the PC0 Ethernet NIC and the Hub0 Port 0 showing
that the link is active.

18
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

Perform the following steps to connect PC2 to Switch0:

a) Click once on PC2 2.


b) Choose Fast Ethernet
c) Drag the cursor to Switch0
d) Click once on Switch0 and choose FastEthernet0/1 5.
e) Notice the green link lights on PC2 Ethernet NIC and amber light Switch0
FastEthernet0/1 port.
The switch port is temporarily not forwarding frames, while it goes through the stages for
the Spanning Tree Protocol (STP) process.
f) After a about 30 seconds the amber light will change to green indicating that the port has
entered the forwarding stage. Frames can now forwarded out the switch port.

19
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

5. Configuring IP Addresses and Subnet Masks on the Hosts

Before we can communicate between the hosts we need to configure IP Addresses and Subnet
Masks on the devices. Click once on PC0.

Choose the Config tab. It is here that you can change the name of PC0. It is also here where you
would enter a Gateway IP Address, also known as the default gateway. We will discuss this later,

20
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

but this would be the IP address of the local router. If you want, you can enter the IP Address
172.16.1.1, although it will not be used in this lab.

Click on Fast Ethernet add the IP Address to 172.16.1.10. Click once in the Subnet Mask field
to 8 enter the default Subnet Mask. You can leave this at 255.255.0.0. We will discuss this later.

Also, notice this is where you can change the Bandwidth (speed) and Duplex of the Ethernet
NIC (Network Interface Card).

The default is Auto (auto negotiation), which means the NIC will negotiate with the hub or
switch. The bandwidth and/or duplex can be manually set by removing the check from the Auto
box and choosing the specific option.

Bandwidth – Auto: If the host is connected to a hub or switch port which can do 100 Mbps,
then the Ethernet NIC on the host will choose 100 Mbps (Fast Ethernet). Otherwise, if the hub or
switch port can only do 10 Mbps, then the Ethernet NIC on the host will choose 10 Mbps
(Ethernet).

Duplex - Auto Hub: If the host is connected to a hub, then the Ethernet NIC on the host will
choose Half Duplex.

21
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

Switch: If the host is connected to a switch, and the switch port is configured as Full Duplex (or
Auto negotiation), then the Ethernet NIC on the host will choose Full Duplex. If the switch port
is configured as Half Duplex, then the 9 Ethernet NIC on the host will choose Half Duplex. (Full
Duplex is a much more efficient option.) The information is automatically saved when entered.

Verify the information, to verify the information that you entered, move the Select tool (arrow)
over each host.

Deleting a Device or Link to delete a device or link, choose the Delete tool and click on the
item you wish to delete.

22
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

6. Connecting Hub0 to Switch0


To connect like-devices, like a Hub and a Switch, we will use a Cross-over cable. Click once the
Cross-over Cable from the Connections options.

23
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

The link light for switch port FastEthernet0/4 will begin as amber and eventually
change to green as the Spanning Tree Protocol transitions the port to forwarding.

Conclusion: By this practical we learned about Cisco packet tracer and how to operate it.

24
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

Experiment: 4
Aim: TO STUDY ABOUT DIFFERENT NETWORK COMMAND.

Theory:
The net command is a Command Prompt command that can be used to manage almost any
aspect of a network and its settings including network shares, network print jobs, network users,
and much more.

 Various networking commands are


1. Ipconfig

Ipconfig is a Console Command which can be issued to the Command Line Interpreter
(or command prompt) to display the network settings currently assigned to any or all
network adapters in the machine. This command can be utilized to verify a network
connection as well as to verify your network settings.

The default is to display only the IP address, subnet mask and default gateway for each adapter
bound to TCP/IP.

For release and renew, if no adapter name is specified, then the IP address leases for all adapters
bound to TCP/IP will be released or renewed.

For Setclassid and Setclassid6, if no ClassId is specified, then the ClassId is removed.

25
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

2. Ping

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.

The ping command operates by sending Internet Control Message Protocol (ICMP) Echo
Request messages to the destination computer and waiting for a response. How many of those
responses are returned, and how long it takes for them to return, are the two major pieces of
information that the ping command provides.

For example, you might find that there are no responses when pinging a network printer, only to
find out that the printer is offline and its cable needs replaced. Or maybe you need to ping
a router to verify that your computer can connect to it, to eliminate it as a possible cause for a
networking issue.

26
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

3. Arp

Address Resolution Protocol (ARP) is a procedure for mapping a dynamic Internet Protocol
address (IP address) to a permanent physical machine address in a local area network (LAN).

The physical machine address is also known as a Media Access Control or MAC address.

27
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

The job of the ARP is essentially to translate 32-bit addresses to 48-bit addresses and vice-
versa. This is necessary because in IP Version 4 (IPv4), the most common level of Internet
Protocol (IP) in use today, an IP address is 32-bits long, but MAC addresses are 48-bits long.

ARP works between network layers 2 and 3 of the Open Systems Interconnection model (OSI
model). The MAC address exists on layer 2 of the OSI model, the network layer, while the IP
address exists on layer 3, the data link layer.

28
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

HOW ARP WORKS?

When a new computer joins a LAN, it is assigned a unique IP address to use for identification
and communication. When an incoming packet destined for a host machine on a particular LAN
arrives at a gateway, the gateway asks the ARP program to find a MAC address that matches the
IP address. A table called the ARP cache maintains a record of each IP address and its
corresponding MAC address.

All operating systems in an IPv4 Ethernet network keep an ARP cache. Every time a host
requests a MAC address in order to send a packet to another host in the LAN, it checks its ARP
cache to see if the IP to MAC address translation already exists. If it does, then a new ARP
request is unnecessary. If the translation does not already exist, then the request for network
addresses is sent and ARP is performed.

ARP broadcasts a request packet to all the machines on the LAN and asks if any of the machines
know they are using that particular IP address. When a machine recognizes the IP address as its
own, it sends a reply so ARP can update the cache for future reference and proceed with the
communication.

4. netstat

The netstat command is used to display the TCP/IP network protocol statistics and information.

The netstat command, meaning network statistics, is a Command Prompt command used to
display very detailed information about how your computer is communicating with other
computers or network devices.

5. tracert

The tracert command is a Command Prompt command that's used to show several details about
the path that a packet takes from the computer or device you're on to whatever destination you
specify.

29
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

You might also sometimes see the tracert command referred to as the trace route
command or traceroute command.

Conclusion: By this practical we learned about various networking commands.

30
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

Experiment No: 5
Aim: TO STUDY ABOUT IPV4 ADDRESSING AND SUBNET.

Theory:
 Introduction

An IP address is an address used to uniquely identify a device on an IP network.

The address is made up of 32 binary bits which can be divisible into a network portion and host
portion with the help of a subnet mask.

32 binary bits are broken into four octets (1 octet = 8 bits) Dotted decimal format (for
example, 172.16.81.100).

31
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

IPv4 Addresses specify four octets of summed bit values, where each bit value represents 2-to-
the-power-of-its position in the octet.

From left-to-right within the octet, bits carry a value, 2-to-the-power-of-8, all the way to 2-to-
the-power-of-0. For example, the address 0.0.0.0 would contain all 8 zero bits across each octet,
while the address 255.255.255.255 would contain 8 one bits across each octet.

With an IPv4 IP address, there are five classes of available IP ranges: Class A, Class B, Class
C, Class D and Class E, while only A, B, and C are commonly used. Each class allows for a
range of valid IP addresses, shown in the following table.

CLASS NAME RANGE DESCRIPTION


CLASS A 1.0.0.1 TO 126.255.255.254 Supports 16 million hosts on
each of 127 networks.
CLASS B 128.1.0.1 to 191.255.255.254 Supports 65,000 hosts on each
of 16,000 networks.
CLASS C 192.0.1.1 to 223.255.254.254 Supports 254 hosts on each of
2 million networks.
CLASS D 224.0.0.0 to 239.255.255.255 Reserved for multicast groups.

CLASS E 240.0.0.0 to 254.255.255.254 Reserved for future use, or


research and development
purposes.

IP addresses are assigned in two different ways. They may be dynamically assigned (they
can change automatically) or statically assigned (they're intended not to change, and must
be changed manually).

32
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

Most home networks use dynamic allocation.

 How data is sent to an IP address on another network?

 Network Mashes

Distinguishes which portion of the address identifies the network and which
portion of the address identifies the node.

Default masks:

1. Class A: 255.0.0.0
2. Class B: 255.255.0.0
3. Class C: 255.255.255.0

33
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

 Introduction to subnetting

Subnetting is the strategy used to partition a single physical network into more than one smaller
logical sub-network (subnets).

An IP address includes a network segment and a host segment. Subnets are designed by
accepting bits from the IP addresses host part and using these bits to assign a number of
smaller sub-networks inside the original network.

Subnetting allows an organization to add sub-networks without the need to acquire a new
network number via the Internet service provider (ISP).

Subnets were initially designed for solving the shortage of IP addresses over the Internet.

Each IP address consists of a subnet mask. All the class types, such as Class A, Class B and
Class C include the subnet mask known as the default subnet mask. The subnet mask is intended
for determining the type and number of IP addresses required for a given local network. The
firewall or router is called the default gateway. The default subnet mask is as follows:

 Class A: 255.0.0.0
 Class B: 255.255.0.0
 Class C: 255.255.255.0

The subnetting process allows the administrator to divide a single Class A, Class B, or Class C
network number into smaller portions. The subnets can be subnetted again into sub-subnets.

A subnet itself also may be segmented into smaller subnets, giving organizations the flexibility
to create smaller subnets for things like point-to-point links or for sub networks that support a

34
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

few devices. The example below uses an 8-bit Subnet ID. The number of bits in the subnet mask
depends on the organization's requirements for subnet size and the number of subnets. Other
subnet mask lengths are common. While this adds some complexity to network addressing, it
significantly improves the efficiency of network address utilization.

 Advantages of Subnetting

1. Reduces the network traffic by reducing the volume of broadcasts


2. Helps to surpass the constraints in a local area network (LAN), for example, the
maximum number of permitted hosts.
3. Enables users to access a work network from their homes; there is no need to open the
complete network.

Conclusion: By this practical we learned about IPV4 addressing and subnets.

35
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

Experiment No: 6
Aim: TO STUDY ABOUT PING AND ARP PACKETS AND SIMULATION IN CISCO
PACKET TRACER.

Theory:
 Ping

The ping command is one of the most often used networking utilities for troubleshooting
network problems.

You can use the ping command to test the availability of a networking device (usually a
computer) on a network.

When you ping a device you send that device a short message, which it then sends back (the
echo), if you receive a reply then the device is working OK, if you don’t then:

 The device is faulty, disconnected, switched off, and incorrectly configured your
network or
 The device you are working on is not working properly.

You can use the ping cmd with an IP address or the computer/host name.

To ping an IP address go to a cmd prompt and enter: Ping IP Address e.g. ping 192.169.0.1 or to
ping a computer name. Ping computer name e.g. ping Computer1.The screen shot below
shows how to use the command with an IP address.

Here we have shown both a failed ping (192.168.0.1), and a successful ping (192.168.1.1).

36
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

Note: a failed ping results in a request timed out response, and a success results in the reply
from message with the round trip delay in milliseconds.

The screen shot below shows how to use the ping command with the computer name.

 ARP

Address Resolution Protocol (ARP) is one of the major protocol in the TCP/IP suit and the
purpose of Address Resolution Protocol (ARP) is to resolve an IPv4 address (32 bit Logical
Address) to the physical address (48 bit MAC Address).

Network Applications at the Application Layer use IPv4 Address to communicate with another
device. But at the Data link layer, the addressing is MAC address (48 bit Physical Address), and
this address is burned into the network card permanently. You can view your network card’s
hardware address by typing the command "Ipconfig /all" at the command prompt (Without
double quotes using Windows Operating Systems).

The purpose of Address Resolution Protocol (ARP) is to find out the MAC address of a device
in your Local Area Network (LAN), for the corresponding IPv4 address, which network
application is trying to communicate.

37
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

 ARP packet simulation steps

1. Design the topology in Cisco packet tracer using one switch, three laptops or pcs.

2. Assign Ip addresses to the respective PCs

38
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

3. Now, open command prompt in Cisco packet tracer and write ping and then copy the
physical address.

4. To observe the traffic closely, select the ‘Simulation Mode’ and in the Simulation Panel
click on “Show all/none” button.

39
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

5. In the PDU information at Device PC-0, you can see how the PDUs are traversing
between the OSI Layers

It clearly shows--what is happening at 'Out Layer 3' of PC-0:

 The Ping process starts the next ping request.

 The Ping process creates an ICMP Echo Request message and sends it to the lower
process.

 The device sets TTL in the packet header.

 The destination IP address is in the same subnet. The device sets the next-hop to
destination.

6. Now we will click on “Show all/none” button to send ARP traffic from PC-3 to Hub-1.

40
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

7. This is the final step where we will test the ARP entries in the ARP Tables of PC-1, PC-
2, and PC-3.

Conclusion: By this practical we learned about ping command and implemented ARP address
resolution by using Cisco packet tracer.

41
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

Experiment No: 7
Aim: TO STUDY ABOUT VLAN AND SIMULATE IN CISCO PACKET TRACER.

Theory:
 What does VLAN mean?

A Virtual local area network (VLAN) is a logical group of workstations, servers and network
devices that appear to be on the same LAN despite their geographical distribution.
A VLAN allows a network of computers and users to communicate in a simulated environment
as if they exist in a single LAN and are sharing a single broadcast and multicast domain. VLANs
are implemented to achieve scalability, security and ease of network management and can
quickly adapt to changes in network requirements and relocation of workstations and server
nodes.
 How can we implement VLAN?
Higher-end switches allow the functionality and implementation of VLANs.
The purpose of implementing a VLAN is to improve the performance of a network or apply
appropriate security features.

Computer networks can be segmented into local area networks (LANs) and wide area networks
(WANs). A LAN is also considered a broadcast domain.
A VLAN allows several networks to work virtually as one LAN. One of the most beneficial
elements of a VLAN is that it removes latency in the network, which saves network resources
and increases network efficiency. In addition, VLANs are created to provide segmentation and
assist in issues like security, network management and scalability. Traffic patterns can also
easily be controlled by using VLANs.

42
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

 Disadvantages of VLAN
1. High risk of virus issues because one infected system may spread a virus through the
whole logical network.
2. Equipment limitations in very large networks because additional routers might be needed
to control the workload.
3. More effective at controlling latency than a WAN, but less efficient than a LAN.
 Simulating VLAN in Cisco packet tracer
1. Build the topology as shown below

2. Configure VLAN on all switches. To do this, the following commands will be used in
global configuration.

43
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

3. PC0: 192.168.1.3 PC1: 192.168.1.2 PC2: 192.168.20.2 PC3: 192.168.20.3

4. Configure the switch for the VLAN

44
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

5. Now, configure port 5/FAST ETHERNET 0/5 to trunk and also change the access mode
of port 3 and 4 to 9 Abhishek(VLAN NAME)

45
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

6. Now, configure the router’s VLAN database

7. Enter the required commands in COMMAND LINE INTERFACE

46
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

8. Configure the IP Address and Subnet Mask.

Conclusion: By this practical we implemented VLAN using CISCO Packet software.

47
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

Experiment No: 8
Aim: IMPLEMENT STATIC ROUTING USING CISCO PACKET TRACER.

Theory:
 What is static routing?

Static routing is the most secure way of routing. It reduces overhead from network resources. In
this type of routing we manually add routes in routing table. It is useful where numbers of route
are limited.

 Advantage of static routing


1. It is easy to implement.
2. It is most secure way of routing, since no information is shared with other routers.
3. It puts no overhead on resources such as CPU or memory.

 Disadvantage of static routing


1. It is suitable only for small network.
2. If a link fails it cannot reroute the traffic.

 Simulating static routing in Cisco packet transfer


1. Create the topology as shown below

48
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

2. Configure the Ip address, subnet mask of both the PC0 and PC1 and interface router 0
and router 1 with the PC0 and PC1 respectively.

49
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

50
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

3. Now interface both the routers so that they can have a communication between them.

51
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

4. Now when we ping PC1 through PC0 we don’t get reply from PC1. Therefore we do
static routing of router0 and router1 by assigning Ip addresses of the PC0 and PC1.

5. Now we open command prompt to check whether the ping command is working or not.

Conclusion: By this practical we have implemented static routing using Cisco packet tracer.

52
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

Experiment No: 9
Aim: IMPLEMENT ROUTING INFORMATION PROTOCOL IN CISCO PACKET
TRACER

Theory:
 Introduction
The Routing Information Protocol (RIP) is one of the oldest distance-vector routing
protocols which employ the hop count as a routing metric.
RIP prevents routing loops by implementing a limit on the number of hops allowed in a path
from source to destination.
The largest number of hops allowed for RIP is 15, which limits the size of networks that RIP
can support.

 What is HOP count?


Hop count is the number of routers occurring in between the source and destination network.
The path with the lowest hop count is considered as the best route to reach a network and
therefore placed in the routing table.
RIP prevents routing loops by limiting the number of hopes allowed in a path from source and
destination. The maximum hop count allowed for RIP is 15 and hop count of 16 is considered as
network unreachable.
 Features of routing information protocol
1. Updates of the network are exchanged periodically.
2. Updates (routing information) are always broadcast.
3. Full routing tables are sent in updates.
4. Routers always trust on routing information received from neighbor routers. This is also
known as routing on rumors.

53
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

 Routing information protocol version


There are three vesions of routing information protocol
1. RIP Version1
2. RIP Version2
3. RIPng.

 RIP: Routing Information Protocol


1. Based on distance vector routing.
2. Use the Bellman-Ford algorithm for calculating the routing tables

 RIP Message Format:

54
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

 Simulation in Cisco packet tracer


1. Make the shown topology in the Cisco packet tracer.

2. Assign Ip addresses to the PC0 and PC1

55
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

3. Configure both the routers

4. Configure routing information protocol in both the routers, in router 0 we are doing it
without the use of CLI and in router 1 we are doing it by writing in CLI.

56
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

5. Now we process the transfer of message from the PC0 to PC1.

Conclusion: By this practical we have implemented routing information protocol using CISCO
packet tracer.

57
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

Experiment No: 10
Aim: TO STUDY ABOUT WIRESHARK SOFTWARE

Theory:
 Introduction

Wireshark is a free and open-source packet analyzer.

It is used for network troubleshooting, analysis, software and communication protocol


development, and education.

Originally named Ethereal, the project was renamed Wireshark in May 2006 due to trademark
issues

Wireshark is cross-platform, using the Qt widget toolkit in current releases to implement its user
interface, and using pcap to capture packets; it runs on Linux, macOS, BSD, Solaris, some
other Unix-like operating systems, and Microsoft Windows.

There is also a terminal-based (non-GUI) version called TShark. Wireshark, and the other
programs distributed with it such as TShark, are free software, released under the terms of
the GNU General Public License.

 Intended purposes
1. Network administrators use it to troubleshoot network problems
2. Network security engineers use it to examine security problems
3. QA engineers use it to verify network applications
4. Developers use it to debug protocol implementations
5. People use it to learn network protocol internals

 Features
1. Available for UNIX and Windows.
2. Capture live packet data from a network interface.

58
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

3. Open files containing packet data captured with tcpdump/WinDump, Wireshark, and
many other packet capture programs.
4. Import packets from text files containing hex dumps of packet data.
5. Display packets with very detailed protocol information.
6. Save packet data captured.
7. Export some or all packets in a number of capture file formats.
8. Filter packets on many criteria.
9. Search for packets on many criteria.
10. Colorize packet display based on filters.
11. Create various statistics.

Wireshark can be started on the PCs by executing the following steps:

Step 1 - Log on to the Linux PC.


Step 2 - Open the terminal window
Step 3 - Enter the command “sudo wireshark”.
Step 4 - Enter your account password

 Running Wireshark
When you run the Wireshark program, the Wireshark graphical user interface shown in Figure 2
will be displayed. Initially, no data will be displayed in the various windows.

Figure: Wireshark Graphical User Interface


 The Wireshark’s five major components:
1. The command menus are standard pull down menus located at the top of the window. Of
interest to us now is the File and Capture menus. The File menu allows you to save

59
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

captured packet data or open a file containing previously captured packet data, and exit
the Wireshark application. The Capture menu allows you to begin packet capture.

2. The packet-listing window displays a one-line summary for each packet captured,
including the packet number (assigned by Wireshark; this is not a packet number
contained in any protocol’s header), the time at which the packet was captured, the
packet’s source and destination addresses, the protocol type, and protocol-specific
information contained in the packet. The packet listing can be sorted according to any of
these categories by clicking on a column name. The protocol type field lists the highest
level protocol that sent or received this packet, i.e., the protocol that is the source or
ultimate sink for this packet.

3. The packet-header details window provides details about the packet selected
(highlighted) in the packet listing window. These details include information about the
Ethernet frame and IP datagram that contains this packet. The amount of Ethernet and IP-
layer detail displayed can be expanded or minimized by clicking on the right-pointing or
down-pointing arrowhead to the left of the Ethernet frame or IP datagram line in the
packet details window. If the packet has been carried over TCP or UDP, TCP or UDP
details will also be displayed, which can similarly be expanded or minimized. Finally,
details about the highest level protocol that sent or received this packet are also provided.

4. The packet-contents window displays the entire contents of the captured frame, in both
ASCII and hexadecimal format.

5. 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 packet-listing window (and hence the packet-header and
packet-contents windows). In the example below, we’ll use the packet-display filter field
to have Wireshark hide (not display) packets except those that correspond to HTTP
messages.

60
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

 Test Run

The best way to learn about any new piece of software is to try it out! First, you need to know the
network interconnections in the lab. The IP addresses are shown in Table 1 The 11 PCs are
connected in the following fashion. (1 ! 2),(3 ! 4),(5 ! 6),(7 ! 8),(9 ! 2),(9 ! 1),(10 ! 3),(10 ! 4),(11
! 5),and (11 ! 6). For ex (1 ! 2) means Pc1 and Pc2 are connected to the same switch. So PC1 and
PC2 can communicate with each other. To perform the following steps, identify the two PCs for
your test run.

Do the following:
1. Start up your favorite web browser.

2. Start up the Wireshark software. You will initially see a window similar to that shown in
Figure 3, except that no packet data will be displayed in the packet listing, packet-header,
or packet-contents window, since Wireshark has not yet begun capturing packets. Make
sure you check “Don't show this message again” and press “ok” on the small dialog box
that pops up.

3. To begin packet capture, select the Capture pull down menu and select Interfaces. This
will cause the “Wireshark: Capture Interfaces” window to be displayed, as shown in
Figure 4.

FIGURE 4: IP ADDRESS ASSIGNMENT


PC IP Addresses(eth0 and eth1)
1 10.0.1.1 and 10.0.1.2
2 10.0.1.3 and 10.0.1.4
3 10.0.1.5 and 10.0.1.6
4 10.0.1.7 and 10.0.1.8
5 10.0.1.9 and 10.0.1.10
6 10.0.1.11 and 10.0.1.12
7 10.0.1.13 and 10.0.1.14
8 10.0.1.15 and 10.0.1.16
9 10.0.1.17 and 10.0.1.18
10 10.0.1.19 and 10.0.1.20
11 10.0.1.21 nd 10.0.1.22

61
EC - 402 DATA COMMUNICATION AND NETWORKING 16ET451

4. The network interfaces (i.e., the physical connections) that your computer has to the
network are shown. The attached snapshot was taken from my computer. You may not
see the exact same entries when you perform a capture in the 237 Lab. You will notice
that eth0 and eth1 will be displayed. Click “Start” for interface eth0. Packet capture will
now begin - all packets being sent / received from/by your computer are now being
captured by Wireshark!
5. If you started your Web browser on PC1, you can only connect to PC2 and PC9 (refer to
the interconnections listed at the start of this section). If you want to connect to PC2, refer
to Table 1, and identify the IP address of eth0. The IP address is 10.0.1.3. If you wanted
to connect to PC9, the IP address would be 10.0.1.17. While Wireshark is running, enter
the URL:http://10.0.1.3/INTRO.htm to connect to the web server in PC2 and have that
page displayed in your browser. In order to display this page, your browser will contact
the HTTP server at 10.0.1.3(PC2) and exchange HTTP messages with the server in order
to download this page. The Ethernet frames containing these HTTP messages will be
captured by Wireshark.
6. After your browser has displayed the intro.htm page, stop Wireshark packet capture by
selecting stop in the Wireshark capture window. This will cause the Wireshark capture
window to disappear and the main Wireshark window to display all packets captured
since you began packet capture. The main Wireshark window should now look similar to
Figure 2. You now have live packet data that contains all protocol messages exchanged
between your computer and other network entities! The HTTP message exchanges with
the PC2 web server should appear somewhere in the listing of packets captured. But there
will be many other types of packets displayed as well (see, e.g., the many different
protocol types shown in the Protocol column in Figure 2). Even though the only action
you took was to download a web page, there were evidently many other protocols
running on your computer that are unseen by the user.
7. 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 entered “http”). This
will cause only HTTP message to be displayed in the packet-listing window.
8. Select the first http message shown in the packet-listing window. This should be the HTTP
GET message that was sent from your computer(ex. PC1) to the PC2 HTTP server. When
you select the HTTP GET message, the Ethernet frame, IP datagram, TCP segment, and
HTTP message header information will be displayed in the packet-header window2. By
clicking on right pointing and down-pointing arrows heads to the left side of the packet
details window, minimize the amount of Frame, Ethernet, Internet Protocol, and
Transmission Control Protocol information displayed. Maximize the amount information
displayed about the HTTP protocol. Your Wireshark display should now look roughly as
shown in Figure 5 (Note, in particular, the minimized amount of protocol information for
all protocols except HTTP, and the maximized amount of protocol information for HTTP
in the packet-header window).
9. Exit Wireshark

Conclusion: By this practical we learned about how to operate and use of Wireshark software.

62

Das könnte Ihnen auch gefallen